You are not logged in.

#1 2012-09-18 09:13:38

valentt
Member
Registered: 2012-08-06
Posts: 7

Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Hi guys,
Mikrotik has nice qos technique called PCQ [1] that easily splits bandwidth equally to all connected clients. Is this possible with linux tools ?

[1] http://wiki.mikrotik.com/wiki/Manual:Qu … Q_Examples

Last edited by valentt (2012-09-18 09:33:55)

Offline

#2 2012-09-18 09:18:16

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Offline

#3 2012-09-18 09:23:24

valentt
Member
Registered: 2012-08-06
Posts: 7

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

I know about these, and these don't offer the abbility of PCQ, please read about Mikrotik's PCQ, it is not as simple a question as it seams.

PCQ dynamically spreads bandwidth. If there is 10MBits/s and only two clients both automatically get 1/2 (5Mbits), and is there are 10 clients, each gets 1/10 (1Mbit).

I haven't yet seen any qos technique on linux that allows this, but my quess is that some linux networking guru has this figured out.

Last edited by valentt (2012-09-19 06:18:55)

Offline

#4 2012-09-19 06:19:34

valentt
Member
Registered: 2012-08-06
Posts: 7

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

So nobody has cracked this with some custom magical bash script?

Offline

#5 2012-09-20 12:53:56

valentt
Member
Registered: 2012-08-06
Posts: 7

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Ah, finally a question that is too difficult even for the most hard core arch admins wink

Offline

#6 2012-09-29 00:53:01

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Ya, this can be done in many diffrnet ways. All of them vary complex when you have only one system.

On a network level this problem is normaly solved with ATM or MPLS.

If you set up a Point-to-Point daemon on your Arch box. Then have all your clients connect to the pppd. Then you can do what you want in a vary normal traditional way. Or, maybe easier would be to setup OpenVPN then each client will have a tun device counterpart on your local system you can work with.

The complex ways envolve the "tc" command, and/or ebtables, and/or tun/tap devices, and/or complex iptables rules.

There is no quick n' easy solution to this. You will have to really sit down and whiteboard out all the diffrent traffic types going through your system and what would be the best way to manage them.

Last edited by hunterthomson (2012-09-29 00:56:22)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#7 2012-09-29 01:50:13

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Maybe you can use shaperd.

Offline

#8 2012-09-29 16:41:17

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Probably is not a open source program and need some particural hardware.
Other solution

  • A programmable router

  • A linux box acting like a router

  • Self controlled traffic, from the peer

The last should work like : pinging all the peers and find how many are connected, then shape it how traffic in that measure. A cron rule should repeat the check and change the limit accordingly. The only problem is to find a subnet or something of a different IP, but home user would be fine.


do it good first, it will be faster than do it twice the saint wink

Offline

#9 2012-11-16 08:30:51

valentt
Member
Registered: 2012-08-06
Posts: 7

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

lucke wrote:

Maybe you can use shaperd.

This looks awesome, just I see few problems:
- development stopped in 2009
- searching for "shaperd" on openwrt forum gave 0 results
- searching for "openwrt" on shaperd mailing list gave 0 results

Does shaperd even work with latest kernels? Have you used it in last year? Have you used it ever?

Update, I found some more recent shaperd activiti on Github:
https://github.com/pld-linux/shaperd.2/ … af67e83e85

Last edited by valentt (2012-11-16 08:57:53)

Offline

#10 2012-11-16 08:41:38

valentt
Member
Registered: 2012-08-06
Posts: 7

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

hunterthomson wrote:

Ya, this can be done in many diffrnet ways. All of them vary complex when you have only one system.

On a network level this problem is normaly solved with ATM or MPLS.

I know, but let's ignore that, that is a completely other pair of socks wink Let's just look at just small wifi network with a single AP and 10-20 clients.

hunterthomson wrote:

If you set up a Point-to-Point daemon on your Arch box. Then have all your clients connect to the pppd. Then you can do what you want in a vary normal traditional way. Or, maybe easier would be to setup OpenVPN then each client will have a tun device counterpart on your local system you can work with.

To keep everything super-simple on client side I would like not to use ppp, so that clients just connect to wifi network and router does all the "clever bits" wink

hunterthomson wrote:

The complex ways envolve the "tc" command, and/or ebtables, and/or tun/tap devices, and/or complex iptables rules.

There is no quick n' easy solution to this. You will have to really sit down and whiteboard out all the diffrent traffic types going through your system and what would be the best way to manage them.

I'm willing to invest my time in this if I have some smarter than me to mentor me and other who will also join.

What would be the first step for making this some kind od PCQ on Linux work?

Offline

#11 2012-11-16 10:34:56

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

I used shaperd some years ago. iptables/tc syntax is probably stable, there's a good chance it'd work okay.

Offline

#12 2012-11-17 11:10:58

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Here is the manual for tc
http://www.lartc.org/manpages/

Meh, forget the hacky suggestion I was makeing...

If you have your clients connect to a VPN, PPP, you set Hard limits on speed, or you have more then 1 device the job is really easy.

Last edited by hunterthomson (2012-11-17 11:51:36)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#13 2012-11-18 09:36:01

valentt
Member
Registered: 2012-08-06
Posts: 7

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

hunterthomson wrote:

Here is the manual for tc
http://www.lartc.org/manpages/

RTFM is ok answer for trivial questions, this is far from trivial question so RTFM answer is far from what is needed. If you know how this would be possible to do please share your knowledge and I'll do most of the ground work, writing code and testing.

hunterthomson wrote:

Meh, forget the hacky suggestion I was makeing...

If you have your clients connect to a VPN, PPP, you set Hard limits on speed, or you have more then 1 device the job is really easy.

Done. No, clients don't use PPP or VPN, as I explained in previous post this solution should be brain dead simple for users, they only need to connect to wifi node and nothing else. This is why it is hard on liunux, on mikrotik you just enable PCQ queing option and Mikrotik does it's magic... now how to do this on Linux?

Offline

#14 2012-11-18 13:42:57

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

I think your question is too specific for a general-purpose linux distribution's forum and that you should find more relevant experience in one of the linux-based router-distribution forums. Maybe bring back the specific questions back here, if your router conf is supposed to run on Arch in the end and you wonder why it does not work. 

Still, it is a great topic and I am also interested to read about your actual testing work in using tc's or shaperd's options, and will comment on your posted configuration/results where I feel it helps.

Offline

#15 2012-11-19 08:58:32

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: Equal bandwidth for all users - Per Connection Queue (PCQ) on Linux ?

Okay, so first off. Sorry if I came off a little harsh. This is a real pain and a problem I have tried to solve many many times too. No one is going to be able to like give you a bash script or anything. You will have to do this all yourself. Everything you do will be specific to your setup, and will take lots of (make a change & test, make a change & test, . . .).

So, I have done some more reading on it, and a VPN, PPP is not needed. Instead, you will need to use iptables.

Basicaly, the problem is that you want to do trafic shaping on Layer 3. That is why I said a VPN or PPP will make the job easier. With like OpenVPN or PPP each client will have it's own interface i.e. tap, tun, or ppp. Then you will be looking to do traffic shapping on Layer 2.

BUT, I found a way around this. You can use iptables to mark packes, then use tc to do traffic shapping on the marked packes.

To do this though you will need to know what IP's each client will have. So, you need to pre-configure your DHCP server to give the same IP address to each client, or configure the clients with static IP's. Then you mark packets based on the IP address.

Last edited by hunterthomson (2012-11-19 09:03:18)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB