Packet sizes, MTU and MSS explained

Updated November 2026

Every link has a largest packet it can carry, the MTU. Get it wrong somewhere along a path and you see one of the most confusing faults in networking: connections that open fine and then hang as soon as real data flows. A little arithmetic and one ping command usually find it.

The maximum transmission unit (MTU) is the largest IP packet, headers included, that a link can carry in one frame. Standard Ethernet carries IP packets of up to 1,500 bytes, a limit that dates back to RFC 894 in 1984. The Ethernet header and checksum come on top of that and are not counted in the MTU.

Other links differ:

Header sizes

Fixed header sizes
HeaderSizeNotes
IPv420 bytesMinimum; options can extend it to 60 bytes
IPv640 bytesFixed; extension headers add more
TCP20 bytesWithout options; options can add up to 40 more
UDP8 bytesFixed
ICMP echo (ping)8 bytesHeader before the ping data

MSS: data per TCP segment

The maximum segment size (MSS) is the largest amount of TCP data, not counting headers, that a host wants to receive in one segment. Each side announces its MSS in the SYN when the connection opens. RFC 9293 defines it as the effective MTU minus the fixed IP and TCP headers:

TCP options such as timestamps take space from the segment, so the data actually carried per packet is often a little lower. If no MSS is announced, TCP must assume 536 bytes for IPv4 and 1,220 bytes for IPv6.

Fragmentation and path MTU discovery

When a packet is bigger than the next link's MTU, IPv4 can split it into fragments, unless the sender set the Don't Fragment (DF) flag, in which case the router drops it. IPv6 routers never fragment; only the sending host may. Fragmentation is costly and fragile: lose one fragment and the whole packet is lost.

So TCP normally uses path MTU discovery (PMTUD): it sends full-size packets with DF set, and a router that cannot forward one sends back an ICMP message ("Fragmentation Needed" in IPv4, "Packet Too Big" in IPv6) giving the smaller MTU. The sender then lowers its packet size for that destination.

MTU black holes

PMTUD fails when those ICMP messages are blocked, often by a firewall configured to drop all ICMP. The sender never learns that its packets are too big, and the router keeps silently dropping them. This is an MTU black hole. Typical symptoms, as listed in the Linux iptables documentation:

The fixes, best first:

  1. Let the ICMP through. Allow ICMP "Fragmentation Needed" (type 3, code 4) and ICMPv6 "Packet Too Big" on firewalls.
  2. Packetization-layer PMTUD. RFC 4821 describes probing with increasing segment sizes instead of trusting ICMP. On Linux, net.ipv4.tcp_mtu_probing = 1 turns this on when a black hole is detected; ESnet recommends 1, especially with jumbo frames.
  3. MSS clamping on the router or firewall where the MTU shrinks (see below).

MSS clamping

A router can rewrite the MSS value in TCP SYN packets passing through it, so both ends agree on segments small enough for the narrow link. On Linux with iptables:

iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

This sets the MSS to the path MTU minus 40 for IPv4 (minus 60 for IPv6). With nftables (Linux 4.14 or later):

nft add rule ip filter forward tcp flags syn tcp option maxseg size set rt mtu

The nftables wiki notes that MSS can differ in each direction, so make sure the rule sees both the SYN and the SYN-ACK. Clamping helps only TCP; UDP applications still need working PMTUD or smaller packets.

Testing the MTU with ping

Send a ping with Don't Fragment set and a payload that makes the packet exactly the size you want to test. Payload = MTU − IP header − 8 bytes of ICMP header:

# Linux (iputils): -M do sets DF and refuses to fragment
ping -M do -s 1472 -c 4 host.example.net
ping -6 -M do -s 1452 -c 4 host.example.net
ping -M do -s 8972 -c 4 host.example.net

# Windows: /f sets Don't Fragment (IPv4 only), /l sets the data size
ping /f /l 1472 host.example.net

If the full-size ping fails and a smaller one works, reduce the size until it passes; that size plus 28 (IPv4) or 48 (IPv6) is your path MTU. ESnet's own jumbo-frame tests use slightly smaller sizes (8,940 for IPv4 and 8,900 for IPv6) to leave some margin. On Linux, tracepath reports the path MTU hop by hop:

tracepath -n host.example.net

If tracepath stalls without reporting a lower MTU, ICMP is probably being blocked somewhere, which is exactly the black hole situation described above.

Sources