Time to Live (TTL)
Time to Live (TTL)
Time-to-Live (TTL) is a value in an Internet Protocol (IP) packet that tells a network router whether or not the packet has been in the network too long and should be discarded.
In other words, it specifies the number of router hops the packet is yet allowed to travel before it must be discarded or returned.
Time-to-Live is a field in the IP header of a packet and is defined to be a timer limiting the lifetime of a datagram. It is an 8-bit field and the units are seconds.
How Time to Live TTL works
For a number of reasons, packets may not get delivered to their destination in a reasonable length of time. For example, a combination of incorrect routing information at routers could cause a packet to loop endlessly. Time-to-Live is a solution to this.
The initial Time-to-Live value is usually set by a system default, for example to 128.
Each router that the packet travels through is required to subtract at least one count from the TTL field.
If the Time-to-Live is reduced to zero (or less), the packet MUST be discarded, and if the destination is not a multicast address, the router MUST send an ICMP Time Exceeded message to the source.
This mechanism ensures that a packet traveling through the network is discarded after a certain time and does not loop endlesly.
Default Time to Live TTL values
The default Windows 95/98 TTL value is 32 hops.
It is recommend to change this to 128 if you have difficulty reaching certain sites.
Where Time to Live TTL is used
The traceroute utility intentionally sends a packet to the target destination. It sends a packet with a low TTL value so that the packet is discarded by each successive router in the destination path.
The time between sending the packet and receiving back the ICMP message that it was discarded is used to calculate each successive hop travel time.
Time-to-Live: Does it measure time or hops?
The Time-to-Live is sometimes used as a hop count limit and other times as a time limit. The hop count function is critical to network functionality. It ensures that network's do not melt down packets looping infinitely in the network. The time limit function is used by transport protocols such as TCP to ensure reliable data transfer.
Each router that handles a packet MUST decrement the TTL by at least one, even if the elapsed time was much less than a second. Time-to-Live functions as a hop count in this perspective. Since this is the case most of the time, TTL is effectively a hop count limit on how far a datagram can propagate through the Internet.
When a router forwards a packet, it MUST reduce the TTL by at least one. If it holds a packet for more than one second, it MAY decrement the TTL by one for each second. This way, Time-to-Live is used as a time count.
Time-to-Live in IPv6
Time-to-Live (TTL) has been renamed renamed in IP version 6. The field is called the hop limit and has the same function as the TTL field in IPv4.
What networking utilities are built around Time to Live?