Ip – How is 8 bits sufficient for the TTL in an IP header

ipNetworktcp

The TTL (Time to Live) is an 8-bit field in the IPv4 header. It can take any value from 0 to 255. If this means that the packet can take a maximum of 255 hops (routers) on its way to its destination, then the packet will be discarded.

How is it possible for me to send packets across continents?

Best Answer

Even when sending packets across continents, a TTL of 255 is more than enough - there simply aren't more routers involved.

Running a quick test (from Germany) shows 17 hops to the US and 18 to Japan. Usually, you don't get above 30 or so. This is due to the hierarchical structure of the Internet - you hit your ISP's backbone with just 2-5 hops, another 2-3 hops take you to the next provider etc.

The effect is somewhat similar to the situation found in the small-world experiments.

Note that TTL counts layer-3 hops only. The much more frequently used layer-2 hops across switches have no impact on the TTL - there's no such concept in Ethernet or similar protocols.

Additionally, encapsulating a packet for tunnel transport 'freezes' the TTL while in the tunnel - regardless of how many hops the outer packet takes (it's got its own TTL), the whole tunnel only counts as one or two hops for the inner packet.

Related Topic