feature request: get openvpn to use closest server
Hi there
If you have a global network with several openvpn servers, you have a problem with getting clients to connect to the "best" server(*). Typically you'd either rely on users manually choosing the best server (which they can't do well as they don't know the full story), or do something easy like have one DNS name with multiple A records - but the latter would mean users were using the *wrong* server the majority of the time
Some can manage tricks using geoip DNS - but even that doesn't work reliably (eg if a lot of users hardwire Google/OpenDNS DNS servers in their client). Really speaking AnyCast is the only "proper" way of doing it - but that's a "big boy" solution
So I propose openvpn itself could solve this problem - if it had some application layer way of "pinging" all available openvpn servers and choosing the one that responds "best". I'd suggest it only be supported for sites using "tls-auth" but that it doesn't need the full cert check
- that way it's one packet from the client and one return packet from the server. I'd also suggest the server can respond with a "don't use me" message: maybe a new config option "pause-logins /path/filename" so that sysadmins can write their own load tests and create/delete that file when needed. The client could send "openvpn-pings" to each server (when the DNS server name resolves to >1 IP) and try up to 3 times before making a decision. ie packet loss means there needs to be a retry aspect, 3 failures means the server is down/firewalled, but if the server responds with "don't use me" then it's treated as "down" too. Then the client can simply figure out which positive return had the smallest latency and then use that to influence the order in which it tries to log into the servers. ie it doesn't replace the current server connection logic, it just re-sorts it before carrying on as usual
I also think it should be done with some "openvpn-ping" instead of icmp ping because it confirms the server is available on the protocol/port combination, whereas icmp doesn't
Is this something others would find useful? Cisco Anyconnect has this feature, so it's not an original idea.
Thanks for listening
Jason
Note (*): we've run cisco vpnclient for over a decade and what we've discovered is "best" matters. Users who vpn into the closest vpn server get off the unpredictable Internet and onto a more predictable/consistent WAN link - and get the benefits that implies. eg we run VoIP internally and such a realtime application is very latency dependent. People who vpn across continents back to their "home" vpn router complain that VoIP is awful, whereas those that vpn'ed into the corporate site down the road from their hotel, they get much better realtime performance. And if they don't - the company can do something to fix that - whereas we have no ability to improve the performance of random hotels/countries/etc.
Signature · 6 lines
Cheers Jason Haar Corporate Information Security Manager, Trimble Navigation Ltd. Phone: +1 408 481 8171 PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Quoted 11 lines
So I propose openvpn itself could solve this problem - if it had some application layer way of "pinging" all available openvpn servers and choosing the one that responds "best". I'd suggest it only be supported for sites using "tls-auth" but that it doesn't need the full cert check
- that way it's one packet from the client and one return packet from the server. I'd also suggest the server can respond with a "don't use me" message: maybe a new config option "pause-logins /path/filename" so that sysadmins can write their own load tests and create/delete that file when needed. The client could send "openvpn-pings" to each server
Quoted 8 lines
(when the DNS server name resolves to >1 IP) and try up to 3 times before making a decision. ie packet loss means there needs to be a retry aspect, 3 failures means the server is down/firewalled, but if the server responds with "don't use me" then it's treated as "down" too. Then the client can simply figure out which positive return had the smallest latency and then use that to influence the order in which it tries to log into the servers. ie it doesn't replace the current server connection logic, it just re-sorts it before carrying on as usual
Would 3 pings and ping replies adequately measure the overall performance of OpenVPN server even for one particular VPN session? What if there's a temporary congestion somewhere between the "best" server and the client? I think that reliably determining the best server (on average) would require long-term statistics to be any good, but that would only work for clients that don't move around. In a road-warrior scenario what you suggest would work better.
Quoted 4 lines
I also think it should be done with some "openvpn-ping" instead of icmp ping because it confirms the server is available on the protocol/port combination, whereas icmp doesn't
In what kind of scenario would an OpenVPN server not be available, if the server itself still responds to pings?
Best regards,
- --
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc
irc freenode net: mattock
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iEYEARECAAYFAlSGtWEACgkQwp2X7RmNIqOkeACeJb3f5+Rgl/sSVBSi2FRMfTu2 sgUAoJI65DBooIxLd9t4beYeTUChxUm5
=M0FU
-----END PGP SIGNATURE-----
Quoted 7 lines · Samuli Seppänen
Would 3 pings and ping replies adequately measure the overall performance of OpenVPN server even for one particular VPN session? What if there's a temporary congestion somewhere between the "best" server and the client? I think that reliably determining the best server (on average) would require long-term statistics to be any good, but that would only work for clients that don't move around. In a road-warrior scenario what you suggest would work better.
Exactly. Static clients don't need any such feature because obviously it would be worth the manual effort figuring out what server would be best to connect to long-term, but "road warriors" involve end-users and I can tell you from our experience with 6000 employees with Cisco Anyconnect, that they don't think much about it :-) They will 99.9% of the time use the same server that they used last time - and will then complain how poorly it performs
As far as 3 pings not being enough, I'd argue in general it would - as long as you don't have servers geographically "competing" with each other. eg servers on the East and West coast of the USA and same for Europe, plus one in China and one in Asia Pacific would mean every client would "see" a server that is fundamentally closer to it than all the rest - irrespective of temporary congestion. But if you were to (say) start populating the USA with servers all over it, then they would start making that decision point "fuzzy" - but frankly even that's a win because the USA clients would be "mostly happy" using any of them - but would be "mostly unhappy" if they were using China (for example)
...and of course it could be 5 packets instead of 3 - that was just a figure :-)
Quoted 3 lines
In what kind of scenario would an OpenVPN server not be available, if the server itself still responds to pings?
Firewalls. It's not impossible that a client be on a network that blocks all outbound traffic except for tcp port 443 (ie including ping). Running openvpn on tcp port 443 would allow that client to get a tunnel. Basically as no-one can predict what every network firewall in the world has in common, then relying on something outside your own control to test the availability of your product is risky (IMHO). In general icmp-ping works - but I've been involved with companies that disabled it
- so there will be others
Signature · 6 lines
Cheers Jason Haar Corporate Information Security Manager, Trimble Navigation Ltd. Phone: +1 408 481 8171 PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
Hi,
Quoted 5 lines · Samuli Seppänen
Quoted 3 lines
I also think it should be done with some "openvpn-ping" instead of icmp ping because it confirms the server is available on the protocol/port combination, whereas icmp doesn't
In what kind of scenario would an OpenVPN server not be available, if the server itself still responds to pings?
"The server process crashed".
Not that OpenVPN would ever ASSERT() on invalid packets, or crash upon bugs, no. :-)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Quoted 3 lines · Gert Doering
In what kind of scenario would an OpenVPN server not be available, if the server itself still responds to pings?
"The server process crashed".
LOL! It took Gert to spot the most obvious scenario ;-) That really re-enforces what I think about this needing to be an "openvpn ping" type
solution: it is irrelevant if the server is up or even if openvpn tcp ports appear to be open, it's only evidence that openvpn is working that should be taken as evidence that openvpn is - well - working :-)
Signature · 6 lines
Cheers Jason Haar Corporate Information Security Manager, Trimble Navigation Ltd. Phone: +1 408 481 8171 PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
Hi,
Quoted 1 line · Jason Haar
LOL! It took Gert to spot the most obvious scenario ;-)
I'm good at breaking things :-)
Quoted 5 lines
That really
re-enforces what I think about this needing to be an "openvpn ping" type
solution: it is irrelevant if the server is up or even if openvpn tcp ports appear to be open, it's only evidence that openvpn is working that should be taken as evidence that openvpn is - well - working :-)
Indeed.
I think what you're proposing is quite a cool feature, but it is not easy to implement.
The "ping" could actually be fairly easy, though it might need protocol changes (to permit a quick health check - for tls-auth authorized clients - without a full TLS negotiation taking place).
More work is the connection loop on the client side - right now, OpenVPN walks the list of "remotes" sequentially, and if one fails, tries the next one. This would need to be changed to try them "all at once", at least for the "ping" check, and then decide on a connection order for the real connection...
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...