Pings TTL networking

1

Lets say that two computers are connected on the same network through a router (default gateway). If I was to ping the other machine, which had a standard TTL of 64 (*nix host), would I get back a TTL value of 64? Or would the fact that it travels through the router make it 63?

user1553248

Posted 2012-12-09T21:02:55.037

Reputation: 123

If they're on the same network, why are they connected through a router? (Or by "router" do you mean a router that is also a switch and the two computers are actually connected by the switch portion?) – David Schwartz – 2013-10-22T06:27:44.650

Answers

1

This depends on which side of the router they reside. If they are both on the LAN side (as you seem to suggest), then all the 'router' is doing is switching packets. This means the TTL would remain the same; 64.

If the other machine was on a different network, say the WAN side of the router; then the TTL would decrease by one. Each time a router makes a decision on which network to route a packet to, it decreases the packet's TTL by one. Similarly for packets generated in response (which should again start with a TTL of 64).

I'm not an expert, but I think switch in a single subnet should know all hosts and how to reach them. TTLs are useful when the route from sender to target is not known ahead of time: This stops packets being routed in circles or bouncing back and fore between two routers. Eventually broken paths will be recognised and fixed via other mechanisms.

Morphit

Posted 2012-12-09T21:02:55.037

Reputation: 91