Re: [LARTC] a simple setup with tbf and prio?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Frank,

 : I'm trying to make a fairly average setup, I want to limit eth1 to
 : 100kbit, and then prioritize things like ACK's and interactive traffic.

Nothing wrong with this.

 : All the scripts I see do this with CBQ, however given the description
 : of it in the HOWTO, I think I'd be much happier having the limiting
 : done by a TBF. So what I'd like is to have the root qdisc be TBF, and
 : put a PRIO qdisc under this. However, from what I understand, I can't
 : put anything as a child under a TBF, not even a single other qdisc
 : because it's classless. Why is this?

That's exactly it, it's classless!  As described on the page detailing TBF
[1], the TBF is what you would want to use if you simply need to slow down
the rate at which packets are dequeued on an interface.

You have more sophisticated needs, because you wish to:

  - shape total traffic to a specified rate AND
  - give priority to some traffic

If you wanted to do either, you would be able to use TBF (to shape to a
particular rate) or PRIO (to prioritize certain traffic).

You are in luck, because HTB (hierarchical token bucket) is a classful
token bucket filter.  So, have a look at HTB [2], which is a part of
kernel 2.4.20+.

Now, you'll attach an HTB qdisc directly to the root of your interface
(remember the usual rule about shaping only what you transmit).  To this
interface, you'll now add a top-level class, which will set rate and ceil
to 100kbit.

Now, you can add your (classful) PRIO qdisc [4] to the top-level HTB
class, and set some filters.  Because three classes will be implicitly
created, you can add qdiscs other than FIFO to these leaf classes, as
suggested in the LARTC HOWTO.

 : The concept of having a bandwidth limiting qdisc as the root and
 : putting prio queues under that makes sense right?

It makes sense to me.

If you are just learning traffic control for the first time, you will find
the tc filter commands frustrating, so consider tcng.  I have written a
brief HOWTO article on using tcng with HTB [5].  Traffic control next
generation provides a much less opaque syntax (for humans) to describe
traffic control structures.

-Martin

 [1]  http://lartc.org/howto/lartc.qdisc.classless.html#AEN678
 [2]  http://luxik.cdi.cz/~devik/qos/htb/
 [3]  http://www.docum.org/
 [4]  http://lartc.org/howto/lartc.qdisc.classful.html#AEN886
 [5]  http://linux-ip.net/articles/Traffic-Control-tcng-HTB-HOWTO.html

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@xxxxxxxxxxxxxx



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux