Re: tc + zebra/quagga

Linux Advanced Routing and Traffic Control

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

 



On Sunday 27 March 2005 14:50, you wrote:
> Lorin wrote:
> >  I have some problem with traffic shaping on debian testing. I actually
> > posted a full config on the list a while ago but didn't get any answers.
> > The problem is that traffic doesn't get into the user classes (~150) when
> > I associate a class with a qdisc. I tried sfq, fifo but none works. If I
> > dont't associate a qdisc with a class classification occurs well.
> >  I'm pretty sure the config is ok.  Just was wondering if someone has
> > already steped into this one.
> >   This box runs zebra and bgpd as it is a bgp border router.
> >   I found this post on google which is quite similar to my case:
> > http://mailman.isi.edu/pipermail/6bone/2002-May/005420.html.
> >
> >  Thank you.
>
> This is strange - can you recreate it with a small test script that
> doesn't use htbinit way of naming/numbering.
>
> Andy.
 It would be quite some work to setup a configuration, there are a lot of 
hosts that need to be limited.
 Here is what I have:

#---class root - RATE/CEIL=100Mbit
/sbin/tc class add dev eth0 parent 1: classid 1:0010 htb rate 100Mbit
/sbin/tc qdisc add dev eth0 root handle 1 htb default 3000
 
#---class bgp - RATE/CEIL=128Kbit
/sbin/tc class add dev eth0 parent 1:0010 classid 1:0050 htb rate 128Kbit ceil 
128Kbit prio 0
/sbin/tc qdisc add dev eth0 parent 1:0050 handle 0050 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 
<bgp peer>/32 classid 1:0050
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 
<bgp peer>/32 classid 1:0050
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip 
sport 179 0xffff classid 1:0050
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip 
dport 179 0xffff classid 1:0050

#---class management - RATE/CEIL=64Kbit (ssh,icmp)
/sbin/tc class add dev eth0 parent 1:0010 classid 1:0500 htb rate 64Kbit ceil 
64Kbit prio 1
/sbin/tc qdisc add dev eth0 parent 1:0500 handle 0500 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip 
dport 22 0xffff classid 1:0500
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip 
sport 22 0xffff classid 1:0500
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 
83.103.150.50 classid 1:0500
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 
83.103.150.50 classid 1:0500
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip 
sport 0 0xffff classid 1:0500
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip 
dport 0 0xffff classid 1:0500

#---class premium - RATE/CEIL=sum of RATE child classes (the broadband way 
[tm])
/sbin/tc class add dev eth0 parent 1:0010 classid 1:1000 htb rate 352Kbit ceil 
352Kbit prio 2
/sbin/tc qdisc add dev eth0 parent 1:1000 handle 1000 sfq perturb 10

/sbin/tc class add dev eth0 parent 1:1000 classid 1:1001 htb rate 32Kbit ceil 
64Kbit prio 2
/sbin/tc qdisc add dev eth0 parent 1:1001 handle 1001 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 
<client1 ip>/32 classid 1:1001

/sbin/tc class add dev eth0 parent 1:1000 classid 1:1002 htb rate 32Kbit ceil 
64Kbit prio 2
/sbin/tc qdisc add dev eth0 parent 1:1002 handle 1002 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 
<client2 ip>/32 classid 1:1002

/sbin/tc class add dev eth0 parent 1:1000 classid 1:1003 htb rate 32Kbit ceil 
64Kbit prio 2
/sbin/tc qdisc add dev eth0 parent 1:1003 handle 1003 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 
<client3 ip> classid 1:1003
....

#---class best-effort RATE/CEIL=sum of RATE child classes
individual limits just like in premium class

#---class default RATE/CEIL=2Kbit
/sbin/tc class add dev eth0 parent 1:3000 classid 1:3000 htb rate 2Kbit prio 7
/sbin/tc qdisc add dev eth0 parent 1:3000 handle 3000 sfq perturb 10

 If I set the leaf qdisc to 'none' traffice gets classified well; if I use a 
qdisc in a child class all traffic goes to default.
 After few tests I managed to isolate the problem (kinndof) - if I use just 
one class, best-effort for example, and put all filters/qdisc in this one 
everything works fine. But I really need to separate big clients (premium) 
from small ones (best-effort) and to shape management/bgp traffic separately 
from those 2. atm the only separations is made after prio value: bgp 0, 
management 1, premium 2, best-effort 3 and default 7.

Thanks for the help!

p.s.
 I'm working on a romanian translation for LARTC. I have about 1/4 of it till 
now. If there are any romanians on this list willing to help it would a very 
nice thing to do for the community. Also translating this great howto it's a 
study itself so you can get also some solid knowledge besides the Glory:)
-- 
+ Lorin
+ I tought I taw a putty cat...I did! I did taw a putty cat!
+ http://si-bemol.ro
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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