How to Change Default TTL Value Set On Ping Packets

If you are familiar with Ping command, you know the importance of TTL (Time To Live) value. TTL value (Time To Live) tells the life span of the ping packets by setting the number of hops the packets can cross. When it reach the hop count set by TTL, ping packets expire. When you ping an address from Command Prompt, computer automatically assign a default Time To Live (TTL) value which is hopefully greater than the hop count between the destination and your computer. Sometimes it may not be enough for the ping packets to reach the address. In those cases we need to set a different TTL value on ping packets. We can simply change the TTL value on ping packets from command prompt but the manually configured value must be between 0 to 255. If the TTL set is 0, ping packets won't go further from your computer. If it is 1, ping packets expire when they reach the subnet. From the TTL value in ping reply we can find the hop count between destination and your computer (check the ping reply). Check the below image to learn how to find the hop count between your computer and different websites.
Manually assign TTL value on ping packets

Here you can see the hop counts between your computer and different addresses.

How to Change Default TTL Value When You Ping an Address

To change the default Time To Live (TTL) value set on Ping packets when you ping an address from your computer, follow the command below.

Ping -i (TTL value) Address

Eg: Ping Google.com -i 100

Please note that if you set a lower TTL value for ping packets than the actual hop count between your computer and destination,  ping packets will never reach the address. The below image shows this.
How to limit TTL Value on ping Packets

Here I set a TTL value which is less than the actual hop count between my computer and Google server. So the packets expired on its way before reaching the destination and I have received the TTL Expired in Transit error message. To learn more about this specific error message click on the link below.
What is The Error Message TTL Expired in Transit

By setting different Time To Live value on ping packets we can troubleshoot many connectivity issues. One of the most common ping error message is Transmit failed general failure. To learn more about this error click on the link below.
Reasons and Solution For PING: Transmit failed. General Failure

Here we have seen the effect of TTL value while  ping to the destination. If the Time To Live value(TTL) set is lower than the actual distance between the destination and your computer, ping packets will expire. There is another ping error message when ping packets send from your computer failed to reach the destination host. To learn more about it click on the link below.
Reasons and Solution for Destination Host Unreachable Error Message

Technology Blog

1 comment:

Anonymous said...

Thanks for sharing this test

Amit