Computer Networking Basics
What is the role of the TTL (Time To Live) field in the IPv4 header?
- AIt records the time from sending a packet until a response returns, to decide when TCP retransmits
- BIt is decremented by 1 at each router, and packets that reach 0 are discarded, preventing packets from circulating forever in a routing loop
- CPackets with larger values are forwarded with higher priority by routers
Show answer and explanation
Answer: B. It is decremented by 1 at each router, and packets that reach 0 are discarded, preventing packets from circulating forever in a routing loop
Despite "time" in its name, TTL is in practice an upper limit on the number of routers (hops) a packet may pass, decremented by 1 at each router. When it reaches 0, the router discards the packet and sends an ICMP time exceeded message back to the source. So even if a misconfiguration creates a routing loop, packets do not circulate forever. A packet sent with a TTL of 64, for example, arrives with 61 after passing three routers. traceroute sends packets with TTL 1, 2, 3 and so on, and discovers the path from the time exceeded messages each router returns. In IPv6 the field with the same role is called the hop limit.
- A. TCP measures the time until a response (RTT) itself; TTL is not involved.
- B. Correct. As a hop limit, it removes looping packets.
- C. Priority is expressed in a different field (such as DSCP).