What does PING utility do?
It sends an ICMP 'echo message' (type 8) and if firewalls don't block it, the sender gets ICMP 'echo reply' (type 0) back. If it works we can get an estimate round-trip time of a target host and we will know it's alive!
But there is more to it than that ;-)
Using ping utility venture a guess of what operating system it runs (Windows, Linux, or IOS).
Let's look at this ping results:
ping -c3 -n www.cisco.com
PING e144.dscb.akamaiedge.net (220.127.116.11) 56(84) bytes of data. 64 bytes from 18.104.22.168: icmp_seq=1 ttl=58 time=5.64 ms 64 bytes from 22.214.171.124: icmp_seq=2 ttl=58 time=7.03 ms 64 bytes from 126.96.36.199: icmp_seq=3 ttl=58 time=5.50 ms
Based on this output we can venture a guess regarding OS of target and how many routers away it is! The 'tell' is the TTL value of the responder.
We know that the default values of TTL are as follows:
- MS Windows: TTL = 128.
- Linux: TTL = 64.
- Cisco IOS: TTL = 255.
Based on the above output I think www.cisco.com most likely runs on Linux system. It is also 6 hops (routers) away from my Raspberry PI computer. Systems on the Internet are rarely farther than 20 hops. So, if we assume that it is Linux, it uses the TTL value of 64, Response comes with ttl=58. That would be six hops away.
Let's verify that last fact using traceroute (if not installed use: apt-get install traceroute).
traceroute -n www.cisco.com
traceroute to www.cisco.com (188.8.131.52), 30 hops max, 60 byte packets 1 192.168.0.1 0.623 ms 0.726 ms 0.767 ms 2 184.108.40.206 5.557 ms 5.915 ms 5.829 ms 3 220.127.116.11 6.519 ms 6.548 ms 6.462 ms 4 18.104.22.168 6.477 ms 22.214.171.124 6.577 ms 126.96.36.199 6.791 ms 5 188.8.131.52 6.804 ms 6.975 ms 6.889 ms 6 184.108.40.206 8.546 ms 8.142 ms 8.046 ms 7 220.127.116.11 6.145 ms 5.620 ms 5.577 ms pi@tron:~ $
Six routers and the seventh number is the target host.