Skip to contentSkip to conversation

400 vpn clients 20% of them loosing the route frequently

Openvpn-devel Marcelo Toledo 2 participants 5 messages Sep 27, 2005 – Oct 6, 2005

lore
Share & tools
lore
#0 lore raw

I have one OpenVPN server version 2.0.2 using TCP port 1194 with TLS with about 400 clients connected to it. From time to time it's impossible to ping the client from the server, but if you log into the client and ping the server, the server now became able to ping the client. I made a lot of tests removing the bridge and trying a older versions of openvpn and the problem still hapenning with about 20% of the clients connected to the vpn.

here is the config of the client and server:

# SERVER CONFIG
mode server
port 1194
proto tcp-server
dev tap
tls-server
ca keys/ca.crt
cert keys/sauron.crt
key keys/sauron.key
dh keys/dh1024.pem
#tls-auth keys/ta.key 0
#ifconfig 10.100.0.2 255.255.0.0
#ifconfig-pool 10.100.99.50 10.100.99.100 255.255.0.0 server-bridge 10.100.0.10 255.255.0.0 10.100.99.100 10.100.255.254 push "dhcp-option DNS 200.160.255.85"
push "dhcp-option DNS 200.160.255.84"
push "ping 10"
push "ping-restart 60"
client-config-dir config
client-to-client
keepalive 10 120
comp-lzo
max-clients 1024
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 2
##########

# CLIENT CONFIG
client
tls-client
dev tap
proto tcp-client
#remote-random
remote 200.160.255.100
#remote vpn1.vexbr.com.br
#remote vpn2.vexbr.com.br
rport 1194
lport 9000
resolv-retry infinite
persist-key
persist-tun
mute-replay-warnings
float
ping 10
ping-restart 60
comp-lzo
verb 4
ca keys/ca.crt
up ./vexbr.up
cert keys/escritorio-claro.crt
key keys/escritorio-claro.key
#############

Signature · 1 line
Marcelo Toledo <[email protected]...>
#1 lore raw
Quoted 8 lines · Marcelo Toledo

I have one OpenVPN server version 2.0.2 using TCP port 1194 with TLS with about 400 clients connected to it. From time to time it's impossible to ping the client from the server, but if you log into the client and ping the server, the server now became able to ping the client. I made a lot of tests removing the bridge and trying a older versions of openvpn and the problem still hapenning with about 20% of the clients connected to the vpn.

Quoted 7 lines

here is the config of the client and server:

# SERVER CONFIG
mode server
port 1194
proto tcp-server
dev tap

[snip]

Observations:
1. 400 clients... 1 server only?
2. TAP means additional overhead full ethernet packet encapsulated in TCP/IP packet. Broadcasts, fragmented ethernet datagrams and for 400 clients....
3. TCP over TCP is not recommended. The internal congestion control can conflict with the external congestion control.
4. What is your full bandwidth and usable bandwidth at the server?

Troubleshooting:
Do packet captures on the real interfaces that the VPN tunnel is using (there the TCP 1194 traffic is), the TAP interfaces. Look for TCP issues.

Recommendations:
1. switch to UDP
2. switch to TUN even if this requires additional configuration. to rely on broadcasts over a VPN is problematic.
3. Bandwidth may be a major bottleneck. suggestions 1 & 2 will help, but it may not be enough.
4. Server look for bottlenecks, may require upgrade(s). Removing one bottleneck may reveal the next bottleneck...

--
Leonard Isham, CISSP
Ostendo non ostento.

#2 lore raw

Em Ter, 2005-09-27 às 21:58 -0400, Leonard Isham escreveu:

Quoted 16 lines · Marcelo Toledo
Quoted 8 lines

I have one OpenVPN server version 2.0.2 using TCP port 1194 with TLS with about 400 clients connected to it. From time to time it's impossible to ping the client from the server, but if you log into the client and ping the server, the server now became able to ping the client. I made a lot of tests removing the bridge and trying a older versions of openvpn and the problem still hapenning with about 20% of the clients connected to the vpn.

Quoted 7 lines

here is the config of the client and server:

# SERVER CONFIG
mode server
port 1194
proto tcp-server
dev tap

Quoted 4 lines

[snip]

Observations:
1. 400 clients... 1 server only?

Yes, 400 clients and only 1 server.

Quoted 3 lines

2. TAP means additional overhead full ethernet packet encapsulated in TCP/IP packet. Broadcasts, fragmented ethernet datagrams and for 400 clients....

We don't use TUN because from what I know it opens one connection per port and also one configuration per client, which is insane for a 400 clients and growing (we're going to reach 600 by the end of this year).

Quoted 2 lines

3. TCP over TCP is not recommended. The internal congestion control can conflict with the external congestion control.

We already used OpenVPN with UDP, but the oscillations were much higher then today, that's why we migrated to TCP.

Quoted 1 line

4. What is your full bandwidth and usable bandwidth at the server?

We have 3MB and we're using half of it (1.5).

what do you think?

Signature · 1 line
Marcelo Toledo <[email protected]...>
#3 lore raw
Quoted 17 lines · Marcelo Toledo

Em Ter, 2005-09-27 às 21:58 -0400, Leonard Isham escreveu:

Quoted 16 lines · Marcelo Toledo
Quoted 15 lines

I have one OpenVPN server version 2.0.2 using TCP port 1194 with TLS with about 400 clients connected to it. From time to time it's impossible to ping the client from the server, but if you log into the client and ping the server, the server now became able to ping the client. I made a lot of tests removing the bridge and trying a older versions of openvpn and the problem still hapenning with about 20% of the clients connected to the vpn.

here is the config of the client and server:

# SERVER CONFIG
mode server
port 1194
proto tcp-server
dev tap

Quoted 6 lines
Quoted 4 lines

[snip]

Observations:
1. 400 clients... 1 server only?

Yes, 400 clients and only 1 server.

What are the stats on the server? Are there any resource issues? CPU, TCP. etc.

Quoted 7 lines
Quoted 3 lines

2. TAP means additional overhead full ethernet packet encapsulated in TCP/IP packet. Broadcasts, fragmented ethernet datagrams and for 400 clients....

We don't use TUN because from what I know it opens one connection per port and also one configuration per client, which is insane for a 400 clients and growing (we're going to reach 600 by the end of this year).

OpenVPN 1.X was one port per connection TUN or TAP. OpenVPN 2.x supports the old setup, but was designed with a server mode for _both_ TUN and TAP. You can either dynamically hand out IP addresses or statically with either method.

Quoted 5 lines
Quoted 2 lines

3. TCP over TCP is not recommended. The internal congestion control can conflict with the external congestion control.

We already used OpenVPN with UDP, but the oscillations were much higher then today, that's why we migrated to TCP.

This indicates that you are experiencing connectivity issues, outside of the tunnel. UDP is connection less, and OpenVPN will not retransmit. Broadcasts or connectionless and usually have no retransmission capacity. TCP is is connection oriented and will resend packets, even the broadcast packets as they are just payload to TCP. Connectivity problems can still cause TCP failures. To many failures and reconnection attempts will use up TCP sockets, an unintentional self inflicted DOS.

Quoted 3 lines
Quoted 1 line

4. What is your full bandwidth and usable bandwidth at the server?

We have 3MB and we're using half of it (1.5).

What is the bandwidth at the client sites?

Quoted 1 line

what do you think?

Are these site-to-site or road warriors? Are the 20% always the same or random? Do the 20% have anything in common. Ant NAT devices or firewalls in between that may be having periodic resource issues?

Have you considered setting up cacti or other system to monitor resources and provide graphs?

Consider setting up a second server or OpenVPN instance and use TUN with UDP and migrate.

Do you have any packet captures of the traffic out the TAP interface on the server and client that experiences the failures?

I don't know your workload or any other details, but what about another person to take some of your workload so you can concentrate on this issue. Or a second set of eyes to work on this issue with you (I would look for someone with at least as much networking experience as you have).

--
Leonard Isham, CISSP
Ostendo non ostento.

#4 lore raw
Quoted 2 lines

What are the stats on the server? Are there any resource issues? CPU, TCP. etc.

Nope, everything ok.

Quoted 4 lines

OpenVPN 1.X was one port per connection TUN or TAP. OpenVPN 2.x supports the old setup, but was designed with a server mode for _both_ TUN and TAP. You can either dynamically hand out IP addresses or statically with either method.

Good to hear it, we already performed tests with one server and 3 clients, looked ok. Now we're going to install the major server and installing upgrading the clients slowly to see how it goes.

Quoted 3 lines

Are these site-to-site or road warriors? Are the 20% always the same or random? Do the 20% have anything in common. Ant NAT devices or firewalls in between that may be having periodic resource issues?

it is site-to-site. And the 20% are not always the same, they vary a lot. We have firewall but it's not causing the issue.

Quoted 2 lines

Have you considered setting up cacti or other system to monitor resources and provide graphs?

Not yet... suggestions?

Quoted 2 lines

Consider setting up a second server or OpenVPN instance and use TUN with UDP and migrate.

Did it.

Quoted 2 lines

Do you have any packet captures of the traffic out the TAP interface on the server and client that experiences the failures?

Nope.

Quoted 5 lines

I don't know your workload or any other details, but what about another person to take some of your workload so you can concentrate on this issue. Or a second set of eyes to work on this issue with you (I would look for someone with at least as much networking experience as you have).

That would be great, actualy I am not looking too much into this, I am just interacting with someone who is actualy doing this, but looks like what you told me will work fine, I will let you know after we have more clients connected.

once again, thanks a lot for your time,

Signature · 1 line
Marcelo Toledo <[email protected]...>