From: "James Ma" Date: Fri, 29 Nov 2002 16:13:11 +0000 Subject: [LARTC] dynamic bandwidth in stef's scripts MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0007_01C29798.4DDF53E0" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C29798.4DDF53E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, All, I went through the HTB test section on www.docum.org. One thing I am = very interested in is the scripts Stef was using: BW1=3D$1'kbps' BW2=3D`expr 100 - $1` BW2=3D$BW2'kbps' tc qdisc del dev eth0 root handle 1: tc qdisc add dev eth0 root handle 1: htb default 12 tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil = 100kbps burst 2k tc class add dev eth0 parent 1:1 classid 1:10 htb rate $BW1 ceil 100kbps = burst 2k tc class add dev eth0 parent 1:1 classid 1:11 htb rate $BW2 ceil 100kbps = burst 2k tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid = 10:10 tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid = 10:11 iptables -F iptables -X iptables -N acc_0 iptables -N acc_1 iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1 iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 2 iptables -A OUTPUT -p tcp --dport 2000 -j acc_0 iptables -A OUTPUT -p tcp --dport 2001 -j acc_1 =09 It seems we could dynamically change the bandwidth allocation between = children. But can we use=20 dynamic bandwidth for the parent? I mean can I use a variable to replace = 100kbps in the parent queue defination and change it whenever this script file is called? This = way, the scripts will=20 work with dynamic bandwidth environment, I can monitor the bandwidth I = have currently, and give=20 it to the scripts dynamically by calling the script file with the = bandwidth parameter. Is this practical? Has anybody tried it before? James ------=_NextPart_000_0007_01C29798.4DDF53E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, All,
 
I went through the HTB test section on = www.docum.org. One thing I am very = interested in=20 is the scripts Stef was using:
 
BW1=3D$1'kbps'
BW2=3D`expr 100 - $1`
BW2=3D$BW2'kbps'

tc qdisc del dev eth0 root handle 1:

tc qdisc add dev eth0 root handle 1: htb default 12
tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil =
100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate $BW1 ceil 100kbps =
burst 2k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate $BW2 ceil 100kbps =
burst 2k

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid =
10:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid =
10:11

iptables -F
iptables -X
iptables -N acc_0
iptables -N acc_1
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1
iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 2
iptables -A OUTPUT -p tcp --dport 2000 -j acc_0
iptables -A OUTPUT -p tcp --dport 2001 -j acc_1
	
It seems we could dynamically change the =
bandwidth allocation between children. But can we use 
dynamic bandwidth for the parent? I mean can I use a =
variable to replace 100kbps in the parent
queue =
defination and change it whenever this script file is called? This way, =
the scripts will 
work with dynamic bandwidth =
environment, I can monitor the bandwidth I have currently, and give =
it to the scripts dynamically by calling the =
script file with the bandwidth parameter.
Is =
this practical? Has anybody tried it before?
 
James
 
------=_NextPart_000_0007_01C29798.4DDF53E0-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/