Path MTU Discovery & ICMP Black Holes
Why small requests fly and big uploads hang forever
Cloud infrastructurecloud infrastructure / networking
The symptom, 2am version
Your service talks to a partner API over a VPN. It works. Then someone adds a field.
GET /health→ 200, 3ms, always- TLS handshake → completes fine
POST /orderswith a 40 KB body → hangs, then times out at 30s- Same request from your laptop → instant
- Retry → hangs again, identically. No error in any log.
Nothing is "down". The connection is open. Bytes just stop moving.
The number you think you know
Ethernet MTU is 1500 bytes. TCP negotiates MSS at handshake time:
MSS = MTU - 20 (IP) - 20 (TCP) = 1460
But every tunnel steals header space from the payload:
WireGuard → ~1420
VXLAN → 1450
GRE → 1476
IPsec → ~1400-1438
AWS VPC → 9001 inside the VPC, 1500 to the internet
Your 40 KB POST is sliced into 1460-byte segments. The 1420-byte tunnel cannot carry them. Your 500-byte health check never hit the limit — that's why only big things break.
The black hole
The router that can't forward the packet is supposed to say so: ICMP type 3 code 4, "fragmentation needed, MTU is 1420". The sender shrinks its segments and life continues. That feedback loop IS Path MTU Discovery.
Then a security group, NACL or hardened firewall "blocks ICMP" because ping felt scary.
Now nobody tells the sender anything. The packet has the DF (don't fragment) bit set, so it is silently dropped. TCP sees a lost segment and retransmits — the same oversized packet, forever. That's an ICMP black hole: not slow, not refused, just an infinite polite retry.
Find it in 30 seconds
Probe with ICMP, DF set, payload sized so total = 1500 (1472 + 8 ICMP + 20 IP):
ping -M do -s 1472 partner.internal
# Frag needed and DF set (mtu = 1420) ← lucky: it told you
# ...or just 100% packet loss ← black hole
ping -M do -s 1392 partner.internal # 1392 + 28 = 1420
# 64 bytes from ... time=12ms ← real path MTU found
tracepath partner.internal # per-hop, shows where it drops
ss -ti dst partner.internal # look at mss: and retrans:
Three real fixes
- Allow ICMP type 3 code 4 (and for IPv6, type 2 "Packet Too Big" — PMTUD is mandatory there, no fragmentation exists). Never blanket-drop ICMP.
- Clamp MSS at the gateway so endpoints never try:
iptables -t mangle -A FORWARD -p tcp --syn \
-j TCPMSS --clamp-mss-to-pmtu
- Enable packetization-layer PMTUD — infers MTU from TCP itself, no ICMP needed:
sysctl -w net.ipv4.tcp_mtu_probing=1 # 2 = always probe
Gotchas that cost people days
- Works from your laptop, fails from the cluster → different path, different MTU. Not a code bug.
- Kubernetes overlays (VXLAN/Geneve) shrink pod MTU below node MTU; a wrong CNI
mtu:setting hits only large payloads. - UDP and QUIC get no retransmit rescue — DNS over UDP breaks at 1232+ bytes for the same reason.
- Jumbo frames (9001) inside a VPC are great until one hop to the internet makes every full-size packet undeliverable.
Your exercise
On any host, run ip link show and note the MTU of your default interface. Then run ping -M do -s <mtu-28> 1.1.1.1 and confirm it succeeds, and ping -M do -s <mtu-27> 1.1.1.1 and confirm it fails locally. Now try the same against a host behind your VPN — does the real path MTU match what the interface claims?