What Is ICMP? Ping, Traceroute, and the Messages Behind Them
ICMP explained: the control messages behind ping and traceroute, the message types that matter, and how ICMP interacts with firewalls and packet loss.

On this page
When a network problem starts, the first thing most engineers type is a ping. It is fast, it needs no account, and it answers a small but useful question: can the destination respond at all? The protocol behind that command is ICMP, and understanding it explains why a failed ping is not always a broken host, and why blocking ICMP can break things quietly.
ICMP, the Internet Control Message Protocol, is the control layer that sits beside IP. It does not carry user data. It carries reports about the network: a host that cannot be reached, a packet that took too long, a route that needs to change, or a request for a path that is too small. Tools like ping and traceroute are simply convenient ways to send and read these messages.
What ICMP Is For
IP itself is a best effort protocol. It forwards packets toward a destination and does not guarantee delivery, does not report every failure, and does not care whether a receiver is listening. ICMP fills the gap by letting routers and hosts tell each other what is happening.
That feedback includes four broad categories: errors, such as destination unreachable or time exceeded; queries, such as echo request and echo reply; redirects, where a router tells a host about a better next hop; and discovery messages that help nodes learn about each other. The exact set is large, but a small handful is responsible for almost everything you will see in practice.
The ICMP Messages You Will Actually See
| Type | Name | Where you meet it |
|---|---|---|
| 0 and 8 | Echo reply and echo request | Ping, reachability checks, monitoring probes |
| 3 | Destination unreachable | A host, port, or network cannot be reached, including fragmentation needed |
| 5 | Redirect | A router suggests a different next hop |
| 11 | Time exceeded | A packet looped too long, which is how traceroute maps a path |
| 12 | Parameter problem | A malformed or unsupported header field |
Type 3 deserves a closer look because it has codes that change the story. Code 3 is port unreachable, which often means the host is healthy and nothing is listening. Code 4 is fragmentation needed, which is how path MTU discovery works, and blocking it is why some connections stall on large transfers while small ones succeed.
Ping and Traceroute Behind the Scenes
Ping sends an echo request and waits for an echo reply, measuring the round trip time and reporting any loss. It is a reachability and latency test, not a service test. A successful ping tells you the IP layer works between the two points, and a failed ping may mean the host is down, the route is broken, or something in the middle is filtering ICMP.
Traceroute uses the time exceeded message from a clever angle. It sends packets with a time to live of 1, then 2, then 3, and so on. Each router that drops the packet because the TTL hit zero replies with a time exceeded message, which reveals the address of the hop. The pattern of hops, and the point where replies stop, usually shows where a path breaks or which hop is adding latency.
Why ICMP Feels Like It Is Blocked
ICMP is frequently restricted, and there are two defensible reasons. Some networks rate limit echo requests so attackers cannot use them to sweep a whole address range, and some operators block redirects and certain error types so hosts cannot be told to change their routing. Both are reasonable. Blocking ICMP entirely is not, because it also removes path MTU discovery, which needs type 3 code 4 messages to work, and it takes away your simplest diagnostic.
Cloud environments make this sharper. Security groups often drop ICMP unless you add an explicit rule, so a host can serve traffic on port 443 while ignoring ping. When a reachability test fails in the cloud, check the security group before concluding the host is down, and confirm with a real service on a real port from the common ports reference.
Reading ICMP in a Real Troubleshooting Flow
Good troubleshooting moves from coarse to precise: first confirm the local stack and gateway, then the far side, then the actual service. Ping handles the first two steps. Traceroute narrows down where the path degrades. A port check confirms the service. Packet capture, where available, shows whether the replies were never sent or were filtered in transit.
The value of ICMP is that it is cheap, stateless, and available before you have credentials on the far side. The limit is that it says nothing about application health. Treat it as the first question, not the only one.
Where ICMP Fits in Your Records
ICMP rarely appears in documentation, but the addresses you ping do. Teams that record which subnets, gateways, and devices live where spend less time guessing what an IP belongs to when a probe fails. IP address management in Obelinf keeps that mapping in one place, so a failed ping to an address leads straight to the device, its subnet, and its owner instead of a search through old notes. That context turns a two minute diagnostic into a ten second lookup.
Frequently Asked Questions
What is ICMP?
What port does ICMP use?
What is the difference between ICMP and TCP?
Why does ping sometimes fail when the network works?
Is blocking ICMP a good idea?
Free Tools
Put this into practice with the free calculators, reference tables, and checklists in the Obelinf toolkit.
Stop reaching for a spreadsheet
Obelinf keeps every subnet, device, circuit, and rack in one live source of truth, with audit logs and a topology view. Free for personal use.
Related Articles

The Interface Inventory Audit: Finding Unused Ports, Orphaned IPs, and Bogus LAGs
A step by step interface audit you can run this week: the exact commands to pull from each switch, the API queries that find orphaned IPs, and how to read LAG flags that hide a broken bundle.
Read more
What Is TFTP and When Is It Still Used?
TFTP explained: how the trivial file transfer works over UDP, why switches and provisioning still use it, and where its lack of authentication becomes a risk.
Read more
How to Find and Fix IP Address Conflicts
Obelinf explains how IP address conflicts happen, the symptoms they leave on your network, the diagnostics that pinpoint the duplicate fast, and the fixes that keep them from coming back.
Read more