The two tools every network engineer reaches for first — and every field, every character, and every quirk an interviewer can ask you to explain.
Ping and traceroute look trivial from the CLI, but they are dense with detail: two ICMP
message types, a fistful of header fields, and a set of output characters that each encode a
precise failure mode. This page walks both tools field by field, decodes the
Cisco IOS output alphabet, and explains the patterns interviewers love to probe — starting with
the famous .!!!!.
Ping answers “is it reachable, and how fast?” Traceroute answers “which path does it take, and where does it break?” Both are built on the same primitive — ICMP running directly over IP — but they exploit different fields: ping uses Echo, traceroute weaponizes TTL.
Ping sends an ICMP Echo Request and waits for the matching
ICMP Echo Reply. ICMP is protocol number 1, carried directly
inside an IP packet (there is no TCP or UDP layer — EtherType 0x0800 → IP proto 1).
| Direction | Type | Code | Meaning |
|---|---|---|---|
| Request (sent by pinger) | 8 | 0 | Echo Request |
| Reply (sent by target) | 0 | 0 | Echo Reply |
A common gotcha: the Echo Reply is type 0, not type 8. The responder copies the payload back verbatim and flips the type field from 8 to 0.
| Field | Size | Purpose |
|---|---|---|
| Type | 1 byte | 8 request / 0 reply |
| Code | 1 byte | 0 for echo |
| Checksum | 2 bytes | Covers the ICMP header + payload |
| Identifier | 2 bytes | Demultiplexes replies to the right process/socket. On Unix it is often the sending process's PID; behind NAT it doubles as the session key (ICMP has no ports). |
| Sequence Number | 2 bytes | Increments per probe (1, 2, 3…). Lets the sender match each reply to its request and detect loss / reordering / duplicates. |
| Payload | variable | Arbitrary data, echoed back unchanged. Used to measure RTT and to test specific sizes/patterns. |
Because ICMP has no port numbers, the kernel needs another way to know which reply belongs to
which request. The Identifier distinguishes one ping instance from another (and
one host from another behind NAT), while the Sequence Number distinguishes the
individual probes within that instance. When a reply arrives, the sender looks up the
(Identifier, Sequence) tuple to find the timestamp it recorded at send time.
The payload is arbitrary but meaningful in practice. Linux ping stuffs a timestamp
into the first bytes so RTT can be computed even if no local table is kept; the rest is a fixed
incrementing pattern (0x10 0x11 0x12 …). Cisco IOS defaults to a 100-byte
packet with a repeating 0xABCD pattern. You can change size and pattern to hunt for
MTU issues or pattern-sensitive faults (e.g. ping ip 10.0.0.1 size 1500 df-bit).
(Identifier, 1).(Identifier, 1), computes RTT = now − send time, prints one ! (or one line on Unix).$ ping -c 4 10.0.30.22
64 bytes from 10.0.30.22: icmp_seq=1 ttl=61 time=2.11 ms
64 bytes from 10.0.30.22: icmp_seq=2 ttl=61 time=1.83 ms
64 bytes from 10.0.30.22: icmp_seq=3 ttl=61 time=1.90 ms
64 bytes from 10.0.30.22: icmp_seq=4 ttl=61 time=1.88 ms
--- 10.0.30.22 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss
rtt min/avg/max/mdev = 1.83/1.93/2.11/0.10 ms
Cisco IOS prints one character per probe. Memorize this table — it is a classic quick-fire interview question, and each symbol maps to a specific ICMP event.
| Char | Meaning | What it really indicates |
|---|---|---|
! | Reply received | An Echo Reply came back in time — success. |
. | Timed out | No reply within the timeout window (default 2 s). Loss, filtering, or slow resolution — see below. |
U | Destination unreachable | A router returned ICMP Destination Unreachable (type 3) — no route, host down, or admin filter. |
Q | Source quench | Received an ICMP Source Quench (type 4) — a legacy congestion signal, now deprecated. |
M | Could not fragment | ICMP type 3 code 4: packet too big and the DF bit was set, so a router had to drop it. The MTU black-hole symptom. |
? | Unknown packet type | An ICMP message IOS didn't recognize / couldn't classify. |
& | Packet lifetime exceeded | TTL hit 0 in transit — a router returned ICMP Time Exceeded (type 11). Usually a routing loop or a too-low initial TTL. |
I | Interrupted | The operator aborted the ping (Ctrl-Shift-6 / break sequence). |
.!!!! patternYou run a five-probe ping from a Cisco router and see:
R1# ping 10.0.30.22
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.30.22, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/2/4 ms
The first probe timed out (.), the next four succeeded (!!!!), giving
80 percent (4/5). This is normal, not a fault — and being able to explain
why is the whole point of the question.
When the router originates the very first Echo Request, it frequently does not yet have the L2 rewrite information it needs to forward the packet:
..By the time probe 2 is sent, the ARP entry and CEF adjacency are fully populated,
the packet is hardware/CEF-switched in the data plane, and every subsequent probe returns
!. On a multi-hop path you may see ..!!! instead: the first probe can
trigger resolution on more than one segment (or hit a control-plane punt at more than one device),
so occasionally the first two probes are lost.
The one-liner for the interview: the first ping seeds the ARP/CEF adjacency; it is punted/process-switched while resolution completes and times out, then the populated entry lets the rest fly. An 80 percent success rate on the first ping to a new destination is expected behavior, not a problem.
!!!!! (100 percent), because
the adjacency is now cached.show ip arp 10.0.30.22 / show adjacency — the entry now exists.. appears intermittently laterA dropped probe in the middle of a run is a different story — the adjacency already exists, so it points to a genuine issue:
ip icmp rate-limit). Under a burst, some Echo Replies simply aren't
generated.df-bit, an
undersized link yields M (or silent . when ICMP errors are filtered),
exposing a PMTUD black hole.Position matters. Loss at the start of a ping = resolution/punt, benign. Loss in the middle/steady state = real drops, rate-limiting, or CoPP. Always say which one you're looking at.
Traceroute maps the path hop by hop by abusing the TTL field. It sends probes with deliberately small, incrementing TTLs and collects the ICMP errors each router returns.
The Time Exceeded trick reveals intermediate hops, but the final hop is signalled differently depending on probe type:
tracert): the destination returns a
normal Echo Reply (type 0).| Probe | Default on | Intermediate hop signal | Destination signal | Firewall friendliness |
|---|---|---|---|---|
| UDP high ports | Linux/macOS traceroute | Time Exceeded (11/0) | Port Unreachable (3/3) | Often blocked; ports vary per probe |
| ICMP Echo | Windows tracert, traceroute -I | Time Exceeded (11/0) | Echo Reply (0/0) | Blocked wherever ICMP is filtered |
| TCP SYN | traceroute -T, tcptraceroute | Time Exceeded (11/0) | SYN-ACK / RST | Best — targets a real open port (e.g. 80/443) to slip through firewalls |
tracert vs Unix traceroute — the port questionA common interview framing: "can you point traceroute at a specific port?" — and the answer follows from which layer the probe lives at:
tracert defaults to ICMP Echo. ICMP is an
L3 protocol with no port field, so there is no port to specify —
you're probing the host, not a service.traceroute defaults to UDP (an L4
protocol), so you can aim it at a port — and with -T (TCP) you target a real service
port like 443. This is what lets TCP/UDP traceroute slip through firewalls that drop ICMP.All three probe types still use the same TTL trick for intermediate hops; only the
transport (and thus port-addressability + how the destination is detected) differs. Note Unix
traceroute can also send ICMP with -I, so "traceroute = UDP" is only the
default, not a hard rule.
$ traceroute 93.184.216.34
traceroute to 93.184.216.34, 30 hops max, 60 byte packets
1 10.0.10.1 0.412 ms 0.388 ms 0.377 ms
2 10.0.255.1 1.02 ms 0.98 ms 1.10 ms
3 100.64.0.1 3.4 ms 3.2 ms 3.6 ms
4 * * *
5 203.0.113.9 12.1 ms 11.8 ms 12.4 ms
6 198.51.100.6 14.9 ms 40.2 ms 14.7 ms
7 93.184.216.34 15.1 ms 14.9 ms 15.0 ms
* * * (all three probes lost at a hop). It does not
necessarily mean the path is broken. Common causes: the hop
rate-limits or deprioritizes its ICMP Time-Exceeded generation (CoPP), it is
configured not to send ICMP errors at all, or a firewall filters
the probe/response. If later hops still answer, the traffic clearly passed through the silent hop —
so * * * in the middle is usually cosmetic. Only * * * all the
way to the destination signals a real reachability problem.no-propagate (no mpls ip propagate-ttl), the IP TTL is
copied into the label only at ingress and back only at egress — transit LSRs decrement the
label TTL, not the IP TTL. The result: the entire MPLS core appears as a
single hop, hiding the P routers. (With TTL propagation enabled, or via
RFC 4950 MPLS extensions, the core hops reappear, sometimes annotated with their MPLS labels.)M character.)* * * at hop 4 but the destination answers at hop 7. Is the path
broken? (No — the silent hop simply doesn't return ICMP; traffic clearly passed it.)