Default MTU
What should the default MTU be?
Right now the default UDP MTU is 1500 if you use --ifconfig, which is probably too high, because as Matthias Andree pointed out, 1500 + IP header size is greater than 1500 and will cause fragmentation on ethernet networks where the MTU is 1500.
1450 might make more sense because that leaves ample space for the IP header, forming a total packet size of less than 1500.
Then again there are arguments for even lower values, 1350 or 1300 to allow multiple levels of encapsulation such as PPPoE, IP, ethernet, etc.
It would also be possible to set the MTU automatically through some sort of initial or ongoing handshake that does secure pings of various packet sizes with the Don't Fragment bit set to determine the optimal MTU for the path (i.e. Secure Path MTU Discovery).
With OpenVPN however, there are some complications to the automatic Path MTU discovery approach:
(1) Static, pre-shared key mode is stateless and handshake-free, so there isn't really an existing context in which PMTU discovery could be implemented.
(2) Path MTU discovery could work in TLS mode, however every time the the MTU changes, the tun or tap device would need to be re-ifconfiged -- this might also involve closing and reopening the tun device which would fail if root privileges have been dropped.
(3) Path MTU discovery in a secure application such as a VPN must itself be secure to protect against DoS attacks, so the standard garden-variety PMTU approaches that depend on return ICMP packets probably won't work securely or reliably.
So at this point a static default is certainly the simpler way to go, but any changes to the static default should be carefully considered since they would introduce backward incompatibility issues.
Comments?
James
Quoted 7 lines · James Yonan
What should the default MTU be?
Right now the default UDP MTU is 1500 if you use --ifconfig, which is probably too high, because as Matthias Andree pointed out, 1500 + IP header size is greater than 1500 and will cause fragmentation on ethernet networks where the MTU is 1500.
Quoted 6 lines
1450 might make more sense because that leaves ample space for the IP header, forming a total packet size of less than 1500.
So at this point a static default is certainly the simpler way to go, but any changes to the static default should be carefully considered since they would introduce backward incompatibility issues.
I'd go for 1300 or so. Even if 1450 works now, you could still encounter more issues later that require another change. I don't think the performance loss will be that great, since all that run TLS now with 1500-ish packetsizes probably already split lots of packets into one large and one tiny packet as it is.
If you are to go for new major version that breaks compat, go for lower defaults on MTU too. You might aswell backport some sort of small logic for the older OpenVPN-track that tries the lower MTU in case it seems like it doesn't work, or a "--compat-v2" setting.
Signature · 11 lines
Jan Johansson ([email protected]...) BioMat System AB Klarabergsgatan 37, III SE-111 21 Stockholm, Sweden Phone: +46-(0)8-233500, Fax: +46-(0)70-3873952 THIS COMMUNICATION IS ONLY INTENDED FOR THE USE OF THE INDIVIDUAL, OR ENTITY, TO WHICH IT IS DIRECTED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. IF RECEIVED IN ERROR: PLEASE NOTIFY US IMMEDIATELY THROUGH [email protected]...
Quoted 15 lines · Jan Johansson
Quoted 7 lines · James Yonan
What should the default MTU be?
Right now the default UDP MTU is 1500 if you use --ifconfig, which is probably too high, because as Matthias Andree pointed out, 1500 + IP header size is greater than 1500 and will cause fragmentation on ethernet networks where the MTU is 1500.
Quoted 6 lines
1450 might make more sense because that leaves ample space for the IP header, forming a total packet size of less than 1500.
So at this point a static default is certainly the simpler way to go, but any changes to the static default should be carefully considered since they would introduce backward incompatibility issues.
Quoted 5 lines
I'd go for 1300 or so. Even if 1450 works now, you could still encounter more issues later that require another change. I don't think the performance loss will be that great, since all that run TLS now with 1500-ish packetsizes probably already split lots of packets into one large and one tiny packet as it is.
I'm inclined to agree that the default MTU should be set conservatively low so it has a high probability of working, even if it is slightly less efficient.
Once somebody has a setup working, they will be in a better position to optimize the MTU to their liking.
Quoted 4 lines
If you are to go for new major version that breaks compat, go for lower defaults on MTU too. You might aswell backport some sort of small logic for the older OpenVPN-track that tries the lower MTU in case it seems like it doesn't work, or a "--compat-v2" setting.
I plan to increment the version number to 1.3.0 due to the default MTU change, though there won't be any other breaks in compatibility, and of course 1.3.0 will be able to talk to previous versions simply by defining MTU size explicitly in the config.
James
Quoted 3 lines · James Yonan
(1) Static, pre-shared key mode is stateless and handshake-free, so there isn't really an existing context in which PMTU discovery could be implemented.
Must the MTU be known to the protocol after all? It might be assymmetric when asymmetric routing (satellite downlink with ISDN uplink) is in place.
Is not it sufficient if your own secure PMTU discovery is done independently for either side? Sorry, I'm still not acquainted with the OpenVPN protocol for lack of time.
Quoted 4 lines
(2) Path MTU discovery could work in TLS mode, however every time the the MTU changes, the tun or tap device would need to be re-ifconfiged -- this might also involve closing and reopening the tun device which would fail if root privileges have been dropped.
If you do it in the application, yes. If you leave it to the kernel, then it's not necessary.
Quoted 3 lines
So at this point a static default is certainly the simpler way to go, but any changes to the static default should be carefully considered since they would introduce backward incompatibility issues.
Signature · 1 line
Matthias Andree