Vol. I · No. 46The protocol sectionSat, 10 Oct 2026
Layer 3 · The Internet Layer · the network’s error & status channel

ICMP

Internet Control Message Protocol

ICMP is how the network reports back. IP itself carries no way to say “that didn’t arrive” — ICMP fills the gap, sending error and diagnostic messages when a packet can’t be delivered, is too big, or outlives its hop budget. It is also the engine behind ping and traceroute.

ICMP is IP’s status channel — it carries errors and diagnostics, never application data.

You can run this one

Open the ICMP lab →

Ping: echo request and reply, TTL counting down hop by hop, and how traceroute reads the failures.

Beginner
Operates at
Layer 3
beside IP itself
Port
None
IP protocol 1
Carries
Control
errors, not payload
IPv6 uses
ICMPv6
protocol 58 · NDP

How it works

Traceroute — ICMP errors mapped into a path
SourceEach router along the way
Send a packet with TTL = 1
Hop 1 decrements TTL to 0 → drops it
Returns Time Exceeded (type 11) — now you know hop 1’s address
Repeat with TTL = 2, 3, 4…
Each further hop expires the packet in turn
One Time-Exceeded per hop draws the whole path, router by router
Reaching the destination
Destination replies — the walk is complete

Ping is simpler still: an Echo Request (type 8) out, an Echo Reply (type 0) back — the round trip is the latency you see.

The main points

What ICMP does, step by step

1
Ride inside IP

An ICMP message is carried as the payload of an IP packet — no ports, no connection, no handshake.

2
Report a problem

A router that can’t deliver sends back an error — unreachable, too big, or time exceeded.

3
Quote the offender

The error carries the start of the original packet, so the sender knows exactly which one failed.

4
Power the tools

Echo request/reply is ping; expiring TTLs on purpose is traceroute — both are just ICMP.

Common message types
0 / 8 — Echo Reply / Request (ping)
3 — Destination Unreachable
11 — Time Exceeded (traceroute)
3 / 4 — Fragmentation Needed (PMTUD)
5 — Redirect (use a better router)
12 — Parameter Problem (bad header)

In cybersecurity

ICMP is invaluable for diagnostics but is also a reconnaissance and covert-channel tool — the trick is filtering the dangerous types without breaking the ones the network needs.

Host & network scanning

Echo sweeps and error responses map which hosts are alive — often the first step of an attack.

Don’t block it all

Dropping every ICMP breaks Path MTU Discovery, so connections silently hang — permit types 3 & 11.

ICMP tunnelling

Data hidden in echo payloads smuggles traffic past filters that wave ping through unquestioned.

Smurf & floods

Spoofed echoes to a broadcast once amplified DDoS; rate-limiting and no directed-broadcast end it.

Redirect abuse

A forged type-5 redirect can steer a host onto an attacker’s gateway — most systems now ignore them.

Rate-limit, don’t kill

Throttling ICMP keeps diagnostics working while blunting scans and floods — the pragmatic middle.

Rides in the stack

EthernetIPICMP

It sits directly on IP with no transport layer — ICMP is the network layer talking about itself.

Works with

IPv4

See it on Linux

pingtraceroutemtrnmapnftiptables

Message & tools

Header
Typewhat
Codewhy
Checksumintegrity
Payloadquoted pkt
Tools
pingecho
tracerouteTTL
pathpingboth
PMTUDtype 3/4