3

What is the best Linux-based QoS platform to implement a configuration where all 256Kbps DSL clients (all belong to the same IP range) get a guaranteed speed of 200Kbps with single QoS rule?

5 Answers 5

1

The standard linux QoS/traffic control system is called [tc][1] (traffic control).

You will need to initialize a chain, set it's properties, then add your IP's to it, something like this:

#!/bin/bash
DEV=eth0
PATH=$PATH:/sbin
tc qdisc del dev $DEV root
tc qdisc add dev $DEV root handle 1: htb default 20
tc class add dev $DEV parent 1:1 classid 1:10 htb rate 2000kbps ceil 2000kbps burst 500kb quantum 1500
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 match ip dst 10.10.10.1/24 flowid 1:10
tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 match ip src 10.10.10.1/24 flowid 1:10
1
  • Can you explain the code a bit, because you used two qdisc's : HTB and SFQ. And will the mentioned configuration assign each IP in the range the required speed without having to have a separate rule for each individual IP?
    – user82915
    May 28, 2011 at 11:12
1

And will the mentioned configuration assign each IP in the range the required speed without having to have a separate rule for each individual IP?

No, it won't. The way HTB works, you just can assign rates for the entire bucket, not individual IPs. What Caleb tried to do, was to evenly distribute the available bandwidth of 2000 Kbps via the SFQ qdisc among your 10 customers. However, this will not work as expected - SFQ calculates the scheduling per connection, not per IP - if any of your customers has more bandwidth-hungry connections open than the others, he will get more bandwidth in total.

There is another scheduler called ESFQ which extends SFQ to be able to schedule per-ip, but even then you only would schedule currently active traffic without capping any given user at 200 kbps. I do not know if there is any readily available qdisc which would allow you do do that, but given the sheer amount of different qdisc projects, I'd assume so.

Another problem is that tc only schedules outgoing traffic on an interface, inbound traffic is never taken into account. The Intermediate Queuing Device (IMQ) helps working around this limitation.

1

For guarantees and fair division, HFSC scheduler (ported from BSD's altq to linux) is a great thing. (at least it's not as clumsy and buckety as HTB.) Regrettably, setting up any traffic shaping in Linux is a painful process with a brutal learning curve, and because tc interface is simply just unfriendly, I'd suggest using MasterShaper or some similar frontend.

(PS. if you decide to manage tc by your own, use IFB kernel feature for upload shaping - it's like IMQ suggested here earlier, but works on newer kernels and fits the whole framework a little better)

0

Mikrotik RouterBoards ;) Best platform you can have. Their OS (RouterOS) is Linux based, but being an applicance you dont have access to a real shell or the file system.

They are a small ISP platform, though, so youay really like them.

0

Perhaps, my previous answers related to Linux/QoS may help you as well:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .