Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
* [LARTC] who is the "right" parent in tc filter statements?
@ 2001-02-16 12:38 Borut
  0 siblings, 0 replies; only message in thread
From: Borut @ 2001-02-16 12:38 UTC (permalink / raw)
  To: lartc

<PRE>Hello!

My setup is quite simple:

I have a Linux router which does traffic shaping. All is well while
each customer has separate bandwidth:

tc qdisc add dev eth0 root handle 10: cbq bandwidth 100Mbit avpkt 1000

tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 100Mbit rate \
  256kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000 bounded
tc qdisc add dev eth0 parent 10:1 sfq quantum 1514b perturb 15
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip src \
  xxx.xx.xxx.xx flowid 10:1

Now I have two customers with a setup like this:
each has 256k bandwidth, but they should be able to share it between
them if the other one doesn't use it (therefore I've left out the &quot;bounded&quot;
part):

tc class add dev eth0 parent 10:0 classid 10:200 cbq bandwidth 100Mbit rate \
  512kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000 bounded

tc class add dev eth0 parent 10:200 classid 10:201 cbq bandwidth 100Mbit rate \
  256kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000
tc qdisc add dev eth0 parent 10:201 sfq quantum 1514b perturb 15
tc filter add dev eth0 parent 10:200 protocol ip prio 100 u32 match ip src \
  xxx.xxx.xx.29 flowid 10:201

tc class add dev eth0 parent 10:200 classid 10:202 cbq bandwidth 100Mbit rate \
  256kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000
tc qdisc add dev eth0 parent 10:202 sfq quantum 1514b perturb 15
tc filter add dev eth0 parent 10:200 protocol ip prio 100 u32 match ip src \
  xxx.xxx.xx.28 flowid 10:202

Now, did I do the right thing setting parent to 10:200 (the joint 512k class)
in tc filter statements? If this is correct, it could be added to the howto.
That part is missing in chapter 9.4 - Class subdivision.

thanks,

-- 
Borut
<A HREF="mailto:borut.mrak@ijs.si">borut.mrak@ijs.si</A>
-----------------
There *is* something on port 23 but it ain't TELNET...
                                Zack Weinberg in Scary Devil Monastery.


</PRE>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-02-16 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-16 12:38 [LARTC] who is the "right" parent in tc filter statements? Borut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox