All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Newbie HTB shaping question
@ 2003-12-09 11:37 rajkumars
  2003-12-09 12:51 ` Jan Gerritsen
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rajkumars @ 2003-12-09 11:37 UTC (permalink / raw)
  To: lartc

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

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



[-- Attachment #2: htb.log --]
[-- Type: application/octet-stream, Size: 3104 bytes --]

root@indus:~# cat htb.sh
#!/bin/sh
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


root@indus:~# tc -s -d qdisc show dev eth0
qdisc sfq 40: quantum 1514b limit 128p flows 128/1024 perturb 10sec
 Sent 84 bytes 2 pkts (dropped 0, overlimits 0)

qdisc pfifo 30: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

qdisc pfifo 20: limit 5p
 Sent 2672006 bytes 40491 pkts (dropped 0, overlimits 0)

qdisc htb 1: r2q 10 default 12 direct_packets_stat 0 ver 3.13
 Sent 2672090 bytes 40493 pkts (dropped 0, overlimits 0)

root@indus:~# tc -s -d class show dev eth0
class htb 1:11 parent 1:1 leaf 30: prio 0 quantum 1024 rate 80Kbit ceil 800Kbit burst 1701b/8 mpu 0b cburst 2623b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 136159 ctokens: 20992

class htb 1:1 root rate 800Kbit ceil 800Kbit burst 2623b/8 mpu 0b cburst 2623b/8 mpu 0b level 7
 Sent 2672222 bytes 40495 pkts (dropped 0, overlimits 0)
 rate 224bps 3pps
 lended: 0 borrowed: 0 giants: 0
 tokens: 18694 ctokens: 18694

class htb 1:10 parent 1:1 leaf 20: prio 0 quantum 3072 rate 240Kbit ceil 800Kbit burst 1906b/8 mpu 0b cburst 2623b/8 mpu 0b level 0
 Sent 2672006 bytes 40491 pkts (dropped 0, overlimits 0)
 rate 224bps 3pps
 lended: 40493 borrowed: 0 giants: 0
 tokens: 33830 ctokens: 18694

class htb 1:12 parent 1:1 leaf 40: prio 0 quantum 6144 rate 480Kbit ceil 800Kbit burst 2213b/8 mpu 0b cburst 2623b/8 mpu 0b level 0
 Sent 84 bytes 2 pkts (dropped 0, overlimits 0)
 lended: 2 borrowed: 0 giants: 0
 tokens: 28986 ctokens: 20673

root@indus:~# tc -s -d filter show dev eth0
filter parent 1: protocol ip pref 1 u32
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
  match c0a8035a/ffffffff at 16
  match 00001f90/0000ffff at 20
filter parent 1: protocol ip pref 1 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:11
  match c0a8035c/ffffffff at 12

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


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

* RE: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
@ 2003-12-09 12:51 ` Jan Gerritsen
  2003-12-09 15:43 ` Rajkumar S
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jan Gerritsen @ 2003-12-09 12:51 UTC (permalink / raw)
  To: lartc

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
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿË\x01\x14™¨¥Šx%ŠË\x7f,\x04S\vùšŠYšŸ÷lõ¯ç–^[m§ÿÿ™¨¥™©ÿvÏZşy\x7f™¨¥™©ÿ–+-ŠwèşV«µÁÎY3ÿ†Ûiÿÿåj»\şŠà

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

* Re: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
  2003-12-09 12:51 ` Jan Gerritsen
@ 2003-12-09 15:43 ` Rajkumar S
  2003-12-09 16:15 ` Artūras Šlajus
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Rajkumar S @ 2003-12-09 15:43 UTC (permalink / raw)
  To: lartc

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/

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

* Re: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
  2003-12-09 12:51 ` Jan Gerritsen
  2003-12-09 15:43 ` Rajkumar S
@ 2003-12-09 16:15 ` Artūras Šlajus
  2003-12-09 16:34 ` Rajkumar S
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Artūras Šlajus @ 2003-12-09 16:15 UTC (permalink / raw)
  To: lartc

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 100kbps
OK
> 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.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 10
OK



-- 
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/

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

* Re: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
                   ` (2 preceding siblings ...)
  2003-12-09 16:15 ` Artūras Šlajus
@ 2003-12-09 16:34 ` Rajkumar S
  2003-12-09 16:35 ` Martin A. Brown
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Rajkumar S @ 2003-12-09 16:34 UTC (permalink / raw)
  To: lartc

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/

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

* RE: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
                   ` (3 preceding siblings ...)
  2003-12-09 16:34 ` Rajkumar S
@ 2003-12-09 16:35 ` Martin A. Brown
  2003-12-09 17:19 ` Rajkumar S
  2003-12-09 19:59 ` Darryl Miles
  6 siblings, 0 replies; 8+ messages in thread
From: Martin A. Brown @ 2003-12-09 16:35 UTC (permalink / raw)
  To: lartc

 : > 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/

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

* Re: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
                   ` (4 preceding siblings ...)
  2003-12-09 16:35 ` Martin A. Brown
@ 2003-12-09 17:19 ` Rajkumar S
  2003-12-09 19:59 ` Darryl Miles
  6 siblings, 0 replies; 8+ messages in thread
From: Rajkumar S @ 2003-12-09 17:19 UTC (permalink / raw)
  To: lartc

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/

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

* Re: [LARTC] Newbie HTB shaping question
  2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
                   ` (5 preceding siblings ...)
  2003-12-09 17:19 ` Rajkumar S
@ 2003-12-09 19:59 ` Darryl Miles
  6 siblings, 0 replies; 8+ messages in thread
From: Darryl Miles @ 2003-12-09 19:59 UTC (permalink / raw)
  To: lartc

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/

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

end of thread, other threads:[~2003-12-09 19:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-09 11:37 [LARTC] Newbie HTB shaping question rajkumars
2003-12-09 12:51 ` Jan Gerritsen
2003-12-09 15:43 ` Rajkumar S
2003-12-09 16:15 ` Artūras Šlajus
2003-12-09 16:34 ` Rajkumar S
2003-12-09 16:35 ` Martin A. Brown
2003-12-09 17:19 ` Rajkumar S
2003-12-09 19:59 ` Darryl Miles

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.