OpenVPN 2.0-test26 released
Ooops... let's try that again with the correct subject line.
A new release of the 2.0 beta is available.
* One of the goals of OpenVPN 2.0 is extreme scalability, i.e. robustly handling connections from potentially thousands of clients. To do this, some kind of load balancing and failover capability is needed, because a single OpenVPN daemon running on a single processor may not be able to handle this kind of load. One solution is to set up a cluster of near-identically configured OpenVPN daemons on separate machines, or multiple daemons on a multiprocessor machine, or both. Each daemon is running with --mode server and can handle multiple clients.
The feature that makes this now possible is that --remote has been extended to allow a list of remote servers and port numbers to be specified on the client such as:
remote server1 5000
remote server1 5001
remote server2 5000
remote server2 5001
By default the OpenVPN client will try each host/port in the order specified.
If the connection fails (such as triggered by --ping/--ping-restart) the
client will move to the next host in the list. The client can also initially randomize the list using the new --remote-random flag, to provide a basic load-balancing capability.
The servers are configured almost identically, though each has its own port number and --ifconfig-pool IP address range.
* Harald Roelle has observed some limitations in the current Linux 2.4 and 2.6 tun/tap driver. Specifically, the TX queue size is set to 10 by default, which is too small. There is also a problem with "kicking" where a packet in the driver may get stuck there and need another packet to come through to "kick" it out. This may account for the "no buffer space available" message that some Linux users report. To work around this problem, OpenVPN has added a --txqueuelen option to raise the queue length to a more sane size, and now defaults to 100. Right now, this is a Linux-only option. I've also added --rcvbuf and --sndbuf to control the TCP/UDP socket buffer sizes. Harald Roelle and Max Krasnyansky have put together some patches which fix the Linux tun/tap driver issues, and should (hopefully) be in the pipeline shortly for inclusion in the mainline 2.4 and 2.6 branches. For now, --txqueuelen will provide a workaround.
At this point I would say that nearly all of the key features which have been envisaged for 2.0 are in place with a few exceptions:
* TCP Support in the multi-client server -- The only way that I can see of scalably adding TCP support (without using multiple threads or processes) is to use an efficient multi-socket API such as epoll() which is available on Linux 2.6 and also apparently on 2.4 via a kernel patch.
* Forking server support -- The 2.0 multi-client server model is designed for people who want a potentially large number of clients to tunnel through a single tun or tap interface using a single daemon process. Some people however might prefer the forking server model, where the server automatically forks off a new process for each incoming client, dynamically allocating a private tun/tap interface for that client.
* Multithreading support -- multithreading offers two key advantages: (1) it reduces the worst-case latency of packets flowing through the tunnel and (2) it offers the opportunity for a single daemon to utilize all the processors on an multiprocessor machine. Unfortunately, multithreading causes a lot of problems including complexifying the source code and introducing race-condition bugs which can be extremely difficult to reproduce or track down. My thinking at this point is that implementing multithreading may not be worth the trouble, especially given the fact that the new load balancing feature can allow multiple OpenVPN daemons running on multiple machines to serve the same client pool.
* Compatibility with 1.x -- OpenVPN 2.0 tries as much as possible to be upwardly compatible with 1.x. The main difference is that 2.0 changes some parameter defaults. The tun/tap MTU has been raised to 1500, --mssfix 1450 is now the default, and --key-method now defaults to 2. The only feature which has been removed is the special-purpose SSL/TLS thread feature which is enabled on 1.x if you build OpenVPN with the --enable-pthread flag. I might put it back if people complain, but overall I'm not sure that it's worth the trouble.
Change Log:
2004.04.28 -- Version 2.0-test26
* Optimized broadcast path in multi-client mode.
* Added socket buffer size options --rcvbuf & --sndbuf.
* Configure Linux tun/tap driver to use a more sensible txqueuelen default. Also allow explicit setting via --txqueuelen option (Harald Roelle).
* The --remote option now allows the port number to be specified as the second parameter. If unspecified, the port number defaults to the --rport value.
* Multiple --remote options on the client can now be specified for load balancing and failover. The --remote-random flag can be used to initially randomize the --remote list for basic load balancing.
* If a remote DNS name resolves to multiple DNS addresses, one will be chosen by random as a kind of basic load-balancing feature if --remote-random is used.
* Added --connect-freq option to control maximum new connection frequency in multi-client mode.
* In multi-client mode, all syslog messages associated with a specific client now include a client-ID prefix.
* For Windows, use a gettimeofday() function based on QueryPerformanceCounter (Derek Burdick).
* Fixed bug in interaction between --key-method 2 and DES ciphers, where dynamic keys would be generated with bad parity and then be rejected.
Download:
[Openvpn-devel] Re: openvpn-d] OpenVPN 2.0-test26 released
Quoted 8 lines · James Yonan
* Compatibility with 1.x -- OpenVPN 2.0 tries as much as possible to be upwardly compatible with 1.x. The main difference is that 2.0 changes some parameter defaults. The tun/tap MTU has been raised to 1500, --mssfix 1450 is now the default, and --key-method now defaults to 2. The only feature which has been removed is the special-purpose SSL/TLS thread feature which is enabled on 1.x if you build OpenVPN with the --enable-pthread flag. I might put it back if people complain, but overall I'm not sure that it's worth the trouble.
Compatability, to me says 'Configuration files' and setup approach. Is Interoperability back with earlier clients also a design goal/feature present? That is, for testing, will I need to set a test bench with two hosts, running the 2.x code, or can I just temporarily repoint a 1.x client at a 2.x host by altering the 'remove (servername)' field at the client?
- Russ Herrold
[Openvpn-devel] Re: openvpn-d] OpenVPN 2.0-test26 released
Quoted 11 lines · R P Herrold
Quoted 8 lines · James Yonan
* Compatibility with 1.x -- OpenVPN 2.0 tries as much as possible to be upwardly compatible with 1.x. The main difference is that 2.0 changes some parameter defaults. The tun/tap MTU has been raised to 1500, --mssfix 1450 is now the default, and --key-method now defaults to 2. The only feature which has been removed is the special-purpose SSL/TLS thread feature which is enabled on 1.x if you build OpenVPN with the --enable-pthread flag. I might put it back if people complain, but overall I'm not sure that it's worth the trouble.
Quoted 3 lines
Compatability, to me says 'Configuration files' and setup approach. Is Interoperability back with earlier clients also a design goal/feature present?
Yes, absolutely. There's no problem with 1.x clients/servers talking with 2.0 clients/servers. There has been no change in the protocol, other than an extension to the 2.0 protocol for --push/-pull. If you want to use --push/-pull, you will need 2.0 running on both sides of the connection.
The major difference is that some default parameters have changed, e.g. if you are using TLS mode, 1.x uses --key-method 1 by default and 2.0 uses --key-method 2. So if you want 1.5+ and 2.0 to talk to each other in TLS, then explicitly set --key-method so that both sides of the connection are consistent (before 1.5, OpenVPN is hardcoded to use --key-method 1). The other default that was changed is --tun-mtu. It's now 1500.
Quoted 4 lines
That is, for testing, will I
need to set a test bench with two hosts, running the 2.x code, or can I just temporarily repoint a 1.x client at a 2.x host by altering the 'remove (servername)' field at the client?
You should be able to do that. To bring a 1.5 or 1.6 host in line with 2.0 defaults, use:
--key-method 2 (if TLS)
--tun-mtu 1500
--mssfix 1450
James
Quoted 13 lines · James MacLean
Quoted 1 line · James Yonan
A new release of the 2.0 beta is available.
Hi James,
We have started to look at how we can make use of the single daemon mode of OpenVPN, but after playing with options and doing some searching we thought it best to post and get direct answers to 2 things that are stopping us from using this in place of the 1 process per link for connecting many sites together. We realize the push was more for roaming users, but it apears it might work in our scenario too.
Quoted 5 lines
1. Is there any way, or may we add to the wish list, the ability to route a subnet through Openvpn (inside the internal router). As we understand it now it will only accept IPs, yet we are trying to use it to connect remote subnets together as we do now with the single daemon method. They are /16 subnets.
Yes, it is possible now, using the --iroute option. When a client connects to the server, the server can have a client-specific configuration, either a file in the --client-config-dir directory or dynamically generated by a --client-connect script. The --iroute option tells OpenVPN to internally route packets in an IP range to a particular client as identified by that client's common-name. You should also preemptively set up those routes so that the kernel will route them to OpenVPN when the daemon actually starts up, before the client has connected.
Note that --iroute currently has one weakness, and that is that it only accepts IP ranges (i.e. start-IP and end-IP) rather than a real subnet-based routing table, and cannot accept really large ranges without consuming a lot of hash-table space. If it was /24 or even /22 subnets it would be no problem, but /16 will require raising a constant in the source, and you will need a larger hash table.
Quoted 3 lines
2. We can not find how to bring up routes when clients connect. Or be able to run a client-up script that would be allowed to add routes (to the remote subnets).
On the server, use --push "route x.x.x.x" to push a route from server to client (this directive can be in the master config file or in a client-specific config file depending on whether you want it pushed to all clients or only certain clients).
To add a route on the server when a client connects, use --route and --iroute. Think of --route as routing the traffic from the kernel to OpenVPN and --iroute routing from OpenVPN to the actual client. When routing from the kernel to OpenVPN always use the remote --ifconfig endpoint as the destination.
James
Quoted 1 line · James Yonan
A new release of the 2.0 beta is available.
Hi James,
We have started to look at how we can make use of the single daemon mode of OpenVPN, but after playing with options and doing some searching we thought it best to post and get direct answers to 2 things that are stopping us from using this in place of the 1 process per link for connecting many sites together. We realize the push was more for roaming users, but it apears it might work in our scenario too.
1. Is there any way, or may we add to the wish list, the ability to route a subnet through Openvpn (inside the internal router). As we understand it now it will only accept IPs, yet we are trying to use it to connect remote subnets together as we do now with the single daemon method. They are /16 subnets.
2. We can not find how to bring up routes when clients connect. Or be able to run a client-up script that would be allowed to add routes (to the remote subnets).
JES
Signature · 3 lines
James B. MacLean [email protected]... Department of Education Nova Scotia, Canada
Quoted 3 lines · James Yonan
Ooops... let's try that again with the correct subject line.
A new release of the 2.0 beta is available.
This prompted me to pull from CVS, I figured I need this patch on Linux when compiling with GCC 3.4 with strict error checking enabled:
Index: syshead.h
===================================================================
RCS file: /cvsroot/openvpn/openvpn/syshead.h,v
retrieving revision 1.25.2.6
syshead.h +2 -0
@@ -26,6 +26,8 @@#ifndef SYSHEAD_H #define SYSHEAD_H +#define _BSD_SOURCE +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif
Matthias,
You didn't bracket it with #ifdef TARGET_LINUX -- does that mean it's appropriate on all platforms?
What about this (from the glibc manual): "If your program defines _BSD_SOURCE, you must give the option `-lbsd-compat' to the compiler or linker when linking the program, to tell it to find functions in this special compatibility library before looking for them in the normal C library."
James
Quoted 39 lines · Matthias Andree
Quoted 3 lines · James Yonan
Ooops... let's try that again with the correct subject line.
A new release of the 2.0 beta is available.
This prompted me to pull from CVS, I figured I need this patch on Linux when compiling with GCC 3.4 with strict error checking enabled:
Index:
syshead.h
===================================================================
RCS file: /cvsroot/openvpn/openvpn/syshead.h,v
retrieving revision 1.25.2.6
diff -u -r1.25.2.6syshead.hsyshead.h +2
-1@@ -26,6 +26,8 @@#ifndef SYSHEAD_H #define SYSHEAD_H +#define _BSD_SOURCE +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -------------------------------------------------------This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Quoted 7 lines · James Yonan
You didn't bracket it with #ifdef
TARGET_LINUX-- does that mean it's appropriate on all platforms?What about this (from the glibc manual): "If your program defines
_BSD_SOURCE, you must give the option `-lbsd-compat' to the compiler or linker when linking the program, to tell it to find functions in this special compatibility library before looking for them in the normal C library."
Ouch, that one hurt, so _BSD_SOURCE doesn't look right.
I see this deserves revision and explanation - and maybe no code change at all.
I came across this compiling with -std=c99 and -pedantic in CFLAGS:
../tun.c: In function `open_tun':../tun.c:836: error: storage size of 'ifr' isn't known ../tun.c:902: error: `IFNAMSIZ' undeclared (first use in this function) ../tun.c:902: error: (Each undeclared identifier is reported only once ../tun.c:902: error: for each function it appears in.) ../tun.c:921: error: storage size of 'netifr' isn't known make[1]: *** [tun.o] Error 1
make: *** [all] Error 2
These compiler flags (and similar except the -std=gnuXX) prevent the definition of __USE_MISC in <features.h>, hence IFNAMSIZ and struct ifr aren't defined. gcc -std=gnu99 is fine.
/One/ way to define these symbol and struct them is to use _BSD_SOURCE, but I wasn't aware of the glibc "override POSIX with BSD, require -lbsd-compat" behaviour, so it make more sense to use _GNU_SOURCE (or _SVID_SOURCE) instead.
HTH,
Signature · 3 lines
Matthias Andree Encrypted mail welcome: my GnuPG key ID is 0x052E7D95