neocturne / fastd

Fast and Secure Tunnelling Daemon
Other
115 stars 16 forks source link

Best MTU for L2TPv3 mode with kernel offload? #32

Open stevefan1999-personal opened 1 year ago

stevefan1999-personal commented 1 year ago

If my calculations are correct, this is the best base MTU: Visual packet size calculator — Daniil Baturin

If I want to add batman futher, I have to add another ethernet frame and IP on top of it, so the new MTU would be like this: Visual packet size calculator — Daniil Baturin

I'm not sure if I made the calculations wrong

neocturne commented 1 year ago

I believe there are some issues in the setup you linked (and both links you posted are the same?):

Without VLAN, this results in a total overhead of 50 bytes for L2TP tunnels over IPv4; 54 bytes with VLAN. The overhead without VLAN is also described in the docs: https://fastd.readthedocs.io/en/stable/manual/mtu.html

I assume you intend to run batman(-adv?) inside fastd. As this is another inner layers inside the tunnel interface, it doesn't affect the MTU of the fastd interface - instead, it would have to be the bat0 MTU. bat0 is often bridged with other interfaces though, so reducing bat0's MTU is usually impractical. More commonly, bat0 is left on 1500, and MSS clamping is applied instead to avoid fragmentation by batman-adv.