From mboxrd@z Thu Jan 1 00:00:00 1970 From: "hotmail" Date: Fri, 04 Apr 2003 12:56:36 +0000 Subject: [LARTC] probleme with cbq share MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00B0_01C2FABA.64005680" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_00B0_01C2FABA.64005680 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi everybody sorry for my poor english. My script doesn't work very well I want to share bandwidth between 3 subnet (64k, 128k, 256k) if i put the flag bounded on the class root that's doesn't work = bandwidth is not limited if i put the flag bounded on each class, all the subnet is limited by = each rule: subnet 64 can't use more than a total of 64k as it was 1 single user ... so i don't know how to share 64k by user on subnet 64, 128k by user on = subnet 128, 256k by user on subnet 254. What's wrong with my script? thx a lot. Michael tc qdisc add dev eth0 root handle 1: cbq bandwidth 100Mbit avpkt 1000 = cell 8 mpu 64 tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 100Mbit \ rate 100Mbit prio 1 allot 1514 weight 10Mbit cell 8 maxburst 20 avpkt = 1000 tc class add dev eth0 parent 1:1 classid 1:2 cbq bandwidth 100Mbit \ rate 4Mbit prio 1 allot 1514 weight 400kbit cell 8 maxburst 20 avpkt = 1000 bounded tc class add dev eth0 parent 1:2 classid 1:11 cbq bandwidth 100Mbit \ rate 64kbit prio 1 allot 1514 weight 6kbit cell 8 maxburst 20 \ avpkt 1000 tc class add dev eth0 parent 1:2 classid 1:12 cbq bandwidth 100Mbit \ rate 128kbit prio 1 allot 1514 weight 13kbit cell 8 maxburst 20 \ avpkt 1000 tc class add dev eth0 parent 1:2 classid 1:13 cbq bandwidth 100Mbit \ rate 256kbit prio 1 allot 1514 weight 26kbit cell 8 maxburst 20 \ avpkt 1000 tc filter add dev eth0 parent 1:0 prio 1 protocol ip u32 tc filter add dev eth0 parent 1:0 prio 1 handle 2: u32 divisor 256 j=3D0; while [ $j -le 255 ]; do hex=3D`echo "obase=3D16; $j" |bc` echo $hex; tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \ match ip src 172.16.64.$j flowid 1:11 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \ match ip src 172.16.128.$j flowid 1:12 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \ match ip src 172.16.254.$j flowid 1:13 j=3D$((j+1)) done tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 800:: \ match ip src 172.16.0.0/16 \ hashkey mask 0x000000ff at 12 \ link 2: =20 ------=_NextPart_000_00B0_01C2FABA.64005680 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi everybody sorry for my poor=20 english.
 
My script doesn't work very = well
 
I want to share bandwidth between 3 = subnet (64k,=20 128k, 256k)
if i put the flag bounded on the class = root that's=20 doesn't work bandwidth is not limited
if i put the flag bounded on each = class, all the=20 subnet is limited by each rule:
 
subnet 64 can't use more than a = total of 64k=20 as it was 1 single user
...
 
so i don't know how to share 64k by = user on subnet=20 64, 128k by user on subnet 128, 256k by user on subnet 254.
 
What's wrong with my = script?
 
thx a lot.
Michael
 
 
tc qdisc add dev eth0 root handle 1: = cbq bandwidth=20 100Mbit avpkt 1000 cell 8 mpu 64
 
tc class add dev eth0 parent 1:0 = classid 1:1 cbq=20 bandwidth 100Mbit \
rate 100Mbit prio 1 allot 1514 weight 10Mbit cell = 8=20 maxburst 20 avpkt 1000
 
tc class add dev eth0 parent 1:1 = classid 1:2 cbq=20 bandwidth 100Mbit \
rate 4Mbit prio 1 allot 1514 weight 400kbit cell = 8=20 maxburst 20 avpkt 1000 bounded
 
tc class add dev eth0 parent 1:2 = classid 1:11 cbq=20 bandwidth 100Mbit \
rate 64kbit prio 1  allot 1514 weight 6kbit = cell 8=20 maxburst 20      \
avpkt 1000
 
tc class add dev eth0 parent 1:2 = classid 1:12 cbq=20 bandwidth 100Mbit \
rate 128kbit prio 1  allot 1514 weight = 13kbit cell 8=20 maxburst 20      \
avpkt 1000
 
tc class add dev eth0 parent 1:2 = classid 1:13 cbq=20 bandwidth 100Mbit  \
rate 256kbit prio 1  allot 1514 weight = 26kbit=20 cell 8 maxburst 20      \
avpkt = 1000
 
tc filter add dev eth0 parent 1:0 prio = 1 protocol=20 ip u32
tc filter add dev eth0 parent 1:0 prio 1 handle 2: u32 divisor = 256
 

j=3D0;
while [ $j -le 255 ]; do
hex=3D`echo "obase=3D16; = $j"=20 |bc`
echo $hex;
tc filter add dev eth0 protocol ip parent 1:0 prio = 1 u32=20 ht 2:$hex: \
match ip src 172.16.64.$j flowid 1:11
tc filter add = dev eth0=20 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \
match ip src = 172.16.128.$j=20 flowid 1:12
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 = ht=20 2:$hex: \
match ip src 172.16.254.$j flowid = 1:13
j=3D$((j+1))
done
 
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 800::=20 \
match ip src 172.16.0.0/16 \
hashkey mask 0x000000ff at 12 = \
link=20 2:

 
------=_NextPart_000_00B0_01C2FABA.64005680-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/