This is a multi-part message in MIME format.
------=_NextPart_000_00B0_01C458A5.455DCD80
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
Hello,
I have wrote some scripts to shape about 1000 workstations.=20
My config:
Pentium IV - 2GHz, 1Gb RAM, RedHat Enterprise Advanced Server 3, kernel =
2.4.21-9.EL, iproute-2.4.7-11.30E.1
2 Gigabit Lan cards in bridge mode.
I use htb. Everything work fine, but I have troubles with showing =
running configuration.
# Init shaper root for dev eth0
tc qdisc add dev eth0 root handle 2: htb default 200
# Default shaper for dev eth0
tc class add dev eth0 parent 2:0 classid 2:200 htb rate 100Mbit prio 10
tc qdisc add dev eth0 parent 2:200 sfq perturb 10
=20
# Init NET1 shaper for dev eth0 , rate 30Mbit , ceil 40Mbit
tc class add dev eth0 parent 2:0 classid 2:30 htb rate 30Mbit ceil =
40Mbit prio 1
tc qdisc add dev eth0 parent 2:30 sfq perturb 10
tc filter add dev eth0 parent 2:0 protocol ip prio 1 u32 match ip src =
192.168.1.0/24 flowid 2:30
# Init NET2 shaper for dev eth0 , rate 30Mbit , ceil 40Mbit
tc class add dev eth0 parent 2:0 classid 2:40 htb rate 30Mbit ceil =
40Mbit prio 1
tc qdisc add dev eth0 parent 2:40 sfq perturb 10
tc filter add dev eth0 parent 2:0 protocol ip prio 1 u32 match ip src =
192.168.2.0/24 flowid 2:40
# User 1 - NET1
tc class add dev eth0 parent 2:30 classid 2:1001 htb rate 32Kbit ceil =
256Kbit quantum 1514
tc qdisc add dev eth0 parent 2:1001 sfq perturb 10
tc filter add dev eth0 parent 2:30 protocol ip prio 1 u32 match ip dst =
192.168.0.1/32 flowid 2:1001
# User 1 - NET2
tc class add dev eth0 parent 2:40 classid 2:2001 htb rate 32Kbit ceil =
256Kbit quantum 1514
tc qdisc add dev eth0 parent 2:2001 sfq perturb 10
tc filter add dev eth0 parent 2:40 protocol ip prio 1 u32 match ip dst =
192.168.0.1/32 flowid 2:2001
# User 2 - NET1
tc class add dev eth0 parent 2:30 classid 2:1002 htb rate 32Kbit ceil =
256Kbit quantum 1514
tc qdisc add dev eth0 parent 2:1002 sfq perturb 10
tc filter add dev eth0 parent 2:30 protocol ip prio 1 u32 match ip dst =
192.168.0.2/32 flowid 2:1002
# User 2 - NET2
tc class add dev eth0 parent 2:40 classid 2:2002 htb rate 32Kbit ceil =
256Kbit quantum 1514
tc qdisc add dev eth0 parent 2:2002 sfq perturb 10
tc filter add dev eth0 parent 2:40 protocol ip prio 1 u32 match ip dst =
192.168.0.2/32 flowid 2:2002
At this point everything work fine, both User 1 and User 2 can get close =
to 256kbit from both networks in same time.
But when I try to show filters I get:
# tc filter ls dev eth0
filter parent 2: protocol ip pref 1 u32
filter parent 2: protocol ip pref 1 u32 fh 802: ht divisor 1
filter parent 2: protocol ip pref 1 u32 fh 802::800 order 2048 key ht =
802 bkt 0 flowid 2:2001
match c0a80001/ffffffff at 16
filter parent 2: protocol ip pref 1 u32 fh 802::801 order 2049 key ht =
802 bkt 0 flowid 2:2002
match c0a80002/ffffffff at 16
filter parent 2: protocol ip pref 1 u32 fh 801: ht divisor 1
filter parent 2: protocol ip pref 1 u32 fh 801::800 order 2048 key ht =
801 bkt 0 flowid 2:1001
match c0a80001/ffffffff at 16
filter parent 2: protocol ip pref 1 u32 fh 801::801 order 2049 key ht =
801 bkt 0 flowid 2:1002
match c0a80002/ffffffff at 16
filter parent 2: protocol ip pref 1 u32 fh 800: ht divisor 1
filter parent 2: protocol ip pref 1 u32 fh 800::800 order 2048 key ht =
800 bkt 0 flowid 2:30
match c0a80100/ffffff00 at 12
filter parent 2: protocol ip pref 1 u32 fh 800::801 order 2049 key ht =
800 bkt 0 flowid 2:40
match c0a80200/ffffff00 at 12
It's look like ALL filters are attached to root class 2: which is not =
true, becouse all work as expected.=20
If I try to specify classid in tc result is:
#tc filter ls dev eth0 parent 2:30
filter protocol ip pref 1 u32
filter protocol ip pref 1 u32 fh 802: ht divisor 1
filter protocol ip pref 1 u32 fh 802::800 order 2048 key ht 802 bkt 0 =
flowid 2:2001
match c0a80001/ffffffff at 16
filter protocol ip pref 1 u32 fh 802::801 order 2049 key ht 802 bkt 0 =
flowid 2:2002
match c0a80002/ffffffff at 16
filter protocol ip pref 1 u32 fh 801: ht divisor 1
filter protocol ip pref 1 u32 fh 801::800 order 2048 key ht 801 bkt 0 =
flowid 2:1001
match c0a80001/ffffffff at 16
filter protocol ip pref 1 u32 fh 801::801 order 2049 key ht 801 bkt 0 =
flowid 2:1002
match c0a80002/ffffffff at 16
filter protocol ip pref 1 u32 fh 800: ht divisor 1
filter protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 =
flowid 2:30
match c0a80100/ffffff00 at 12
filter protocol ip pref 1 u32 fh 800::801 order 2049 key ht 800 bkt 0 =
flowid 2:40
match c0a80200/ffffff00 at 12
"parent" is disapearing from list, but I see ALL attached filters.
If I try to see 2:40 class result is exactly the same:
#tc filter ls dev eth0 parent 2:40
filter protocol ip pref 1 u32
filter protocol ip pref 1 u32 fh 802: ht divisor 1
filter protocol ip pref 1 u32 fh 802::800 order 2048 key ht 802 bkt 0 =
flowid 2:2001
match c0a80001/ffffffff at 16
filter protocol ip pref 1 u32 fh 802::801 order 2049 key ht 802 bkt 0 =
flowid 2:2002
match c0a80002/ffffffff at 16
filter protocol ip pref 1 u32 fh 801: ht divisor 1
filter protocol ip pref 1 u32 fh 801::800 order 2048 key ht 801 bkt 0 =
flowid 2:1001
match c0a80001/ffffffff at 16
filter protocol ip pref 1 u32 fh 801::801 order 2049 key ht 801 bkt 0 =
flowid 2:1002
match c0a80002/ffffffff at 16
filter protocol ip pref 1 u32 fh 800: ht divisor 1
filter protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 =
flowid 2:30
match c0a80100/ffffff00 at 12
filter protocol ip pref 1 u32 fh 800::801 order 2049 key ht 800 bkt 0 =
flowid 2:40
match c0a80200/ffffff00 at 12
I read in lartc.org that filter can be attached to any class, not only =
to root. I make my traffic control acording to that. And everything is =
fine.
I see thah filters are grouped. There is "fh 800::", but where is =
relation between "parent 2:0" and "fh 800::". Logicaly
"parent 2:30" =
=3D> "fh 801::" and "parent 2:40" =3D> "fh
802::".=20
What I'm missing?
Regards,
Svetozar
------=_NextPart_000_00B0_01C458A5.455DCD80
Content-Type: text/html;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html;
charset=3Dkoi8-r">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have wrote some scripts to shape
=
about 1000=20
workstations. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My config:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Pentium IV - 2GHz, 1Gb
RAM, RedHat =
Enterprise=20
Advanced Server 3, kernel 2.4.21-9.EL, =
iproute-2.4.7-11.30E.1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2 Gigabit Lan cards in bridge =
mode.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I use htb. Everything work fine,
but I =
have=20
troubles with showing running configuration.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2># Init shaper root for dev =
eth0</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>tc qdisc add dev eth0 root handle
2: =
htb default=20
200<BR># Default shaper for dev eth0<BR>tc class add dev eth0 parent
2:0 =
classid=20
2:200 htb rate 100Mbit prio 10<BR>tc qdisc add dev eth0 parent 2:200 sfq =
perturb=20
10<BR> </FONT></DIV>
<DIV><FONT face=3DArial size=3D2># Init NET1 shaper for dev
eth0 , =
rate 30Mbit=20
, ceil 40Mbit<BR>tc class add dev eth0 parent 2:0 classid =
2:30 htb=20
rate 30Mbit ceil 40Mbit prio 1<BR>tc qdisc add dev eth0 parent =
2:30 =20
sfq perturb 10<BR>tc filter add dev eth0 parent 2:0 protocol ip prio 1 =
u32 match=20
ip src 192.168.1.0/24 flowid 2:30<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2># Init NET2 shaper for dev
eth0 , =
rate 30Mbit=20
, ceil 40Mbit<BR>tc class add dev eth0 parent 2:0 classid =
2:40 htb=20
rate 30Mbit ceil 40Mbit prio 1<BR>tc qdisc add dev eth0 parent =
2:40 =20
sfq perturb 10<BR>tc filter add dev eth0 parent 2:0 protocol ip prio 1 =
u32 match=20
ip src 192.168.2.0/24 flowid 2:40</FONT></DIV><FONT
face=3DArial=20
size=3D2></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial =
size=3D2></FONT></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2># User 1 -
NET1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>tc class add dev eth0
parent =
2:30 =20
classid 2:1001 htb rate 32Kbit ceil 256Kbit quantum 1514<BR>tc qdisc add =
dev=20
eth0 parent 2:1001 sfq perturb 10<BR>tc filter add dev eth0
parent =
2:30 protocol ip prio 1 u32 match ip dst 192.168.0.1/32 flowid=20
2:1001</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># User 1 -
NET2</FONT></DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>tc class add dev eth0
parent =
2:40 =20
classid 2:2001 htb rate 32Kbit ceil 256Kbit quantum 1514<BR>tc qdisc add =
dev=20
eth0 parent 2:2001 sfq perturb 10<BR>tc filter add dev eth0
parent =
2:40 protocol ip prio 1 u32 match ip dst 192.168.0.1/32 flowid=20
2:2001</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2># User 2 -
NET1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>tc class add dev eth0
parent =
2:30 =20
classid 2:1002 htb rate 32Kbit ceil 256Kbit quantum 1514<BR>tc qdisc add =
dev=20
eth0 parent 2:1002 sfq perturb 10<BR>tc filter add dev eth0
parent =
2:30 protocol ip prio 1 u32 match ip dst 192.168.0.2/32 flowid=20
2:1002</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># User 2 -
NET2</FONT></DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>tc class add dev eth0
parent =
2:40 =20
classid 2:2002 htb rate 32Kbit ceil 256Kbit quantum 1514<BR>tc qdisc add =
dev=20
eth0 parent 2:2002 sfq perturb 10<BR>tc filter add dev eth0
parent =
2:40 protocol ip prio 1 u32 match ip dst 192.168.0.2/32 flowid=20
2:2002</FONT></DIV>
<DIV> </DIV>
<DIV>At this point everything work fine, both User 1 and User 2 can get =
close to=20
256kbit from both networks in same time.</DIV>
<DIV>But when I try to show filters I get:</DIV>
<DIV> </DIV>
<DIV># tc filter ls dev eth0<BR>filter parent 2: protocol ip pref
1=20
u32<BR>filter parent 2: protocol ip pref 1 u32 fh 802: ht divisor =
1<BR>filter=20
parent 2: protocol ip pref 1 u32 fh 802::800 order 2048 key ht 802 bkt 0 =
flowid=20
2:2001<BR> match c0a80001/ffffffff at 16<BR>filter parent
2: =
protocol ip=20
pref 1 u32 fh 802::801 order 2049 key ht 802 bkt 0 flowid =
2:2002<BR> match=20
c0a80002/ffffffff at 16<BR>filter parent 2: protocol ip pref 1 u32 fh =
801: ht=20
divisor 1<BR>filter parent 2: protocol ip pref 1 u32 fh 801::800 order =
2048 key=20
ht 801 bkt 0 flowid 2:1001<BR> match c0a80001/ffffffff at =
16<BR>filter=20
parent 2: protocol ip pref 1 u32 fh 801::801 order 2049 key ht 801 bkt 0 =
flowid=20
2:1002<BR> match c0a80002/ffffffff at 16<BR>filter parent
2: =
protocol ip=20
pref 1 u32 fh 800: ht divisor 1<BR>filter parent 2: protocol ip pref 1 =
u32 fh=20
800::800 order 2048 key ht 800 bkt 0 flowid 2:30<BR> match=20
c0a80100/ffffff00 at 12<BR>filter parent 2: protocol ip pref 1 u32 fh =
800::801=20
order 2049 key ht 800 bkt 0 flowid 2:40<BR> match =
c0a80200/ffffff00 at=20
12<BR></DIV>
<DIV>It's look like ALL filters are attached to root class 2: which is =
not true,=20
becouse all work as expected. </DIV>
<DIV>If I try to specify classid in tc result is:</DIV>
<DIV> </DIV>
<DIV>#tc filter ls dev eth0 parent 2:30<BR>filter protocol ip pref
1=20
u32<BR>filter protocol ip pref 1 u32 fh 802: ht divisor 1<BR>filter
=
protocol ip=20
pref 1 u32 fh 802::800 order 2048 key ht 802 bkt 0 flowid =
2:2001<BR> match=20
c0a80001/ffffffff at 16<BR>filter protocol ip pref 1 u32 fh 802::801 =
order 2049=20
key ht 802 bkt 0 flowid 2:2002<BR> match c0a80002/ffffffff at =
16<BR>filter=20
protocol ip pref 1 u32 fh 801: ht divisor 1<BR>filter protocol ip pref 1 =
u32 fh=20
801::800 order 2048 key ht 801 bkt 0 flowid 2:1001<BR> match=20
c0a80001/ffffffff at 16<BR>filter protocol ip pref 1 u32 fh 801::801 =
order 2049=20
key ht 801 bkt 0 flowid 2:1002<BR> match c0a80002/ffffffff at =
16<BR>filter=20
protocol ip pref 1 u32 fh 800: ht divisor 1<BR>filter protocol ip pref 1 =
u32 fh=20
800::800 order 2048 key ht 800 bkt 0 flowid 2:30<BR> match=20
c0a80100/ffffff00 at 12<BR>filter protocol ip pref 1 u32 fh 800::801 =
order 2049=20
key ht 800 bkt 0 flowid 2:40<BR> match c0a80200/ffffff00 at =
12<BR></DIV>
<DIV>"parent" is disapearing from list, but I see ALL attached =
filters.</DIV>
<DIV> </DIV>
<DIV>If I try to see 2:40 class result is exactly the same:</DIV>
<DIV> </DIV>
<DIV>#tc filter ls dev eth0 parent 2:40</DIV>
<DIV>filter protocol ip pref 1 u32<BR>filter protocol ip pref 1 u32
fh =
802: ht=20
divisor 1<BR>filter protocol ip pref 1 u32 fh 802::800 order 2048 key ht =
802 bkt=20
0 flowid 2:2001<BR> match c0a80001/ffffffff at
16<BR>filter =
protocol ip=20
pref 1 u32 fh 802::801 order 2049 key ht 802 bkt 0 flowid =
2:2002<BR> match=20
c0a80002/ffffffff at 16<BR>filter protocol ip pref 1 u32 fh 801: ht =
divisor=20
1<BR>filter protocol ip pref 1 u32 fh 801::800 order 2048 key ht 801 bkt =
0=20
flowid 2:1001<BR> match c0a80001/ffffffff at 16<BR>filter
protocol =
ip pref=20
1 u32 fh 801::801 order 2049 key ht 801 bkt 0 flowid 2:1002<BR>
=
match=20
c0a80002/ffffffff at 16<BR>filter protocol ip pref 1 u32 fh 800: ht =
divisor=20
1<BR>filter protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt =
0=20
flowid 2:30<BR> match c0a80100/ffffff00 at 12<BR>filter
protocol =
ip pref 1=20
u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 2:40<BR>
match=20
c0a80200/ffffff00 at 12<BR></DIV></DIV></DIV>
<DIV> </DIV>
<DIV>I read in lartc.org that filter can be attached to any class, not =
only to=20
root. I make my traffic control acording to that. And everything is =
fine.</DIV>
<DIV>I see thah filters are grouped. There is "fh 800::", but
where is =
relation=20
between "parent 2:0" and "fh 800::". Logicaly "parent
2:30" =3D> "fh =
801::" and=20
"parent 2:40" =3D> "fh
802::". </DIV>
<DIV> </DIV>
<DIV>What I'm missing?</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Svetozar</DIV>
<DIV><BR> </DIV></FONT>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial =
size=3D2> </DIV>
<DIV><BR></DIV></FONT></FONT></BODY></HTML>
------=_NextPart_000_00B0_01C458A5.455DCD80--