The ping utility was written by Mike Muuss in December 1983 during his employment at the Ballistic Research Laboratory, now the US Army Research Laboratory. A remark by David Mills on using ICMP echo packets for IP network diagnosis and measurements prompted Muuss to create the utility to troubleshoot network problems.2 The author named it after the sound that sonar makes since its methodology is analogous to sonar's echolocation.34 The backronym Packet InterNet Groper for PING has been used for over 30 years. Muuss says that, from his point of view, PING was not intended as an acronym but he has acknowledged Mills' expansion of the name.56 The first released version was public domain software; all subsequent versions have been licensed under the BSD license. Ping was first included in 4.3BSD.7 The FreeDOS version was developed by Erick Engelke and is licensed under the GPL.8 Tim Crawford developed the ReactOS version. It is licensed under the MIT License.9
Any host must process ICMP echo requests and issue echo replies in return.10
The following is the output of running ping on Linux for sending five probes (1-second interval by default, configurable via -i option) to the target host www.example.com:
The output lists each probe message and the results obtained. Finally, it lists the statistics of the entire test. In this example, the shortest round-trip time was 9.674 ms, the average was 10.968 ms, and the maximum value was 11.726 ms. The measurement had a standard deviation of 0.748 ms.
In cases of no response from the target host, most implementations display either nothing or periodically print notifications about timing out. Possible ping results indicating a problem include the following:
In case of error, the target host or an intermediate router sends back an ICMP error message, for example host unreachable or TTL exceeded in transit. In addition, these messages include the first eight bytes of the original message (in this case header of the ICMP echo request, including the quench value), so the ping utility can match responses to originating queries.11
An ICMP packet transported with IPv4 looks like this.
Most Linux systems use a unique Identifier for every ping process, and Sequence number is an increasing number within that process. Windows uses a fixed Identifier, which varies between Windows versions, and a Sequence number that is only reset at boot time.
The Echo Reply is returned as:
An ICMP packet transported with IPv6 looks like this.
The payload of the packet is generally filled with ASCII characters, as the output of the tcpdump utility shows in the last 32 bytes of the following example (after the eight-byte ICMP header starting with 0x0800):
The payload may include a timestamp indicating the time of transmission and a sequence number, which are not found in this example. This allows ping to compute the round-trip time in a stateless manner without needing to record the time of transmission of each packet.
The payload may also include a magic packet for the Wake-on-LAN protocol, but the minimum payload, in that case, is longer than shown. The Echo Request typically does not receive any reply if the host was sleeping in hibernation state, but the host still wakes up from sleep state if its interface is configured to accept wakeup requests. If the host is already active and configured to allow replies to incoming ICMP Echo Request packets, the returned reply should include the same payload. This may be used to detect that the remote host was effectively woken up, by repeating a new request after some delay to allow the host to resume its network services. If the host was just sleeping in low power active state, a single request wakes up that host just enough to allow its Echo Reply service to reply instantly if that service was enabled. The host does not need to wake up all devices completely and may return to low-power mode after a short delay. Such configuration may be used to avoid a host to enter in hibernation state, with much longer wake-up delay, after some time passed in low power active mode.
A packet including IP and ICMP headers must not be greater than the maximum transmission unit of the network, or risk being fragmented.
To conduct a denial-of-service attack, an attacker may send ping requests as fast as possible, possibly overwhelming the victim with ICMP echo requests. This technique is called a ping flood.16
Ping requests to multiple addresses, ping sweeps, may be used to obtain a list of all hosts on a network.
Mike Muuss. "The Story of the PING Program". U.S. Army Research Laboratory. Archived from the original on 25 October 2019. Retrieved 8 September 2010. My original impetus for writing PING for 4.2a BSD UNIX came from an offhand remark in July 1983 by Dr. Dave Mills ... I named it after the sound that a sonar makes, inspired by the whole principle of echo-location ... From my point of view PING is not an acronym standing for Packet InterNet Grouper, it's a sonar analogy. However, I've heard second-hand that Dave Mills offered this expansion of the name, so perhaps we're both right. /wiki/Mike_Muuss ↩
Salus, Peter (1994). A Quarter Century of UNIX. Addison-Wesley. ISBN 978-0-201-54777-1. 978-0-201-54777-1 ↩
Mills, D.L. (December 1983). Internet Delay Experiments. IETF. doi:10.17487/RFC0889. RFC 889. Retrieved 26 November 2019. /wiki/David_L._Mills ↩
"man page ping section 8". www.manpagez.com. http://www.manpagez.com/man/8/ping/ ↩
"ibiblio.org FreeDOS Package -- ping (Networking)". www.ibiblio.org. http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/ping.html ↩
"GitHub - reactos/reactos: A free Windows-compatible Operating System". 8 August 2019 – via GitHub. https://github.com/reactos/reactos ↩
R. Braden, ed. (October 1989). Requirements for Internet Hosts -- Communication Layers. Network Working Group. doi:10.17487/RFC1122. STD 3. RFC 1122. Internet Standard 3. Updated by RFC 1349, 4379, 5884, 6093, 6298, 6633, 6864, 8029 and 9293. Every host MUST implement an ICMP Echo server function that receives Echo Requests and sends corresponding Echo Replies. /wiki/Bob_Braden ↩
"ICMP: Internet Control Message Protocol". repo.hackerzvoice.net. 13 January 2000. Archived from the original on 4 August 2016. Retrieved 4 December 2014. https://web.archive.org/web/20160804032607/http://repo.hackerzvoice.net/depot_madchat/ebooks/TCP-IP_Illustrated/icmp_int.htm ↩
J. Postel (September 1981). INTERNET CONTROL MESSAGE PROTOCOL - DARPA INTERNET PROGRAM PROTOCOL SPECIFICATION. Network Working Group. doi:10.17487/RFC0792. STD 5. RFC 792. Internet Standard 5. Updates RFC 760, 777, IENs 109, 128. Updated by RFC 950, 4884, 6633 and 6918. /wiki/Jon_Postel ↩
"RFC Sourcebook's page on ICMP". Archived from the original on 6 July 2018. Retrieved 20 December 2010. https://web.archive.org/web/20180706090020/http://networksorcery.com/enp/protocol/icmp.htm#ICMP%20Header%20Checksum ↩
A. Conta; S. Deering (March 2006). M. Gupta (ed.). Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification. Network Working Group. doi:10.17487/RFC4443. STD 89. RFC 4443. Internet Standard 89. Obsoletes RFC 2463. Updates RFC 2780. Updated by RFC 4884. /wiki/Steve_Deering ↩
"What is a Ping Flood | ICMP Flood | DDoS Attack Glossary | Imperva". Learning Center. Retrieved 26 July 2021. https://www.imperva.com/learn/ddos/ping-icmp-flood/ ↩