ping command packet size
Matthew Harrington
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 msso 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 13607mswhat is time ? and how is calculated ?
regards
01 Answer
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