Gerry Weaver wrote: > Hi All, > > I need help to understand the proper order to create qdiscs. I'm trying to > do the following: > > 1. Use the TBF to slow a 100mb link to 3mb Check the "UNITS" section of the tc manual to make sure you don't get "mbit" confused with "mbps". In tc unit nomenclature, "kb" and "mb" refer to quantities rather than bandwidths. > 2. Use PRIO to prioritize the traffic > 3. Use SFQ to hand out bandwidth to each PRIO class fairly > > Here's my question. What order should the qdiscs be in? For example: > > ROOT->TBF->PRIO[1,2,3]->SFQ or ROOT->PRIO[1,2,3]->SFQ->TBF > Well, the first cannot work because TBF is a classless discipline, and as such cannot have child qdiscs. The second cannot work because sfq is also classless (and even if it were, I don't think that configuration would do what you want. Try htb. I'm going to assume you mean "mbit"; you'll want to tweak other parameters, too. This (untested) example won't behave exactly like PRIO, but I think you could modify it to do so by changing each class' rate to 0mbit (remember that's the guaranteed rate) and let them take their shares of the bandwidth solely based on prio. htb allows for what are usually more elegant solutions to bandwidth prioritization, though, so what I've written below allows the three classes to share bandwidth disproportionately when they all have packets waiting. tc qdisc add dev eth0 root handle htb tc class add dev eth0 parent 1: classid 1:1 htb rate 3mbit tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1500kbit ceil \ 3mbit prio 1 tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 tc class add dev eth0 parent 1:1 classid 1:20 htb rate 1000kbit ceil \ 3mbit prio 2 tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10 tc class add dev eth0 parent 1:1 classid 1:30 htb rate 500kbit ceil \ 3mbit prio 3 tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10 (then write some filters attached to 1: to pass packets to 1:10, 1:20, and 1:30) -Corey _______________________________________________ LARTC mailing list / LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/