MTU, PMTUD and the tunnel that worked yesterday

The classic shape of this problem: small requests work fine, logins hang forever, and scp of anything larger than a few kilobytes stalls at 0%. Nothing in the application changed.

What is happening is that the path MTU shrank — usually because traffic now crosses a tunnel — and the ICMP "fragmentation needed" message that is supposed to tell the sender is being filtered somewhere along the way. TCP keeps retrying, and the connection simply appears to freeze.

ping -M do -s 1472 host.example.net   # 1472 + 28 = 1500
ping -M do -s 1400 host.example.net   # binary search downwards

Once you have the working size, the fix is either clamping MSS on the tunnel interface or lowering the MTU on the client. Clamping is preferable: it fixes the problem for every device behind the link instead of only the one you are sitting at.

The reason it "worked yesterday" is almost always that the route changed, the tunnel was brought up, or a middlebox started filtering ICMPv4 type 3 code 4. None of those are visible in application logs, which is exactly why this wastes an afternoon.

← All notes