Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01CA8686.F5D86280" Date: Sat, 26 Dec 2009 17:55:52 -0600 Message-ID: <846C5B546E47494CBBD796CA8CA1617EA3BD3B@...1285...> From: "Neulinger, Nathan" Subject: [Openvpn-devel] Inability of openvpn to detect partial failure of UDP link List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: openvpn-devel@...350... This is a multi-part message in MIME format. ------_=_NextPart_001_01CA8686.F5D86280 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable As currently written, openvpn appears to be unable to detect the partial failure (unidirectional) of a UDP based tunnel. Attached is a note I sent to info@...515... about this yesterday, figured I'd mention progress on the devel list as well.=20 Basic summary, assume bridged link from A <-> B, and a unidirectional failure, openvpn configured with keepalives: A ------> B A: sends pings, never gets any traffic or ping packets, constantly restarts/exits B: sends pings (they never actually make it to A), but sees pings from A, thinks everything is fine. I've written some code to implement a ping request/reply facility - however, here's where I'm hitting up against a secondary snag. It looks like in the code right now, there isn't really any way to cleanly request a packet be sent. encrypt_sign() sortof appears to do this, but, with how it (and the other code is implemented), it appears to only permit a SINGLE packet to be generated by ANY of the various tasks spawned off in the event loop.=20 If a second packet is generated in the same pass through the event loop, the packet waiting to be sent by process_io just gets stomped on/overwritten silently. I fully believe that this stomping has the potential to occur during other regular activity as well, but it may just be that it is ordered/timed in a way that it doesn't usually cause any issue. For example, if an OCC reply was sent in the same interval as a ping, the ping is always going to be overwritten, but in that case w/ default code, the ping isn't important since sending the OCC packet will have the same effect. It seems like some sort of combination of: * short circuit the event loop as soon as a single packet is queued * reduce minimum (while no other I/O) event_wait time or - much more invasively, implement ability to queue multiple packets to be sent.=20 Any thoughts on this issue?=20 -- Nathan ------------------------------------------------------------ Nathan Neulinger nneul@...1284... Missouri S&T Information Technology (573) 612-1412 System Administrator - Principal KD0DMH ------_=_NextPart_001_01CA8686.F5D86280 Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: feature idea to solve a local reliability issue, may be of interest to others - are you interested in a patch? Date: Thu, 24 Dec 2009 21:21:07 -0600 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: feature idea to solve a local reliability issue, may be of interest to others - are you interested in a patch? Thread-Index: AcqFEUwKKkADvDyzQzKg3BaZolak1w== From: "Neulinger, Nathan" To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I've got a multi-gigabit openvpn deployment, using UDP based openvpn, set up as a bridge to provide layer 2 connectivity between two sites over a 10 gig routed internet connection.=20 Everything is working great, with one problem. We've had an issue with our intermediate network connection where our provider is randomly filtering/blocking certain UDP flows, sometimes in only one direction, due to an IPS they have installed between our two sites. The problem is that openvpn - when run in UDP mode - effectively has no existing way to detect a unidirectional link. (The underlying problem is being worked on, but the inability to detect it automatically is my current focus.) A ------> B A: sends pings, never gets any traffic or ping packets, constantly restarts/exits B: sends pings (they never actually make it to A), but sees pings from A, thinks everything is fine. What I propose implementing is a small optional extension to the current ping handling code that would request "ping confirmation". The actual implementation of this could be relatively simple - it is after all just an enhanced keepalive.=20 Upon configuration of this mode, openvpn would have the following behavior: 1. Ping send interval and timeout would be changed to be based on ping packets only - not 'any packet' 2. Ping packet itself would be extended to indicate a REQUEST or REPLY. 3. On every ping interval, a ping REQUEST packet would be sent. 4. Upon receipt of any ping REPLY, timer would be reset and packet would be dropped 5. Upon receipt of any ping REQUEST, a ping REPLY will be sent. Obviously, this option would only be usable if both sides enabled it, so a flag for it would be added to the options string consistency check.=20 This could also be implemented as a completely separate option, but I figured it would be most useful to leverage the existing ping/ping-restart/keepalive/etc. option syntax and simply be a flag to request the extra behavior.=20 Is this something you would be interested in including in the code if I send you a patch? I know that in our environment, it will resolve the problem we are seeing with openvpn not being able to detect a unidirectional UDP link.=20 -- Nathan BTW, if you're interested in more info about our deployment, performance, implementation, etc. I'll be happy to get that to you. ------------------------------------------------------------ Nathan Neulinger nneul@...1284... Missouri S&T Information Technology (573) 612-1412 System Administrator - Principal KD0DMH ------_=_NextPart_001_01CA8686.F5D86280--