Kitz Forum

Broadband Related => Broadband Technology => Topic started by: UncleUB on November 05, 2008, 08:56:52 AM

Title: Ping Command
Post by: UncleUB on November 05, 2008, 08:56:52 AM
Hi all just done ping command test and having read Kitz's tutorial I noticed that the TTL value by default is 255,well mine has pinged back at 112.Why is it that low?
The average round trip time in milli- seconds was 39.
packets sent4,received 4,lost 0
Title: Re: Ping Command
Post by: broadstairs on November 05, 2008, 09:28:41 AM
Well Kitz's description does not make much sense when I ping another PC on my home lan as the TTL shows as 128 and sure as hell there are not 128 hops to get to it. If I ping my router I get a TTL of 64.   Go figure.......
Title: Re: Ping Command
Post by: roseway on November 05, 2008, 10:18:22 AM
I imagine that this depends on the particular implementation of the ping command. If you look at the options at the end of the tutorial you'll see that the -i option can set the TTL to a specific value. I expect that the implementation of ping on your systems uses by default the parameter -i128 or something like that. On my Linux systems if I ping the router it returns 254 which is what Kitz's tutorial says it should do, but I get a value of 120 from bbc.co.uk which is 8 hops from here.
Title: Re: Ping Command
Post by: UncleUB on November 05, 2008, 10:25:54 AM
Eric,that ping of 112 was from bbc.co.uk
Title: Re: Ping Command
Post by: broadstairs on November 05, 2008, 10:42:06 AM
Eric my ping was to another local PC and to the same PC the TTL was 64, no ping parameter was added to the command, so its whatever the default is on XP. Also ping times are less that 1ms!
Title: Re: Ping Command
Post by: kitz on November 05, 2008, 01:20:00 PM
hmm   very good point and something I hadnt noticed had happened. 

My default TTL is now 128 rather than the 255 it was for many years.
- You can check your default TTL by using the command ping localhost

The default TTL can be set within the operating system so possibly at some point over the last 4 or so years since I did that tutorial, something has changed within XP.

Need to do a bit of digging around before I comment further and make a dork of myself.
Title: Re: Ping Command
Post by: roseway on November 05, 2008, 02:32:07 PM
>> - You can check your default TTL by using the command ping localhost

I suspect that it's a bit more complicated than that, and that the default TTL varies according to the type of target. I don't know if Windows uses similar variation, but on my Linux systems I get three different values of default TTL:

ping localhost : TTL = 64
ping 192.168.1.254 (my router) : TTL = 254 which equals 255 minus 1 hop
ping bbc.co.uk : TTL = 120 which equals 128 minus 8 hops

So, depending on the target, the default TTL can be 64, 128 or 255.
Title: Re: Ping Command
Post by: kitz on November 05, 2008, 02:40:24 PM
>> on the target, the default TTL can be 64, 128 or 255.

I havent searched it yet..  thats what I was going to do before commenting further.. but I suspect youre right..  and thats what was crossed my mind..  in that I suspected that the remote host could actually over-ride the default TTL - regardless of whats set on your system.

I was going to look properly later into remote hosts over-riding the TTL and update the page if necessary accordingly.
Title: Re: Ping Command
Post by: Oranged on November 05, 2008, 02:44:07 PM
For me, both localhost and router TTL=64
Title: Re: Ping Command
Post by: kitz on November 05, 2008, 03:57:44 PM
Just had a look further into this - lol theres been plenty debates over the same question.. and some confusion because TCP/IP packets use a different TTL to ICMP.

But I believe the answer and explanation actually lies in the UNIX System Manager's Manual (http://www.rt.com/man/ping.8.html) which explains the ping command.

Summary

~ Ping packets (ICMP ECHO_REQUEST ) get a TTL of 255
~ TTL gets decreased by 1 for each router/server (hop) that it passes through.


Most Unix systems set the ICMP ECHO_REQUEST packets to 255  (ping uses ICMP)

When responding to ping the remote server can either




----
Still not sure about this bit though
This is why you  will find you can ``ping'' some hosts, but not reach them with telnet(1) or ftp(1).

and where that fits in and how - because take for eg erics router has a TTL of 255 but I assume you can still telnet into it.
.. or maybe Ive missed something.


 
Title: Re: Ping Command
Post by: roseway on November 05, 2008, 04:11:36 PM
>> erics router has a TTL of 255 but I assume you can still telnet into it.

Yes I can.
Title: Re: Ping Command
Post by: kitz on November 05, 2008, 04:56:30 PM
Ive made a quick and small adjustment to the page which should hopefully cover it. 

There's already a link on there to the unix system man, so I'll let anyone read all the techy specs in there if they want.
Title: Re: Ping Command
Post by: guest on November 05, 2008, 06:12:51 PM
You might find this Chapter from the O'Reilly "fish book" - AKA Internet Core Protocols: The Definitive Guide - useful?

http://oreilly.com/catalog/coreprot/chapter/ch02.html#32174

TTL is measured in hops or seconds - AFAIK the two are interchangeable, certainly on Cisco kit anyway.
Title: Re: Ping Command
Post by: UncleUB on November 05, 2008, 06:29:56 PM
Wow,a lot of this is all looking a bit techy.
I only wanted to know if I was pinging,(ok)
Now my head is zinging  :D
Title: Re: Ping Command
Post by: roseway on November 05, 2008, 06:36:10 PM
Never mind Phil, you stimulated a useful discussion. :)
Title: Re: Ping Command
Post by: UncleUB on November 05, 2008, 06:42:58 PM
Happy to help Eric. :) Now I'm off for some paracetamols  :bye:
Title: Re: Ping Command
Post by: kitz on November 07, 2008, 05:52:04 PM
Thanks for the linky rizla.. I must admit that although obviously Ive had to study protocols in the past, they dont rock my boat and its not anything Ive gone any deeper into than the necessary to be able to Pass what I needed to.  :D

The idea of the page was to make it simple for average person, so I'm going to avoid any of the too techy refs on the page itself.