This IPsec overhead calculator shows how many bytes a VPN adds to each packet and what MTU and TCP MSS that leaves you. It models ESP in tunnel or transport mode with AES-CBC, AES-GCM or ChaCha20, includes padding alignment and the 8 extra bytes of NAT traversal, and also shows the record overhead of TLS 1.2, TLS 1.3 and DTLS.
Result
The result updates automatically as you change any input.
Formula and worked steps
Formulas used
- ESP tunnel packet = outer IP (20 or 40) + [UDP 8 for NAT-T] + ESP header 8 (SPI + sequence) + IV + inner packet + padding + trailer 2 + ICV
- Padding makes (inner packet + pad + 2) a multiple of the cipher alignment: 16 bytes for AES-CBC, 4 bytes for GCM and ChaCha20
- Largest inner packet = the largest L whose encapsulated size is at most the path MTU; MSS = L - inner IP header - 20 (TCP) - options
- IV and ICV: CBC IV 16, GCM and ChaCha20 IV 8; ICV 12 (SHA1-96), 16 (SHA-256-128 and AEAD), 32 (SHA-512-256)
- TLS records: 1.2 GCM = 5 + 8 + 16 = 29 bytes; 1.3 = 5 + 1 + 16 = 22; DTLS 1.2 GCM = 13 + 8 + 16 = 37
- Vendors and options differ slightly (for example extended sequence numbers, additional padding, TFC padding or different IV sizes); confirm on your device.
- The TLS figures assume one inner packet per record and one record per TCP segment or UDP datagram. VPN products may add their own framing, which you can enter.
- TCP-in-TCP effects of SSL VPNs over TCP are not modelled.
References
- RFC 4303: IP Encapsulating Security Payload (ESP)
- RFC 3948: UDP Encapsulation of IPsec ESP Packets
- RFC 4106: The Use of Galois/Counter Mode (GCM) in IPsec ESP
- RFC 3602: The AES-CBC Cipher Algorithm and Its Use with IPsec
- RFC 7634: ChaCha20, Poly1305, and Their Use in IKE and IPsec
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3
- RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2
- RFC 6347: Datagram Transport Layer Security Version 1.2
Estimating the cost of encrypting data on storage arrays or in storage networks? Use the storage encryption overhead calculator; this page covers network tunnel overhead such as IPsec and TLS.
What is VPN overhead?
A VPN wraps each original packet in a new one. The wrapper holds a new IP header, protocol headers, cryptographic fields and padding, so the packet that crosses the network is bigger than the one the host sent. If the result exceeds the path MTU, the packet must be fragmented or dropped, and throughput and latency suffer. Knowing the overhead tells you how to set the tunnel MTU and the TCP MSS so that packets fit.
IPsec ESP in tunnel mode
In tunnel mode the whole inner IP packet is encrypted and a new outer IP header is added. The Encapsulating Security Payload (RFC 4303) adds an 8-byte header with the security parameter index and sequence number, an initialisation vector (IV), padding, a 2-byte trailer holding the pad length and next header, and an integrity check value (ICV). The outer IP header is 20 bytes for IPv4 and 40 for IPv6. With NAT traversal (RFC 3948), a UDP header of 8 bytes is inserted before the ESP header so that the packet can pass through NAT devices.
Ciphers and sizes
AES-CBC needs a 16-byte IV and pads the data to a multiple of 16 bytes; it is paired with a separate integrity algorithm whose ICV is 12 bytes for HMAC-SHA1-96, 16 for HMAC-SHA-256-128 and 32 for HMAC-SHA-512-256. AES-GCM and ChaCha20-Poly1305 are authenticated ciphers: an 8-byte IV, a 16-byte ICV and padding aligned to only 4 bytes. That is why GCM has the lowest overhead of the common choices and why it is the default in modern deployments.
Transport mode and TLS
In transport mode ESP is inserted after the original IP header and no outer header is added, saving 20 bytes, but it is only suitable between the two endpoints of a connection. TLS-based VPNs wrap each packet in a record: 5 bytes of header and an authentication tag, plus an 8-byte explicit nonce in TLS 1.2 and a 1-byte content type in TLS 1.3. Because the record is carried over TCP or UDP, the outer IP and transport headers must be counted too.
How the IPsec overhead calculator works
Why padding means you cannot just subtract
The encrypted block is rounded up to the cipher alignment, so the overhead varies with the inner packet size by up to 15 bytes with AES-CBC. The tool therefore finds the largest inner packet that fits by testing sizes downward from the MTU instead of subtracting a constant, and it shows how many bytes of padding a given packet receives.
Worked example: GCM and CBC at a 1,500-byte path MTU
With AES-GCM in tunnel mode the encapsulated size is 20 + 8 + 8 + padded(L + 2) + 16. The largest inner packet is 1,446 bytes, which leaves a TCP MSS of 1,406. A 1,400-byte packet becomes 1,456 bytes: 56 bytes of overhead, 96.2% efficiency. With AES-CBC and HMAC-SHA1 the largest packet is 1,438 bytes (MSS 1,398), and a 1,400-byte packet picks up 64 bytes. Adding NAT traversal costs another 8 bytes: the GCM limit falls to 1,438 and the CBC limit to 1,422 because it drops to the next 16-byte block.
Worked example: TLS
With TLS 1.3 over TCP and IPv4, each inner packet adds a 20-byte IP header, 20-byte TCP header and 22-byte record: 62 bytes. A 1,400-byte packet becomes 1,462 bytes, 95.8% efficient, and the largest inner packet at a 1,500-byte MTU is 1,438. TLS 1.2 with GCM adds 29 bytes per record, and DTLS 1.2 over UDP adds 13 + 8 + 16 for the record plus 28 for the IP and UDP headers.
MSS clamping
TCP’s maximum segment size tells the peer how big a segment may be. If the tunnel interface clamps the MSS to the value shown, hosts behind the VPN never send segments that would exceed the path MTU after encapsulation. That avoids fragmentation and also avoids problems with path MTU discovery, which fails when ICMP messages are filtered.
Why it matters for network engineers
MTU problems are among the most common VPN faults. Small packets work, large ones hang, and the symptoms (a web page that never finishes loading, a file transfer that stalls) look like application bugs. Setting the right tunnel MTU and MSS is cheap. The overhead also reduces useful throughput, because every packet carries a fixed number of extra bytes: on voice and other small packets the share is much larger than on bulk data. For WAN planning, add the overhead to the circuit estimate in the WAN bandwidth calculator, and see how the extra bytes interact with Ethernet framing in the Ethernet overhead calculator.
Best practices and common mistakes
Use AES-GCM where both ends support it, since it combines encryption and authentication and has the smallest overhead. Clamp the MSS on the tunnel interface rather than relying on path MTU discovery. Test with do-not-fragment pings at the expected maximum size, both ways. Remember that nested encapsulation, such as IPsec over GRE or MPLS underneath, adds up; for the MPLS part, use the MPLS overhead calculator.
Common mistakes are using a fixed 58-byte overhead for every case, forgetting NAT traversal on connections that pass through a NAT device, and setting the tunnel MTU without changing the MSS. Another is blaming the VPN device for throughput caused by encryption overhead on small packets: check the packet size distribution first. If your concern is the cost of encrypting stored data rather than traffic in motion, that is a different calculation, handled by the storage encryption overhead calculator.
Checking your settings
After deployment, verify the tunnel MTU and MSS with a packet capture on both ends. The largest packet on the wire should equal the path MTU, with no fragments, and the SYN packets should carry the clamped MSS. If you see fragments, an overhead is missing from the calculation, usually NAT traversal or an extra encapsulation layer.
FAQs
How much overhead does IPsec add?
In tunnel mode with AES-GCM and no NAT traversal, about 56 bytes for a 1,400-byte packet: outer IP 20, ESP header 8, IV 8, padding and trailer, and a 16-byte ICV. AES-CBC adds more because of its larger IV and padding.
What MTU and MSS should I use for an IPsec tunnel?
For AES-GCM over a 1,500-byte path the largest inner packet is 1,446 bytes and the TCP MSS 1,406. With NAT traversal use 1,438 and 1,398. The calculator gives the figures for other ciphers.
How much does NAT-T add?
NAT traversal inserts a UDP header of 8 bytes between the outer IP header and ESP, so overhead rises by 8 bytes and usually lowers the usable MTU by 8 to 16 bytes depending on padding.
What is the overhead of TLS 1.3 for a VPN?
Each record adds 22 bytes (5-byte header, 1-byte content type, 16-byte tag), and with outer IP and TCP headers that is 62 bytes per packet.
Next, try the Ethernet overhead calculator, the mpls-overhead-calculator and WAN bandwidth calculator, or browse all Network Security & Overhead calculators and the full list of network calculators.