"Classful Queueing Disciplines" in LARTC HOWTO
Hi,
I am a newbie to LARTC and to this mailing-list. I have read through the Linux Advanced Routing & Traffic Control HOWTO many times, trying to understand Classful Queueing Disciplines (and in particular CBQ). I have some suggestions that I think will help to make the HOWTO more understandable.
Suggestions
====(1)
In section 9.4 (Terminology) the definition for "Classes" states that:
"A classful qdisc may have many classes, which each are internal to the qdisc. Each of these classes may contain a real qdisc".
As far as I can understand, each class can actually contain one _or more_ qdiscs. Furthermore, (at least in the case of CBQ) a class may also contain one or more _classes_ (this really puzzled me. But the HOWTO's example of a CBQ configuration, and a reading of /usr/src/linux-2.4/net/sched/sch_cbq.c appear to indicate this).
(2)
In section 9.5.2 ("The qdisc family: roots, handles, siblings and parents"), the HOWTO does not really make clear the fact that some of the nodes in the tree are qdiscs, and some nodes are classes. In particular, the "ASCII-art" diagram does not show this; it just shows a bunch of nodes with handles. As I understand it, the diagram should be as follows (please tell me if I am wrong).
1: root qdisc
|
1:1 class (child of root qdisc)
--|--
/ | \
/ | \
/ | \
/ | \
10: 11: 12: qdiscs contained in 1:1 class / \ / \
10:1 10:2 12:1 12:2 classes (children of qdiscs)
Section 9.5.2, paragraph 2 says "The handles of these qdiscs consist of two parts...". The text does not explicitly say that _classes_ are also assigned handles in the same way (that only became apparent after reading the HOWTO several times).
Section 9.5.2 paragraph 3 says "Classes need to have the same major number as their parent". Shouldn't this be changed to "Classes need to have the same major number as their parent _qdisc_"?
(3)
Section 9.5.2.2 paragraph 1 says "When the kernel decides that it needs to extract packets to send to the interface, the root qdisc 1: gets a dequeue request, which is passed to 1:1, which is in turn passed to 10:, 11: and 12: ..".
I think it would be clearer if this was changed to "....which is passed to the 1:1 class, which is in turn passed to the 10:, 11: and 12: qdiscs...".
(4)
Section 9.5.3 ("The PRIO qdisc") has a spelling mistake in paragraph 4: "It can also contain more all qdiscs...". I think this should be "It can also contain almost all qdiscs...". (I know this is rather nitpicky).
(5)
Section 9.5.3.2 ("Sample configuration") has another ASCII-art diagram where it would be clearer if the nodes were labelled as being either qdiscs or classes. Node 1: is the root qdisc; nodes 1:1, 1:2 and 1:3 are classes; nodes 10:, 20: and 30: are qdiscs.
(6)
Section 9.5.4.2 ("CBQ classful behaviour") paragraph 2: the phrase "lower priority classes" should, I believe, be "lower-numbered priority classes" (because lower-numbered means higher-priority). The same applies in the paragraph that describes the prio parameter.
(7)
Section 9.5.4.4 ("Sample configuration") really took many re-readings to understand, and I'm still not sure I do understand. An ASCII-art diagram would really help here, showing which nodes are qdiscs and which are classes.
The second paragraph starts "This part installs the root node and the customary 1:0 class". I think this is an error, it should be the 1:1 class, not the 1:0 class.
A bit lower down, the HOWTO shows the commands to add classes 1:3 and 1:4. My understanding is that these two _classes_ are being added to the parent _class_ 1:1, is this right? This part was confusing, because in previous examples _classes_ were added to a parent _qdisc_, or _qdiscs_ were added to a parent _class_. This is the first place where _classes_ are added to a parent _class_. That's why I suggested (above) that the definition of a class be changed to make it clear that a class can contain other classes, not only qdiscs.
In the next paragraph the HOWTO says "These are our two classes". But there are actually three classes in the configuration.
In the same paragraph, the last sentence reads "The classids need to be within the same major number as the parent CBQ". I think this should be
"The classids need to have the same major number as the parent qdisc"
because it it not clear (except by re-reading a few times) that these two classes have _class_ 1:1 as a parent, which in turn has _qdisc_ 1:0 as a parent; so classes 1:3 and 1:4 actually need to have the same major number as their _grandparent_ node, which is a qdisc.
A bit lower down, the HOWTO shows the commands to attach some filters directly to the root qdisc. May I suggest inserting the following sentence just _before_ these commands:
'Now we attach "filters" to the root qdisc, to send traffic to the correct classes (1:3 and 1:4).'
I hope these suggestions will help to make the HOWTO clearer to the uninitiated (like me). Please tell me if I have misunderstood anything.
Regards
Rob Pitman
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 12 lines · Rob Pitman
Hi,
I am a newbie to LARTC and to this mailing-list. I have read through the Linux Advanced Routing & Traffic Control HOWTO many times, trying to understand Classful Queueing Disciplines (and in particular CBQ). I have some suggestions that I think will help to make the HOWTO more understandable.
Suggestions
====> (1)
In section 9.4 (Terminology) the definition for "Classes" states that:
Quoted 8 lines
"A classful qdisc may have many classes, which each are internal to the qdisc. Each of these classes may contain a real qdisc".
As far as I can understand, each class can actually contain one
_ormore_qdiscs. Furthermore, (at least in the case of CBQ) a class may also contain one or more _classes_ (this really puzzled me. But the HOWTO's example of a CBQ configuration, and a reading of/usr/src/linux-2.4/net/sched/sch_cbq.cappear to indicate this).
Each class has __one__ qdisc attached to it. If you create a class, a fifo qdisc is attached. But you can replace it with something else if you want. A class can't send the data it contains. That's why you need a qdisc. Also, you can't add a qdisc to a non-leaf class. (a leaf class is a class with no children). You can add a qdisc, but if you add a child class, the qdisc is removed.
Quoted 18 lines
(2)
In section 9.5.2 ("The qdisc family: roots, handles, siblings and parents"), the HOWTO does not really make clear the fact that some of the nodes in the tree are qdiscs, and some nodes are classes. In particular, the "ASCII-art" diagram does not show this; it just shows a bunch of nodes with handles. As I understand it, the diagram should be as follows (please tell me if I am wrong).1: root qdisc 1:1 class (child of root qdisc) --|-- / | \ / | \ / | \ / | \ 10: 11: 12: qdiscs contained in 1:1 class
Quoted 2 lines
/ \ / \
10:1 10:2 12:1 12:2 classes (children of qdiscs)
Not really. The ascii drawing is wrong.
It should look like this :
root 1:
|
_1:1_
/ | \
/ | \
1:10 1:11 1:12
| | |
10: 11: 12:
/ \ / \10:1 10:2 12:1 12:2
Quoted 4 lines
Section 9.5.2, paragraph 2 says "The handles of these qdiscs consist of two parts...". The text does not explicitly say that _classes_ are also assigned handles in the same way (that only became apparent after reading the HOWTO several times).
The line should be "The handles of these qdisc and classes consists of two parts : <major number>:<minor number>"
Quoted 3 lines
Section 9.5.2 paragraph 3 says "Classes need to have the same major number as their parent". Shouldn't this be changed to "Classes need to have the same major number as their parent _qdisc_"?
No. Class. A class can have an other class as parent.
Better would be: "Class need to have the same major number as their parent."
Quoted 6 lines
(3)
Section 9.5.2.2 paragraph 1 says "When the kernel decides that it needs to extract packets to send to the interface, the root qdisc 1: gets a dequeue request, which is passed to 1:1, which is in turn passed to 10:, 11: and 12: ..".
Quoted 7 lines
I think it would be clearer if this was changed to "....which is passed to the 1:1 class, which is in turn passed to the 10:, 11: and 12: qdiscs...".
(4)
Section 9.5.3 ("The PRIO qdisc") has a spelling mistake in paragraph 4: "It can also contain more all qdiscs...". I think this should be "It can also contain almost all qdiscs...". (I know this is rather nitpicky).
Better : "You can add an other qdisc to the 3 predefined classes."
Quoted 5 lines
(5)
Section 9.5.3.2 ("Sample configuration") has another ASCII-art diagram where it would be clearer if the nodes were labelled as being either qdiscs or classes. Node 1: is the root qdisc; nodes 1:1, 1:2 and 1:3 are classes; nodes 10:, 20: and 30: are qdiscs.
Qdiscs are always x: or x:0. See 9.5.2 paragraph 2.
Quoted 5 lines
(6)
Section 9.5.4.2 ("CBQ classful behaviour") paragraph 2: the phrase "lower priority classes" should, I believe, be "lower-numbered priority classes" (because lower-numbered means higher-priority). The same applies in the paragraph that describes the prio parameter.
Indeed. Lower prio means higher priority.
Quoted 5 lines
(7)
Section 9.5.4.4 ("Sample configuration") really took many re-readings to understand, and I'm still not sure I do understand. An ASCII-art diagram would really help here, showing which nodes are qdiscs and which are classes.
root 1:
|
_1:1_
/ \
1:3 1:4
| |
sfq sfqQuoted 3 lines
The second paragraph starts "This part installs the root node and the customary 1:0 class". I think this is an error, it should be the 1:1 class, not the 1:0 class.
Indeed
Quoted 11 lines
A bit lower down, the HOWTO shows the commands to add classes 1:3 and 1:4. My understanding is that these two _classes_ are being added to the parent _class_ 1:1, is this right? This part was confusing, because in previous examples _classes_ were added to a parent _qdisc_, or _qdiscs_ were added to a parent _class_. This is the first place where _classes_ are added to a parent _class_. That's why I suggested (above) that the definition of a class be changed to make it clear that a class can contain other classes, not only qdiscs.
In the next paragraph the HOWTO says "These are our two classes". But there are actually three classes in the configuration.
Yes. But only 2 classes are leaf classes so they are the only classes who can actually send data.
Quoted 4 lines
In the same paragraph, the last sentence reads "The classids need to be within the same major number as the parent CBQ". I think this should be
"The classids need to have the same major number as the parent qdisc"
Indeed.
Quoted 9 lines
because it it not clear (except by re-reading a few times) that these two classes have _class_ 1:1 as a parent, which in turn has _qdisc_ 1:0 as a parent; so classes 1:3 and 1:4 actually need to have the same major number as their _grandparent_ node, which is a qdisc.
A bit lower down, the HOWTO shows the commands to attach some filters directly to the root qdisc. May I suggest inserting the following sentence just _before_ these commands:
Quoted 5 lines
'Now we attach "filters" to the root qdisc, to send traffic to the correct classes (1:3 and 1:4).'
I hope these suggestions will help to make the HOWTO clearer to the uninitiated (like me). Please tell me if I have misunderstood anything.
It was fun :)
Maybe it's time to reread the pages thru the eyes of a newbie.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/