Path MTU Discovery: Classic PMTUD, PLPMTUD and MTU Black Holes
How hosts find the largest packet a whole path can carry: classic PMTUD with DF and ICMP "fragmentation needed" or Packet Too Big, the per-destination cache, tracepath, what happens when ICMP is blocked (a measured black hole), and the fixes: MSS clamping, PLPMTUD and DPLPMTUD.
kvi5hnuCode Sprout team member18 min readOn this page
The path MTU (PMTU) is the smallest MTU of all the links between two hosts: the largest IP packet that can travel the whole path without being fragmented. A laptop on Wi-Fi might have a 1,500-byte MTU, while somewhere in the middle a VPN tunnel or a PPPoE broadband line carries only 1,400 or 1,492 bytes. The sender can't see that link. It only knows its own interface's MTU.
Article 46 showed why fragmenting to fit is a bad idea. Path MTU discovery is the alternative: the sender finds out the PMTU and sends packets that fit. This article shows the classic method based on ICMP, how it fails when ICMP is blocked, and the newer methods that don't depend on ICMP at all.
Classic PMTUD: let the routers tell you
Classic path MTU discovery is defined in RFC 1191 for IPv4 and RFC 8201 for IPv6. The idea is simple:
- The sender sets Don't Fragment (DF) on every packet and starts with its own interface MTU as the estimate.
- A router that can't forward a packet because the next link is too small drops it and sends back an ICMP error containing the next link's MTU:
- IPv4: Destination Unreachable, code 4, "fragmentation needed and DF set", with the next-hop MTU in the message.
- IPv6: Packet Too Big. IPv6 routers never fragment, so for IPv6 this mechanism is always active.
- The sender lowers its estimate for that destination to the reported MTU and sends smaller packets.
- Because routes change, the estimate eventually expires and the sender tries bigger packets again. RFC 1191 suggests 10 minutes.
The estimate is kept per destination, in the routing cache, so every program talking to the same host benefits.

Watching it happen with UDP
In the lab, the link between router r1 and the server's network was given an MTU of 1,400 bytes. The client's own link is still 1,500. Linux's defaults on the client:
net.ipv4.ip_no_pmtu_disc = 0
net.ipv4.route.mtu_expires = 600
net.ipv4.route.min_pmtu = 552
ip_no_pmtu_disc = 0 means PMTUD is on. mtu_expires is the estimate's lifetime in seconds (600, the 10 minutes from RFC 1191), and min_pmtu is the lowest value Linux will accept from an ICMP message, a defense against forged ICMP that tries to shrink packets to nothing.
Before any traffic, the route to the server has no cached MTU:
198.51.100.10 via 192.0.2.1 dev eth0 src 192.0.2.10 uid 0
cache
A small program on the client then sent three 1,472-byte UDP datagrams (1,500-byte IP packets) over a connected UDP socket, 0.3 seconds apart, using the Linux default socket mode:
send #1 of 1472 bytes: ok
send #2 of 1472 bytes: [Errno 90] Message too long
send #3 of 1472 bytes: ok
socket's path MTU estimate (IP_MTU): 1400
And the capture on the client:
IP (tos 0x0, ttl 64, id 928, offset 0, flags [DF], proto UDP (17), length 1500)
192.0.2.10.36240 > 198.51.100.10.9000: UDP, length 1472
IP (tos 0xc0, ttl 64, id 9367, offset 0, flags [none], proto ICMP (1), length 576)
192.0.2.1 > 192.0.2.10: ICMP 198.51.100.10 unreachable - need to frag (mtu 1400), length 556
IP (tos 0x0, ttl 64, id 928, offset 0, flags [DF], proto UDP (17), length 1500)
192.0.2.10.36240 > 198.51.100.10.9000: UDP, length 1472
IP (tos 0x0, ttl 64, id 929, offset 0, flags [+], proto UDP (17), length 1396)
192.0.2.10.36240 > 198.51.100.10.9000: UDP, length 1472
Step by step:
- Send #1 went out as a 1,500-byte packet with DF set. It didn't fit the 1,400-byte link, so
r1dropped it and returned "need to frag (mtu 1400)". The ICMP message quotes the start of the dropped packet, so the client knows which destination it was about. - The kernel stored MTU 1,400 for 198.51.100.10 and reported the problem on the next call: send #2 failed with
Message too long(EMSGSIZE). For UDP, the application is expected to react, for example by sending smaller messages. - Send #3 succeeded. In the default Linux mode (
IP_PMTUDISC_WANT), once the PMTU is known, datagrams bigger than it are fragmented by the host itself, with DF clear: the capture shows a 1,396-byte first fragment. The second fragment doesn't appear because the capture filter matched UDP port 9000, and only the first fragment carries the port.
The route now carries the learned value and its remaining lifetime:
198.51.100.10 via 192.0.2.1 dev eth0 src 192.0.2.10 uid 0
cache expires 596sec mtu 1400
An application that must never fragment sets IP_MTU_DISCOVER to IP_PMTUDISC_DO. Then every oversized send fails instead of fragmenting. QUIC stacks and modern DNS servers want the same no-fragmentation behavior; they use this mode or the related IP_PMTUDISC_PROBE and IP_PMTUDISC_OMIT modes, which also always set DF but don't shrink to a PMTU learned from ICMP, a defense against forged ICMP. With the cache flushed and the same three sends:
send #1 of 1472 bytes: ok
send #2 of 1472 bytes: [Errno 90] Message too long
send #3 of 1472 bytes: [Errno 90] Message too long
socket's path MTU estimate (IP_MTU): 1400
IP_MTU returns the kernel's current estimate for the connected destination, so an application can size its datagrams from it.
tracepath: find the PMTU hop by hop
tracepath (Linux) combines traceroute and PMTUD: it sends UDP probes with DF set and increasing TTL, and reports where the PMTU drops:
1?: [LOCALHOST] pmtu 1500
1: 192.0.2.1 0.051ms
1: 192.0.2.1 0.007ms
2: 192.0.2.1 0.005ms pmtu 1400
2: 198.51.100.10 0.137ms reached
Resume: pmtu 1400 hops 2 back 2
The pmtu 1400 on hop 2 means the router at hop 1 (r1) reported that the next link carries only 1,400 bytes. On macOS and Windows there's no tracepath, but you can probe manually with ping: ping -D -s 1372 host on macOS or ping -f -l 1372 host on Windows sends a DF packet of 1,400 bytes (1,372 + 8 + 20).
IPv6: Packet Too Big
IPv6 works the same way, except that DF doesn't exist because routers never fragment. On Linux, ping -M do refuses to fragment locally too, so you can see the router's message:
PING 2001:db8:2::10 (2001:db8:2::10) 1452 data bytes
From 2001:db8:1::1 icmp_seq=1 Packet too big: mtu=1400
ping: sendmsg: Message too long
--- 2001:db8:2::10 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1021ms
The first ping got a Packet Too Big from r1 (2001:db8:1::1) with mtu=1400. The second failed locally because the kernel now knew the PMTU. The IPv6 route shows the learned value:
2001:db8:2::10 from :: via 2001:db8:1::1 dev eth0 src 2001:db8:1::10 metric 1024 expires 597sec mtu 1400 pref medium
Two IPv6-specific rules matter:
- Every IPv6 link must carry at least 1,280 bytes, so a PMTU below that should never be reported. If a Packet Too Big claims less, a host now simply uses 1,280 (RFC 8021 removed the older behavior of adding a Fragment header to every packet).
- Blocking ICMPv6 Packet Too Big breaks IPv6. Since routers can't fragment, a lost Packet Too Big message means the big packets just disappear. RFC 4890 lists Packet Too Big among the ICMPv6 messages a firewall must never drop.
When ICMP is blocked: the PMTU black hole
Classic PMTUD depends on the ICMP message getting back to the sender. Many firewalls drop all ICMP, on the mistaken theory that it's dangerous, and some routers are configured not to send it. When that happens, big packets are dropped silently, the sender never learns why, and it keeps sending packets that can't get through. This is a PMTU black hole.
It's nasty because small packets still work. A TCP connection opens normally: the handshake packets are tiny. A web page's first request goes through. Then the server starts sending full-size data segments, and the connection hangs. Users report "the site loads forever" or "SSH works but ls on a big directory freezes".
The lab reproduced it. This time the small link was in the middle, from r1 to the client, and both hosts believed their path was 1,500 bytes. The client downloaded 3 MB from the server, with 50 ms round-trip time, in four setups:
- Normal:
r1sends ICMP "fragmentation needed". - Black hole: an nftables rule on
r1drops its outgoing "fragmentation needed" messages. - Black hole, plus
net.ipv4.tcp_mtu_probing=1on the server, so its TCP detects black holes and lowers its segment size. - Black hole, plus MSS clamping on
r1, explained below.

The results printed by the downloader for the first three cases:
normal: received 3,000,000 of 3,000,000 bytes in 1.3 s
blackhole: received 0 of 3,000,000 bytes in 40.3 s
net.ipv4.tcp_mtu_probing = 1
net.ipv4.tcp_base_mss = 1024
probing: received 3,000,000 of 3,000,000 bytes in 7.9 s, first data after 4.0 s
And the rule on r1 counted the ICMP messages it blocked:
icmp type destination-unreachable icmp code 4 counter packets 61 bytes 35136 drop
In the black hole case, the connection was open, the request was sent, and not a single byte of the response arrived in 40 seconds. The server kept retransmitting its 1,500-byte segments with longer and longer timeouts (article 65), and every one was dropped.
Fix 1: the sender detects the black hole
Linux's tcp_mtu_probing setting controls packetization-layer PMTU discovery (PLPMTUD), defined in RFC 4821. With the value 1, TCP treats repeated timeouts as a hint that big packets might be the problem, drops its segment size to tcp_base_mss (1,024 bytes by default), and later probes upward with bigger segments. The value 2 uses PLPMTUD always, not only after a black hole is suspected.
It worked in the lab, but not instantly. The first data arrived after about 4 seconds, and the download finished after about 8. Three more runs, each with a fresh connection and the server's cached TCP metrics flushed, gave similar times:
run1: received 3,000,000 of 3,000,000 bytes in 8.2 s, first data after 4.2 s
run2: received 3,000,000 of 3,000,000 bytes in 8.2 s, first data after 4.2 s
run3: received 3,000,000 of 3,000,000 bytes in 8.2 s, first data after 4.2 s
Why about 4 seconds? Linux runs black hole detection from its retransmission timer. Once a connection has been retransmitting for longer than tcp_retries1 (default 3) backed-off timeouts would take, measured from the 200 ms minimum RTO (retransmission timeout, how long TCP waits for an acknowledgment before resending; roughly 3 seconds), the next timeout enables probing and lowers the segment size. The handshake and the first timeout add the rest. This timing varies from run to run and from path to path: it depends on the connection's measured RTT and RTO, and on where the exponential backoff happens to stand when the threshold is crossed. On a long, slow path the backed-off timeouts are longer, so detection takes longer too. After that, TCP restarted from a tiny congestion window (the amount of data TCP allows itself to have in flight, which it grows as acknowledgments arrive; article 72 covers it), which is why the orange line ramps up instead of jumping. That's far better than hanging forever, but much worse than a working path. Linux leaves tcp_mtu_probing at 0 by default, so you must enable it yourself.
Fix 2: the network clamps the MSS
TCP tells the other side the largest segment it wants to receive in the MSS option of its SYN (article 60). By default that's the interface MTU minus 40 bytes: 1,460. A router that knows its links are smaller can rewrite the MSS option in SYNs passing through it, so neither side ever sends segments that are too big. This is MSS clamping. With nftables, the rule on r1 was:
tcp flags syn / syn,rst tcp option maxseg size set rt mtu
tcp flags syn / syn,rst matches packets with SYN set and RST clear, which means SYNs and SYN-ACKs. rt mtu takes the MTU from the router's routing information for the connection. With the rule active, the SYNs captured on the server side:
IP 192.0.2.10.36144 > 198.51.100.10.8080: Flags [S], seq 509278365 ... mss 1460 ...
IP 198.51.100.10.8080 > 192.0.2.10.36144: Flags [S.], seq 452104127, ack 509278366 ... mss 1460 ...
IP 192.0.2.10.35070 > 198.51.100.10.8080: Flags [S], seq 384135958 ... mss 1360 ...
IP 198.51.100.10.8080 > 192.0.2.10.35070: Flags [S.], seq 341686426, ack 384135959 ... mss 1460 ...
The first connection is the normal one, where both sides announce 1,460. In the second, the client's SYN arrives with 1,360: r1 rewrote it to fit the 1,400-byte link (1,400 − 40). The server then never sends a segment bigger than 1,360 bytes of data, and the download finished in a second or two:
clamped: received 3,000,000 of 3,000,000 bytes in 2.0 s
MSS clamping is standard on PPPoE routers (home routers clamp to 1,452 for a 1,492-byte line) and on VPN gateways. Its limitation is that it only helps TCP. UDP and QUIC traffic still need PMTUD of their own.
PLPMTUD and DPLPMTUD: discovery without ICMP
Because ICMP can't be trusted, the modern approach is to let the transport protocol discover the PMTU itself:
- PLPMTUD (RFC 4821) does it inside TCP or another packetization layer. It sends a probe that's bigger than the current estimate. If the probe is acknowledged, the larger size works. If it's lost, the size is too big, or there was ordinary loss, which is why it needs repeated evidence before acting. ICMP messages, if they arrive, are used as hints only.
- DPLPMTUD (RFC 8899) applies the same idea to datagram transports such as UDP-based protocols, SCTP (Stream Control Transmission Protocol, a message-based transport) and QUIC. It starts from a safe base PMTU (1,200 bytes for QUIC), sends padded probe packets of increasing size, and treats an acknowledged probe as proof. It also detects black holes that appear later, when a route changes.
QUIC (article 86) is built around this. It requires every path to support 1,200-byte UDP payloads, sets DF on its packets, never relies on IP fragmentation, and uses DPLPMTUD to grow above 1,200 when the path allows. That's one reason QUIC works through networks where large UDP packets would otherwise disappear.
Where PMTU problems come from
The usual suspects for a path MTU below 1,500 bytes:
| Link or tunnel | Typical MTU | Why |
|---|---|---|
| PPPoE broadband | 1,492 | 8 bytes of PPPoE and PPP headers |
| WireGuard | 1,420 by default | Outer IP, UDP and WireGuard headers (article 82) |
| IPsec ESP (Encapsulating Security Payload) tunnels | about 1,400 to 1,440 | ESP header, padding, integrity check, outer IP |
| GRE (Generic Routing Encapsulation) tunnel | 1,476 | 24 bytes of outer IPv4 and GRE |
| VXLAN overlay | 1,450 | 50 bytes of outer Ethernet, IP, UDP and VXLAN |
| IPv6 in IPv4 (6in4) | 1,480 | 20-byte outer IPv4 header |
Tunnels are the most common cause of black holes, because the tunnel endpoint adds headers to packets that already used the full 1,500 bytes. The usual fix is to configure the tunnel interface with the reduced MTU and clamp the TCP MSS on it.
Common questions
Why not just always send small packets, say 1,280 bytes?
That would work almost everywhere, but it wastes capacity: more packets mean more headers and more per-packet processing for the same data. With 1,280-byte packets instead of 1,500, a TCP transfer needs about 17% more packets. PMTUD lets the common case, a full 1,500-byte path, run at full size.
Is it safe to block ICMP on my firewall?
Not all of it. Blocking ICMP "fragmentation needed" (IPv4 type 3 code 4) or ICMPv6 Packet Too Big creates PMTU black holes. If you filter ICMP, allow at least those messages, plus the other error types RFC 4890 recommends. Rate limiting is a better defense than blocking.
How do I know if I'm hitting a black hole?
The classic signs: connections open and small requests work, but large transfers hang; SSH logs in but freezes on big output; problems only through a VPN. Test with DF pings of increasing size (ping -M do -s 1472 on Linux), run tracepath, and look at ip route get for a cached MTU. A capture on the sender shows full-size segments being retransmitted with no ICMP coming back.
Can an attacker abuse PMTUD?
An attacker could forge "fragmentation needed" messages claiming a tiny MTU, to make a host send many small packets. Defenses: hosts ignore values below a floor (min_pmtu, 552 on Linux; 1,280 for IPv6), check that the quoted packet matches a real connection, and treat ICMP as a hint, as PLPMTUD does.
Does the PMTU differ in each direction?
It can. Routes can be asymmetric, so the path from A to B may have a different MTU from the path from B to A. Each sender discovers its own direction. In the lab black hole, only the server's direction was affected, because only the server sent big packets.
Why did my UDP application get "Message too long" when the network seemed fine?
Linux reports a learned PMTU to a connected UDP socket as EMSGSIZE on the next send, as in the lab. It's telling the application that the datagram it's trying to send exceeds the current path MTU estimate. Either send smaller datagrams or let the kernel fragment.
Does PMTUD happen for every connection?
The estimate is per destination and is shared by all sockets, so only the first connection to a host pays the cost. TCP also starts from the smaller of its interface MTU and the peer's MSS option, so in most cases no discovery is needed at all.
Summary
- The path MTU is the smallest MTU on the path. Sending packets that fit avoids fragmentation.
- Classic PMTUD sets DF; routers that can't forward return ICMPv4 "fragmentation needed" (type 3, code 4) or ICMPv6 Packet Too Big with the next-hop MTU, and the sender caches the lower value per destination for about 10 minutes.
- On Linux, a connected UDP socket learns about the new PMTU as
EMSGSIZE; in the default mode later datagrams are fragmented locally, and withIP_PMTUDISC_DOthey're refused.ip route getshows the cached MTU andtracepathfinds it hop by hop. - IPv6 routers never fragment, so dropping Packet Too Big breaks IPv6. The minimum IPv6 MTU is 1,280.
- If ICMP is blocked, big packets vanish silently: a PMTU black hole. In the lab, a 3 MB download received nothing in 40 seconds.
- TCP fixes: PLPMTUD (
tcp_mtu_probing), which recovered after about 4 seconds of retransmission timeouts, and MSS clamping on the router, which made the download work normally. - DPLPMTUD (RFC 8899) brings probe-based discovery to datagram protocols. QUIC starts from 1,200 bytes and never fragments.
Practice questions
1. A host on Ethernet sends to a server behind a PPPoE line with a 1,492-byte MTU. What's the path MTU, and what's the largest UDP payload over IPv4 that fits without fragmentation?
Answer
The path MTU is 1,492. The largest UDP payload is 1,492 − 20 (IPv4) − 8 (UDP) = 1,464 bytes.
2. A router receives a 1,500-byte IPv4 packet with DF set, and its next link has MTU 1,400. What does it do? What would it do with DF clear?
Answer
With DF set, it drops the packet and sends ICMP Destination Unreachable, code 4 (fragmentation needed), with next-hop MTU 1,400 to the source. With DF clear, it fragments the packet into two fragments and forwards them.
3. Users can open a website over a new VPN, but large pages never finish loading. Small pages work. What's the likely cause, and two ways to fix it?
Answer
A PMTU black hole: the VPN tunnel lowered the path MTU, and the ICMP messages that would tell the server are being dropped somewhere, so full-size segments vanish. Fixes: clamp the TCP MSS on the VPN gateway, lower the tunnel interface MTU, allow ICMP "fragmentation needed" or Packet Too Big through the firewalls, or enable PLPMTUD (tcp_mtu_probing) on the servers.
4. What MSS should a router clamp to for a link with MTU 1,420, for IPv4 and for IPv6 TCP connections?
Answer
For IPv4: 1,420 − 20 (IPv4) − 20 (TCP) = 1,380. For IPv6: 1,420 − 40 (IPv6) − 20 (TCP) = 1,360. The nftables rt mtu form computes the right value automatically.
5. Why does QUIC start with a 1,200-byte minimum and use DPLPMTUD instead of classic PMTUD?
Answer
1,200 bytes of UDP payload fits in virtually every path, including IPv6's 1,280-byte minimum after headers, so the first packets always get through. Classic PMTUD depends on ICMP, which is often blocked or rate-limited and can be forged. DPLPMTUD uses QUIC's own acknowledgments of padded probe packets as proof that a size works, so it doesn't depend on ICMP at all.
6. A Packet Too Big message arrives claiming an MTU of 900 bytes. What should an IPv6 host do?
Answer
Ignore the value below 1,280 and use 1,280, the IPv6 minimum link MTU, as its path MTU. No IPv6 link may have a smaller MTU, so the message is wrong or forged, and RFC 8021 removed the old behavior of responding with atomic fragments.
7. Why does TCP's handshake succeed through a PMTU black hole even though the connection later hangs?
Answer
SYN, SYN-ACK and ACK packets are tiny, around 60 to 80 bytes, so they fit through any link. The problem only appears when a side sends full-size data segments, which are bigger than the small link and are dropped without any ICMP reaching the sender.
Previous: IP Fragmentation and Reassembly: How It Works and Why It's Avoided
Next: Building on UDP: Datagram Sizes, Server Design, UDP-Lite and UDP in Today's Internet

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.