1

Assume I have network as follows (R1, R2, and R3 are routers):

LAN A -> R1 -> R2 -> R3 -> LAN B

Now, if LAN A generates frame for LAN B, then I am looking how many times TTL will be decremented?

LAN A will look till DLL, then R1, R2, and R3 will decrement TTL by one each. So, net TTL is decremented by three. Is it possible that the receiver also decrements TTL? If yes, then why so?

P.S:- I have checked some online sources, and everyone says that TTL is decremented by routers only, and not by a destination host.

1
  • Why should the destination decrement TTL? The destination would receive a packet but then decide to drop it?
    – Zac67
    Aug 18, 2017 at 7:35

1 Answer 1

3

In practice, a host probably doesn't decrement the TTL, but what an actual host or OS does is off-topic here.

According to RFC 791, Internet Protocol, the IPv4 module in the host network stack should decrement the TTL, too, as it processes the IPv4 header. This is to protect upper-layer protocols from old data:

Time to Live: 8 bits

This field indicates the maximum time the datagram is allowed to remain in the internet system. If this field contains the value zero, then the datagram must be destroyed. This field is modified in internet header processing. The time is measured in units of seconds, but since every module that processes a datagram must decrease the TTL by at least one even if it process the datagram in less than a second, the TTL must be thought of only as an upper bound on the time a datagram may exist. The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime.

-and-

Time to Live

The time to live is set by the sender to the maximum time the datagram is allowed to be in the internet system. If the datagram is in the internet system longer than the time to live, then the datagram must be destroyed.

This field must be decreased at each point that the internet header is processed to reflect the time spent processing the datagram. Even if no local information is available on the time actually spent, the field must be decremented by 1. The time is measured in units of seconds (i.e. the value 1 means one second). Thus, the maximum time to live is 255 seconds or 4.25 minutes. Since every module that processes a datagram must decrease the TTL by at least one even if it process the datagram in less than a second, the TTL must be thought of only as an upper bound on the time a datagram may exist. The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime.

Some higher level reliable connection protocols are based on assumptions that old duplicate datagrams will not arrive after a certain time elapses. The TTL is a way for such protocols to have an assurance that their assumption is met.

This leads to some confusion. Certainly, if a host is configured to forward IPv4 packets to other hosts on other networks, including VMs on an internal, virtual network, it should decrement the TTL, but that doesn't always seem to happen in real life.

For IPv6, the wording is more specific, telling you that a node that forwards a packet must decrement the Hop Limit field. Instead of a TTL field, IPv6 uses a Hop Limit field. The IPv6 Hop Limit field is really the same thing as the IPv4 TTL field.

RFC 2460, Internet Protocol, Version 6 (IPv6) Specification:

Hop Limit

8-bit unsigned integer. Decremented by 1 by each node that forwards the packet. The packet is discarded if Hop Limit is decremented to zero.

The IPv6 RFC seems to say that IPv4 hosts are required to enforce the TTL, which doesn't seem to really happen:

8.2 Maximum Packet Lifetime

Unlike IPv4, IPv6 nodes are not required to enforce maximum packet lifetime. That is the reason the IPv4 "Time to Live" field was renamed "Hop Limit" in IPv6. In practice, very few, if any, IPv4 implementations conform to the requirement that they limit packet lifetime, so this is not a change in practice. Any upper-layer protocol that relies on the internet layer (whether IPv4 or IPv6) to limit packet lifetime ought to be upgraded to provide its own mechanisms for detecting and discarding obsolete packets.

2
  • Is it possible that destination host decrements and checks the TTL value before accepting ?I came across such a figure somewhere.I will post that as a separate post Aug 19, 2017 at 11:02
  • That's what the RFCs say it is supposed to do, but in practice, most OSes simply do not do that. Unfortunately, questions about what hosts or OSes do are off-topic here.
    – Ron Maupin
    Aug 19, 2017 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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