<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi John,<BR>
&nbsp;<BR>
Thanks for the reply.&nbsp; I removed the ceil parameters as a troubleshooting process to ensure that they weren't what was causing the excess of the configured rate.&nbsp; From what I can see if the ceil parameter is not specified it defaults to the same figure as the rate parameter.&nbsp; I have verified this by running "tc -s -d class list dev eth0".&nbsp; The output from this command also shows that the rate limited classes have not borrowed at all (see below). &nbsp; I have tried what you suggested anyway and it is still exceeding the configured rate.&nbsp; The output below was generated on the server immediately after the completion of the iperf tests.&nbsp; Another thing that doesn't make sense to me is that all but one of the classes are reported to have been lending but which class&nbsp;are they lending to?&nbsp; None of the classes have been recorded as borrowing.<BR><BR>
# tc -s -d class list dev eth0<BR>class htb 1:10 parent 1:1 prio 0 quantum 200000 rate 30000Kbit ceil 100000Kbit burst 39093b/8 mpu 0b overhead 0b cburst 126587b/8 mpu 0b overhead 0b level 0<BR>&nbsp;Sent 574506 bytes 1223 pkts (dropped 0, overlimits 0)<BR>&nbsp;rate 63888bit 18pps<BR>&nbsp;lended: 1223 borrowed: 0 giants: 0<BR>&nbsp;tokens: 10155 ctokens: 9883<BR>
class htb 1:1 root rate 100000Kbit ceil 100000Kbit burst 1487b/8 mpu 0b overhead 0b cburst 126587b/8 mpu 0b overhead 0b level 7<BR>&nbsp;Sent 1006166 bytes 7723 pkts (dropped 0, overlimits 0)<BR>&nbsp;rate 181840bit 240pps<BR>&nbsp;lended: 0 borrowed: 0 giants: 0<BR>&nbsp;tokens: 110 ctokens: 9883<BR>
class htb 1:40 parent 1:4 leaf 40: prio 0 quantum 1000 rate 50000bit ceil 50000bit burst 1661b/8 mpu 0b overhead 0b cburst 1661b/8 mpu 0b overhead 0b level 0<BR>&nbsp;Sent 81010 bytes 1225 pkts (dropped 341, overlimits 0)<BR>&nbsp;rate 21272bit 40pps<BR>&nbsp;lended: 1225 borrowed: 0 giants: 0<BR>&nbsp;tokens: -239487 ctokens: -239487<BR>
class htb 1:4 parent 1:1 rate 300000bit ceil 300000bit burst 1974b/8 mpu 0b overhead 0b cburst 1974b/8 mpu 0b overhead 0b level 6<BR>&nbsp;Sent 431660 bytes 6500 pkts (dropped 0, overlimits 0)<BR>&nbsp;rate 117952bit 222pps<BR>&nbsp;lended: 0 borrowed: 0 giants: 0<BR>&nbsp;tokens: 39055 ctokens: 39055<BR>
class htb 1:41 parent 1:4 leaf 41: prio 0 quantum 1000 rate 50000bit ceil 50000bit burst 1661b/8 mpu 0b overhead 0b cburst 1661b/8 mpu 0b overhead 0b level 0<BR>&nbsp;Sent 78502 bytes 1189 pkts (dropped 294, overlimits 0)<BR>&nbsp;rate 20376bit 39pps<BR>&nbsp;lended: 1189 borrowed: 0 giants: 0<BR>&nbsp;tokens: -176795 ctokens: -176795<BR>
class htb 1:42 parent 1:4 leaf 42: prio 0 quantum 2500 rate 200000bit ceil 200000bit burst 1849b/8 mpu 0b overhead 0b cburst 1849b/8 mpu 0b overhead 0b level 0<BR>&nbsp;Sent 272120 bytes 4086 pkts (dropped 809, overlimits 0)<BR>&nbsp;rate 71768bit 135pps<BR>&nbsp;lended: 4086 borrowed: 0 giants: 0<BR>&nbsp;tokens: 4616 ctokens: 4616<BR><BR>
&nbsp;<BR>
<BR>&gt; Date: Mon, 19 Nov 2007 22:49:03 +0100<BR>&gt; From: default@advaita.sytes.net<BR>&gt; Subject: Re: [LARTC] Unexpected results using HTB qdisc<BR>&gt; To: lartc@mailman.ds9a.nl<BR>&gt; <BR>&gt; Hi<BR>&gt; <BR>&gt; Stuart Clouston wrote:<BR>&gt; &gt; Hi All,<BR>&gt; &gt;<BR>&gt; &gt; I am using the script below to limit download rates and manage traffic for a certain IP address and testing the results using iperf. The rate that iperf reports is much higher than the rate I have configured for the HTB qdisc. It's probably just some newbie trap that's messing things up but I'm buggered if I can see it.<BR>&gt; &gt;<BR>&gt; &gt; The following script is run on the server (192.168.10.30): (I have simplified it and removed all of the ceil parameters during my troubleshooting process)<BR>&gt; &gt; <BR>&gt; it think you should have not removed ceiling parameters : )<BR>&gt; &gt; # Remove any existing qdisc<BR>&gt; &gt; tc qdisc del dev eth0 root handle 1:<BR>&gt; &gt;<BR>&gt; &gt; # Root queueing discipline<BR>&gt; &gt; tc qdisc add dev eth0 root handle 1: htb default 10<BR>&gt; &gt;<BR>&gt; &gt; # Root class<BR>&gt; &gt; tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit burst 1500 ceil 100mbit<BR>&gt; &gt;<BR>&gt; &gt; # Default class<BR>&gt; &gt; tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30mbit ceil 100mbit burst 1500<BR>&gt; &gt;<BR>&gt; &gt; # Rate limited classes<BR>&gt; &gt; tc class add dev eth0 parent 1:1 classid 1:4 htb rate 300kbit<BR>&gt; &gt; <BR>&gt; &gt; tc class add dev eth0 parent 1:4 classid 1:40 htb rate 50kbit<BR>&gt; &gt; <BR>&gt; You should use ceil here right after rate, otherwise the class can <BR>&gt; borrow from its parent class and therefore your overall traffic will be <BR>&gt; shaped in correct proportion but not absolutely (i.e to proper bandwidth)<BR>&gt; Once you set ceil value, the class will not get any more throughput even <BR>&gt; if the link is free...<BR>&gt; <BR>&gt; &gt; tc class add dev eth0 parent 1:4 classid 1:41 htb rate 50kbit<BR>&gt; &gt; tc class add dev eth0 parent 1:4 classid 1:42 htb rate 200kbit<BR>&gt; &gt;<BR>&gt; &gt; tc qdisc add dev eth0 parent 1:40 handle 40: sfq perturb 10<BR>&gt; &gt; tc qdisc add dev eth0 parent 1:41 handle 41: sfq perturb 10<BR>&gt; &gt; tc qdisc add dev eth0 parent 1:42 handle 42: sfq perturb 10<BR>&gt; &gt;<BR>&gt; &gt; # Filters to direct traffic to the right classes:<BR>&gt; &gt;<BR>&gt; &gt; U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32"<BR>&gt; &gt; $U32 match ip dst 192.168.10.85 match ip sport 3389 0xffff flowid 1:42<BR>&gt; &gt; $U32 match ip dst 192.168.10.85 match ip sport 1352 0xffff flowid 1:41<BR>&gt; &gt; $U32 match ip dst 192.168.10.85 flowid 1:40<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; The client (192.168.10.85) then runs iperf to test the results:<BR>&gt; &gt;<BR>&gt; &gt; iperf -c 192.168.10.30 -p 1352 -P 5 -f k<BR>&gt; &gt; [SUM] 0.0-11.4 sec 3016 KBytes 2163 Kbits/sec<BR>&gt; &gt;<BR>&gt; &gt; iperf -c 192.168.10.30 -p 23 -P 5 -f k<BR>&gt; &gt; [SUM] 0.0-11.4 sec 2856 KBytes 2053 Kbits/sec<BR>&gt; &gt;<BR>&gt; &gt; iperf -c 192.168.10.30 -p 3389 -P 5 -f k<BR>&gt; &gt; [SUM] 0.0-10.3 sec 11264 KBytes 8956 Kbits/sec<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; The traffic is being shaped proportionally as I'd hoped but each class is well in excess of its configured limit. <BR>&gt; &gt;<BR>&gt; &gt; I am getting similar results on two separate units:<BR>&gt; &gt; 1: Debian (testing), Kernel v2.6.16.19, iproute2 ss070313<BR>&gt; &gt; 2: Ubuntu (dapper), Kernel v2.6.23.1, iproute2 ss041019<BR>&gt; &gt;<BR>&gt; &gt; I'd be very grateful for any information that could help me out.<BR>&gt; &gt; Thanks,<BR>&gt; &gt; Stu (newbie to HTB)<BR>&gt; &gt; _________________________________________________________________<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; I am newbie too, so if i am wrong please someone correct me.<BR>&gt; <BR>&gt; -- <BR>&gt; ___________________________________<BR>&gt; S pozdravom / Best regards<BR>&gt; <BR>&gt; John Default<BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; LARTC mailing list<BR>&gt; LARTC@mailman.ds9a.nl<BR>&gt; http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc<BR><BR><br /><hr />Listen now! <a href='http://ninemsn.com.au/share/redir/adTrack.asp?mode=click&clientID=832&referral=hotmailtaglineOct07&URL=http://music.ninemsn.com.au/roguetraders' target='_new'>New music from the Rogue Traders.</a></body>
</html>