ping 的一些小知识

ping

# linux
ping 10.10.66.90 -c 5
-c 不写参数的话是10个包
linux默认不停的发包

# windows
ping 10.10.66.90 -n 3
windows 默认发包4次

ping size:

-c 指定发包的数量
-s xxx 可以设定大小 : arbitrary amount of data 的 size

ping包的构成:

IP header :20 bytes
ICMP ECHO_REQUEST :
ICMP header :8 bytes worth
arbitrary amount of data.:the default is 56bytes

举例说明:

ping -c 5 baidu.com
PING baidu.com (39.156.66.10) 56(84) bytes of data.
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=1 ttl=45 time=33.4 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=2 ttl=45 time=32.8 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=3 ttl=45 time=33.5 ms

这里有 56(84) bytes of data , 56 = “arbitrary amount of data ”
84则是包含 IP header、ICMP header的总大小

--fin

posted @ 2024-02-05 10:35  kasusa  阅读(42)  评论(0)    收藏  举报