The Internet Control Message Protocol (ICMP) is the "error reporting system" or "diagnostic service" of the Internet Protocol. It is used whenever something goes wrong during packet transmission—for example, when a destination computer is unreachable or a router doesn't know a route.
ICMP doesn't operate at the same level as applications or services, but rather directly interacts with the IP protocol at the network level (Layer 3). It helps identify problems, but not resolve them. ICMP doesn't send payload data, but rather control information.
A well-known example of ICMP is the ping
command. When you ping an IP address, a so-called echo request (ICMP Type 8) is sent to the target host. If the host responds with an echo reply (ICMP Type 0), you know the connection is established and the target is alive.
ICMP can also report when a destination is unreachable, the TTL (time to live) of a packet has expired, or the packet was too large. It is therefore not a tool for communication in the sense of data exchange, but rather an important tool for communication about communication—for what is also called "network diagnostics" in computer science.