IP datagram structure


The IP version (4 for IPv4).

IHL (Internet Header length, 4 bytes)

The IP header length in 32 bit words/4 bytes (octets). The minimum is 5 x 32 bit words, so 20 bytes. With options it can get to 60 bytes long.

Total length

This explains the total length of the IP datagram (header + data). As this is a 16 bit field, it can describe up to 64KB (2^16 = 65536) MTU.


All the fragments of a datagram have the same identification number.


Bit 1: reserved
Bit 2: DF (do not fragment)
Bit 3: more fragments (all fragments except the last one have this bit set).

Fragment offset

This describes the offset of the current fragment within the original datagram. As all fragments have to be integer of 8 bit and there are 13 bits in the fragment offset field, it results the maximum datagram size: 8 x 2^13 = 2^16 bytes = 64KB.

Time to live (TTL)

This represents the maximum number of hops (usually routers) that a package can transit.


This specifies the layer 4 protocol that will process the IP datagram.