Skip to contentSkip to conversation

MTU

Openvpn-devel James Yonan 2 participants 3 messages Feb 22, 2003 – Feb 23, 2003

lore
Share & tools
lore
#0 lore raw

Recently I've been taking a new look at MTU issues. It seems that some people are having problems lately that are related to MTU or PMTU discovery.

I was trying to think up some ways to make OpenVPN's handling of MTU a bit less opaque, more automatic, and also give more manual control to those who know what they're doing.

I have some preliminary code in the CVS (under branch MTU_EXPERIMENTAL) that adds an option (--mtu-disc) that gives manual control over whether path MTU discovery is performed on the UDP link. I also borrowed some code from tracepath to print the discovered PMTU size on UDP read/write errors. Unfortunately, I'm not sure whether this code will work on non-Linux OSes. See mtu.c for more info.

I've also considered ways of making OpenVPN's MTU calculation more automatic without relying on PMTU which is often broken due to over-restrictive firewalls in the path that block ICMP messages. PMTU also lacks DoS resilience. One way might be to do our own PMTU discovery by transmitting various sized packets over the UDP channel and having the remote peer report back on the largest packet it received. One problem is that MTU size could change during a session, necessitating a re-ifconfig of the TUN/TAP device, which may not be possible on some platforms and breaks --user/--group nobody.
This might be handled in a way similar to --ping-restart or SIGHUP/SIGUSR1,
where the openvpn daemon would essentially restart if the MTU size changed. This would be effective if path MTU changes are infrequent but still creates problems when --user/--group nobody is used, since the openvpn daemon will lack sufficient privilege to reopen and re-ifconfig the TUN/TAP device.

Comments?

James

#1 lore raw
Quoted 6 lines · James Yonan

This might be handled in a way similar to --ping-restart or SIGHUP/SIGUSR1,
where the openvpn daemon would essentially restart if the MTU size changed. This would be effective if path MTU changes are infrequent but still creates problems when --user/--group nobody is used, since the openvpn daemon will lack sufficient privilege to reopen and re-ifconfig the TUN/TAP device.

One option to deal with the --user/--group stuff is to keep a parent process running as root with the real work being done by the child with dropped privledges. The parent just waits around waiting for a signal regarding the child, and then let the parent start a new child. Of course if you are going to go down the IPC route, there is other fun things you can do like passing sockets via AF_UNIX sockets. It really depends on how you want to do it.

Regards,

Aaron

#2 lore raw
Quoted 17 lines · Aaron Sethman
Quoted 6 lines · James Yonan

This might be handled in a way similar to --ping-restart or SIGHUP/SIGUSR1,
where the openvpn daemon would essentially restart if the MTU size changed. This would be effective if path MTU changes are infrequent but still creates problems when --user/--group nobody is used, since the openvpn daemon will lack sufficient privilege to reopen and re-ifconfig the TUN/TAP device.

One option to deal with the --user/--group stuff is to keep a parent process running as root with the real work being done by the child with dropped privledges. The parent just waits around waiting for a signal regarding the child, and then let the parent start a new child. Of course if you are going to go down the IPC route, there is other fun things you can do like passing sockets via AF_UNIX sockets. It really depends on how you want to do it.

Quoted 3 lines

Regards,

Aaron

Aaron,

Actually OpenVPN has some of this right now. If built with pthread support, it will negotiate SSL/TLS keys in a background thread and communicate with the foreground via a pair of AF_UNIX sockets (this helps tunnel latency a lot). The split-privilege model is a good idea, and has been implemented with some success in OpenSSH, but is arguably overkill for OpenVPN given that up till now, OpenVPN has been able to do all of its privileged work at startup, then downgrade to nobody with little loss of flexibility. IMHO, the alternative is more complex and prone to becoming a bug-magnet.

James