awesome-everything RU
↑ Back to the climb

Networking & Protocols

IP packets: dump and trace reading

Crux Read real packet dumps, route tables, and traceroute output; decode the header, predict the forwarding decision, and pick the highest-leverage fix.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

Packet dumps, route tables, and traceroute output are where IP-layer problems are actually diagnosed. Read each one, work out what the bytes and columns mean, then choose the call a senior engineer would make first.

Goal

Practise the loop you run in every routing or path-MTU incident: decode the header or table in front of you, predict the behaviour, and reach for the fix that does not depend on a signal you cannot guarantee.

Snippet 1 — decode the IPv4 header

A tcpdump -X capture shows the first 20 bytes of an IPv4 packet:

45 00 00 3c 1c 46 40 00 28 06 a6 ec c0 a8 00 0a 5d b8 d8 22
byte 0:  45        -> version 4, IHL 5 (5 * 4 = 20-byte header)
byte 8:  28        -> TTL = 0x28 = 40
byte 9:  06        -> protocol = 6
bytes 12-15: c0 a8 00 0a -> source 192.168.0.10
bytes 16-19: 5d b8 d8 22 -> destination 93.184.216.34
Quiz

From this header, what is the L4 protocol, what is the TTL, and what does the TTL value 40 most likely tell you about the packet's journey so far?

Snippet 2 — the route table

$ ip route show
default via 203.0.113.1 dev eth0
10.0.0.0/8 via 10.4.0.1 dev eth1
10.4.0.0/16 via 10.4.0.1 dev eth1
10.4.2.0/24 dev eth2 scope link
Quiz

A packet for 10.4.2.9 arrives. Which line forwards it, and which line would handle a packet for 8.8.8.8?

Snippet 3 — the traceroute

$ traceroute -n example.com
 1  192.168.1.1      0.9 ms
 2  203.0.113.1      8.4 ms
 3  * * *
 4  198.51.100.7    24.1 ms
 5  93.184.216.34   71.2 ms
Quiz

Hop 3 shows three asterisks but hops 4 and 5 reply normally. What is happening at hop 3, and is the path broken?

Snippet 4 — MSS clamping on the gateway

# VPN/PPPoE gateway, packets stalling on large transfers
# iptables rule under consideration:
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN \
  -j TCPMSS --clamp-mss-to-pmtu
Quiz

Large transfers through this gateway stall while small ones work. What does this rule do, and why is it preferred over just unblocking ICMP?

Recap

Every IP-layer incident is read in bytes and columns: the first nibble of an IPv4 header gives version and length, byte 8 is TTL (a hop counter, not a clock) and byte 9 is the L4 protocol; a route table is resolved by longest-prefix match with the default route as the last resort; traceroute asterisks usually mean a hop that withholds ICMP, not a broken path; and an MSS-clamp rule fixes path-MTU stalls without depending on ICMP. Decode what is in front of you, predict the behaviour, then fix the cause — not the symptom.

Continue the climb ↑IP packets: trace, decode, and fix a path-MTU black hole
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.