ping


ping (正體)

Free Web Hosting with Website Builder

ping是一个电脑网络工具,用来测试特定主机能否通过IP到达。ping的运作原理是向目标主机传出一个ICMP echo要求封包,等待接收echo回应封包。程式会按时间和反应成功的次数,估计失去封包率(丢包率)和封包来回时间(网络时延)。

1983年12月,Mike Muuss写了这个程式,在IP网络出问题时方便找出其根源。因为这个程式的运作和潜水艇声纳相似,他便用声纳的声音来为程式取名。David L. Mills曾提出另一个取名:Packet Internet Grouper/Gopher(后者指地鼠)。

例子

Linux iputils内的ping

$ ping www.google.com
PING www.l.google.com (64.233.183.103) 56(84) bytes of data.
64 bytes from 64.233.183.103: icmp_seq=1 ttl=246 time=22.2 ms
64 bytes from 64.233.183.103: icmp_seq=2 ttl=245 time=25.3 ms
64 bytes from 64.233.183.103: icmp_seq=3 ttl=245 time=22.7 ms
64 bytes from 64.233.183.103: icmp_seq=4 ttl=246 time=25.6 ms
64 bytes from 64.233.183.103: icmp_seq=5 ttl=246 time=25.3 ms
64 bytes from 64.233.183.103: icmp_seq=6 ttl=245 time=25.4 ms
64 bytes from 64.233.183.103: icmp_seq=7 ttl=245 time=25.4 ms
64 bytes from 64.233.183.103: icmp_seq=8 ttl=245 time=21.8 ms
64 bytes from 64.233.183.103: icmp_seq=9 ttl=245 time=25.7 ms
64 bytes from 64.233.183.103: icmp_seq=10 ttl=246 time=21.9 ms

--- www.l.google.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9008ms
rtt min/avg/max/mdev = 21.896/24.187/25.718/1.619 ms

Microsoft Windows XP内置的ping:

C:\>ping www.google.com

Pinging www.l.google.com [64.233.183.103] with 32 bytes of data:


Reply from 64.233.183.103: bytes=32 time=25ms TTL=245
Reply from 64.233.183.103: bytes=32 time=22ms TTL=245
Reply from 64.233.183.103: bytes=32 time=25ms TTL=246
Reply from 64.233.183.103: bytes=32 time=22ms TTL=246

Ping statistics for 64.233.183.103:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 22ms, Maximum = 25ms, Average = 23ms

结果说明了www.google.comwww.l.google.comDNS别名,IP位址是64.233.183.103

外部链接







Why are we here?
All text is available under the terms of the GNU Free Documentation License
This page is cache of Wikipedia. History