On Mon, Apr 14, 2003 at 07:16:00PM +0200, Frank v Waveren wrote:> Also, in the trivia section: Why won''t the PRIO qdisc allow me to set > less than 2 bands?Ok, my mistake, I just forget to set a proper priomap. That concludes the trivia for today. :) -- Frank v Waveren Fingerprint: 21A7 C7F3 fvw@[var.cx|stack.nl|chello.nl] ICQ#10074100 1FF3 47FF 545C CB53 Public key: hkp://wwwkeys.pgp.net/fvw@var.cx 7BD9 09C0 3AC1 6DF2 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
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. 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? The concept of having a bandwidth limiting qdisc as the root and putting prio queues under that makes sense right? Also, in the trivia section: Why won''t the PRIO qdisc allow me to set less than 2 bands? -- Frank v Waveren Fingerprint: 21A7 C7F3 fvw@[var.cx|stack.nl|chello.nl] ICQ#10074100 1FF3 47FF 545C CB53 Public key: hkp://wwwkeys.pgp.net/fvw@var.cx 7BD9 09C0 3AC1 6DF2 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
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@securepipe.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Mon, Apr 14, 2003 at 07:31:59PM -0500, Martin A. Brown wrote:> You have more sophisticated needs, because you wish to: > - shape total traffic to a specified rate AND > - give priority to some trafficI hoped classless merely meant it couldn''t put stuff in different classes, but that it could still serve as a parent to a single other qdisc. Is there any fundamental reason why it can''t, apart from ''code simplicity''?> 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+.I was avoiding it because it''d involve having to get a new version of iproute2 :)> 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.Wasn''t having too much trouble with tc, apart from the slightly confusing error messages from time to time. But I wasn''t aware there were other tools out there, and if they support HTB out of the box even better, I''ll give it a try. Thanks! -- Frank v Waveren Fingerprint: 21A7 C7F3 fvw@[var.cx|stack.nl|chello.nl] ICQ#10074100 1FF3 47FF 545C CB53 Public key: hkp://wwwkeys.pgp.net/fvw@var.cx 7BD9 09C0 3AC1 6DF2 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Frank, : > You have more sophisticated needs, because you wish to: : > - shape total traffic to a specified rate AND : > - give priority to some traffic : : I hoped classless merely meant it couldn''t put stuff in different : classes, but that it could still serve as a parent to a single other : qdisc. Is there any fundamental reason why it can''t, apart from ''code : simplicity''? Well, you could always attach a TBF to one of the prio classes, but then you are limiting traffic only in that one class, not limiting the total bandwidth transmitted on the interface. I''ll copy in something I wrote earlier this year about classful vs. classless queuing disciplines: A classless queuing discipline cannot contain another queueing discipline. A classful queuing discipline can contain classes and leaf queuing disciplines. In other words: - a classless queuing discipline is, by definition, a terminal qdisc - a classful queuing discipline can be terminal or - can contain a number of classes, each of which - can contain another queuing discipline (classless or classful) Does that illustrate for you why the top-level class should perform the shaping? : > 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+. : I was avoiding it because it''d involve having to get a new version of : iproute2 :) -Martin -- Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Mon, Apr 14, 2003 at 08:48:53PM -0500, Martin A. Brown wrote:> Does that illustrate for you why the top-level class should perform the > shaping?Yeah, I got that. However I don''t quite understand why TBF can''t be like CBQ, ie classful? They both do the same thing (albeit in different ways), right? -- Frank v Waveren Fingerprint: 21A7 C7F3 fvw@[var.cx|stack.nl|chello.nl] ICQ#10074100 1FF3 47FF 545C CB53 Public key: hkp://wwwkeys.pgp.net/fvw@var.cx 7BD9 09C0 3AC1 6DF2 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hmmmm.....clearly I must have failed to explain something. : > Does that illustrate for you why the top-level class should perform the : > shaping? : : Yeah, I got that. However I don''t quite understand why TBF can''t be : like CBQ, ie classful? Let me try again. The following qdiscs are classless: - tbf - pfifo_fast - sfq The following qdiscs are classful: - prio - cbq - htb TBF, as a classless qdisc, can only be a terminal qdisc. That makes it far less complex than CBQ, which can support an arbitrary number of nested classes. : They both do the same thing (albeit in different ways), right? Only in the most general way do they do the same thing. Each qdisc provides a set of parameters you can adjust to limit your bandwidth. While CBQ is a fully-featured queuing discipline, TBF provides only shaping capabilities. Both CBQ and TBF are non-work-conserving qdiscs, though--this is what you are looking for if you want to shape your transmitted traffic. Again, since you appear to want the non-work-conserving (shaping) features of TBF in a classful form, you are well-advised to look at HTB. HTB is an implementation of TBF-style scheduling in a classful queuing discipline. And one other note--it sounds like you want to use "tc filter" commands to prioritize ACKs and other interactive traffic. In order to use "tc filter" commands (classification), you need to have separate classes into which to classify your traffic. TBF provides no classes, so you can''t classify! -Martin -- Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Mon, Apr 14, 2003 at 09:56:19PM -0500, Martin A. Brown wrote:> Hmmmm.....clearly I must have failed to explain something. > [snip] > TBF, as a classless qdisc, can only be a terminal qdisc. That makes it > far less complex than CBQ, which can support an arbitrary number of nested > classes.Yes ok, I got that bit. I was merely wondering why TBF wasn''t made classful, like HTB is. Is there a fundamental reason why you couldn''t have a TBF that''s classful?> And one other note--it sounds like you want to use "tc filter" commands to > prioritize ACKs and other interactive traffic. In order to use "tc > filter" commands (classification), you need to have separate classes into > which to classify your traffic. TBF provides no classes, so you can''t > classify!That''s why I wanted to add a prio qdisc under it. -- Frank v Waveren Fingerprint: 21A7 C7F3 fvw@[var.cx|stack.nl|chello.nl] ICQ#10074100 1FF3 47FF 545C CB53 Public key: hkp://wwwkeys.pgp.net/fvw@var.cx 7BD9 09C0 3AC1 6DF2 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
: > TBF, as a classless qdisc, can only be a terminal qdisc. That makes it : > far less complex than CBQ, which can support an arbitrary number of nested : > classes. : : Yes ok, I got that bit. I was merely wondering why TBF wasn''t made : classful, like HTB is. Is there a fundamental reason why you couldn''t : have a TBF that''s classful? Right. OK. Sorry--didn''t mean to go on a feature-length tirade...I guess that''s where email conversations provide less opportunity to gauge the audience. Good luck, Frank, -Martin -- Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Mon, Apr 14, 2003 at 11:27:14PM -0500, Martin A. Brown wrote:> Right. OK. Sorry--didn''t mean to go on a feature-length tirade...Not at all, I''m happy someone''s willing to take the time to explain.. Now, I think I know what I want, however before I try to convert it all into tc/tcc, I''d appreciate it if somebody could tell me if they think it makes sense (not yet showing which parts are the classes and which are qdiscs because that''s part of what I still have to figure out (-:) o | +------------------+ | HTB | |Limited at 100kbit| | Ceil at 100kbit | +------------------+ | +----+ |PRIO| +----+ / | \ /- | -\ /- | -\ /- | -\ /- | -\ /- | -\ /- | -\ /- | -\ +---+ +---+ +---+ |SFQ| |SFQ| |HTB| +---+ +---+ +---+ Interactive Regular / \ /- -\ /- -\ /- -\ /- -\ /- -\ /- -\ +-----------------+ +-----------------+ | HTB | | HTB | |Limited at 50kbit| |Limited at 50kbit| | Ceil at 100kbit | | Ceil at 100kbit | +-----------------+ +-----------------+ Bulk App A Bulk App B Traffic that has the lowlatency TOS bit set, is an ACK, or is on port 80 (I''m not expecting any heavy uploads over http) goes into the interactive SFQ, and everything else that doesn''t have a netfilter mask goes into ''Regular''. Further, I have two bandwith hogging applications running whose packets I mark with the iptables MARK target. Each gets sent to its own HTB (A or B). What I intend the end result to be is that if there''s any interactive traffic that goes first, then if there''s room left the regular traffic goes, and after that if there''s any room left, Bulk Apps A and B use up all the leftover bandwidth (even if one of them decides to be quiet for a while). Is this correct? Suggestions? -- Frank v Waveren Fingerprint: 21A7 C7F3 fvw@[var.cx|stack.nl|chello.nl] ICQ#10074100 1FF3 47FF 545C CB53 Public key: hkp://wwwkeys.pgp.net/fvw@var.cx 7BD9 09C0 3AC1 6DF2 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/