Re: [LARTC] Still a question about qdiscs

Linux Advanced Routing and Traffic Control

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

 



On Friday 13 June 2003 18:02, Emmanuel SIMON wrote:
> Hello,
>
> There is one thing that stays in the deep of my brain (where i can't
> access)
>
> which qdisc exactly send the paquets: the root or the leafs ?
>
> I explain:
>
> You must have a root qdisc
> then you have classes (don't care about how much)
> and leaf classes MUST have qdisc to send the bits
>
> in the howto 9.5.2.1 it's writen:
> "Packets get enqueued and dequeued at the root qdisc, which is the only
> thing the kernel talks to."
>
> In the FAQ of docum.org article "root qdisc - class - qdisc - filter", Stef
> Coene writes :
> "Each leaf class has exactly 1 qdisc attached to it that actual sends the
> packets."
>
> These are only 2 sources and everybody say the same thing. So which qdisc
> sends the trafic, the root or the leaf ? Or maybe the leaf sends the trafic
> to the root which sends it to the NIC ?
To be honest, I just don't know.

I see it like this.  Packets get dequeued in the root qdisc.  These packets 
are placed in the leaf classes attached to the root qdisc.  Each class is 
polled by the root qdisc to see if there are packets.  If it has packets, 
it's allowed to send some of them.  The maximum packets that the class can 
send in 1 turn is quantum and number of packets is controlled by the class so 
(for htb) the rates and ceils are respected.  The order of the packets within 
a class is determined by the qdisc attached to the leaf class.  If this is a 
simple fifo class, the packets are send in the same order as they arrived in 
the root qdisc.  If this is a sfq qdisc, the packets can be reordered so each 
flow has the same opportunity to send packets.

So each leaf class can send some packets.  But at the end, all packets are 
placed in the network card buffer and placed on the wire.

As example, we have 2 leaf classes and 3 packet flows : A, B and C.  B and C 
are placed in the same class and that class has a sfq qdisc attached.  A is 
sending 15 packets, B is sending 8 packets and C is sending 3 packets.

Packets entering the root qdisc :
A1 A2 B1 A3 A4 B2 A5 A6 B3 C1 A7 A8 B4 A9 A10 B5 A11 A12 C2 B6 A13 A14 B7 A15 
B8 

So the packets are splitted in 2 class :
- A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15
- B1 B2 B3 C1 B4 B5 C2 B6 B7 B8

The A packets are coming too fast and the class is dropping some of them.  
After some time, the sender will throttle down.
- A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11

The second class has sfq qdis so the packets are reorded :
- B1 C1 B2 C2 B3 B4 B5 B6 B7

The classes has a quantum of 3 so each class may send 3 packets and then the 
other class can send 3 classes.  They also have the same rate.  So as a 
result this is placed on the wire:
- A1 A2 A3 B1 C1 B2 A4 A5 A6 C2 B3 B4 A7 A8 A9 B5 B6 B7 


This can be totally wrong, so any comments are welcome.

Stef

-- 

stef.coene@xxxxxxxxx
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net



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