Haga ping a más de 56 bytes en macOS

Haga ping a más de 56 bytes en macOS

Estoy en macOS y uso la terminal para hacer ping. ¿Cómo podría hacer ping a más de 56 bytes? Intenté buscar pero no pude encontrar la respuesta.

Respuesta1

ping -s tamaño anfitrión

ping -s 1472 target.example.com

Di 1472 como ejemplo porque con longitudes de encabezado típicas, se crea un único paquete de tamaño completo sin fragmentación.

Para obtener más información sobre las ping(1)opciones del comando, consulte su página de manual con el comando man pingen la terminal.

Respuesta2

Depende del host al que también hagas ping

mbp ~ % ping -s 1400 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 1400 data bytes
76 bytes from 8.8.8.8: icmp_seq=0 ttl=117 time=12.969 ms
wrong total length 96 instead of 1428
76 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=12.342 ms
wrong total length 96 instead of 1428
^C

mbp ~ % ping -s 1400 bbc.co.uk
PING bbc.co.uk (151.101.64.81): 1400 data bytes
1408 bytes from 151.101.64.81: icmp_seq=0 ttl=59 time=10.415 ms
1408 bytes from 151.101.64.81: icmp_seq=1 ttl=59 time=12.601 ms

En el ejemplo anterior, 8.8.8.8 no responde con el paquete completo, sino con bbc.co.uk. hace

Obtienes un comportamiento similar en Linux, solo que en su lugar.

wrong total length 96 instead of 1428

usted obtiene

truncated 

Mismo ejemplo en Linux:

E520:~$ ping -s 1400 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 1400(1428) bytes of data.
76 bytes from 8.8.8.8: icmp_seq=1 ttl=117 (truncated)
76 bytes from 8.8.8.8: icmp_seq=2 ttl=117 (truncated)

E520:~$ ping -s 1400 bbc.co.uk
PING bbc.co.uk (151.101.192.81) 1400(1428) bytes of data.
1408 bytes from 151.101.192.81 (151.101.192.81): icmp_seq=1 ttl=59 time=8.27 ms
1408 bytes from 151.101.192.81 (151.101.192.81): icmp_seq=2 ttl=59 time=8.36 ms

información relacionada