MTU, TCP MSS and VPN Tunnel Overhead Calculator
Subtracts every header a tunnel adds from the link MTU to find the largest inner packet that fits: 20 or 40 bytes of outer IP plus UDP, ESP, GRE, VXLAN, Geneve, WireGuard, MASQUE or OpenVPN fields, IVs, tags and block padding, after PPPoE's 8 bytes. Tailscale and WARP over WireGuard report their 1280. TCP MSS is that MTU minus 40 for IPv4 or 60 for IPv6; efficiency divides TCP payload by the frame's bytes on the wire.
Every tunnel wraps your packet in more headers, and the wrapped packet still has to fit the link underneath. Pick the link and the tunnel, and the calculator finds the largest inner packet that fits, the TCP MSS to clamp to, and the share of each frame left for payload. With the defaults, WireGuard over IPv4 on 1500-byte Ethernet, the tunnel MTU is 1440 bytes, the MSS is 1400 for IPv4 and 1380 for IPv6, and 91.03% of every full-size frame is TCP payload.
How the calculation works
Start from the link MTU, the largest IP packet the link carries: 1500 on Ethernet, 1492 on PPPoE, 9000 on the jumbo setting, or any whole number from 576 to 65535. Then take off each header the tunnel puts in front of your packet and each trailer it puts after it:
tunnel MTU = link MTU − outer IP header − tunnel headers − tunnel trailer
IPsec ESP is different, because block ciphers pad. The calculator uses the formula from the Linux kernel's xfrm_state_mtu(), with a block of 16 for AES-CBC and 4 for AES-GCM, which needs only 4-byte alignment:
ESP inner MTU = ⌊(link MTU − headers − ICV) ÷ block⌋ × block − 2
In transport mode the packet keeps its own IP header, so the kernel takes that header out before rounding and adds it back afterwards. The MSS then leaves out the inner IP and TCP headers, and efficiency compares TCP payload with the bytes the frame occupies on the wire:
MSS = tunnel MTU − 40 for IPv4, or − 60 for IPv6
efficiency = MSS ÷ (outer packet + PPPoE + VLAN tag + 38)
The 38 bytes are Ethernet's 14-byte header, 4-byte frame check sequence, 8 bytes of preamble and start delimiter and the 12-byte gap between frames. RFC 6349 counts the same 1538 bytes for a 1500-byte MTU. When a tunnel leaves less than 1280 bytes, the IPv6 MSS shows n/a, because 1280 is the smallest MTU IPv6 accepts on a link. Tailscale and WARP in WireGuard mode keep their 1280-byte interfaces on a shorter path, so IPv6 still runs and the IPv6 MSS shown fits the path.
A worked example
WireGuard over IPv4 adds a 20-byte outer header, an 8-byte UDP header, 16 bytes of its own (a type byte, 3 reserved bytes, a 4-byte receiver index and an 8-byte counter) and a 16-byte Poly1305 tag: 60 bytes in all. 1500 − 60 = 1440. The MSS is 1440 − 40 = 1400 for IPv4 and 1440 − 60 = 1380 for IPv6. On the wire the frame still takes 1538 bytes, so efficiency is 1400 ÷ 1538 = 91.03%. With no tunnel the same link gives 1460 ÷ 1538 = 94.93%, so WireGuard costs 3.90 percentage points. To see what that means for a real connection, turn link speed into megabytes per second and scale it by the efficiency.
wg-quick, the usual WireGuard setup script, sets the route MTU minus 80 and so picks 1420. That is the exact answer over IPv6, and 20 bytes short of the IPv4 maximum. The Linux WireGuard device defaults to the same 1420 for the same reason.
Where 1500 and minus forty came from
Charles Hornig's RFC 894, from April 1984, set 1500 octets as the largest IP datagram on Ethernet. Jon Postel's RFC 879, from November 1983, put the rule in capitals: the TCP maximum segment size is the IP maximum datagram size minus forty, giving a default MSS of 536 for the 576-byte datagrams every host had to accept. RFC 879 is now historic, and RFC 9293 of August 2022 restates the rule as the effective MTU minus the fixed IP and TCP headers. IPv6, specified today in RFC 8200 of July 2017, requires a 1280-byte MTU on every link, recommends 1500 or more so that tunnels fit, and computes the MSS as the packet size minus 60.
Fragmentation, Path MTU Discovery and black holes
A packet too big for the next hop is either fragmented or dropped. Path MTU Discovery, specified by Jeffrey Mogul and Steve Deering in RFC 1191 in November 1990, sets the don't-fragment bit and waits for routers to send back an ICMP message naming the smaller size. RFC 2923, in September 2000, described the long-standing black hole that follows when a firewall blocks those messages: pings and some interactive connections still work, while large packets vanish. The iptables manual presents MSS clamping as the workaround for networks that block those messages, and Tailscale suggests it for the same symptom.
PPPoE and VLAN tags
PPPoE, from RFC 2516 in February 1999, puts a 6-byte header and a 2-byte PPP protocol ID inside the 1500-byte Ethernet payload, which leaves 1492. RFC 4638, an informational document from September 2006, lets both ends negotiate more than 1492 when the access network carries larger frames. IEEE 802.3ac, approved in September 1998, let Ethernet frames carry the 4-byte 802.1Q VLAN tag, which works differently: it adds 4 bytes to the frame, not to the packet. Linux keeps the payload limit at 1500 for tagged and untagged frames, so the tag box here never lowers the MTU. It only adds 4 bytes to the wire count, which takes efficiency from 94.93% to 94.68% on a plain link.
What each tunnel adds
GRE, first published in October 1994, adds 4 bytes, plus 4 for each optional checksum, key or sequence number, so GRE over IPv4 gives 1476. IPsec ESP, defined today in RFC 4303 of December 2005, adds an 8-byte header, an IV, a 2-byte trailer and an ICV: AES-GCM fits 1446, and AES-CBC with HMAC-SHA1-96 fits 1438 with 4 bytes of the link unused. NAT traversal puts an 8-byte UDP header in front. OpenVPN, first released as version 0.90 in May 2001, adds 4 bytes of opcode and peer ID, a packet ID and a 16-byte GCM tag. Version 2.7, released in February 2026, added a data format with a 64-bit packet ID that two 2.7 peers negotiate, which gives 1444 over UDP against 1448 for the older 32-bit format; on Linux and FreeBSD, kernel data-channel offload still uses the 32-bit format. VXLAN (RFC 7348, August 2014) carries a whole Ethernet frame, and Geneve (RFC 8926, November 2020) usually does, so their 1450 counts the inner 14-byte Ethernet header too.
Jason Donenfeld presented WireGuard at NDSS in February 2017, and it shipped in Linux 5.6 in March 2020. Tailscale builds on it and documents an MTU of 1280, the IPv6 minimum, so its packets need 1340 bytes over IPv4. Cloudflare's WARP launched on WireGuard in 2019 and announced MASQUE in March 2024. Cloudflare asks for a 1361-byte path for MASQUE over IPv4, which is 1280 plus 53 bytes of MASQUE and 28 of IP and UDP headers. Since client version 2026.6.822.0, desktop clients run Path MTU Discovery by default and resize the interface to the path, so the MASQUE option shows what fits: 1419 on a 1500-byte link. Cloudflare publishes no top for the probe range, so on bigger links the calculator assumes a 1500-byte path to its edge.
Clamping the MSS
Every TCP handshake announces an MSS in its SYN, and a router can rewrite it. The rules table gives two ways to do that. Fixed rules set the value the calculator found, on SYNs that leave through the tunnel and on those that arrive from it, so both ends of the handshake hear the smaller size. Policy-based IPsec has no interface, so its rules match the IPsec policy instead. Automatic rules clamp to the route MTU; since Linux 2.6.25 the kernel checks the route back to the source as well as the one to the destination, and nftables gained the same feature in Linux 4.14 and nftables 0.9. Neither a fixed --set-mss nor an nftables maxseg size set raises an MSS that is already lower. The nftables rules live in their own table, because nftables has no built-in chains.
Limits of the model
The MSS assumes IP and TCP headers without options. TCP timestamps and other options take space from each segment without changing the MSS itself, so real payload per packet is slightly smaller. The calculator leaves out IPv6 extension headers, OpenVPN compression and fragment framing, and ESP with shorter GCM tags. Interface names in the rules are placeholders. To stack tunnels, such as GRE inside IPsec transport mode, run the inner one with Custom MTU set to the outer result: 1466 for AES-GCM transport mode gives GRE 1442. That second run counts only GRE, so add the outer tunnel's overhead yourself: GRE's 1504 bytes plus 34 of ESP make 1538 on the wire, and efficiency falls from the 93.22% shown to 1402 ÷ 1538 = 91.16%. To plan the addresses inside the tunnel, use the subnet calculator, and for the effect on big transfers try a download time estimate.
Frequently asked questions
What MTU should I set on a WireGuard interface?
Take 60 bytes off the link MTU when the tunnel runs over IPv4 and 80 when it runs over IPv6: 20 or 40 bytes of outer IP header, 8 of UDP, 16 for WireGuard's type, receiver index and counter, and a 16-byte Poly1305 tag. On a 1500-byte Ethernet link that is 1440 over IPv4 and 1420 over IPv6. wg-quick always subtracts 80, so its automatic 1420 works for either.
Why is the TCP MSS 1452 on a PPPoE connection?
PPPoE spends 6 bytes on its own header and 2 on the PPP protocol ID inside the 1500-byte Ethernet payload, which leaves 1492 bytes for IP, the limit RFC 2516 sets. The MSS leaves out the 20-byte IPv4 header and the 20-byte TCP header, so 1492 minus 40 is 1452. For IPv6 the two headers take 60 bytes and the MSS is 1432.
Does an 802.1Q VLAN tag reduce the MTU?
No. The 4-byte tag goes in the Ethernet header, so the largest frame grows from 1518 to 1522 bytes counting the frame check sequence, while the payload limit stays 1500. Linux uses 1500 as the payload limit for tagged and untagged frames alike. The tag still costs wire time: on a plain 1500-byte link it lowers payload efficiency from 94.93 to 94.68 percent.
What is the difference between MTU and MSS?
MTU is the largest IP packet a link carries, headers included. MSS is the largest TCP payload in one segment, which is the MTU minus the IP and TCP headers: 40 bytes for IPv4 and 60 for IPv6. A 1440-byte WireGuard tunnel therefore gives an MSS of 1400 for IPv4 and 1380 for IPv6. Each host announces its MSS in the SYN packet, which is why a router can rewrite it to clamp connections.
How much overhead does IPsec add per packet?
In tunnel mode over IPv4 with AES-GCM: a 20-byte outer header, 8 bytes of ESP header, an 8-byte IV, 2 bytes of trailer and a 16-byte ICV, 54 bytes in all, so a 1500-byte link carries inner packets up to 1446. NAT traversal adds an 8-byte UDP header and drops that to 1438. AES-CBC with HMAC-SHA1-96 pads to 16-byte blocks, so its largest inner packet is 1438 and 4 bytes of the link go unused. Transport mode keeps the packet's own header and fits 1466 with AES-GCM.
Why do Tailscale and Cloudflare WARP use an MTU of 1280?
1280 is the smallest MTU IPv6 allows on any link, so a 1280-byte tunnel can carry IPv6 anywhere. Tailscale documents 1280 as its MTU, and with WireGuard's overhead its packets need 1340 bytes over IPv4 and 1360 over IPv6. Cloudflare asks for the same 1340 and 1360 bytes in WireGuard mode, which is 1280 plus WireGuard's overhead, and its example interface output shows an MTU of 1280. With MASQUE it asks for 1361 or 1381 bytes. Desktop WARP clients from version 2026.6.822.0 resize the interface by Path MTU Discovery, so for MASQUE the calculator shows what fits the path: 1419 on a 1500-byte IPv4 link.
Sources
- RFC 894: A Standard for the Transmission of IP Datagrams over Ethernet Networks, IETF, 1984
- RFC 879: The TCP Maximum Segment Size and Related Topics, IETF, 1983
- RFC 9293: Transmission Control Protocol (TCP), IETF, 2022
- RFC 8200: Internet Protocol, Version 6 (IPv6) Specification, IETF, 2017
- RFC 1191: Path MTU Discovery, IETF, 1990
- RFC 2923: TCP Problems with Path MTU Discovery, IETF, 2000
- RFC 2516: A Method for Transmitting PPP Over Ethernet (PPPoE), IETF, 1999
- RFC 6349: Framework for TCP Throughput Testing, IETF, 2011
- RFC 4303: IP Encapsulating Security Payload (ESP), IETF, 2005
- RFC 4106: The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating Security Payload (ESP), IETF, 2005
- xfrm_state_mtu() in net/xfrm/xfrm_state.c, Linux kernel source on GitHub
- RFC 7348: Virtual eXtensible Local Area Network (VXLAN), IETF, 2014
- RFC 8926: Geneve: Generic Network Virtualization Encapsulation, IETF, 2020
- WireGuard protocol and cryptography, WireGuard
- OpenVPN 2.7 reference manual: link options (--mssfix), OpenVPN on GitHub
- Troubleshoot TCP connection issues between two devices, Tailscale
- Path MTU Discovery (PMTUD), Cloudflare
- Client architecture, Cloudflare
- iptables-extensions(8): TCPMSS, Linux man-pages project
- Mangling packet headers, nftables wiki