[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] commit 5d021c879 ("implement MTU calculation and adj

From: Daniel Golle
Subject: [GNUnet-developers] commit 5d021c879 ("implement MTU calculation and adjustments")
Date: Fri, 1 Feb 2019 11:30:20 +0100
User-agent: Mutt/1.11.2 (2019-01-07)

Hi Christian,

I just reviewed 5d021c879 ("implement MTU calculation and adjustments")
and want to make some comments on it:

+  case AF_INET:
+    base_mtu
+      = 1480 /* Ethernet MTU, 1500 - Ethernet header - VLAN tag */
+      - sizeof (struct GNUNET_TUN_IPv4Header) /* 20 */
+      - sizeof (struct GNUNET_TUN_UdpHeader) /* 8 */;
+    break;
+  case AF_INET6:
+    base_mtu
+      = 1280 /* Minimum MTU required by IPv6 */
+      - sizeof (struct GNUNET_TUN_IPv6Header) /* 40 */
+      - sizeof (struct GNUNET_TUN_UdpHeader) /* 8 */;

This seems wrong to me, for several reasons:
Ethernet MTU applies for both, IPv4 and IPv6 the same way.

Assuming MTU 1500 for IPv4 should then be assumed for IPv6 as well.

Assuming the minimum of 1280 for IPv6 and not equally for IPv4 will
obviously break IPv4 in situations where MTU (a property of Ethernet)
is less than 1480 (eg. in case of using a VPN for WAN connectivity
which can easily reduce MTU below 1480).

VLAN tag doesn't affect MTU, it remains 1500 (unless you have a very
broken dump switch sitting in between. Those do exist, but are rare
and then people usually just don't use VLANs over them anyway).

In short: those assumptions don't hold true in reality. You will need
to discover MTU for the path and there is no way around it. It's a
very common mistake, and I saw it causing all sorts of weird problems
in the past. Please don't hard-code any value there, we will regret
that and it may work in 85% of typical setups and screw up people who
are in less typical network environments.

Obviously there is a privacy aspect of it as well, which may justify
hardcoding it to 1280 for **both** IPv4 and IPv6 -- as it will be only
GNUnet doing that, this will then identify GNUnet users which is also
not great. I guess doing it the way it is done in popular protocols
used over UDP is the best thing we can do, so please take a look at
WebRTC and RTP implementations around, BitTorrent UTP may also be a
good reference.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]