TCP/IP 笔记 7 Ping

 

 

lenovo-myc@lenovomyc-Lenovo-Product:~$ ping www.baidu.com
PING www.a.shifen.com (123.125.65.82) 56(84) bytes of data.    这句出现前的延时,为DNS对域名的解析时间
64 bytes from 123.125.65.82: icmp_seq=1 ttl=50 time=2.60 ms    这句time如果较长,可能是发送ARP请求和接受ARP应答所花的时间
64 bytes from 123.125.65.82: icmp_seq=2 ttl=50 time=3.36 ms
64 bytes from 123.125.65.82: icmp_seq=3 ttl=50 time=2.38 ms
64 bytes from 123.125.65.82: icmp_seq=4 ttl=50 time=2.75 ms
64 bytes from 123.125.65.82: icmp_seq=5 ttl=50 time=3.64 ms
^C
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 2.382/2.950/3.647/0.480 ms


lenovo-myc@lenovomyc-Lenovo-Product:~$ ping 123.125.65.78
PING 123.125.65.78 (123.125.65.78) 56(84) bytes of data.
64 bytes from 123.125.65.78: icmp_seq=1 ttl=50 time=2.45 ms
64 bytes from 123.125.65.78: icmp_seq=2 ttl=50 time=2.35 ms
64 bytes from 123.125.65.78: icmp_seq=3 ttl=50 time=2.19 ms
64 bytes from 123.125.65.78: icmp_seq=4 ttl=50 time=2.94 ms
64 bytes from 123.125.65.78: icmp_seq=5 ttl=50 time=2.59 ms
64 bytes from 123.125.65.78: icmp_seq=6 ttl=50 time=2.71 ms
64 bytes from 123.125.65.78: icmp_seq=7 ttl=50 time=2.57 ms
^C
--- 123.125.65.78 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6008ms
rtt min/avg/max/mdev = 2.193/2.547/2.947/0.232 ms

 

ping -s packetsize 指定数据包大小,默认为56

   -s packetsize
              Specifies  the  number of data bytes to be sent.  The default is
              56, which translates into 64 ICMP data bytes when combined  with
              the 8 bytes of ICMP header data.

lenovo-myc@lenovomyc-Lenovo-Product:~$ ping -s 4 www.baidu.com
PING www.a.shifen.com (220.181.112.244) 4(32) bytes of data.
12 bytes from 220.181.112.244: icmp_seq=1 ttl=45
12 bytes from 220.181.112.244: icmp_seq=2 ttl=45
12 bytes from 220.181.112.244: icmp_seq=3 ttl=45
12 bytes from 220.181.112.244: icmp_seq=4 ttl=45
12 bytes from 220.181.112.244: icmp_seq=5 ttl=45
^C
--- www.a.shifen.com ping statistics ---
6 packets transmitted, 5 received, 16% packet loss, time 5006ms

 

查看中间路由。。。没找到可以测的网址

lenovo-myc@lenovomyc-Lenovo-Product:~$ ping -R www.baidu.com
PING www.a.shifen.com (220.181.111.188) 56(124) bytes of data.
64 bytes from 220.181.111.188: icmp_seq=1 ttl=45 time=186 ms
NOP
RR:     220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188

64 bytes from 220.181.111.188: icmp_seq=2 ttl=45 time=184 ms
NOP
RR:     220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188

64 bytes from 220.181.111.188: icmp_seq=3 ttl=45 time=178 ms
NOP
RR:     220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188

64 bytes from 220.181.111.188: icmp_seq=4 ttl=45 time=176 ms
NOP
RR:     220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188
    220.181.111.188

^C
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4006ms
rtt min/avg/max/mdev = 176.328/181.574/186.643/4.214 ms

 

ping同一个网段

lenovo-myc@lenovomyc-Lenovo-Product:~$ ping -R 10.100.156.2
PING 10.100.156.2 (10.100.156.2) 56(124) bytes of data.
64 bytes from 10.100.156.2: icmp_seq=1 ttl=255 time=2.30 ms
NOP
RR:     10.100.156.2
    10.100.156.2
    10.100.156.2
    10.100.156.2

64 bytes from 10.100.156.2: icmp_seq=2 ttl=255 time=2.53 ms
NOP    (same route)
64 bytes from 10.100.156.2: icmp_seq=3 ttl=255 time=1.11 ms
NOP    (same route)
64 bytes from 10.100.156.2: icmp_seq=4 ttl=255 time=4.45 ms
NOP    (same route)
^C
--- 10.100.156.2 ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4005ms
rtt min/avg/max/mdev = 1.110/2.602/4.459/1.200 ms

 

posted @ 2015-08-06 18:25  马小豆包  阅读(863)  评论(0编辑  收藏  举报