NetCalcLab

MTU, MSS and encapsulation overhead

How much room a tunnel leaves for real data: the header arithmetic behind MTU and MSS, why path MTU discovery fails silently, and how to size MSS for GRE, VXLAN and GTP-U.

MTU and MSS are not the same thing

It is tempting to treat MTU and MSS as two names for the same number. They are not, and the confusion causes a large share of tunnel performance problems. The MTU is a property of a link: the largest frame that link will carry. For standard Ethernet that is 1500 bytes, and it is why an oversized ping does not get through a badly configured network.

MSS is a property of a TCP connection: the largest payload either endpoint will put in a single segment. It is not a link setting and it is not negotiated from the MTU — each endpoint announces the MSS it can receive, and each subtracts the headers it knows about from its own MTU.

MSS from MTU on a plain Ethernet path
MSS = MTU − IP header − TCP header

IPv4: 1500 − 20 − 20 = 1460 bytes
IPv6: 1500 − 40 − 20 = 1440 bytes

The 1460-byte figure is so common it is worth memorising. If you see a value well below it on a working connection, something is adding headers — which is the whole subject of this page.

Every header eats into the payload

MTU is measured at the outermost layer, so every byte of header between the link frame and the application data reduces how much data fits. On a plain path that is 40 bytes of overhead out of 1500, about 2.7%. Add a tunnel and it climbs fast.

Header sizes for the layers you are most likely to stack
LayerBase sizeStandardNotes
Ethernet II14 BIEEE 802.36 + 6 + 2; the 4 B FCS is usually stripped by the NIC
802.1Q VLAN tag+4 BIEEE 802.1QOne tag; QinQ adds another 4 B
IPv420 BRFC 791Options push the header as high as 60 B
IPv640 BRFC 8200Fixed; optional data uses extension headers
TCP20 BRFC 9293Timestamps and SACK typically add 12 B
UDP8 BRFC 768Fixed
GRE4 BRFC 2784Checksum, key and sequence add 4 B each
VXLAN8 BRFC 7348Carried inside UDP; often on a 50 B overlay
GTP-U8 B3GPP TS 29.281E, S and PN flags add 4 B each
PPPoE8 BRFC 25166 B PPPoE + 2 B PPP protocol
IPsec ESP (tunnel)~50–73 BRFC 4303SPI + sequence + IV + padding + ICV
MPLS4 B per labelRFC 3032Two labels for a typical L3VPN

The last two rows are why IPsec and MPLS sites so often need a reduced MTU. An ESP tunnel with AES-CBC and a SHA-256 integrity check adds around 73 bytes on its own, before the outer IP header.

A worked tunnel calculation

Take a GRE tunnel over the public internet, carrying traffic from a private site. The packet on the wire is the public Ethernet frame; the private packet is the payload inside it. Working from the outside in:

GRE over IPv4 over Ethernet, 1500-byte outer MTU

Outer Ethernet   14 B
Outer IPv4        20 B
GRE header           4 B
Inner IPv4        20 B
TCP header         20 B
─────────────────────────
Total overhead     78 B
Inner MSS    1500 − 78 = 1422 B

So the correct MSS for this path is 1422 bytes, not 1460. A host using the default 1460 will build packets 38 bytes too large for the tunnel. If PMTUD is working, the router returns an ICMP message with the smaller MTU and the host adapts. If ICMP is filtered — as it often is — those packets are dropped silently and the connection stalls on every transfer larger than one segment.

The same arithmetic with VXLAN shows why overlay networks are so often set to a 1450-byte inner MTU: Ethernet, IPv4, UDP, VXLAN, then the inner Ethernet, IPv4 and TCP headers total 14 + 20 + 8 + 8 + 14 + 20 + 20 = 104 bytes, leaving 1396 for the inner TCP payload at a 1500-byte outer MTU.

Path MTU discovery, and how it fails

PMTUD is the mechanism that should make all of this automatic. A sender sets the Don't Fragment bit and sizes packets to what it believes the path supports. When a router finds the next hop's MTU is smaller, it is supposed to drop the packet and send back an ICMP message — “fragmentation needed”, with the smaller MTU. The sender reduces its size and retries.

The failure mode is that ICMP is frequently blocked by firewalls, either deliberately as a security measure or as collateral damage from rate limiting. When the message never arrives, the sender keeps using the oversized packet, every one is dropped, and the connection appears to hang. This is a PMTUD blackhole, and it is characterised by a very specific pattern:

Symptoms that point at an MTU or MSS problem
SymptomWhat it suggests
Ping and DNS work, large transfers hangClassic PMTUD blackhole — small packets fit, full-size ones do not
SSH connects, then freezes after loginThe banner fits, the key exchange does not
HTTPS handshake completes, page never loadsHandshake segments are small, the data ones are not
Works on a LAN, fails over the tunnelTunnel overhead reduced the path MTU and nothing adjusted MSS
Intermittent, worse for some destinationsOnly some paths have the smaller MTU or the ICMP filter
One direction fine, the other stallsAsymmetric PMTUD failure — check both directions separately

The quickest diagnostic is to send an oversized ping with Don't Fragment set and binary-search the payload size until it gets through. On a tunnel that should give you the real path MTU, which you can compare against what the endpoints believe.

MSS clamping and the options when PMTUD will not work

Where PMTUD cannot be relied on, MSS clamping is the usual fix. A router on the path rewrites the MSS field in the SYN and SYN-ACK packets, so both endpoints immediately use a value that fits without needing to discover anything. It is common on PPPoE links, where the 8-byte PPPoE header reduces the effective MTU to 1492 and MSS to 1452.

Clamping has limits worth knowing. It only affects connections whose handshake passes through the clamping device, so it does nothing for hosts on the far side of a router that is not in the path. It also does not touch a connection that is already established. And because it rewrites a field the endpoints agreed on, it can mask a genuine misconfiguration rather than fixing it.

The alternatives are to set the MSS explicitly on the endpoints, to reduce the interface MTU on the tunnel so the arithmetic works out naturally, or — for IPv6 — to respect that PMTUD is mandatory and make sure ICMPv6 type 2 messages are never filtered.

Practical rules

  • Size MSS from the outermost MTU, not from 1500. Add up the headers you actually use. The MTU and MSS calculator will do the arithmetic per layer.
  • Never block ICMP wholesale. If you must filter it, allow fragmentation-needed (type 3, code 4) inbound — blocking it breaks PMTUD for every path that terminates behind you. For IPv6, allow Packet Too Big (type 2).
  • Remember that 1460 is only correct for a plain IPv4 Ethernet path. IPv6 gives 1440, PPPoE gives 1452, and anything with a tunnel in it is smaller still.
  • Expect tunnels to cost more than the header arithmetic suggests. A GRE-over-IPsec stack can consume well over 100 bytes, taking a 1500-byte path down to an MSS near 1330.
  • Check both directions. Asymmetric routing means the return path can have a different MTU, and MSS is announced per direction.

MSS by path type

The MSS a host should use for common path configurations, all at a 1500-byte Ethernet MTU unless stated otherwise.

Correct MSS per encapsulation
PathOverheadMSS (IPv4)MSS (IPv6)
Ethernet + IPv4/IPv6 + TCP40 B / 60 B14601440
Ethernet + TCP options (12 B)52 B / 72 B14481428
PPPoE (1492 MTU)34 B / 54 B14521432
Ethernet + IPv4 + GRE + IPv4/IPv6 + TCP58 B / 78 B14221402
Ethernet + IPv4 + UDP + VXLAN + inner Ethernet + IPv4/IPv6 + TCP84 B / 104 B13961376
Ethernet + IPv4 + UDP + VXLAN, 1450 inner MTU50 B / 70 B13701350
Ethernet + IPv4 + ESP (tunnel) + IPv4/IPv6 + TCP~112 B / ~132 B~1338~1318
Ethernet + IPv4 + GRE + ESP + IPv4/IPv6 + TCP~140 B~1310~1290
Ethernet + GTP-U + IPv4 + TCP62 B1418—
Jumbo frames (9000 MTU), plain IPv440 B89608940

Values are for minimum-size headers. Every option you enable — TCP timestamps, an IPsec integrity check, more MPLS labels, a second VLAN tag — reduces the MSS further.

MTU and MSS numbers worth remembering

Reference values
QuantityValueWhere it comes from
Standard Ethernet MTU1500 bytesIEEE 802.3 / de facto internet standard
Ethernet frame with headers and FCS1522 bytes (1526 with VLAN)14 + 1500 + 4, plus 4 for a tag
Default IPv4 TCP MSS1460 bytes1500 − 20 − 20
Default IPv6 TCP MSS1440 bytes1500 − 40 − 20
Minimum IPv4 MTU a host must accept576 bytesRFC 791
Minimum IPv6 MTU1280 bytesRFC 8200 — routers never fragment
PPPoE MTU1492 bytes1500 − 8 B PPPoE header
Maximum IPv4 header60 bytesIHL = 15 × 4
Maximum TCP header60 bytesData offset = 15 × 4
Jumbo frame MTU9000 bytesCommon data-centre convention, not an internet standard

Related: MTU / MSS calculator, TCP throughput calculator, TCP throughput and the BDP, bandwidth calculator.

Frequently asked questions

What is the difference between MTU and MSS?

MTU is the largest frame or packet a link can carry, measured at layer 2 or layer 3 — 1500 bytes on standard Ethernet. MSS is the largest TCP payload a sender may place in a single segment, and it is derived from the MTU by subtracting the IP and TCP headers. On a plain 1500-byte Ethernet path with IPv4 and TCP, MSS = 1500 − 20 − 20 = 1460 bytes. MTU is a property of the link; MSS is an agreement between the two TCP endpoints.

Why does a tunnel break TCP connections?

A tunnel adds its own headers outside the original packet, which makes the encapsulated packet larger than the original. If the tunnel's outer MTU is 1500 bytes, the inner packet that fits is smaller than 1500 — so a host that believes the path MTU is 1500 will send packets too big to fit, and the tunnel either fragments them or drops them. Drops show up as connections that establish and then hang during bulk transfer, which is the classic 'ping works, web browsing stalls' symptom.

How do I calculate the correct MSS for a tunnel path?

Add up every header between the outer link frame and the TCP payload, then subtract that total from the outer MTU. For Ethernet + IPv4 + GRE + IPv4 + TCP: 14 + 20 + 4 + 20 + 20 = 78 bytes, so the inner MSS is 1500 − 78 = 1422 bytes. The calculation is the same regardless of the tunnel type — only the header list changes. The MTU and MSS calculator does this layer by layer with the options you actually use.

What is MSS clamping?

MSS clamping is when a router rewrites the MSS value in the TCP handshake as it passes, forcing both endpoints to use a smaller segment size that fits the path. It is used where path MTU discovery cannot work — most commonly on PPPoE links and some tunnels, and where ICMP is filtered. It is a workaround rather than a fix: it only helps connections whose handshake passes through the clamping router, and it does nothing for a flow already in progress.

What is path MTU discovery?

PMTUD works by sending packets with the Don't Fragment bit set. When a router along the path cannot forward a packet because the next hop's MTU is smaller, it drops the packet and returns an ICMP 'fragmentation needed' message carrying the smaller MTU. The sender then reduces its packet size. It works well until someone blocks ICMP — the sender never learns about the smaller MTU and the connection stalls, which is why PMTUD blackholes are such a common and hard-to-diagnose fault.

Why does IPv6 not fragment in routers?

IPv6 removed router fragmentation entirely: only the sending host may fragment, and routers never do. The minimum MTU IPv6 requires is 1280 bytes, so PMTUD is mandatory rather than optional. The practical consequence is that a 40-byte IPv6 header reduces MSS by 20 bytes compared with IPv4, and that a path reducing the MTU without delivering the ICMPv6 Packet Too Big message will break the connection rather than degrade it.

Should I just raise the MTU everywhere instead?

Only if every device on the path supports it. Jumbo frames of 9000 bytes are common inside a data centre but almost never end to end across a WAN, and a mismatch creates exactly the blackhole PMTUD problems you were trying to avoid. Raising the MTU within a controlled network is worthwhile; assuming a larger MTU across a path you do not fully control is not.