ICMP & Path Discovery
Most important commands to remember
ping— ask an IP destination for an echo reply.tracepath— discover responding hops toward a destination.
Commands and flags
| Command or option | Meaning |
|---|---|
ping -4 -c 2 -W 2 127.0.0.1 |
Use IPv4, send two echo requests, and wait two seconds when no response arrives. |
tracepath -4 -n -m 5 127.0.0.1 |
Use IPv4, display numeric addresses, and explore at most five hops. |
127.0.0.1 is IPv4 loopback: this machine itself. Neither command changes network configuration.
The concepts that matter
1. ICMP provides feedback about IP delivery
IP carries packets without guaranteeing delivery. ICMP, the Internet Control Message Protocol, lets routers and hosts report conditions such as an unreachable destination or an expired packet. It does not repair a route or retransmit lost data.
Your laptop already supports ICMP through its operating system. Opening a website uses HTTPS, not an automatic preliminary ping. ICMP may report a network problem affecting that exchange.
2. Ping tests one specific exchange
Ping sends an Echo Request and waits for an Echo Reply. Its round-trip time (RTT) includes travel to the responding device and back.
A reply establishes that this echo exchange worked. It does not establish that a website, database, or other application works. Conversely, a missing reply can reflect filtering rather than an offline destination.
3. TTL makes intermediate hops observable
An IPv4 packet carries Time to Live (TTL). A forwarding router reduces it, normally by one. When the budget expires, the router discards the packet and normally returns Time Exceeded. This prevents indefinite circulation in routing loops.
Path-discovery tools send separate probes with increasing TTL. TTL 1 can reveal the first router, TTL 2 the second, and so on. Each reply supplies an observation; one packet does not return with a complete route written inside it.
4. A discovered path is a partial observation
Tracepath uses UDP probes. A probe reaching an unused destination port can produce ICMP Port Unreachable, which helps the tool recognize arrival. Echo probes instead finish with Echo Reply.
Some routers filter or rate-limit diagnostic replies. Paths can change, and return traffic can follow another route. A hop’s RTT is the round trip from the sender, not the delay of just the preceding link. Subtracting adjacent RTTs does not reliably isolate that link’s latency.
One small example
Optional: run these commands in a Linux terminal. This local example needs no external destination or administrator access.
ping -4 -c 2 -W 2 127.0.0.1
tracepath -4 -n -m 5 127.0.0.1
In ping, read icmp_seq, reply ttl, and time in milliseconds, then compare transmitted and received counts. The reply TTL is its remaining budget, not the request’s initial TTL.
Tracepath should identify the local destination as reached; this loopback exercise crosses no router. A displayed hop number is a probe position, not proof of that many physical routers. pmtu reports a packet-size limit in bytes, while ms reports RTT. Addresses, timing, and formatting depend on your system. No cleanup is required.
This illustrates the tools’ output; observing intermediate routers requires a destination beyond your local link.
Keep this idea: ICMP supplies feedback; increasing TTL deliberately uses that feedback to discover responding hops.