Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1] 2

Author Topic: Ping Command  (Read 11559 times)

UncleUB

  • Helpful
  • Senior Kitizen
  • *
  • Posts: 29543
Ping Command
« 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
Logged

broadstairs

  • Kitizen
  • ****
  • Posts: 3700
Re: Ping Command
« Reply #1 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.......
Logged
ISP:Vodafone Router:Vodafone Wi-Fi hub FTTP

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43608
  • Penguins CAN fly
    • DSLstats
Re: Ping Command
« Reply #2 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.
Logged
  Eric

UncleUB

  • Helpful
  • Senior Kitizen
  • *
  • Posts: 29543
Re: Ping Command
« Reply #3 on: November 05, 2008, 10:25:54 AM »

Eric,that ping of 112 was from bbc.co.uk
Logged

broadstairs

  • Kitizen
  • ****
  • Posts: 3700
Re: Ping Command
« Reply #4 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!
Logged
ISP:Vodafone Router:Vodafone Wi-Fi hub FTTP

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33884
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Ping Command
« Reply #5 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.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43608
  • Penguins CAN fly
    • DSLstats
Re: Ping Command
« Reply #6 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.
Logged
  Eric

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33884
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Ping Command
« Reply #7 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.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

Oranged

  • Reg Member
  • ***
  • Posts: 623
    • The Mobile Help Forum
Re: Ping Command
« Reply #8 on: November 05, 2008, 02:44:07 PM »

For me, both localhost and router TTL=64
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33884
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Ping Command
« Reply #9 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 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

  • Not change it; (TTL value in the received packet will be 255 minus the number of routers in the round-trip path).
  • Set it to 255; (TTL value in the received packet will be 255 minus the number of routers in the path from the remote system to the pinging host).
  • Set it to some other value.  (Some machines use the same value for ICMP packets that they use for TCP packets).



----
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.


 
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43608
  • Penguins CAN fly
    • DSLstats
Re: Ping Command
« Reply #10 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.
Logged
  Eric

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33884
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Ping Command
« Reply #11 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.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

guest

  • Guest
Re: Ping Command
« Reply #12 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.
Logged

UncleUB

  • Helpful
  • Senior Kitizen
  • *
  • Posts: 29543
Re: Ping Command
« Reply #13 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
Logged

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43608
  • Penguins CAN fly
    • DSLstats
Re: Ping Command
« Reply #14 on: November 05, 2008, 06:36:10 PM »

Never mind Phil, you stimulated a useful discussion. :)
Logged
  Eric
Pages: [1] 2