Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When i use ping command i get next results (Windows):

C:\>ping example.microsoft.com
Pinging example.microsoft.com [192.168.239.132] with 32 bytes of data:
Reply from 192.168.239.132: bytes=32 time=101ms TTL=124
...

In documentation to such utilities TTL is measured in hops. According to ICMP specification RFC 792:

Time to Live. Time to live in seconds; as this field is decremented at each machine in which the datagram is processed, the value in this field should be at least as great as the number of gateways which this datagram will traverse.

So, every host descreases TTL by atleast 1 second. Nothing said about hops. So why hops are used? Why not to use, say ms, if hosts process datagrams too fast? And why specification doesn't say anything about hops?

share|improve this question
    
Good question. If I remember correctly, they replaced TTL with hops in IPv6, but I'm not sure. –  AndrejaKo Mar 7 '11 at 20:46
1  
@AndrejaKo, yes, they did. But officially only in IPv6. –  kirmir Mar 7 '11 at 20:57

1 Answer 1

up vote 7 down vote accepted

TTL is designed to stop packets living (and consuming resources) forever if there is a routing loop.

Originally, routers might take more than one second to process a packet.

When routers became much faster, and started processing packets in under one second, it would be silly for them to reduce the TTL by zero, because then it wouldn't stop loops.

So instead, it decrements the TTL by one second.

This change was documented in RFC 1716 section 5.3.1.

The Time-to-Live (TTL) field of the IP header is defined to be a timer limiting the lifetime of a datagram. It is an 8-bit field and the units are seconds. Each router (or other module) that handles a packet MUST decrement the TTL by at least one, even if the elapsed time was much less than a second. Since this is very often the case, the 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.

See also:

Wikipedia - Time to Live:

The TTL field is set by the sender of the datagram, and reduced by every host on the route to its destination.

Maxi-pedia - Time to Live (TTL)

Each router that the packet travels through is required to subtract at least one count from the TTL field.

share|improve this answer
    
Don't see anything about hops and why they used instead of seconds or ms. –  kirmir Mar 7 '11 at 20:53
1  
I added a link to RFC 1716. That's where it's specified. –  Mikel Mar 7 '11 at 20:56
    
Thank you for explanation. –  kirmir Mar 7 '11 at 21:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.