IP Addresses & Routing

MTU, MSS and Fragmentation

Understand packet size limits, spot the classic symptoms of an MTU problem and find the right value with a simple ping test.

Key takeaways

  • Standard Ethernet has an MTU of 1500 bytes, and tunnels or encapsulation reduce what is left for your data.
  • TCP's MSS is the MTU minus the IP and TCP headers, typically 1460 bytes over IPv4.
  • IPv6 routers never fragment packets; they report that a packet is too big.
  • Blocking the "too big" messages creates black holes where large transfers hang.
  • A ping with fragmentation forbidden lets you measure the path's limit yourself.

The MTU (maximum transmission unit) is the largest packet a link can carry in one piece. The MSS (maximum segment size) is the largest chunk of data TCP will put in one packet. When a packet is too big for a link somewhere along the path, it must be split or rejected so the sender can try smaller.

When that process works, you never see it. When it breaks, you get a peculiar fault: small things succeed, large things hang. A login page loads but the dashboard doesn't, or a VPN connects and then stalls on the first file.

Where the numbers come from

An Ethernet frame traditionally carries up to 1500 bytes of payload. That payload is the IP packet, headers included. The Ethernet header and checksum are extra and don't count toward the MTU.

Inside that 1500, headers take their share. A basic IPv4 header is 20 bytes, an IPv6 header 40, a basic TCP header 20 and a UDP header 8.

Path MTU 1500 Largest TCP segment Largest UDP payload
IPv4 1460 bytes 1472 bytes
IPv6 1440 bytes 1452 bytes

These assume no optional headers. TCP options such as timestamps use part of the segment space in practice. The MTU planner works out the arithmetic for other values.

What MSS does

When a TCP connection opens, each side announces in its SYN packet the largest segment it is willing to receive. This is the MSS option, exchanged during the three-way handshake. Each sender stays at or below what the other announced.

MSS is based on each end's own link. It knows nothing about a narrower link in the middle. And it applies only to TCP; UDP applications have to choose sensible sizes themselves.

Things that shrink the path

Wrapping one packet inside another costs bytes.

Why a tunnel leaves less room
Outer IP header Carries the wrapped packet between the tunnel endpoints. Tunnel and encryption overhead UDP or protocol headers, keys, sequence numbers and integrity checks. Inner IP header The original source and destination. Inner TCP header Ports and sequence numbers for the real connection. Your data Whatever room remains after everything above it. Outer IP header Carries the wrapped packet between the tunnel endpoints. Tunnel and encryption overhead UDP or protocol headers, keys, sequence numbers and integrity checks. Inner IP header The original source and destination. Inner TCP header Ports and sequence numbers for the real connection. Your data Whatever room remains after everything above it.

The outer packet must still fit the physical link.

PPPoE, used by many DSL and some fiber services, takes 8 bytes, leaving 1492. VPNs take more; the exact amount depends on the protocol and cipher. WireGuard interfaces commonly default to 1420 for this reason. Provider tunnels and mobile networks may impose their own limits.

Fragmentation

In IPv4, a router facing a packet too big for the next link may split it into fragments, unless the packet has the Don't Fragment (DF) bit set. Fragments are reassembled only at the destination.

Fragmentation has real costs. Losing one fragment loses the whole packet. Later fragments carry no TCP or UDP header, so firewalls and load balancers have trouble judging them, and many drop them. Reassembly consumes memory and has been a source of vulnerabilities.

IPv6 removes router fragmentation entirely. Only the sending host may fragment. Every IPv6 link must carry at least 1280 bytes, so that size is always safe. IPv4 requires every host to accept reassembled datagrams of at least 576 bytes, an old conservative figure.

Path MTU discovery

Instead of fragmenting, modern systems try to learn the smallest MTU along the path.

Path MTU discovery
1 Send large The host sends a full-size packet that must not be fragmented. 2 Hit a narrow link A router finds it will not fit on the next hop. 3 Report back It drops the packet and returns an ICMP message with the size. 4 Shrink The sender lowers its size for that destination and resends. 5 Remember The value is cached for a while, then may be rechecked. Send large The host sends a full-size packet that must not be fragmented. 1 Hit a narrow link A router finds it will not fit on the next hop. 2 Report back It drops the packet and returns an ICMP message with the size. 3 Shrink The sender lowers its size for that destination and resends. 4 Remember The value is cached for a while, then may be rechecked. 5

In IPv4 the message is ICMP "destination unreachable, fragmentation needed" (type 3, code 4). In IPv6 it is ICMPv6 "Packet Too Big" (type 2). The classic procedures are described in RFC 1191 and RFC 8201.

The black hole problem

Suppose a firewall somewhere drops all ICMP because someone thought it was safer. The "too big" message never reaches the sender. It keeps retransmitting the same large packet, which keeps being discarded. This is a path MTU black hole.

The signature is distinctive:

  • ping works,
  • connections open,
  • small requests succeed,
  • anything that fills a full packet hangs, such as a certificate exchange, a large page or an upload.

The right fix is to allow those specific ICMP messages. In IPv6 they are essential, and blanket ICMPv6 blocking breaks things. Firewall rules should be selective.

Another remedy lets endpoints probe for themselves without relying on ICMP, by sending test packets of different sizes and seeing which are acknowledged (RFC 4821, and RFC 8899 for datagram protocols). QUIC implementations use this kind of probing.

MSS clamping

Routers at the edge of a tunnel or PPPoE link often rewrite the MSS option in passing TCP handshakes, lowering it to what will fit. This MSS clamping sidesteps discovery for TCP, and most consumer routers apply it automatically on PPPoE. It does nothing for UDP, and it can't see inside traffic that is already encrypted into a tunnel by someone else upstream.

Measuring your path

Send pings that may not be fragmented and adjust the payload size. For IPv4, add 28 bytes (20 IP plus 8 ICMP) to the largest payload that works to get the MTU.

Windows:

ping -f -l 1472 example.com

Linux:

ping -M do -s 1472 example.com

macOS:

ping -D -s 1472 example.com

Some users have reported that on certain macOS releases -D doesn't set the don't-fragment flag, so if every size succeeds there, confirm the result from another system.

If 1472 succeeds, the path handles 1500. If you see a message that the packet needs fragmenting or is too long, or you get silence, step down until it works, then narrow in. Confirm that an ordinary small ping succeeds first, since some hosts ignore ping entirely and that would mislead you.

To see your own interface values: netsh interface ipv4 show subinterfaces on Windows, ip link on Linux and ifconfig on macOS.

A worked example

Say your home connection uses PPPoE, so the router's WAN MTU is 1492, and you add a VPN whose overhead on this setup is 80 bytes (an illustrative figure). Inside the tunnel, the largest packet that fits is 1492 minus 80, or 1412 bytes. Over IPv4, a TCP segment can then carry at most 1412 minus 40, which is 1372 bytes of data.

Now suppose the VPN interface was left at 1500. Your computer builds full-size packets, the tunnel wraps them into something larger than the link allows, and either the outer packets get fragmented or they vanish. Browsing a small page may work, while copying a file to the office stalls at the start. Setting the tunnel MTU to 1412 or a bit lower cures it. Choosing a little below the calculated figure leaves margin, at a tiny cost in efficiency.

If you manage the VPN server, setting the value there, with MSS clamping, saves every user from tuning their own machine.

UDP applications have to cope alone

TCP adapts through MSS and path discovery. A UDP application must decide its own message size. Many protocols stay conservative, keeping payloads around 1200 bytes so they fit almost any path, including IPv6 over tunnels.

DNS is a good example. Large answers, especially ones carrying DNSSEC signatures, once depended on fragmented UDP. Because fragments are often lost and can be abused, current practice is to advertise a modest buffer size and fall back to TCP when an answer doesn't fit. If large DNS answers time out while small ones work, check that your firewall allows DNS over TCP as well as UDP.

Games, voice and video tend to send small packets, so MTU faults more often show up in their login, update or file transfer steps than in the live stream itself.

Mail, remote desktop and file sharing over a tunnel are worth including in your tests after any change, because each builds packets a little differently. A fix that helps a web page but leaves file copies stalling usually means that only TCP clamping was applied, or that one direction of the path still has the wrong value. Test downloads and uploads separately, since the two ends choose their sizes independently.

Telling MTU trouble from other faults

Several problems resemble this one. Packet loss on a bad Wi-Fi link hurts large transfers more than small ones, but it is erratic, whereas an MTU black hole fails the same way every time. A server that is simply slow delays everything, including small requests. A blocked port fails to connect at all, instead of connecting and then stalling.

A quick experiment separates them: temporarily lower the MTU on one test machine to 1280 or thereabouts and repeat the failing action. If it now works reliably, you have your answer, and you can then raise the value step by step or fix the device that is dropping the error messages. If nothing changes, restore the setting.

Setting it sensibly

Change MTU only when you have evidence. If a VPN is the problem, lower the MTU on the tunnel interface, not on your whole network. If your internet service uses PPPoE, set the router's WAN MTU to what the provider specifies.

Jumbo frames, commonly around 9000 bytes, can reduce processing overhead on storage or backup networks. Every device on that segment, switches included, must support the same size, or you create exactly the failures described here. For a typical home network, the gain rarely justifies the trouble.

After any change, retest the thing that was failing, such as the large upload or the page that hung. If lowering the value cured it, note why in your configuration, so nobody "tidies" it back later. If it made no difference, restore the default and look elsewhere, starting with a structured troubleshooting method.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in IP Addresses & Routing →

Latest news on this topic