Hello! 😃
So, problem (almost) solved, here we go:
Server config:
local <server_ip_address_1>
proto udp
port 1194
dev bond-server1
dev-type tun
fragment 1420
mssfix
txqueuelen 1000
keepalive 10 30
persist-tun
persist-key
script-security 2
log-append openvpn.log
nice -20
fast-io
verb 4
status status.log 300
comp-lzo adaptive
comp-noadapt
auth none
cipher BF-CBC
replay-window 256 60
tls-server
ca ca.crt
dh dh4096.pem
cert server-1.crt
key server-1.key
key-method 2
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA
reneg-sec 900
tran-window 900
tls-auth ta.key 0
local <server_ip_address_2>
proto udp
port 1194
dev bond-server2
dev-type tun
fragment 1420
mssfix
txqueuelen 1000
keepalive 10 30
persist-tun
persist-key
script-security 2
log-append openvpn.log
nice -20
fast-io
verb 4
status status.log 300
comp-lzo adaptive
comp-noadapt
auth none
cipher BF-CBC
replay-window 256 60
tls-server
ca ca.crt
dh dh4096.pem
cert server-2.crt
key server-2.key
key-method 2
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA
reneg-sec 900
tran-window 900
tls-auth ta.key 0
# auto bond0
iface bond0 inet static
pre-up /sbin/modprobe bonding
pre-up /usr/sbin/openvpn --mktun --dev-type tun --dev bond-server1
pre-up /usr/sbin/openvpn --mktun --dev-type tun --dev bond-server2
post-up /etc/init.d/openvpn start bond-server1 bond-server2
pre-down /etc/init.d/openvpn stop bond-server1 bond-server2
post-down /bin/sleep 5
post-down /usr/sbin/openvpn --rmtun --dev-type tun --dev bond-server1
post-down /usr/sbin/openvpn --rmtun --dev-type tun --dev bond-server2
post-down /sbin/rmmod bonding
bond_mode balance-xor
bond_xmit_hash_policy layer3+4
slaves bond-server1 bond-server2
address 10.10.10.2
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255
Client config:
remote <server_ip_address_1> 1194
proto udp
nobind
dev bond-client1
dev-type tun
fragment 1420
mssfix
txqueuelen 1000
keepalive 10 30
persist-tun
persist-key
script-security 2
log-append openvpn.log
nice -20
fast-io
verb 4
status status.log 300
comp-lzo adaptive
comp-noadapt
client
auth none
cipher BF-CBC
replay-window 256 60
tls-client
ca ca.crt
cert client-1.crt
key client-1.key
key-method 2
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA
reneg-sec 900
tran-window 900
tls-auth ta.key 1
ns-cert-type server
remote <server_ip_address_2> 1194
proto udp
nobind
dev bond-client2
dev-type tun
fragment 1420
mssfix
txqueuelen 1000
keepalive 10 30
persist-tun
persist-key
script-security 2
log-append openvpn.log
nice -20
fast-io
verb 4
status status.log 300
comp-lzo adaptive
comp-noadapt
client
auth none
cipher BF-CBC
replay-window 256 60
tls-client
ca ca.crt
cert client-2.crt
key client-2.key
key-method 2
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA
reneg-sec 900
tran-window 900
tls-auth ta.key 1
ns-cert-type server
# auto bond0
iface bond0 inet static
pre-up /sbin/modprobe bonding
pre-up /usr/sbin/openvpn --mktun --dev-type tun --dev bond-client1
pre-up /usr/sbin/openvpn --mktun --dev-type tun --dev bond-client2
post-up /etc/init.d/openvpn start bond-client1 bond-client2
pre-down /etc/init.d/openvpn stop bond-client1 bond-client2
post-down /bin/sleep 5
post-down /usr/sbin/openvpn --rmtun --dev-type tun --dev bond-client1
post-down /usr/sbin/openvpn --rmtun --dev-type tun --dev bond-client2
post-down /sbin/rmmod bonding
bond_mode balance-xor
bond_xmit_hash_policy layer3+4
slaves bond-client1 bond-client2
address 10.10.10.1
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255
Notes:
- Bonding "mode" is set to "balance-xor" instead of "balance-rr": higher throughput with multiple connexions (no packet reordering)
- "xmit_hash_policy" is set to "layer3+4": TUN interface has no MAC address so balancing is done on upper level (source/dest IP + source/dest port)
- OpenVPN auth is disabled : less overhead, higher throughput
- OpenVPN cipher is set to "BF-CBC": AES-256-CBC consume too much CPU on client side (Atom CPU)
- Compression is always enabled (noadapt): higher upload speed when serving HTML/CSS/JS files
Tested (and approved) with an Atom (1.8 Ghz - client) and a Core I5 (3.3 Ghz - server).
Max download speed : 28 Mbit/s (I would expect 35 Mbit/s...)
Max upload speed : 1.8 Mbit/s (almost twice, this is good)
The main problem is the latency introduced: as far I know, throughput is highly dependent on latency so I think this is why I do not get a better download speed (I did not "play" with TCP windows size).
Just a question: is there an option or a way to tell OpenVPN to "group" multiple small packets inside a big one?
When downloading a file, there are many TCP ACK packets (40 bytes) sent.
But, problem is that with a PPPOE connexion, the overhead is huge : 40 bytes (IP) => 106 bytes (ATM, two cells).
If multiple ACK packets could be "encaspsulated" inside a "big" packet (MTU size), this would be much better.
Cheers!