"Time to Live (TTL)", "Services", "Flags and Fragmentation Offset" and "Total Length"


TTL stands for Time to Live. It is the number of hops inside a network before it is discarded. It is also used in CDN caching and DNS caching. There is always a risk that a packet will pass from router to router indefinitely. To reduce this risk, packets are designed with an expiration also called TTL. Each packet has a value store which determines how long the packet will be alive until it is passed on to the next.


TTL Size

The maximum value of Time to Live is 255 and the size is an 8-bit field.


The IP packets have a TOS byte also known as Type of Services. It has two types:

  • IP Precedence: The first three bytes of the packet is IP Precedence. The higher the value the more priority it gets. This type of service is used to assign what kind of delay, throughput, and reliability. About 10 years later, in 1992 RFC 1349 was created that changes the definition of the TOS byte.

  • Differentiated Services: Differentiated services is a computer networking architecture that specifies a simple and scalable mechanism for classifying and managing network traffic. In 1988, the TOS byte was given a new name and is now called Differentiated Services. The first 6 bits will affect the Per-Hop Behavior. The codepoint is also what we call the DSCP value.

Services Size

IP Precedence: It has an 8-bit field or 255 bytes size.

Differentiated Services: It has a 6-bit field or 64 bytes size.

Flags and Fragmentation offset

The first, bit of the Flag field will be 0 (unset), and the second bit, Don’t Fragment, is also unset. The last, More Fragments (MF), will be set to 1. Fragment Offset is used in the starting position of the data in relation to the original packet. Whether they arrive in order or not, this is used to reassemble. The first fragment of the offset is 0.


Flags and Fragmentation offset Size

Flag: It has a 3-bit field or 8 bytes size.

Fragmentation offset: It has a 13-bit field or 8192 bytes size.

Total Length

Total Length is the total length of the IPv4 in bytes. Using this field, we can find where the data portion starts, and its length. The maximum size of an IPv4 is 65,535 bytes. It is possible to send a 65,535-byte IP but most link layers cannot carry this large without fragmenting it into smaller pieces.


Total Length Size

The maximum size of Total Length is 65,535 bytes (65KB) or 16-bit field.