Tunnel MTU and MSS calculator
A site-to-site tunnel wraps every packet in extra headers, like a carrier around a letter. Enter the link MTU between your offices to see how much room is left inside the tunnel, and the TCP MSS to clamp to.
Packing slip (estimate)
- Tunnel MTU
- 1440 bytes
- TCP MSS, IPv4 inside
- 1400 bytes
- TCP MSS, IPv6 inside
- 1380 bytes
- Link MTU 1500
- − outer IPv4 header 20
- − UDP header 8
- − WireGuard data header and tag 32
- = room inside the link 1440
- = tunnel MTU, rounded down to a multiple of 16 1440
Illustrative first sum: a 1,500-byte link with WireGuard over IPv4. Bar not to scale. Results are estimates; check your router's documentation before you change a setting.
Formula and assumptions
room = link MTU − (outer IP header + UDP 8 + WireGuard 32) tunnel MTU = 16 × floor(room ÷ 16) TCP MSS = tunnel MTU − (inner IP header + TCP 20) With no tunnel, the first two lines are skipped: the path MTU is the link MTU and the MSS is worked out from it, so the readouts are labelled Path MTU, TCP MSS over IPv4 and TCP MSS over IPv6. The formula assumes the base outer and inner IP headers only, no other encapsulation, and a fixed 20-byte TCP header for the advertised MSS (RFC 9293 section 3.7.1, RFC Editor).
The rounding line is the conservative case: WireGuard pads the inner packet with zeros up to a multiple of 16 bytes, so the figure is rounded down to keep the padded packet inside the link. Some implementations cap the padding at the interface MTU and can carry up to the unrounded room, so your tunnel may show a slightly larger number.
Header sizes used
- IPv4 header: 20 bytes, the minimum, with no options (RFC 791, Internet Protocol, RFC Editor).
- IPv6 header: 40 bytes, fixed, with no extension headers (RFC 8200, Internet Protocol, Version 6 (IPv6) Specification, RFC Editor).
- UDP header: 8 bytes (RFC 768, User Datagram Protocol, RFC Editor).
- TCP header: 20 bytes, the minimum, with no options; the MSS counts TCP data only (RFC 9293, Transmission Control Protocol (TCP), RFC Editor).
- WireGuard: 32 bytes per data packet, a 16-byte header (message type, reserved bytes, receiver index and counter) plus a 16-byte authentication tag (Protocol & Cryptography, WireGuard; tag size from RFC 8439 section 2.5, RFC Editor). The same page describes the padding of the inner packet to a multiple of 16 bytes used in the rounding line.
Assumptions
- The link MTU is the one for the path between the offices. The Ethernet preset of 1500 bytes comes from the Ethernet payload size (RFC 894, A Standard for the Transmission of IP Datagrams over Ethernet Networks, RFC Editor). The PPPoE preset is 1500 − 6 − 2 = 1492 bytes, the 6-byte PPPoE header and 2-byte PPP protocol field taken from Ethernet's 1500 (RFC 2516, A Method for Transmitting PPP Over Ethernet (PPPoE), RFC Editor); larger values can be negotiated (RFC 4638, Accommodating a Maximum Transit Unit/Maximum Receive Unit (MTU/MRU) Greater Than 1492 in the Point-to-Point Protocol over Ethernet (PPPoE), RFC Editor), so enter your own figure if you know it.
- The calculator's lower bound is 68 bytes, the size RFC 791 says IPv4 modules must be able to forward without further fragmentation. For an IPv6 outer path it uses 1,280 bytes, the minimum link MTU in RFC 8200. These are limits of this calculator, not a rule that every link needs them.
- The figure 1420, often seen in WireGuard setups, is the unrounded IPv6 result for a 1500-byte link (1500 − 80). With the rounding line above, the calculator shows 1408 for that case.
- Other tunnel types (IPsec, OpenVPN, PPPoE inside the tunnel) add different overheads and are not covered here.
- The calculator's input cap is 65,535 bytes, the largest value of the IPv4 total length field (RFC 791). Whole numbers in digits only; stray spaces at the ends are ignored.