Chap 3 - IPv4 Packet Header
Chap 3 - IPv4 Packet Header
The IPv4 packet header has quite some fields. In this lesson we’ll take a look at them and I’ll explain what everything
is used for. Take a look at this picture:
Version: the first field tells us which IP version we are using, only IPv4 uses this header so you will always find
decimal value 4 here.
Header Length: this 4 bit field tells us the length of the IP header in 32 bit increments. The minimum length of
an IP header is 20 bytes so with 32 bit increments, you would see value of 5 here. The maximum value we
can create with 4 bits is 15 so with 32 bit increments, that would be a header length of 60 bytes. This field is
also called the Internet Header Length (IHL).
Type of Service: this is used for QoS (Quality of Service). There are 8 bits that we can use to mark the packet
which we can use to give the packet a certain treatment. You can read more about this field in my IP
precedence and DSCP tutorial.
Total Length: this 16-bit field indicates the entire size of the IP packet (header and data) in bytes. The
minimum size is 20 bytes (if you have no data) and the maximum size is 65.535 bytes, that’s the highest value
you can create with 16 bits.
Identification: If the IP packet is fragmented then each fragmented packet will use the same 16 bit
identification number to identify to which IP packet they belong to.
IP Flags: These 3 bits are used for fragmentation:
1/2
IPv4 Packet Header
Here’s a real life example of an IP packet in Wireshark where you can see how these fields are used:
I hope this lesson has been helpful to understand the different fields in the IPv4 packet header. If you have any
questions, feel free to leave a comment in our forum.
2/2