On Monday 22 July 2002 10:44, Lumir Unzeitig wrote: >> Hi >> I have flat structure of traffic control - 8 children can borrow from a >> parent. >> Problem: The rest bandwidth is not divided to children how I expect. >>I supposed "the rest of bandwidth is divided to the PCs in ratio of their >>RATE values". But it isn't. >But how is the bandwidth divided in your test ? Can be handy to know to >find >a solution/answer ... >And can you post the used htb script? >Stef ====================== 1. Real measurement of bw (also in Calculation in previous mail) In my test the downstream bw was divided: class real bw ---------------------------------------- class 1:10-RATE=4kbit....... 12 kbit/s class 1:40-RATE=4kbit....... 12 kbit/s class 1:80-RATE=15kbit...... 29.6 kbit/s ---------------------------------------- Used bw .................... 53.6 kbit/s 2. HTB script ---------------------- #!/bin/bash # chkconfig: 2345 14 89 # description: sets up HTB traffic control and filters #VLAN ########## BAND=56 #kbit/s BURST=2 VBAND1=4 VBAND2=9 VBAND4=4 VBAND5=6 VBAND6=9 VBAND7=4 VBAND8=15 VBAND9=6 ######### case "$1" in ### START ### start) #Delete a root qdisc #******************** tc qdisc del dev eth0 2>/dev/null #Root handle #************ tc qdisc add dev eth0 root handle 1: htb default 100 tc qdisc add dev eth1 root handle 1: htb default 100 #Class for 56kbps channel #************************ tc class add dev eth0 parent 1: classid 1:1 htb \ rate ${BAND}kbit ceil ${BAND}kbit burst 2k #VLAN #1 - subclass 1:10 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:10 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.1.0/24 flowid 1:10 #qdisc - SFQ tc qdisc add dev eth0 parent 1:10 handle 100: sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:10 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 1 \ fw classid 1:10 #qdisc - SFQ tc qdisc add dev eth1 parent 1:10 handle 100: sfq #VLAN #2 - subclass 1:20 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:20 htb \ rate ${VBAND2}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.2.0/24 flowid 1:20 #qdisc - SFQ tc qdisc add dev eth0 parent 1:20 handle 200 sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:20 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 2 \ fw classid 1:20 #qdisc - SFQ tc qdisc add dev eth1 parent 1:20 handle 200: sfq #VLAN #4 - subclass 1:40 #------------------------- #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:40 htb \ rate ${VBAND4}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.4.0/24 flowid 1:40 #qdisc - SFQ tc qdisc add dev eth0 parent 1:40 handle 400: sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:40 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 4 \ fw classid 1:40 #qdisc - SFQ tc qdisc add dev eth1 parent 1:40 handle 400: sfq #VLAN #5 - subclass 1:50 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:50 htb \ rate ${VBAND5}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.5.0/24 flowid 1:50 #qdisc - SFQ tc qdisc add dev eth0 parent 1:50 handle 500: sfq #Upstrean #Subclass definition tc class add dev eth1 parent 1:1 classid 1:50 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 5 \ fw classid 1:50 #qdisc - SFQ tc qdisc add dev eth1 parent 1:50 handle 500: sfq #VLAN #6 - subclass 1:60 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:60 htb \ rate ${VBAND6}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.6.0/24 flowid 1:60 #qdisc - SFQ tc qdisc add dev eth0 parent 1:60 handle 600: sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:60 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 6 \ fw classid 1:60 #qdisc - SFQ tc qdisc add dev eth1 parent 1:60 handle 600: sfq #VLAN #7 - subclass 1:70 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:70 htb \ rate ${VBAND7}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.7.0/24 flowid 1:70 #qdisc - SFQ tc qdisc add dev eth0 parent 1:70 handle 700: sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:70 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 7 \ fw classid 1:70 #qdisc - SFQ tc qdisc add dev eth1 parent 1:70 handle 700: sfq #VLAN #8 - subclass 1:80 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:80 htb \ rate ${VBAND8}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.8.0/24 flowid 1:80 #qdisc - SFQ tc qdisc add dev eth0 parent 1:80 handle 800: sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:80 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 8 \ fw classid 1:80 #qdisc - SFQ tc qdisc add dev eth1 parent 1:80 handle 800: sfq #VLAN #9 - subclass 1:90 #------------------------------ #Downstream #Subclass definition tc class add dev eth0 parent 1:1 classid 1:90 htb \ rate ${VBAND9}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth0 protocol ip parent 1: prio 1 u32 \ match ip dst 192.168.9.0/24 flowid 1:90 #qdisc - SFQ tc qdisc add dev eth0 parent 1:90 handle 900: sfq #Upstream #Subclass definition tc class add dev eth1 parent 1:1 classid 1:90 htb \ rate ${VBAND1}kbit ceil ${BAND}kbit burst ${BURST}k #Filter tc filter add dev eth1 parent 1: protocol ip prio 1 handle 9 \ fw classid 1:90 #qdisc - SFQ tc qdisc add dev eth1 parent 1:90 handle 900: sfq ;; stop) for dev in `ip link| sed -n '/^[0-9]/ { s/^[0-9]\+: \([a-z0-9]\+\):.*/\1/; p; }'`; do tc qdisc del dev $dev root &>/dev/null done ;; restart) $0 stop $0 start ;; stats) echo ---[ eth0: queueing disciplines ]------------------------- echo; tc -s qdisc show dev eth0; echo echo ---[ eth0: configured classes ]--------------------------- echo; tc -s class show dev eth0; echo echo ========================================================================== echo ---[ eth1: queueing disciplines ]------------------------- echo; tc -s qdisc show dev eth1; echo echo ---[ eth1: configured classes ]--------------------------- echo; tc -s class show dev eth1; echo ;; *) echo "HTB start|stop|restart|stats" ;; esac -----Original Message----- From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]On Behalf Of Stef Coene Sent: Monday, July 22, 2002 4:39 PM To: lumir.unzeitig@gatc.com; lartc@mailman.ds9a.nl Subject: Re: htb2 with link sharing - the bandwidth dividing question _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/