ping
维基百科,自由的百科全书
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.com是www.l.google.comDNS別名,IP位址是64.233.183.103。

