Re: tc questions

Linux Advanced Routing and Traffic Control

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

 



Hi Alejandro

>Hi to all of you!!!
>
>I am a Computer Science student trying to do the pre-grade thesis. I am
trying 
>to develop a free software tool to help administrators to control the 
>traffic. Right now this tool is based on tc and iptables.
>I am having some problems trying to understand tc and tc examples:
>- Why in almost every list of tc rules based on htb class, there is
>  a "tc qdisc dev ... root ... htb default ..." as a root node?
>  Is it mandatory to work with htb class?

It is not mandatory to attach a HTB qdisc to the root. You can attach
it to any classfull qdisc's cass.

You can only create HTB classes under a HTB qdisc, and you can only
create CBQ classes under a CBQ class. However you can attach any
qdisc to a given class.
What is exactly that you find strange?

>- I understood that every class node has its own qdisc attached
>  (fifo by default, right?).

Correct.
To be exact, most qdiscs use Packet FIFO (pfifo) by default, but that's
not a rule (there are exceptions).

>If that is the case, why when I do "tc qdisc show ..." it 
>JUST shows me those qdisc I explicitly attached to classes without any
child 
>class?

The default pFIFO qdisc that get attached to the classes are not
shown by the above command.

>- What should I expect if I run something like this?
>
>tc qdisc add dev eth0 root handle 1: htb default 10
>tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit
>tc class add dev eth0 parent 1:1 classid 1:10 htb rate 90mbit
>tc class add dev eth0 parent 1:1 classid 1:20 htb rate 1kbit
>tc class add dev eth0 parent 1:20 classid 1:21 htb rate 10mbit
>
>I guessed the traffic redirected to 1:21 should have 1kbit of rate at
most 
>(because of its parent 1:20), but when I ran this, I got a higher rate 
>(because of the 10mbit rate, I guess). Why? Shouldn't parent classes
restrict 
>children's rate?

I would say that that is a misconfiguration.
Neither the tc command nor the kernel gives you any warning.
You could implement it as part of your project ... :)

You are right. Class 1:20 does not limit the class 1:21's rate to 1kbit.
This is due to the way the kernel schedules the HTB classes.
Note that since you did not use the "ceil" config option, class 1:21
gets by default "ceil" = "rate" = 10mbit, and therefore it can not
borrow from its parent 1:20.
There would be nothing to borrow anyway, since 1:20 is limited to
1kbit (rate=cel=1kbit).

Regards
/Christian
[http://benve.info]


_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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