ping command packet size

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 July 2020 в 17:54

1 ответ

Вы можете получить manpages («руководство») для пакета с помощью команды man .

Если вы запустите man ping в В терминале вы получите подробное описание утилиты ping и инструкции по ее использованию.

На странице руководства есть следующая запись:

ДЕТАЛИ ПАКЕТА ICMP Заголовок IP без опций составляет 20 байтов. Пакет ICMP ECHO_REQUEST содержит дополнительные 8 байтов заголовка ICMP, за которым следует произвольное количество данных. Когда указан размер пакета, это указывает на размер этого дополнительного фрагмента данных (по умолчанию 56). Таким образом, объем данных, полученных внутри IP-пакета типа ICMP ECHO_REPLY, всегда будет на 8 байт больше, чем запрашиваемое пространство данных (заголовок ICMP).

Да, и время вычисляется в миллисекундах (мс)

1
ответ дан 30 July 2020 в 22:15

Другие вопросы по тегам:

Похожие вопросы: