ICMP is a network-layer protocol primarily used for diagnostics, error reporting, and reachability testing. It is encapsulated within IP and does not use TCP or UDP. While ICMP itself does not carry application data, it is essential for network troubleshooting and behavior analysis.

The screenshot below shows the ICMP message within an IP packet.

The computer on the receiving end responds with an ICMP Echo Reply (ICMP Type 0).


Ping: Echo Request and Reply

The ping utility sends an ICMP Echo Request (Type 8) to a destination. If the destination is reachable, it replies with an ICMP Echo Reply (Type 0).

Ping Output Example

$ ping 10.0.0.1 -c 4

64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=12.3 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=10.1 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=10.5 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=9.9 ms

--- 10.0.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss
rtt min/avg/max/mdev = 9.9/10.7/12.3/0.9 ms

Common Reasons Ping May Fail