--shaper and --server together

This is where we can discuss what we would like to see added or changed in OpenVPN.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
jbennett
OpenVpn Newbie
Posts: 2
Joined: Fri Feb 25, 2011 4:22 am

--shaper and --server together

Post by jbennett » Fri Feb 25, 2011 4:35 am

There are many uses in which a openvpn server needs to be able to limit outgoing bandwidth. The most common is a server on an asynchronous internet connection (DSL/cable) When the --server flag is set, the --shaper option cannot be set. It would be nice if the --shaper option could be set even when acting as a server.

Thanks,
Jonathan Bennett

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: --shaper and --server together

Post by janjust » Fri Feb 25, 2011 10:38 am

There is a good reason why --shaper is not supported on the server end.
How should --shaper work on the server? Set this limit for each connection? Or for all connections as a whole?

If you want to throttle the download speed of the clients you're better off to use something like 'tc' on Linux. Other solutions exist for other platforms.

User avatar
ecrist
Forum Team
Posts: 237
Joined: Wed Nov 26, 2008 10:33 pm
Location: Northern Minnesota, USA
Contact:

Re: --shaper and --server together

Post by ecrist » Fri Feb 25, 2011 1:38 pm

On FreeBSD, pf with ALTQ is a good way to shape traffic.
OpenVPN Community Administrator
IRC: #openvpn, #openvpn-devel
Co-Author of Mastering OpenVPN
Author of Troubleshooting OpenVPN

jbennett
OpenVpn Newbie
Posts: 2
Joined: Fri Feb 25, 2011 4:22 am

Re: --shaper and --server together

Post by jbennett » Fri Feb 25, 2011 8:45 pm

Thanks for the replies.

Just a note on my specific issue:
I'm forced to use a tcp connection for the VPN (Going through an http proxy). When transferring a large file via scp, I get these errors: "MULTI: packet dropped due to output saturation (multi_process_incoming_tun)" Shortly thereafter, the scp transfer dies, but the vpn normally stays up. My theory is that the tcp outout buffer fills up, and when that starts dropping packets, it kills scp.

I know that I can use tc, and have had it set up in the past. Since I'm sending tcp over a tcp tunnel, the openvpn tcp output buffer fills up without the application being notified to slow its rate of sending data. As I understand it, a tcp connection uses dropped packets to gauge available bandwidth. Using tc limits the tunnel from the outside: It's the same as having a slower upload speed on my connection. This would just cause the buffer to fill faster. I think the shaper option would remedy this problem.

I would think that the --shaper option would restrict traffic as a whole. Perhaps a per client config could be added, as well.

Cheers,
Jonathan Bennett

hostizzle
OpenVpn Newbie
Posts: 12
Joined: Mon Feb 07, 2011 5:15 am

Re: --shaper and --server together

Post by hostizzle » Sun Mar 13, 2011 3:30 am

I have successfully implemented tc shaping on my OpenVPN server. I use a variation of a script found on the internet:

http://www.topwebhosts.org/tools/traffic-control.php

I'm not sure what, if anything, --shaping does

hostizzle
OpenVpn Newbie
Posts: 12
Joined: Mon Feb 07, 2011 5:15 am

Re: --shaper and --server together

Post by hostizzle » Thu Mar 24, 2011 6:50 am

Update:

tc renders openvpn unusable. Bummer. This is with htb, haven't used the other shaping qdisc algorithms.

OpenVPN is pretty slow to begin with. Anything you do to the tunnel subtracts speed. There are papers on this available on the web.

Then if you add shaping, I think the interaction between the shaping algorithms and the context switching of OpenVPN kills the speed. Latency was reported as high as 3000ms!

I have to admit I don't really understand why this is. We have a server with four processors barely registering use, RAM that's not full, a 1Gbps NIC, and a 2.5Gbps system bus.

Project for the OpenVPN community: optimize the program for speed. It's great that you don't need to recompile the kernel to install OpenVPN--I "get" that, but there's a huge price to be paid in terms of speed.

This must be the reason why OpenVPN didn't take over the world, and why PPTP is still the built-in VPN protocol in Windows 7.

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: --shaper and --server together

Post by krzee » Thu Mar 24, 2011 7:15 am

hostizzle wrote: This must be the reason why OpenVPN didn't take over the world, and why PPTP is still the built-in VPN protocol in Windows 7.
oh so microsoft cares about the quality that much? is that why they still ship with pptp, a known faulty protocol...?
i figured it was because they made pptp... and by the way they would NEVER ship with openvpn, it is GPL which would require them to ship the source code (same reason you wouldnt see apple shipping with it)

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: --shaper and --server together

Post by maikcat » Thu Mar 24, 2011 8:33 am

As always M$ builds their products with security in mind...

PPtP is one of them


:D

michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

Douglas
Forum Team
Posts: 285
Joined: Wed Aug 27, 2008 2:41 am

Re: --shaper and --server together

Post by Douglas » Fri Mar 25, 2011 12:37 am

This must be the reason why OpenVPN didn't take over the world, and why PPTP is still the built-in VPN protocol in Windows 7.
Now that.. is a funny one. :lol:

kuchiku
OpenVpn Newbie
Posts: 6
Joined: Sat Apr 23, 2011 10:32 pm
Contact:

Re: --shaper and --server together

Post by kuchiku » Mon Sep 12, 2011 10:33 am

hostizzle wrote:Update:

tc renders openvpn unusable. Bummer. This is with htb, haven't used the other shaping qdisc algorithms.

OpenVPN is pretty slow to begin with. Anything you do to the tunnel subtracts speed. There are papers on this available on the web.

Then if you add shaping, I think the interaction between the shaping algorithms and the context switching of OpenVPN kills the speed. Latency was reported as high as 3000ms!

I have to admit I don't really understand why this is. We have a server with four processors barely registering use, RAM that's not full, a 1Gbps NIC, and a 2.5Gbps system bus.

Project for the OpenVPN community: optimize the program for speed. It's great that you don't need to recompile the kernel to install OpenVPN--I "get" that, but there's a huge price to be paid in terms of speed.

This must be the reason why OpenVPN didn't take over the world, and why PPTP is still the built-in VPN protocol in Windows 7.
So have you successfully limited your clients download speed? From your post it seems like it will actually make the connection unusable. I tried tc but can't get it to work. I also tried squid and iptables to limit the download speed but that makes the download speed also unusable.

psevdo
OpenVpn Newbie
Posts: 4
Joined: Sun Aug 04, 2013 8:31 am

Re: --shaper and --server together

Post by psevdo » Wed Aug 07, 2013 10:42 am

guys. tell please

how shape outgoing traffic for each client openvpn

prefer easy method

Post Reply