From: "hotmail" Date: Mon, 31 Mar 2003 09:01:33 +0000 Subject: [LARTC] problem in large bandwidth management MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_003D_01C2F774.E42EE220" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_003D_01C2F774.E42EE220 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi! I have to manage the bandwitdh of a cable operator and share it. They have a total bandwidth of 4Mb and 250 customers connected on this = network. They divided their bandwith in 3 category: 64kb =3D> subnet 172.16.64.X 128k =3D> subnet 172.16.128.X 256k =3D> subnet 172.16.254.X So I have to limit the bandwith of eith user: 64Kb for a user in the subnet 172.16.64.X .... After reading the LARC HOWTO, i tried to make a script for sharing the = bandwith. The example 12.4 (Hashing filters for very fast massive filtering) = correspond exactly to my problem but i'm not able to implement it, my script doesn't work, the bandwitdh is not share.:(( Can anyone can help me and tell me what is wrong in my script below? The only difference i see between my script and the example in the howto = is: - In my script i define the rules for ip dst -In the howto they define the rules for ip src Thank you very much for your help The script: tc qdisc del dev eth1 root tc qdisc add dev eth1 root handle 1:0 cbq bandwidth 4Mbit avpkt 1000 = cell 8 tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth 64kbit \ rate 64kbit prio 5 allot 1514 weight 6kbit cell 8 maxburst 20 \ avpkt 1000 isolated tc class add dev eth1 parent 1:0 classid 1:2 cbq bandwidth 128kbit \ rate 128kbit prio 5 allot 1514 weight 12kbit cell 8 maxburst 20 \ avpkt 1000 isolated tc class add dev eth1 parent 1:0 classid 1:3 cbq bandwidth 256kbit \ rate 256kbit prio 5 allot 1514 weight 25kbit cell 8 maxburst 20 \ avpkt 1000 isolated tc filter add dev eth1 parent 1:0 prio 5 protocol ip u32 tc filter add dev eth1 parent 1:0 prio 5 handle 2: u32 divisor 256 j=3D0; while [ $j -le 255 ]; do hex=3D`echo "obase=3D16; $j" |bc` tc filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 2:$hex: \ match ip dst 172.16.64.$j flowid 1:1 tc filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 2:$hex: \ match ip dst 172.16.128.$j flowid 1:2 tc filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 2:$hex: \ match ip dst 172.16.254.$j flowid 1:3 j=3D$((j+1)) done tc filter add dev eth1 protocol ip parent 1:2 prio 5 u32 ht 800:: \ match ip dst 172.16.0.0/16 \ hashkey mask 0x000000ff at 12 \ link 2: Michael Richez. ------=_NextPart_000_003D_01C2F774.E42EE220 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi!
 
I have to manage the bandwitdh of a = cable operator=20 and share it.
 
They have a total bandwidth of 4Mb and = 250=20 customers connected on this network.
 
They divided their bandwith in 3=20 category:
 
64kb =3D> subnet = 172.16.64.X
128k =3D> subnet = 172.16.128.X
256k =3D> subnet = 172.16.254.X
 
So I have to limit the bandwith of = eith=20 user:
64Kb for a user in the subnet=20 172.16.64.X
....
 
After reading the LARC HOWTO, = i tried to=20 make a script for sharing the bandwith.
The example 12.4 (Hashing filters for = very fast=20 massive filtering) correspond exactly to my problem but i'm not able to implement it,
my script doesn't work, the bandwitdh = is not=20 share.:((
 
Can anyone can help me and tell me what = is wrong in=20 my script below?
The only difference i see between my = script and the=20 example in the howto is:
 
- In my script i define the rules for = ip=20 dst
-In the howto they define the rules for = ip=20 src
 
 
Thank you very much for your = help
 
 
 
The script:
 
 
tc qdisc del dev eth1 root
 
tc qdisc add dev eth1 root handle 1:0 = cbq bandwidth=20 4Mbit avpkt 1000 cell 8
 

tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth = 64kbit=20 \
rate 64kbit prio 5  allot 1514  weight 6kbit cell 8 = maxburst=20 20      \
avpkt 1000 isolated
 
tc class add dev eth1 parent 1:0 classid 1:2 cbq bandwidth 128kbit=20 \
rate 128kbit prio 5  allot 1514 weight 12kbit cell 8 maxburst=20 20      \
avpkt 1000 isolated
 
tc class add dev eth1 parent 1:0 classid 1:3 cbq bandwidth = 256kbit =20 \
rate 256kbit prio 5  allot 1514 weight 25kbit cell 8 maxburst=20 20      \
avpkt 1000 isolated
 
tc filter add dev eth1 parent 1:0 prio 5 protocol ip u32
tc = filter add=20 dev eth1 parent 1:0 prio 5 handle 2: u32 divisor 256
 
j=3D0;
while [ $j -le 255 ]; do
hex=3D`echo "obase=3D16; $j" = |bc`
tc=20 filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 2:$hex: = \
match ip=20 dst 172.16.64.$j flowid 1:1
tc filter add dev eth1 protocol ip parent = 1:0=20 prio 5 u32 ht 2:$hex: \
match ip dst 172.16.128.$j flowid 1:2
tc = filter=20 add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 2:$hex: \
match ip = dst=20 172.16.254.$j flowid 1:3
j=3D$((j+1))
done
 
tc filter add dev eth1 protocol ip parent 1:2 prio 5 u32 ht 800::=20 \
match ip dst 172.16.0.0/16 \
hashkey mask 0x000000ff at 12 = \
link=20 2:

 
Michael = Richez.
------=_NextPart_000_003D_01C2F774.E42EE220-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/