Is used to calculate the overhead of different encapsulations, header size and hence required path MTU
This tools is an effort of Daniil Baturin, 2013 and is distributed under the terms of MIT license.
Get Source code
PDU (Protocol Data Unit) is a general term for frames, packets, segments etc.
If you want to calculate tunnel MTU, specify protocols before the encapsulated one. That is, if you want MTU for GRE over IPv4, add IPv4 and GRE. PDU value will be your MTU, whatever you encapslate into GRE must not exceed that size.
If you want to calculate TCP MSS, add the underlying protocol and TCP after tunnel protocols. E.g. for TCP over IPv6 encapsulated into GRE over IPv4, add IPv4, GRE, IPv6, and TCP.
Protocol overhead values here are just what they add to the frame. E.g. if you want MTU for QinQ over physical Ethernet links, just add QinQ, as your physical link MTU already takes Ethernet header and first VLAN tag into account. If you want to encapsulate the whole frame into a pseudowire, add Ethernet, VLAN, and QinQ.
IPIP and IP6IP6 (and mixed) encapsulations do not use any specific headers, they are just IPv4 or IPv6 packets sent as IPv4 or IPv6 payload. So for IPIP just add IPv4 twice, for IPIP6 add IPv4 and IPv6 etc.
This calculator does not check if specified encapsulation is any practical, if implementations exist, or if protocols are in "correct order". In theory you can encapsulate anything in anything, in practice it usually turns out there is even a valid a use case for it, so it just sums up header size.
GRE over IPv4, encapsulates IPv4. We want tunnel MTU, parent interface MTU is 1500
Parent interface MTU is maximum size of IPv4 packets it can transmit, not counting Ethernet frame headers. So we only need to care about IPv4 and GRE, and we add IPv4 (20 bytes) and GRE (4 bytes). Tunnel MTU is 1476, which means maximum size of encapsulated IPv4 packet must not exceed 1476 if we don't want it to be fragmented
MSS for the above example.
To get MSS, we need to add IPv4 and TCP after those IPv4 and GRE. MSS will be 1436 (1476 - 20 - 20), which means TCP payload must not exceed 1436.