New beta available + progress update
A message that is not in the archive (sent off-list or not yet received): [email protected]...
Quoted 10 lines · Matthias Andree
Quoted 9 lines
What the
FRAGMENT_ENABLEcode does is to add an extra 4 byte header to each datagram that includes, among other things, feedback on the number of datagrams received as well as the maximum datagram size received. This information can then be used by an OpenVPN peer to dynamically set the MTU size as well as the datagram transmit rate independently of the OS and the proper functioning of path MTU discovery. Ultimately this code can make OpenVPN more robust in situations where fragmentation is necessary (such as in TAP-based bridged ethernets) when firewalls or routers in the path break PMTU discovery.
Quoted 3 lines
How about compatibility? Does this need a
FRAGMENT_ENABLEdOpenVPN on either side of the tunnel or will OpenVPN negotiate the fragment capability dynamically as well?
Negotiation of the fragment capability is similar to how other parameters are negotiated, such as cipher algorithm, lzo compression, etc. The option (--mtu-dynamic) must be used on both ends of the connection. In SSL mode, both peers will complain if --mtu-dynamic is used on one end but not the other. In non-SSL mode, there is no negotiation, so each peer assumes that the other is using compatible options.
Quoted 2 lines
Does this
FRAGMENT_ENABLErely on SSL or
will it work with preshared keys?
No, it doesn't rely on SSL or pre-shared keys. It can work even on plaintext tunnels.
I think the major issue still to be worked out is how to make it efficient. While I've written a simple heuristic (see fragment_adjust_mtu_bandwidth() in fragment.c) that is a starting point for determining MTU and transmit throttle levels based on feedback from the peer, I'm finding a big performance dropoff once the fragmenting code kicks in. A big reason for this is packet loss, that can be seen if you run ftp over the tunnel. When there is a one-to-one correspondence between TUN/TAP packets and UDP datagrams (as there is in non-FRAGMENT_ENABLE openvpn), then the TCP level does the heavy lifting in terms of pushing packets at the optimal rate to avoid packet loss. Once openvpn starts doing its own fragmenting, then it also needs to take explicit control over the transmit rate (as it can now do statically with --shaper).
A better alternative (orginally suggested by you) is to avoid fragmenting in the first place by bouncing back ICMP_DEST_UNREACH/ICMP_FRAG_NEEDED to the TUN device. This won't work on TAP devices because the ethernet MTU is fixed at 1500.
Unfortunately (or fortunately depending on your perspective), my network connections are not broken enough to benefit from the FRAGMENT_ENABLE stuff just yet, so I can't really test it properly.
James
Quoted 7 lines · James Yonan
A better alternative (orginally suggested by you) is to avoid fragmenting in the first place by bouncing back ICMP_DEST_UNREACH/ICMP_FRAG_NEEDED to the TUN device. This won't work on TAP devices because the ethernet MTU is fixed at 1500.
Unfortunately (or fortunately depending on your perspective), my network connections are not broken enough to benefit from the
FRAGMENT_ENABLEstuff just yet, so I can't really test it properly.
Well, the peer that was behind an overloaded 1 Mbps 2 km radio link has now moved and has become a V.34+ modem link (33k6 bps), with corresponding effects on the MTU. I wonder if running a local pppd pair with properly MTU can be used to figure if fragmentation works, but there's yet have to be someone who drops individual fragments (unless gremlin mode does it already) for real testing.
OTOH, fragmenting links also have a natural impact on the packet loss:
if you assume 10% packet loss on the transport layer (that transports the fragment), and you fragment a TAP packet of 1500+ bytes into 3 of approx 500 bytes (say, MTU=552), the effective packet loss for TCP or something is much higher: it takes losing a single fragment to retransmit, so the effective packet loss will come out as 27% (not taking burst loss into account).
I also have another patch to fix prototype warnings:
thread.h +4 -4
@@ -118,17 +118,17 @@#define MUTEX_UNLOCK (lock)static inline void -thread_init () +thread_init (void ) { }static inline void -thread_cleanup () +thread_cleanup (void ) { }static inline int -thread_number () +thread_number (void ) {return 0 ; }
@@ -139,7 +139,7 @@ }static inline void -work_thread_join () +work_thread_join (void ) { }
Signature · 1 line
Matthias Andree
Quoted 5 lines · Matthias Andree
Quoted 3 lines · James Yonan
A better alternative (orginally suggested by you) is to avoid fragmenting in the first place by bouncing back ICMP_DEST_UNREACH/ICMP_FRAG_NEEDED to the TUN device. This won't work on TAP devices because the ethernet MTU is fixed
at 1500.
Quoted 11 lines
Quoted 4 lines
Unfortunately (or fortunately depending on your perspective), my network connections are not broken enough to benefit from the
FRAGMENT_ENABLEstuff just yet, so I can't really test it properly.Well, the peer that was behind an overloaded 1 Mbps 2 km radio link has now moved and has become a V.34+ modem link (33k6 bps), with corresponding effects on the MTU. I wonder if running a local pppd pair with properly MTU can be used to figure if fragmentation works, but there's yet have to be someone who drops individual fragments (unless gremlin mode does it already) for real testing.
Gremlin tests that the dynamic MTU/bandwidth algorithm can survive, but doesn't really help when it comes to tuning the algorithm for optimality in real-world conditions.
The nice part about a radio link is that it is probably under your control, meaning that you can ensure that ICMPs get properly passed. This allows path MTU discovery to work and therefore solves a lot of the harder problems.
In this case, the FRAGMENT_ENABLE code would take the Path MTU hint from the OS rather than trying to figure it out empirically by trial-and-error. The current FRAGMENT_ENABLE code knows how to get the PMTU from Linux, but still needs code for other OSes.
Quoted 7 lines
OTOH, fragmenting links also have a natural impact on the packet loss:
if you assume 10% packet loss on the transport layer (that transports the fragment), and you fragment a TAP packet of 1500+ bytes into 3 of approx 500 bytes (say, MTU=552), the effective packet loss for TCP or something is much higher: it takes losing a single fragment to retransmit, so the effective packet loss will come out as 27% (not taking burst loss into account).
Good point.
Quoted 1 line
I also have another patch to fix prototype warnings:
Merged.
James
Quoted 48 lines
diff -u
thread.hthread.hthread.h +4
-4@@ -118,17 +118,17 @@#define MUTEX_UNLOCK (lock)static inline void -thread_init () +thread_init (void ) { }static inline void -thread_cleanup () +thread_cleanup (void ) { }static inline int -thread_number () +thread_number (void ) {return 0 ; }@@ -139,7 +139,7 @@ }static inline void -work_thread_join () +work_thread_join (void ) { }Signature · 12 lines
-- Matthias Andree ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Quoted 3 lines · James Yonan
The nice part about a radio link is that it is probably under your control, meaning that you can ensure that ICMPs get properly passed. This allows path MTU discovery to work and therefore solves a lot of the harder problems.
Well, at least for the bits that crossed a Linux 2.2 masquerade router...
Quoted 4 lines
In this case, the
FRAGMENT_ENABLEcode would take the Path MTU hint from the OS rather than trying to figure it out empirically by trial-and-error. The currentFRAGMENT_ENABLEcode knows how to get the PMTU from Linux, but still needs code for other OSes.
For FreeBSD, apparently the routing table has to be queried for the MTU -- unless someone comes up with better information. NetBSD has an IP_RETURNMTU ioctl, I'm unsure about other systems. Seems to be non-standard :-/