Hi Stef, Sorry to write to you directly but my list membership is not working, I receive the archive but cant send to the list, cant delete myself because I don''t exist and can''t rejoin as they say I do exist, anyway hope you don''t mind Can you tell me what the difference between these two scripts is please. What I want to achieve is a high speed channel 1000kbit from port 3000 from an application running on the box doing the shaping, while shaping the traffic at 64kbit going thru the box to the network, WITHOUT affecting the small 64kbit bandwidth. In EXAMPLE 1 ALL traffic goes thru 1:1 but does not seem to affect the slow channels 1:2,1:3 and 1:4 In EXAMPLE 2 the port 3000 traffic only goes thru 1:998 and 1:997 but it shows "lended" packets in the "tc stats" My feeling is EXAMPLE 2 is the right way but I would like your input EXAMPLE 1: tc qdisc del dev eth0 root handle 1: htb default 999 tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1 tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit tc class add dev eth0 parent 1: classid 1:998 htb rate 1000kbit tc qdisc add dev eth0 parent 1:998 handle 1998: sfq perturb 10 tc class add dev eth0 parent 1:998 classid 1:997 htb rate 1000kbit ceil 1000kbit prio 0 quantum 15140 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000 0xffff flowid 1:997 tc class add dev eth0 parent 1:1 classid 1:999 htb rate 6kbit ceil 64kbit prio 0 quantum 1514 tc qdisc add dev eth0 parent 1:999 handle 1999: sfq perturb 10 tc class add dev eth0 parent 1:1 classid 1:2 htb rate 24kbit ceil 64kbit prio 0 quantum 1514 tc class add dev eth0 parent 1:1 classid 1:3 htb rate 24kbit ceil 24kbit prio 0 quantum 1514 tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10kbit ceil 64kbit prio 0 quantum 1514 tc qdisc add dev eth0 parent 1:2 handle 200: sfq perturb 2 tc qdisc add dev eth0 parent 1:3 handle 300: sfq perturb 2 tc qdisc add dev eth0 parent 1:4 handle 400: sfq perturb 2 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xffff flowid 1:2 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 25 0xffff flowid 1:3 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53 0xffff flowid 1:4 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53 0xffff match ip protocol 17 0xff flowid 1:4 END EXAMPLE 1 EXAMPLE 2: tc qdisc del dev eth0 root handle 1: htb default 999 tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1 tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit tc class add dev eth0 parent 1:1 classid 1:999 htb rate 6kbit ceil 64kbit prio 0 quantum 1514 tc qdisc add dev eth0 parent 1:999 handle 1999: sfq perturb 10 tc class add dev eth0 parent 1:1 classid 1:2 htb rate 24kbit ceil 64kbit prio 0 quantum 1514 tc class add dev eth0 parent 1:1 classid 1:3 htb rate 24kbit ceil 24kbit prio 0 quantum 1514 tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10kbit ceil 64kbit prio 0 quantum 1514 tc class add dev eth0 parent 1:1 classid 1:5 htb rate 1000kbit ceil 1000kbit prio 0 quantum 15140 tc class add dev eth0 parent 1:5 classid 1:6 htb rate 1000kbit ceil 1000kbit prio 0 quantum 15140 tc qdisc add dev eth0 parent 1:2 handle 200: sfq perturb 2 tc qdisc add dev eth0 parent 1:3 handle 300: sfq perturb 2 tc qdisc add dev eth0 parent 1:4 handle 400: sfq perturb 2 tc qdisc add dev eth0 parent 1:6 handle 600: sfq perturb 5 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xffff flowid 1:2 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 25 0xffff flowid 1:3 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53 0xffff flowid 1:4 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53 0xffff match ip protocol 17 0xff flowid 1:4 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000 0xffff flowid 1:6 END EXAMPLE 2 Regards Allan Gee Equation 021 4181777 www.equation.co.za _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Wednesday 09 April 2003 20:06, Allan Gee wrote:> Hi Stef, > Sorry to write to you directly but my list membership is not working, I > receive the archive but cant send to the list, cant delete myself because I > don''t exist and can''t rejoin as they say I do exist, anyway hope you don''t > mind > > Can you tell me what the difference between these two scripts is please.Sorry it took so long to formulate an answer. It'' was a busy week for me.> What I want to achieve is a high speed channel 1000kbit from port 3000 from > an application running on the box doing the shaping, while shaping the > traffic at 64kbit going thru the box to the network, WITHOUT affecting the > small 64kbit bandwidth. > > In EXAMPLE 1 ALL traffic goes thru 1:1 but does not seem to affect the slow > channels 1:2,1:3 and 1:4 > In EXAMPLE 2 the port 3000 traffic only goes thru 1:998 and 1:997 but it > shows "lended" packets in the "tc stats" > My feeling is EXAMPLE 2 is the right way but I would like your inputYou need to do something like this : root htb qdisc class 1:1 with rate = ceil = 1000 + 64 = 1046 class 1:2 with rate = 1000, ceil = 1064 class 1:3 with rate = 64, ceil = 64 If you want to control the 64 kbit more, you have to attach the classes to 1:3. Giving class 1:2 a ceil of 1064, allows it to borrow the unused bandwidth of class 1:3. You also have to give class 1:3 a ceil of 64, so you never send more data then your link cna handle. I also have some comments on your scripts :> tc class add dev eth0 parent 1: classid 1:998 htb rate 1000kbit > tc qdisc add dev eth0 parent 1:998 handle 1998: sfq perturb 10The added sfq will removed as soone as you execute the foloowing command.> tc class add dev eth0 parent 1:998 classid 1:997 htb rate 1000kbit ceil > 1000kbit prio 0 quantum 15140 > tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport > 3000 0xffff flowid 1:997> EXAMPLE 2: > tc qdisc del dev eth0 root handle 1: htb default 999 > tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1 > tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit > tc class add dev eth0 parent 1:1 classid 1:5 htb rate 1000kbit ceil > 1000kbit prio 0 quantum 15140 > tc class add dev eth0 parent 1:5 classid 1:6 htb rate 1000kbit ceil > 1000kbit prio 0 quantum 15140Why are you doing 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/