Pages that half load: MTU problems
Ping works, some pages hang, uploads stall, and it only happens with a VPN. Why packet size can be the cause, how to find the limit, and what to set.
3 min read
On this page
Some sites open and others hang forever. A page starts and stops. Text messages go through and photos don't. Ping is perfect. If this happens with a VPN, on a DSL line or behind a new router, the packets may be too large for some part of the way. Small ones pass and large ones vanish.
What goes wrong
Every link has a largest packet it can carry, its MTU. On Ethernet it's 1,500 bytes. Tunnels put each packet inside another one, and that takes space:
Normally the two ends find the right size by themselves. A router that can't forward a packet reports it, and the sender uses smaller ones. This is called path MTU discovery, and it has a well-known weakness, described by the IETF back in 2000 in RFC 2923:
- 1A full-size packet is sentMarked “don’t split”
- 2A narrower link can’t take itIt should report: “too big, use this size”
- 3The report is blockedOften by a firewall that drops all ICMP
- 4The sender waitsAnd sends the same size again
Small packets get through all the while, so ping and the first bytes look fine.
Systems have learned to notice and try smaller sizes (RFC 4821), but it takes time, and it isn't enabled everywhere.
Why it's more visible now
For years the first message of an encrypted connection was small, and problems only showed up later, with the content. That has changed. Browsers now send keys for post-quantum encryption in that first message, and they're large:
Chrome's doesn't fit in one packet, and the first of the two is full size. So on a line with an MTU black hole, Chrome can fail to connect at all where curl succeeds on the same machine. There's a second, similar problem: some servers can't handle a first message in two pieces. tldr.fail collects those cases. If a site fails from every network, that's more likely.
Find the limit
Send pings that may not be split, and reduce the size until they get through. Turn the VPN on if that's when the problem occurs.
On macOS:
ping -D -c 3 -s 1472 1.1.1.1On Linux:
ping -M do -c 3 -s 1472 1.1.1.1On Windows:
ping -f -n 3 -l 1472 1.1.1.11472 is a full 1,500-byte packet. If it works, try other targets, and if they all work, MTU isn't your problem. If it doesn't, you see one of two things:
ping: sendto: Message too longYour own computer refuses, because it knows the limit. (On Windows: "Packet needs to be fragmented but DF set.") If a router on the way reports frag needed and DF set, that's equally good. The limit is known, and that doesn't cause hanging.
Request timeout for icmp_seq 0No answer, while ping -s 100 to the same target works: that's the black hole. Try the sizes in the table from top to bottom: 1464, 1452, 1448, 1412, 1392. The largest that gets an answer, plus 28, is the MTU of the path.
Some targets ignore large pings on principle. Compare with a second one, such as 8.8.8.8.
Fix it
Work from the place where the limit is.
With a VPN. Lower the MTU in the VPN's settings. In WireGuard, it's the MTU line in the [Interface] section: try 1420, then 1380 and 1280. Other programs call it MTU, MSS or "packet size". If there's no setting, try another protocol, such as TCP instead of UDP.
At the router. For a PPPoE line, the WAN setting should be 1492. Many routers have MSS clamping, which tells both ends of each connection to use smaller packets. Turn it on. It's the most effective single measure, because it helps every device without needing the reports that get blocked.
On one computer, as a test or a stopgap. On macOS (replace en0 with your interface):
networksetup -setMTU en0 1400On Windows, as administrator:
Set-NetIPInterface -InterfaceAlias "Wi-Fi" -NlMtuBytes 1400Set it back to 1500 afterward. If it works at 1400, you've confirmed the cause, and the permanent fix belongs in the router or the VPN.
Don't block all ICMP in your own firewall. For IPv6 it's indispensable: routers there never split packets, so without the "packet too big" report nothing large gets through. 1,280 bytes is the smallest MTU that IPv6 permits.
Is it really this?
Signs in favor:
- It hangs instead of failing, and always at about the same point.
- Small things work and large ones don't, above all uploads.
- It depends on the VPN, the line or the router, and it isn't there on mobile data.
curlworks and the browser doesn't.
Signs against:
- Some loss at every size: that's packet loss.
- Everything is slow only while others download: bufferbloat.
- An error appears immediately: look up what it means.
- One site fails everywhere, for everyone: it's the site.
After a change, see whether the sites that hung respond again:
The check requests only small files, so it shows that a site can be reached. Whether large transfers work, you have to try: open a page that hung before, and upload a photo.