Ping is a simple computer network software utility used to test a host's reachability on an Internet Protocol (IP) network. Packets are sent from the source to the target host, which sends packets back if it has access to the network. Following packet analysis, the source host calculates simple statistics of packets traversing the network and determines whether the target host is accessible.
How It Works and the Sequence
This is History
During his time at the US Army Research Laboratory, Mike Muuss wrote the ping utility in December 1983. Its name comes from the sound sonar makes when bouncing off underwater objects. Due to time passing, the acronym PING was developed from the name ping: Packet InterNet Groper. It was designed to provide a simple method of testing IP network connections and collecting network measurements. PING has always been a public domain software utility.
Exactly How Does It Work?
ICMP packets are used by Ping for its operation. To ping a target host, you send an ICMP echo request and wait for a reply with an ICMP echo. As well as packet loss and errors, the utility provides a statistical summary of the results (minimums, maximums, average round-trip times, and standard deviations).
A variety of ping implementations are available with additional features, such as controllable payload size, test count, network hop limit (TTL), interval time between requests, and time to wait for a response (round-trip time (RTT) or latency). We can also record the network route from the source to the target host via ping, which is relayed back to the source host via echo reply. A DNS name resolution test is also performed. ICMPv6 is the protocol used to communicate with Internet Protocol version 6 (IPv6) networks.
Examples
The following is the output of the ping utility (run on Linux). In the current configuration, 4 packets are sent to the target host. Seen below is a combination of the correct IP being resolved through a DNS resolver, successful ICMP echo reply and completion of a single ping test:
The following is the output of running ping, on Linux, for a 4-packet test. Compared to the test above, the destination was unreachable (i.e. no ICMP echo reply was received):
Format of message
The IPv4 datagrams used by ping are ICMP packets with the following format:
ICMP datagram for IPv4
ICMP is specified with value 1 in the protocol field and 0 in the Type of service field of the IPv4 packet header in blue. There is a header and payload for the ICMP packet in red. Headers contain information about ICMP messages, codes, checksums, and header data.
In an ICMP echo request, the type is 8. The reply value is 0. In ICMP echo requests and replies, an identifier and sequence number are included in the ICMP header. Each implementation determines the length of the ICMP payload. A packet (including IPv4 and ICMP headers) cannot exceed a network's maximum transmission unit or maximum packet size (due to fragmentation risks).
Concerns About Security
Unfortunately, ping can also be misused for malicious purposes, just like many other utilities. Here are some examples:
- An attacker sends ping requests as fast as they can to overwhelm the target systems in a Ping Flood attack (DoS).
- The process of sending ping requests to multiple addresses in order to obtain a list of all hosts on a network.
- Attackers spoof the IP address of other network devices to capture echo request packets. Attackers then send echo reply messages pretending to have the IP address in question. The victim is from now on communicating with the third party network device and not the original one. Network devices can be discovered using ping, but this poses a problem.
About AgileCDN
2800+
Global Points of Presence
With Global PoPs spread across the world, AgileCDN delivers content closer to users by accessing a nearby CDN node. It supports dynamic and static content acceleration, ensuring stability and reducing loading times.
24x7
Rapid response by a team of highly skilled professionals.
Help customers to develop their business quickly, save labor and time, and focus on core business
5+
Multi-scene acceleration
Deep insight into the actual use of various scenarios. Supports proxy acceleration, whole site acceleration, dynamic acceleration, static resource acceleration and advanced configuration to adapt to the needs of multiple scenarios.
Click here to register and get $2 voucher for free: https://www.agilecdn.cloud/register/