Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Utilities such as Windows ping.exe have an option to change default TTL value in the IP header for Echo Request messages. TTL shows maximal hops limit for packets. I know that each router decreases TTL value and it was made for "cleaning" network from looped packets. But what the point of changing TTL? Why just not to set it to its maximal value 255? And how can i know what value is better? I heard that TTL is somehow connected with notion of Domain Zones and its size. Can someone explain, please? Thank you.

share|improve this question
Please understand that TTL in the context of ICMP ping packages (or other low level packages) is a vastly different concept from the various TTL values in DNS, despite the same name. – Holger Just Mar 9 '11 at 19:19
up vote 1 down vote accepted

TTL is a fairly generic term and means 'Time To Live'. It is used in many situations where a finite lifetime is required.

In ping, as you rightly mention, it's used to set the maximum hop count a packet can travel. In DNS it's used as the length of time before an entry expires from the cache.

You ask why not just set it as 255 all the time? Well, in 99% of the situations you use ping that's fine. There are just a few (well, one that springs to mind) where you may want to specify an exact number of hops.

Imagine if you will a network with multiple routes between points A and B. Route 1 (R1) has 6 hops between A and B. Route 2 (R2) has 8 hops between A and B.

By setting ping to only allow 6 hops you can accurately determine how many packets take R1 and how many take R2.

share|improve this answer
Are there any official references with advices what to set for TTL? – Kyrylo M Mar 9 '11 at 18:15
In what context? Ping? DNS? – Majenko Mar 9 '11 at 18:16
Setting TTL value for ping and why default, for example, is 128... – Kyrylo M Mar 9 '11 at 18:17
For ping the default TTL is down to the creator of the operating system: For DNS it's depenant on what you're doing with the DNS at the time: – Majenko Mar 9 '11 at 18:21
Also, when there is random loops (due to broken routes), lowering TTL is good idea, because otherwise all packets are running between routers for 255 times, when maximum required TTL might be something like 10 or so. – Olli Mar 9 '11 at 18:40

As I know yet the TTL in ping is for basically to eliminate the packet after a certain time then it is not able to circulate on the network forewer. You can also use this value to see how fare is the station where you sent the echo request, because every router decrease it before send it towards. But! , when the echo request packet hit the targeted station (so it is stil alive) an "echo reply" packet generated and this reply also contains a TTL which is reseted back to maximum based on the "target station rule". A linux/BSD station set it to 64, A Windows 128 A cisco or a solaris stuff set it to 255 I gues, then send it back to the destination adress.

This is why you can see different TTL values on ping reports.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .