VPN Tunnel (WireGuard / IPSec / VXLAN) MTU, TCP MSS & Goodput Calculator

Compute fragmentation-free WireGuard/IPSec MTU and TCP MSS clamping values.

Tunnel Interface MTU (WAN MTU − Overhead) 1,440 bytes
Clamped TCP MSS (MTU − Headers) 1,400 bytes
Protocol Goodput Efficiency 93.33 %
Total Encapsulation + TCP/IP Overhead 100 bytes
Inputs
Try:
bytes
Underlying WAN interface MTU in bytes (1500 Ethernet, 1492 PPPoE).
bytes
Tunnel header overhead in bytes (60 WireGuard IPv4, 80 WireGuard IPv6, 73 IPSec).
bytes
Inner IP + TCP header bytes (40 for IPv4, 60 for IPv6).
Results & Graph
Tunnel Interface MTU (WAN MTU − Overhead)
1,440 bytes
Clamped TCP MSS (MTU − Headers)
1,400 bytes
Protocol Goodput Efficiency
93.33 %
Total Encapsulation + TCP/IP Overhead
100 bytes

Tunnel Interface MTU (WAN MTU − Overhead)

Graph 1 • How the inputs feed VPN MTU & TCP MSS
VPN Tunnel (WireGuard / IPSec / VXLAN) MTU, TCP MSS & Goodput Calculator • Custom Domain Schematic (Networking & Digital Systems) physicaltunnelEnOut Physical Wan Mtu Bytes: 1.5k bytes • Tunnel Encapsulation Overhead Bytes: 60 bytes TUNNEL INTERFACE MTU (WAN 1,440 bytes • Clamped TCP MSS (MTU −: 1,400 bytes • Protocol Goodput Effic: 93.33 % Eq: Tunnel_MTU = Physical_MTU − Enca
Graph 2 • Tunnel Interface MTU (WAN MTU − Overhead) as Physical Wan Mtu Bytes changes (40% to 160% of current)
0 bytes 1.3k bytes 2.6k bytes 540 600bytes 840 900bytes 1.1k 1.2kbytes 1.4k 1.5kbytes 1.7k 1.8kbytes 2.0k 2.1kbytes 2.3k 2.4kbytes
Graph 3 • Physical Wan Mtu Bytes and Tunnel Encapsulation Overhead Bytes together Compares Tunnel Interface MTU (WAN MTU − Overhead) when Tunnel Encapsulation Overhead Bytes is shifted +25% (solid) vs. −25% (dashed).
0 bytes 1.0k bytes 2.1k bytes --- Tunnel Encapsulation Overhead Bytes @ 75% 975 -30% 1.2k -15% 1.4k +0% 1.6k +15% 1.9k +30%
Summary: Subtracting 60 B tunnel overhead from 1500 B WAN MTU gives a fragmentation-free Tunnel MTU of 1440 bytes and TCP MSS of 1400 bytes (93.3% payload efficiency).
Summary: Subtracting 60 B tunnel overhead from 1500 B WAN MTU gives a fragmentation-free Tunnel MTU of 1440 bytes and TCP MSS of 1400 bytes (93.3% payload efficiency).
Interactive chart & math engine powered by CalculatorGraph

Formula: VPN MTU & TCP MSS Systems Engineering Formula

TunnelMTU = PhysicalMTU − EncapsulationOverhead
TCPMSS = TunnelMTU − 40 (IPv4) or − 60 (IPv6)
Tunnel_MTU = Physical_MTU − EncapsulationOverhead; TCP_MSS = Tunnel_MTU − 40 (IPv4) or − 60 (IPv6)
  • physicalWanMtuBytes: Physical Wan Mtu Bytes (bytes)
  • tunnelEncapsulationOverheadBytes: Tunnel Encapsulation Overhead Bytes (bytes)
  • tcpIpHeaderBytes: Tcp Ip Header Bytes (bytes)

Frequently Asked Questions

Why is the WireGuard overhead 60 bytes over IPv4 and 80 over IPv6?

The difference is the outer IP header. WireGuard's own framing plus the UDP header add the same bytes either way, while the outer IPv4 header is 20 bytes and the outer IPv6 header is 40. Enter 60 or 80 depending on which family carries the tunnel between peers. When the peers might use either family, choose 80.

Should I clamp MSS if the tunnel MTU is already set?

Usually yes. Setting the tunnel MTU stops the tunnel endpoint itself from sending oversized packets, but hosts behind it may not know the tunnel is there. Clamping the MSS in TCP handshakes tells those hosts to send smaller segments, which avoids fragmentation even when path MTU discovery is blocked. It is a cheap safety net on most routers.

What value should I enter for IPsec overhead?

It depends on your cipher, integrity algorithm, padding and whether NAT traversal adds a UDP header. The field suggests 73 bytes as a typical figure, which returns a tunnel MTU 13 bytes lower than WireGuard over IPv4. Check your own configuration and leave some margin if padding varies.

Does this calculator account for TCP options like timestamps?

Not by default. The 40 byte header value assumes no options. Most stacks subtract option bytes themselves when building segments. If you want to see the effect, enter 52 in the header box, which adds 12 bytes for timestamps and lowers the MSS by the same amount.

Why is efficiency higher on the jumbo-frame preset?

Because the overhead is fixed. The tunnel and TCP/IP headers still total 100 bytes, but on a 9,000 byte WAN MTU they are spread over a far larger packet, so the payload share rises to 98.89%. On the PPPoE preset the same headers take a larger share and efficiency is 93.3%, close to the default.

Does MSS clamping fix problems with UDP traffic?

No. The MSS is a TCP setting and only affects TCP connections. UDP traffic over the tunnel, such as some voice, video or game protocols, must keep its own datagrams below the tunnel MTU, or the packets will be fragmented or dropped. Check the application's own settings.

How do I find the real MTU of my internet connection?

Send pings with the do-not-fragment flag and raise the payload size until they stop getting through. The largest working payload plus the ICMP and IP header sizes is your path MTU. Enter that value in the WAN box rather than assuming the Ethernet default of 1,500 bytes. Test at a few different times, since some paths change.

Can I use this for VXLAN or GRE?

Yes. Add up every header the encapsulation puts in front of the inner packet, including any outer IP and UDP headers, and enter that total as the overhead. The subtraction is the same for any tunnel. Only the overhead number changes between protocols.

Why does the total overhead line show 100 bytes on the default?

It adds the 60 byte tunnel overhead to the 40 bytes of inner IP and TCP headers. Those 100 bytes are the difference between the 1,500 byte WAN MTU and the 1,400 byte MSS, and they are the bytes in every full packet that carry no application data.

Why does the calculator show an error instead of a result?

One of the limits was broken. The WAN MTU must be a whole number in the range real links use, the overhead cannot be negative, the TCP/IP headers must be at least 40 bytes, and the result must leave a positive MSS. Check for a value typed into the wrong box, then re-enter the measured MTU of the underlay first.

Do I need to change anything for nested tunnels?

Run the calculator once per layer. Start with the physical link, subtract the outer tunnel's overhead, and use that tunnel MTU as the WAN MTU for the inner tunnel. The final MSS is the inner tunnel MTU minus the inner TCP/IP headers.

Is a bigger tunnel MTU always faster?

Only up to the point where packets still fit the path. Within that limit, larger packets carry the fixed headers over more data, which is why efficiency rises from 93.33% on the default to 98.89% on the jumbo-frame preset. Beyond it, packets are fragmented or dropped and throughput falls sharply, so the largest safe value is the target.

Three subtractions behind the 1,440 and 1,400 byte answers

The default models WireGuard over IPv4 on an ordinary Ethernet link. The physical WAN MTU is 1,500 bytes, the tunnel overhead is 60 bytes and the inner TCP/IP headers are 40 bytes. The calculator answers with a tunnel interface MTU of 1,440 bytes and a clamped TCP MSS of 1,400 bytes.

Each step is a plain subtraction. The tunnel MTU is the WAN MTU minus the encapsulation overhead: 1,500 minus 60. The MSS is the tunnel MTU minus the IP and TCP headers that ride inside the tunnel: 1,440 minus 40. The third supporting line adds the two overheads together and reports 100 bytes, the total that never carries application data.

The 60 byte WireGuard figure for an IPv4 outer path breaks down as a 20 byte outer IPv4 header, an 8 byte UDP header, and 32 bytes of WireGuard's own framing: a message header plus the 16 byte authentication tag. Over an IPv6 outer path the outer IP header is 40 bytes instead of 20, which is why the IPv6 figure is 80.

Nothing here is guessed or measured. The tool only does arithmetic on the three numbers you give it, so the answer is only as good as those numbers.

Picking the overhead value for your tunnel

The overhead box is the input that changes most between setups, and the right number depends on the outer path and the protocol.

For WireGuard the value is fixed by the protocol: 60 bytes when the tunnel runs over IPv4 and 80 when it runs over IPv6. If your peers can reach each other over either family, size for the larger figure. Entering 80 on the default lowers both the tunnel MTU and the MSS by 20 bytes and drops the efficiency figure from 93.33% to 92%.

IPsec is less tidy. ESP overhead depends on the cipher, the integrity algorithm, padding to the cipher block size, whether NAT traversal adds a UDP header, and whether you run tunnel or transport mode. The field's help text suggests 73 bytes as a typical figure. Treat that as a starting point and check your actual cipher suite, because padding can make the real overhead vary from packet to packet.

VXLAN and other overlay encapsulations have their own fixed header sizes. Add up every header the tunnel puts in front of the inner packet, including the outer IP and UDP headers, and enter that total. If there are two layers of tunnelling, add both.

When in doubt, slightly overstating the overhead is the safer error. The cost is a marginally smaller MSS. Understating it leaves packets that are too big for the path, which is the problem the calculator exists to prevent.

IPv4 or IPv6 inside the tunnel

The third box is about the traffic inside the tunnel, not the path outside it. If the inner packets are IPv4, the IP and TCP headers take 40 bytes: 20 for IP and 20 for TCP. If they are IPv6, the IP header is 40 bytes and the total is 60.

Keep the two choices separate. A WireGuard tunnel can carry IPv6 traffic over an IPv4 underlay, or the other way round. The outer family decides the overhead box, the inner family decides the header box.

Setting both to IPv6 on the default, with 80 bytes of overhead and 60 bytes of headers, gives an efficiency of 90.67%. That is the worst common case for WireGuard and a safe value to clamp to when a tunnel carries mixed traffic over mixed paths.

TCP options change the picture a little. Timestamps add 12 bytes to most TCP segments on modern stacks. MSS values are normally calculated without options, and the sending host subtracts option bytes itself. Entering 52 in the header box shows the effect: the MSS falls by 12 and the efficiency to 92.53%.

Where to apply the numbers on a router or host

The tunnel MTU goes on the tunnel interface. In WireGuard that is the MTU setting on the interface itself. Many tools pick a value automatically, but an explicit setting avoids surprises when the underlying link is not plain Ethernet.

The MSS figure is for clamping. A firewall or router rewrites the MSS option in TCP SYN packets passing through the tunnel so that neither end tries to send segments larger than the tunnel can carry. On Linux this is usually done with a rule that clamps to a fixed value or to the path MTU. Both approaches aim at the same 1,400 bytes on the default inputs.

Clamping matters most where path MTU discovery breaks. If something on the path drops the ICMP messages that tell a sender to use smaller packets, large TCP transfers can stall while small requests work fine. That pattern, where a page partly loads or an SSH session hangs on large output, is the classic sign of an MTU problem.

MSS clamping only helps TCP. UDP applications, including some video and gaming protocols, need to size their own datagrams or rely on fragmentation.

Reading the goodput efficiency percentage

The protocol goodput efficiency line divides the MSS by the WAN MTU. On the default that is 1,400 out of 1,500, or 93.33%. It tells you what share of each full-size packet on the wire is application data.

The preset scenarios show how this changes with link size while the overhead stays fixed at 100 bytes. On a PPPoE line with a 1,492 byte WAN MTU the tunnel MTU is 1,432, the MSS is 1,392 and efficiency is 93.3%, almost the same as the default. On a jumbo-frame link with a 9,000 byte WAN MTU the tunnel MTU is 8,940, the MSS 8,900 and efficiency rises to 98.89%. Fixed overhead weighs more on small packets and almost disappears on large ones.

This figure ignores the Ethernet frame header, frame check sequence, preamble and inter-frame gap, which sit outside the IP MTU. Throughput measured at the line rate will therefore be a little below what this percentage suggests.

It also assumes every packet is full size. Interactive traffic made of small packets has much lower efficiency, because the same 100 bytes of headers wrap a few bytes of data.

Underlays that are not a clean 1,500 bytes

Plenty of real links offer less than the Ethernet default. PPPoE broadband adds an 8 byte header, so its usable MTU is 1,492 bytes rather than 1,500, and the PPPoE preset shows the tunnel and MSS both shrinking by those same 8 bytes, to 1,432 and 1,392 bytes. Mobile networks, some cloud provider networks and nested VPNs can be smaller again.

Enter the MTU you have actually measured on the underlay, not the number printed on the interface. A ping with the do-not-fragment flag set and increasing payload sizes will find the largest packet that crosses the path. Add the ICMP and IP header sizes to the largest working payload to get the path MTU.

If you are tunnelling inside another tunnel, use the inner MTU of the outer tunnel as the WAN MTU here. Each layer subtracts its own overhead in turn.

On the other side, jumbo-frame networks inside a data centre can carry much larger frames, which is what the 9,000 byte preset illustrates. A larger underlay leaves room for a much larger tunnel MTU, 8,940 bytes in that case, but every device along the path must support the same size or the first hop that does not will drop the packets.

A worked check before changing production settings

Suppose you run WireGuard between two offices whose internet links are plain Ethernet, with IPv4 between the peers and IPv4 traffic inside. Those are exactly the defaults, so the tunnel MTU is 1,440 bytes and the MSS to clamp to is 1,400 bytes.

Now suppose one office later gains IPv6 connectivity and the peers start talking over it. The outer header grows by 20 bytes. Re-run with an overhead of 80 and both numbers fall by 20. If you leave the old setting in place, full-size packets from the tunnel are now 20 bytes too large for the path, and they will be fragmented or dropped.

This is why it pays to size for the worst path you expect, not the one you happen to use today. A tunnel MTU that is a few bytes too small costs a fraction of a percent in efficiency. One that is too large produces intermittent stalls that are hard to diagnose.

After any change, test with a large transfer through the tunnel and with do-not-fragment pings sized to the new MTU. If both succeed, the setting is right for that path.

Limits the calculator enforces and checks it leaves to you

The tool checks its inputs before subtracting. The WAN MTU must be a whole number within the range real links use, from small legacy links up to jumbo frames. The overhead must be 0 or more, and the TCP/IP header box must be at least 40, the IPv4 minimum. If the numbers would leave no room for a positive MSS, it shows an error rather than a negative result.

What it does not do is judge whether the result suits your traffic. The headline is labelled tunnel interface MTU, WAN MTU minus overhead, and that is exactly what it is: the largest tunnel MTU that avoids fragmentation for the overhead you entered. It is not tuned for throughput or latency, and it will not catch a header counted twice, for example if you add the inner TCP/IP bytes into the overhead box as well.

Minimum sizes are also your responsibility. IPv6 requires every link to carry a minimum packet size, so a small underlay combined with a large overhead can leave a tunnel MTU that breaks IPv6 traffic inside the tunnel, even though the calculator accepts it.