0

when i use ping command on linux

i get the following output :

    ping google.com
PING google.com (216.58.205.206) 56(84) bytes of data.
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=2 ttl=128 time=490 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=3 ttl=128 time=1209 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=4 ttl=128 time=702 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=5 ttl=128 time=112 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=6 ttl=128 time=320 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=7 ttl=128 time=137 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=8 ttl=128 time=145 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=9 ttl=128 time=281 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=10 ttl=128 time=138 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=11 ttl=128 time=298 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=12 ttl=128 time=194 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=13 ttl=128 time=395 ms
64 bytes from mil04s29-in-f14.1e100.net (216.58.205.206): icmp_seq=14 ttl=128 time=124 ms

so for the first line it says the size is 56 bytes (which is the size of icmp data right ?) + 8 (icmp header ) + 20 (ipv4 header ) = 84 bytes , which is the size of each sent packet right ?

no on the next line it says 64 bytes (data + icmp header) , why 64 bytes in replay why not 84 bytes ?!

in the last line

14 packets transmitted, 13 received, 7% packet loss, time 13607ms

what is time ? and how is calculated ?

regards

0
1

You can get the manpages (the "manual") for a package with the man command.

If you run man ping in a terminal you will get a detailed description of the ping utility and instructions on how to use it.

In the manpage, there is the following entry:

ICMP PACKET DETAILS An IP header without options is 20 bytes. An ICMP ECHO_REQUEST packet contains an additional 8 bytes worth of ICMP header followed by an arbitrary amount of data. When a packetsize is given, this indicated the size of this extra piece of data (the default is 56). Thus the amount of data received inside of an IP packet of type ICMP ECHO_REPLY will always be 8 bytes more than the requested data space (the ICMP header).

Oh, and time is calculated in milliseconds (ms)

2
  • thanks for the answer , so the sent data is 56 bytes , and the received data is 8 bytes larger which makes it (64 bytes ) these numbers don't include the icmp header or the IP header right ?! , one last thing i know that time is in milliseconds ,but what i mean the number in the above example "time 13607ms" how this number is calculated ?! Regards – Colin Jack Jul 1 '20 at 15:43
  • per above, the default packet size of 56 bytes is for the "arbitrary amount of data" returned along with the 8 byte IMCP header. The final tally is the total amount of time the ping utility took from start to finish -- (note that one of your packets was not returned, which can add considerable wait time) – Nmath Jul 1 '20 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.