3 min read

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.

ByAndré Ribeiro· Founder, Obelinf
What Is ICMP? Ping, Traceroute, and the Messages Behind Them
What Is ICMP? Ping, Traceroute, and the Messages Behind Them · October 18, 2026
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?
ICMP, the Internet Control Message Protocol, is the protocol IP uses to report errors and share control information. It carries messages such as echo request and echo reply, destination unreachable, and time exceeded, which is how tools like ping and traceroute work.
What port does ICMP use?
None. ICMP is a separate protocol that sits directly on top of IP, so it has message types and codes instead of port numbers. That distinction matters on firewalls, where ICMP is allowed or blocked by type rather than by port.
What is the difference between ICMP and TCP?
TCP is a transport protocol that carries application data reliably and uses ports, while ICMP is a control protocol that reports conditions about the network itself and uses message types. TCP moves your data, and ICMP tells you why the path to it is failing.
Why does ping sometimes fail when the network works?
Many firewalls and cloud security groups drop ICMP by default, so a failed ping does not always mean the host is down. A service on the same host can be perfectly reachable over TCP while echo requests are filtered, so test with a real service as well.
Is blocking ICMP a good idea?
Blocking all ICMP is a common mistake. It hides path MTU discovery, which depends on ICMP fragmentation-needed messages, and it removes the fastest diagnostic tool you have. Most networks allow a defined subset of ICMP and rate limit the rest.

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