Routers and hosts use ICMP messages to report conditions such as an unreachable destination, an expired hop limit, or a packet that is too large for a path. ICMP is part of IP operation, not a general application-data transport.
IPv4 uses ICMP, while IPv6 uses ICMPv6, which also supports essential IPv6 functions. Echo request and echo reply messages underpin the familiar ping test, but they are only two message types. Traceroute commonly elicits time-exceeded messages by sending packets with progressively larger IPv4 time-to-live or IPv6 hop-limit values.
Key points
Error reportingICMP reports a problem to a sender; it does not repair the failed delivery or guarantee that every network error produces a message.
DiagnosticsPing, traceroute, and monitoring systems use selected ICMP behavior to test reachability and investigate paths, delay, and loss.
Safe filteringPermit message types needed for correct operation, validate them in context where possible, rate-limit abuse, and restrict unnecessary traffic rather than applying an indiscriminate block.
Important limitationICMP messages are not inherently proof of the sender’s identity or of the reported condition. They can be spoofed, filtered, rate-limited, or abused, yet blocking all ICMP can impair diagnostics and functions such as Path MTU Discovery, especially in IPv6.