Ping(Packet InterNet Groper) ist ein Software-Dienstprogramm zur Computernetzwerkverwaltung, mit dem die Erreichbarkeit eines Hosts in einem Internet Protocol (IP)-Netzwerk getestet und die Umlaufzeit für vom Ursprungshost gesendete Nachrichten gemessen werden kann zu einem Zielcomputer und zurück.
Ping sendet ICMP-Echoanforderungspakete (Internet Control Message Protocol) an den Zielhost und wartet auf eine ICMP-Echoantwort. Es misst die Umlaufzeit von der Übertragung bis zum Empfang und meldet Fehler und Paketverluste.
$ 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
Viele Systeme bieten ein begleitendes Dienstprogramm ping6 für ähnliche Tests in IPv6-Netzwerken (Internet Protocol Version 6).
$ 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.
Das Folgende ist die Ausgabe der Ausführung von Ping unter Linux zum Senden von fünf Sonden an den Zielhost www.yahoo.com.
$ 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
Das Dienstprogramm fasst seine Ergebnisse nach Abschluss der Ping-Prüfungen zusammen. Die kürzeste Umlaufzeit (RTT) betrug 22,228 ms, der Durchschnitt lag bei 22,503 ms und der Maximalwert bei 22,853 ms. Die Messung hatte eine Standardabweichung von 0,316 ms.