Hi, I am following the HTB user manual and testing HTB on my local lan, using the rules given in the manual. I applied the rules in my eth0 and limited it to 100kbps, but when I tried to wget a file from another machine it came at 1mbps, Here are the commands and the settings. Did I do any thing stupid or is this supposed to work that way? 1. The commands 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 tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30kbps ceil 100kbps tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbps ceil 100kbps tc class add dev eth0 parent 1:1 classid 1:12 htb rate 60kbps ceil 100kbps tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.3.90 match ip dport 8080 0xffff flowid 1:10 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.3.92 flowid 1:11 tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5 tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5 tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10 2. wget output raj@indus:~$ wget -O /dev/null http://penguin:8080/knoppix --14:01:45-- http://penguin:8080/knoppix => `/dev/null'' Resolving penguin... done. Connecting to penguin[192.168.3.90]:8080... connected. HTTP request sent, awaiting response... 200 OK Length: 733,825,024 [text/plain] 2% [> ] 16,952,192 1.03M/s ETA 11:02 As you can see from the command and wget output i limited the outgoing bandwidth to 100kbps but i am still getting 1Mbps. Is this what I am supposed to get or did I do some thing really stupid? I have attached the full logs as a text file also incase my mail client messes up the output. Thanks in Advance, raj
Hi,> As you can see from the command and wget output i limited the > outgoing bandwidth to 100kbps but i am still getting 1Mbps. Is > this what I am supposed to get or did I do some thing really stupid?yes, you limit the outgoing bandwidth,.. not the incomming ;) greets, Jan Gerritsen ,S f)+-L)Y=jyaffvZ_j)fjb?psLmr
Jan Gerritsen wrote:>>As you can see from the command and wget output i limited the >>outgoing bandwidth to 100kbps but i am still getting 1Mbps. Is >>this what I am supposed to get or did I do some thing really stupid? > > > yes, you limit the outgoing bandwidth,.. not the incomming ;)That''s what I tried to do, How did I go wrong? isn''t tc qdisc add dev eth0 root handle 1: htb default 12 supposed to limit the ourgoing bandwidth? Some one please hit me with a clue stick :) raj _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
rajkumars@asianetindia.com wrote:> 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 > tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30kbps ceil 100kbps > tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbps ceil 100kbps > tc class add dev eth0 parent 1:1 classid 1:12 htb rate 60kbps ceil 100kbpsOK> tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.3.90 match ip dport 8080 0xffff flowid 1:10tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.3.90 match ip sport 8080 0xffff flowid 1:10 you aren''t wgeting file from 8080 port of other machine, do you? look from you pc perspective, not client.> tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.3.92 flowid 1:11 > tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5 > tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5 > tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10OK -- Sincerely, Artūras ''arturaz'' Šlajus You can find me at: irc.freenode.org: nick arturaz irc.data.lt: nick arturaz ICQ: 157929934 Jabber: arturaz@akl.lt _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Artūras Šlajus wrote:> you aren''t wgeting file from 8080 port of other machine, do you? > look from you pc perspective, not client.Oh!! /me goes and stands in the corner for 5 minutes :) raj _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
: > As you can see from the command and wget output i limited the : > outgoing bandwidth to 100kbps but i am still getting 1Mbps. Is : > this what I am supposed to get or did I do some thing really stupid? : : yes, you limit the outgoing bandwidth,.. not the incomming ;) What Jan is suggesting is that you might not understand what you''ll need to understand to get the shaping working as you desire. [ I assume your "Internet connected router" is a Linux box. If that''s not accurate, then just assume where I say "Internet connected router" that I''m saying "the router/bridge you are using to shape Internet-bound traffic." ] It''s key that you understand that shaping only functions correctly on transmitted packets (frames), so you''ll need to make sure that you are shaping the packets forwarded from your Internet connected gateway onto the LAN. This means that the gateway may well have the packet(s) already, but it delays transmitting them to meet a certain bandwidth. Shaping your outgoing traffic, which is mostly very small TCP ACK packets, will do little to shape the much larger packets on the "download" side of the stream. Check out the rules I have written [0], the rules that Stef has written [1], and maybe a tidbit about shaping [2]. Now, do you understand why you need to shape the packets transmitted from your Internet connected router to your internal hosts? -Martin [0] http://tldp.org/HOWTO/Traffic-Control-HOWTO/rules.html [1] http://www.docum.org/stef.coene/qos/faq/cache/9.html [2] http://tldp.org/HOWTO/Traffic-Control-HOWTO/elements.html#e-shaping -- Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Martin A. Brown wrote:> It''s key that you understand that shaping only functions correctly on > transmitted packets (frames),Yup, This was the stuff I missed. Thanks a lot for all who replied. I knew I was doing some thing silly, but could not figure out what :)> Now, do you understand why you need to shape the packets transmitted > from your Internet connected router to your internal hosts?Yes, Thanks again. raj _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Martin A. Brown wrote:>Shaping your outgoing traffic, which is mostly very small TCP ACK packets, >will do little to shape the much larger packets on the "download" side of >the stream. >Speaking of this, I am currently thinking about doing some research into shaping of fine grained flows in the reverse direction. My personal itch I''m looking into scratching is using an abundance of spare CPU cycles and memory to help improve the inbound queue situation where bandwidth is limited. In real life situations this would be like a Pentium 266MHz or better class machine is on the end of a connection ranging from 128kbit to 8mbit connection. I''m thinking of using the Linux connection tracker, to make predictions about each connection it is tracking based on recent usage and/or well known expected patterns for that particluar service (at connection creation). This monitoring would then be able calculate some values to weigh in the RTT (from this point to the dest and back) and anticipated reverse payload the destination would return after receipt of this response. With this information available the outbound packets maybe further processed in times where the inbound link is saturated, by selecting packets to delay and/or re-order based on this information, maybe even performing on the fly TCP window clamping or otherwise altering packets in an acceptable way. I''m not trying to defeat TCP congestion control I''m trying to use it to predict the inbound congestion expected at a time in the immediate future, then tweak the packets I can control to make ther other end alter its behaviour. So my questions is does anyone know of any starting points I should look at on this topic ? Thanks Darryl _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/