All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] dynamic bandwidth in stef's scripts
@ 2002-11-29 16:13 James Ma
  2002-11-29 18:05 ` Stef Coene
  0 siblings, 1 reply; 2+ messages in thread
From: James Ma @ 2002-11-29 16:13 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

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=$1'kbps'
BW2=`expr 100 - $1`
BW2=$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



[-- Attachment #2: Type: text/html, Size: 2265 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] dynamic bandwidth in stef's scripts
  2002-11-29 16:13 [LARTC] dynamic bandwidth in stef's scripts James Ma
@ 2002-11-29 18:05 ` Stef Coene
  0 siblings, 0 replies; 2+ messages in thread
From: Stef Coene @ 2002-11-29 18:05 UTC (permalink / raw)
  To: lartc

On Friday 29 November 2002 17:13, James Ma wrote:
> 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=$1'kbps'
> BW2=`expr 100 - $1`
> BW2=$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?
I never tried it but why not?
But how can you know the maximum bandwidth ??  If you limit all the traffic to 
200kbit, and suddenly you can use 250kbit, how will you notice this?

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-29 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-29 16:13 [LARTC] dynamic bandwidth in stef's scripts James Ma
2002-11-29 18:05 ` Stef Coene

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.