Question
What is ICMP and what are its main purposes?
Answer
ICMP is a network-layer protocol that reports feedback about problems processing IP packets — its common messages (in both ICMPv4 and ICMPv6) are host reachability, destination/service unreachable, and time exceeded.
ICMP (Internet Control Message Protocol):
A network layer protocol that provides feedback about issues related to IP packet processing.
Two Versions:
| Version | Used With | Notes |
|---|---|---|
| ICMPv4 | IPv4 | Basic messaging protocol |
| ICMPv6 | IPv6 | Extended functionality for IPv6 |
Common ICMP Messages (both versions):
- Host reachability - Test if a host is available
- Destination or Service Unreachable - Report delivery failures
- Time exceeded - TTL/Hop Limit reached zero
Security Note: ICMPv4 messages are not required and are often not allowed within a network for security reasons. Firewalls frequently block ICMP to prevent network reconnaissance.
Go deeper:
RFC 792 — Internet Control Message Protocol — the original ICMP specification defining echo, destination unreachable, and time exceeded.
Internet Control Message Protocol — Wikipedia — overview of ICMP's role, message types, and diagnostic uses (ping, traceroute).
Note saved — thanks!
Question
How does ICMP test host reachability?
Answer
The source sends an ICMP Echo Request; if the destination is available it returns an ICMP Echo Reply. No reply suggests the host is unreachable. This is the mechanism behind ping.
ICMP Echo Messages for Host Reachability:
ICMP Echo messages test whether a host is reachable on an IP network.
* The source sends an Echo Request; a reachable host answers with an Echo Reply, which is exactly what ping does. *
Process:
Source Host Destination Host
│ │
│──── ICMP Echo Request ─────→│
│ │
│←──── ICMP Echo Reply ───────│
│ │
Steps:
- Local host sends an ICMP Echo Request to a destination
- If the destination is available, it responds with an ICMP Echo Reply
- If no reply is received, the destination may be unreachable
ICMP Message Types:
| Type | Message |
|---|---|
| 8 | Echo Request (IPv4) |
| 0 | Echo Reply (IPv4) |
| 128 | Echo Request (IPv6) |
| 129 | Echo Reply (IPv6) |
Key insight: This is the mechanism behind the ping command.
Go deeper:
ICMP, Ping & Traceroute Explained — Sunny Classroom — animated walkthrough of how echo request/reply tests connectivity.
Ping (networking utility) — Wikipedia — how echo messages measure round-trip time and reachability.
Note saved — thanks!