Fixes

Fix

Large downloads hang but small requests work

Usually a path MTU black hole: a link on the path carries smaller packets, and a firewall drops the ICMP message that would tell the sender to shrink them.

Likely causes

  1. A link with a smaller MTU on the path (a VPN, a tunnel, PPPoE), and a firewall that drops ICMP fragmentation needed, so path MTU discovery never hears about it.
  2. A wrong MTU set by hand on one card, bigger than the network really carries.

Diagnose

Run these in order. The output is what each printed on a lab's real Linux machines.

chartDesk:~# curl -sS -m 8 http://10.0.4.10/tides.txt
A small file loads whole: High water 06:12 and 18:40. The connection itself works.
High water 06:12 and 18:40
chartDesk:~# curl -sS -m 8 -o chart.bin -w '%{size_download} bytes in %{time_total} s\n' http://10.0.4.10/chart.bin
The big file connects, then gets 0 out of 3000000 bytes: its full-size packets vanish on the way.
curl: (28) Operation timed out after 8004 milliseconds with 0 out of 3000000 bytes received
0 bytes in 8.004385 s
chartDesk:~# ping -c 2 -M do -s 1472 10.0.3.10
A Don't Fragment ping of 1,500 bytes finds the smaller link: the router before it answers Frag needed and DF set (mtu = 1400).
PING 10.0.3.10 (10.0.3.10) 1472(1500) bytes of data.
From 10.0.1.254 icmp_seq=1 Frag needed and DF set (mtu = 1400)
ping: local error: message too long, mtu=1400

--- 10.0.3.10 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1041ms
shoreRelay:~# tcpdump -n -c 2 -i quay icmp
The router at the smaller link sends the server need to frag (mtu 1400) for each big packet it drops.
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on quay, link-type EN10MB (Ethernet), snapshot length 262144 bytes
11:29:28.898121 IP 10.0.3.10 > 10.0.4.10: ICMP 10.0.1.10 unreachable - need to frag (mtu 1400), length 556
11:29:29.124623 IP 10.0.3.10 > 10.0.4.10: ICMP 10.0.1.10 unreachable - need to frag (mtu 1400), length 556
2 packets captured
3 packets received by filter
0 packets dropped by kernel
officeWall:~# iptables -L FORWARD -v -n
On a firewall between them, a rule that drops all ICMP counts every one of those messages.
Chain FORWARD (policy ACCEPT 16 packets, 21410 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    9  5184 DROP       1    --  *      *       0.0.0.0/0            0.0.0.0/0           
chartStore:~# ip route get 10.0.1.10
So the server has learned nothing: a bare cache, no mtu, and it keeps sending 1,500-byte packets.
10.0.1.10 via 10.0.4.254 dev eth0 src 10.0.4.10 uid 0 
    cache 

Fix

officeWall:~# iptables -I FORWARD -p icmp --icmp-type fragmentation-needed -j ACCEPT
Let ICMP fragmentation needed through, above the drop, so path MTU discovery works again. Pings stay blocked.
chartDesk:~# curl -sS -m 8 -o chart.bin -w '%{size_download} bytes in %{time_total} s\n' http://10.0.4.10/chart.bin
The same download: 3000000 bytes, the whole file.
3000000 bytes in 0.302580 s
shipRouter:~# iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
Or, when you cannot let the ICMP through: rewrite the MSS in every SYN the router beside the small link forwards, so TCP picks segments that fit.
chartDesk:~# curl -sS -m 8 -o chart.bin -w '%{size_download} bytes in %{time_total} s\n' http://10.0.4.10/chart.bin
The same download, ICMP still blocked: the whole file.
3000000 bytes in 0.214512 s

Break it and fix it yourself

Each lab is a small network of real Linux machines in your browser, where this fault happens.

Open MTU black holes: the chart that never comes ashore

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab