Network mathematics · Local calculator

MTU Calculator

Start with an IP packet-size limit and determine how many bytes remain for data after headers. This is useful when a tunnel or transport option consumes part of a packet budget.

Inputs

Result

Maximum modeled payload
1460 bytes
Base IP header
20 bytes
Base transport header
20 bytes
Additional overhead
0 bytes

Packet budget within the supplied IP MTU, excluding link-layer framing. This arithmetic model does not determine path MTU or validate link configuration.

In this guide12 sections

Introduction

Start with an IP packet-size limit and determine how many bytes remain for data after headers. This is useful when a tunnel or transport option consumes part of a packet budget.

Formula and calculation

Payload that fits an IP MTU
payload = IP MTU − IP header − transport header − additional overhead

This model uses 20 bytes for the IPv4 base header, 40 for IPv6, 20 for the TCP base header, and 8 for UDP. Additional bytes are entered by the user. Link-layer framing is excluded.

IP MTU · bytes
maximum modeled IP packet size on the link
overhead · bytes
additional IP or transport bytes supplied to the tool

Method and concepts

Data budget = IP MTU − IP header − transport header − additional overhead. A basic IPv4 header is 20 bytes and the IPv6 base header is 40. TCP starts at 20 bytes and UDP uses 8. The additional-overhead field accounts for bytes inside the selected MTU that these base headers omit.

  1. Use the maximum IP packet size for the layer you are budgeting. Identify whether the IP version and transport are IPv4 or IPv6, and TCP or UDP.
  2. Add the bytes for options, extensions or encapsulation that share this packet budget. Check which headers are already represented before subtracting them.

MTU and packet payload diagram

  1. 1500-byte outer IP budget
  2. 40-byte outer header
  3. 1460-byte inner packet
  4. Inner headers and data
In this IPv6-in-IPv6 example the outer header uses 40 bytes. Further encapsulation would consume additional space.

Worked examples

Fit TCP data and options in a 1500-byte IPv4 packet

  1. Choose a 1500-byte IP MTU and IPv4 with TCP. The base headers take 20 + 20 = 40 bytes, leaving 1460 bytes.
  2. Suppose this packet carries 12 more bytes of TCP options and padding. Enter 12 as additional overhead.
  3. The data budget is 1448 bytes. Reassemble the packet on paper: 20 bytes of IPv4 + 32 bytes of TCP + 1448 bytes of data = 1500.

MTU and packet payload: Size a datagram inside a tunnel

  1. An IPv6-in-IPv6 path carries outer packets up to 1500 bytes. Assume base IPv6 headers and UDP inside, with no extensions or other encapsulation.
  2. Subtract the outer 40 bytes to get an inner packet budget of 1460. Subtract another 40 for the inner IPv6 header and 8 for UDP.
  3. Up to 1412 bytes of UDP data fit. Check the sum of 40 + 40 + 8 + 1412 = 1500 before documenting the application limit.

Reference table

MTU Calculator reference
Stack at MTU 1500Base headersData budget
IPv4 + TCP20 + 20 B1460 B
IPv4 + UDP20 + 8 B1472 B
IPv6 + TCP40 + 20 B1440 B
IPv6 + UDP40 + 8 B1452 B

Reading the result

This result is the capacity of one packet under the stated assumptions. For TCP, options can lower the data carried in an individual segment. The MSS option advertised to a peer follows separate rules based on fixed header sizes. The smallest link MTU along a route constrains the path.

Common mistakes

  • An IP MTU already excludes outer Ethernet framing. Subtracting the Ethernet header again understates the budget.
  • If an interface already publishes an inner tunnel MTU, subtracting its outer tunnel headers again counts overhead twice.

Frequently asked questions

How much UDP data fits in an IPv6 packet of 1280 bytes?

With the 40-byte IPv6 base header, the 8-byte UDP header and no extensions, 1232 bytes remain.

What if the headers exceed the MTU?

That header combination cannot fit within the given limit. Review the layer, MTU and extra-header count before interpreting any payload size.

Why does a small request succeed while a large transfer stalls?

An MTU mismatch is one possible explanation. Compare the affected sizes with interface and tunnel budgets and any existing Packet Too Big reports. Application timeouts and loss can produce similar symptoms.

Can every IPv6 application send 1280 data bytes in one 1280-byte packet?

The 1280-byte budget includes IPv6 and transport headers. For base IPv6 and UDP, 1232 data bytes remain.

Does MTU include Ethernet headers?

An IP MTU usually describes the largest IP packet carried by a link. Ethernet framing adds link-layer bytes outside that IP packet size.

Why can a smaller path MTU cause a connection to hang?

If oversized packets are dropped and the sender does not learn a usable path size, larger transfers can stall while small exchanges succeed. Path MTU discovery depends on correct feedback handling.

Do tunnels reduce the usable inner packet size?

Encapsulation adds outer headers, consuming part of the underlay MTU. Tunnel designs must account for the overhead or adjust inner MTU and segmentation behavior.

Is a larger MTU always faster?

No. Larger packets reduce per-packet overhead in some cases, but every device and path segment must support them. Mismatches can cause loss or fragmentation.

What is the difference between IP MTU and TCP MSS?

MTU is the maximum IP packet size a link can carry. TCP MSS is the maximum TCP payload size advertised by an endpoint, usually accounting for IP and TCP headers.

Can IPv6 routers fragment packets in transit?

No. IPv6 routers do not fragment forwarded packets. A source can use an IPv6 Fragment header, and Path MTU Discovery helps the sender choose a usable size.

What happens if an IPv6 packet exceeds a link MTU?

A router drops it and sends an ICMPv6 Packet Too Big message so the source can adjust. Filtering that control message can cause path-MTU problems.

Why can reducing an interface MTU fix a tunnel issue?

A lower inner MTU leaves room for tunnel headers in the outer path. It can avoid oversized encapsulated packets, though it should be set based on the actual path and overhead.

What is Path MTU Discovery?

It is a mechanism for learning the smallest packet size supported along a route. IPv4 and IPv6 use different feedback and fragmentation rules, but both depend on control messages being handled correctly.

Does TCP MSS include IP options?

MSS represents the maximum TCP data portion. A sender must still account for actual IP and TCP header sizes, including options, when fitting a segment into the path MTU.

Can a VLAN tag reduce Ethernet's available IP packet size?

A VLAN tag adds frame-header bytes. The configured Ethernet MTU often still describes the IP payload, but hardware frame limits and path accounting should be checked explicitly.

Why might small pings work while large transfers fail?

Small packets may fit where larger packets do not. Filtering or mishandling MTU feedback can leave a connection partially working until a larger packet is sent.

Should I set every interface to a jumbo MTU?

No. Jumbo frames require support across the full relevant path. Set them only where the network design and all intermediate devices have been verified.

Further learning and references