Ethernet frame header size of TAP device and apropriate MTU calculation

Guus Sliepen guus at tinc-vpn.org
Sun Jan 20 15:43:29 CET 2013


On Sat, Jan 19, 2013 at 09:52:15AM -0500, Donald Pearson wrote:

> On Sat, Jan 19, 2013 at 5:30 AM, SVM <svm7 at mail15.com> wrote:
> 
> > What is a right way to calc mtu on TAP device to avoid fragmentation on
> > real eth device?
> >
> > I suppose TAP MTU = 1500-8(UDP)-20(IP)-18(**Ethernet) = 1454.
> > So I'd set 1454 for tap device: "ip link set mtu 1454 dev eth0"

You are forgetting that there is some overhead for encryption and
authentication of packets. Also, to really avoid fragmentation you would have
to know the lowest MTU on the path to the destination, not just that of your
local network.

> > I'm not shure about what is the exact size of ethernet frame header, which
> > tap device use in switch mode?
> > Is there FCS field? - Sure it should be.
> > But is there InterFrame Space and Preamble in the "switch environment"?

No, there is no FCS, preamble or inter-frame space as far as the operating
system is concerned. Real network cards need to deal with that, but the
computer itself never sees those bits.

> > And how this correlate with PMTU and PMTUDiscovery options?
> > Should I really manually change MTU for tap device?
[...]
> My understanding is that PMTUDiscovery determines what mtu to use for
> tunneled frames in switch mode so that they will fit without fragmentation.

Indeed, PMTUDiscovery will let tinc automatically detect the real MTU between
nodes, and will use various techniques to ensure that the packets will not be
fragmented, without you having to change the MTU of the virtual network
interface.

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>


More information about the tinc mailing list