ICMP (Internet Control Message Protocol) is a network layer protocol that reports errors and provides information related to IP packet processing. ICMP is used by network devices to send error messages indicating, for example, that a requested service is not available or that a host isn’t reachable.
ICMP is commonly used by network tools such as ping or traceroute. Consider the following example that illustrates how ping can be used to test the reachability of a host:
Host A wants to test whether it can reach Server over the network. Host A will start the ping utility that will send ICMP Echo Request packets to Server. If Server is reachable, it will respond with ICMP Echo Reply packets. If Host A receives no response from Server, there might be a problem on the network.
NOTE – ICMP messages are encapsulated in IP datagrams.
One other common ICMP message is the Destination unreachable message. Here is an example:
Host A sends a packet to Host B. Because the R1’s interface connected to Host B is down, the router will send an ICMP Destination unreachable message to Host A, informing it that the destination host is unreachable.