ICMP is used for error handling and diagnostics in IP networks by sending control and error messages.
Facts (CCNA)
- ICMP is part of the IP layer (Layer 3) – not TCP/UDP
- Used for error reporting and diagnostics, not data transport
- Known tools: ping and traceroute
- ICMP messages are sent in response to IP packets that cannot be delivered properly
Important types
| ICMP type | Function | Typical use |
|---|---|---|
| Echo Request (8) | Test reachability | ping |
| Echo Reply (0) | Answer to echo request | ping |
| Destination Unreachable (3) | Cannot deliver the packet | routing / ACL / MTU |
| Time Exceeded (11) | TTL expired | traceroute |
Echo request / reply
- Sender sends echo request (type 8)
- Receiver answers echo reply (type 0)
- RTT is measured
Confirms reachability, tests latency and packet loss. Caveats: ICMP may be blocked by ACL/firewall; a reply means reachability only – not that applications work.
Destination Unreachable (type 3)
| Code | Meaning |
|---|---|
| 0 | Network unreachable |
| 1 | Host unreachable |
| 3 | Port unreachable |
| 4 | Fragmentation needed (PMTUD) |
A router or host detects a delivery problem and sends type 3 back – helps identify wrong routing, blocking ACLs, and MTU problems (Path MTU Discovery).
Time Exceeded (type 11)
- Every router decrements TTL by 1
- TTL = 0 → packet dropped
- Router sends ICMP Time Exceeded back
traceroute sends packets with TTL 1, 2, 3…; each router answers with type 11 → the whole path is mapped. Identifies routing loops and gives insight into path selection.
Special considerations
- ICMP can be rate-limited (CoPP)
- Excessive ICMP is used in DoS attacks (e.g. ping floods)
- Many networks allow only selected ICMP types
CCNA troubleshooting
ping 8.8.8.8
traceroute 8.8.8.8
show ip route
show access-lists
| Error message | First thing to check |
|---|---|
| Network unreachable | Routing table |
| Host unreachable | ARP + host status |
| Port unreachable | Application / UDP |
| TTL expired | Routing loop / path |
| Fragmentation needed | MTU / DF bit |
| Redirect | Gateway design |
Exam tip 💡: see ICMP type 3 code 0/1/3/4 → ask yourself: routing? host? port? MTU?
Short version: Echo = reachability · Destination Unreachable = why delivery fails · Time Exceeded = how the packet moves through the network.