networkservicemesh / sdk-kernel

Apache License 2.0
6 stars 17 forks source link

Minimum MTU verification for IPv6 #471

Open LionelJouin opened 2 years ago

LionelJouin commented 2 years ago

The minimum MTU allowed with IPv6 is 1280. If the MTU is set to a lower value, issues will happen with the connection, no error will be returned to the NSC and this error will be in the forwarder logs:

failed to set /proc/sys/net/ipv6/conf/proxy.load-fe75/disable_ipv6 = 0: open /proc/sys/net/ipv6/conf/proxy.load-fe75/disable_ipv6: no such file or directory

Raised here: https://github.com/networkservicemesh/sdk-kernel/blob/0125eaf79f2ed9aa6c6de9116f0163b9611b2829/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go#L91

I think there should be some checks somewhere in the chain to verify the connection this MTU property is valid.

zolug commented 2 years ago

It seems when requesting a lower than 1280 bytes mtu, the network stack "realizes" that the interface can't support ipv6. So the interface won't be included under /proc/sys/net/ipv6/conf/, therefore _disableipv6 fails (https://github.com/networkservicemesh/sdk-kernel/blob/release/v1.3.1/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go#L88) If using a lower mtu should be supported, then probably the code would need to check if the interface was already running "without ipv6".