Ping(Packet InterNet Groper) は、インターネット プロトコル (IP) ネットワーク上のホストの到達可能性をテストし、発信元のホストから送信されたメッセージの往復時間を測定するために使用されるコンピューター ネットワーク管理ソフトウェア ユーティリティです。 宛先のコンピューターに行ったり戻ったりします。
Ping は、インターネット制御メッセージ プロトコル (ICMP) エコー要求パケットをターゲット ホストに送信し、ICMP エコー応答を待つことによって動作します。 送信から受信までの往復時間を測定し、エラーとパケット損失を報告します。
$ ping -help
Usage: ping [-LRUbdfnqrvVaAD] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface]
[-M pmtudisc-hint] [-m mark] [-S sndbuf]
[-T tstamp-options] [-Q tos] [hop1 ...] destination
多くのシステムは、インターネット プロトコル バージョン 6 (IPv6) ネットワークで同様のテストを行うためのコンパニオン ユーティリティ ping6 を提供しています。
$ ping6 -help
Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface]
[-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]
[[-N nodeinfo-option] ...]
[hop1 ...] destination
C:\>ping /?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name
Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet (IPv4-only).
-i TTL Time To Live.
-v TOS Type Of Service (IPv4-only. This setting has been deprecated
and has no effect on the type of service field in the IP Header).
-r count Record route for count hops (IPv4-only).
-s count Timestamp for count hops (IPv4-only).
-j host-list Loose source route along host-list (IPv4-only).
-k host-list Strict source route along host-list (IPv4-only).
-w timeout Timeout in milliseconds to wait for each reply.
-R Use routing header to test reverse route also (IPv6-only).
-S srcaddr Source address to use.
-4 Force using IPv4.
-6 Force using IPv6.
以下は、ターゲット ホスト www.yahoo.com に 5 つのプローブを送信するために Linux で ping を実行した場合の出力です。
$ ping -c 5 www.yahoo.com PING www.yahoo.com (116.214.12.74) 56(84) bytes of data. 64 bytes from 116.214.12.74: icmp_req=1 ttl=47 time=22.8 ms 64 bytes from 116.214.12.74: icmp_req=2 ttl=47 time=22.3 ms 64 bytes from 116.214.12.74: icmp_req=3 ttl=47 time=22.8 ms 64 bytes from 116.214.12.74: icmp_req=4 ttl=47 time=22.2 ms 64 bytes from 116.214.12.74: icmp_req=5 ttl=47 time=22.2 ms --- www.yahoo.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 22.228/22.503/22.853/0.316 ms
ユーティリティは、ping プローブの完了後に結果を要約します。 最短往復時間(RTT)は22.228ミリ秒、平均は22.503ミリ秒、最大値は22.853ミリ秒でした。 測定値の標準偏差は 0.316 ミリ秒でした。