All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] basic htb setup
@ 2002-02-28  3:25 Ben
  2002-02-28  9:00 ` Martin Devera
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Ben @ 2002-02-28  3:25 UTC (permalink / raw)
  To: lartc

Hey all. I'm trying to set up QoS using the HTB qdisc in a very basic
setup, but it the example shown in the howto doesn't seem to be working.
While the packets show up in the correct classes, they appear to be
completely ignoring the rates, meaning nothing gets shaped.

My setup is that I've got a a bunch of machines behind my firewall/router:


1.2.3.1      +----------------------------+    10.0.0.1
1.2.3.2 -----+eth0  firewall/router   eth1+--- 10.0.0.2
1.2.3.3      +----------------------------+    10.0.0.3


10.0.0.1 is nat'd to 1.2.3.1, 10.0.0.2 to 1.2.3.2, etc. eth0 is attached
to a 768Kbit DSL line, and eth1 to a 100Mb ethernet.

I want to limit the output of 10.0.0.1, but let it borrow from everybody
else's bandwidth when the bandwidth would go unused. HTB seems ideal for
this, and the TC stuff is pretty much identical to the basic one in the
howto:

tc qdisc add dev eth0 handle 1: root htb default 11

tc class add dev eth0 parent 1: classid 1:1 htb rate 768kbit ceil 768kbit burst 15k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 160kbit ceil 768kbit burst 15k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 608kbit ceil 768kbit burst 15k

tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth0 parent 1:11 handle 10: sfq perturb 10

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 1.2.3.1 flowid 1:10


When I start sucking a lot of data from 10.0.0.1 and 10.0.0.2 from outside
the firewall, the packets end up in the correct classes (judging by tc -s
-d show dev eth0). But they also are processed at equal rates, not at the
160:608 ratio I've specified.

What am I doing wrong?

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] basic htb setup
  2002-02-28  3:25 [LARTC] basic htb setup Ben
@ 2002-02-28  9:00 ` Martin Devera
  2002-02-28  9:04 ` Stef Coene
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Martin Devera @ 2002-02-28  9:00 UTC (permalink / raw)
  To: lartc

Hi,
look whether backlog was build on htb qdisc. In your setup
where both you and modem are limiting the flow on the same
rate it is possible that modem is limiting "a bit more" thus
preventing backlog to be build on qdisc.
All non-work-conserving disciplines (shapers) must have some
backlog to work correctly.
As fix make HTB's rate a bit smaller (750kbit f.e.).
devik

On Wed, 27 Feb 2002, Ben wrote:

> Hey all. I'm trying to set up QoS using the HTB qdisc in a very basic
> setup, but it the example shown in the howto doesn't seem to be working.
> While the packets show up in the correct classes, they appear to be
> completely ignoring the rates, meaning nothing gets shaped.
> 
> My setup is that I've got a a bunch of machines behind my firewall/router:
> 
> 
> 1.2.3.1      +----------------------------+    10.0.0.1
> 1.2.3.2 -----+eth0  firewall/router   eth1+--- 10.0.0.2
> 1.2.3.3      +----------------------------+    10.0.0.3
> 
> 
> 10.0.0.1 is nat'd to 1.2.3.1, 10.0.0.2 to 1.2.3.2, etc. eth0 is attached
> to a 768Kbit DSL line, and eth1 to a 100Mb ethernet.
> 
> I want to limit the output of 10.0.0.1, but let it borrow from everybody
> else's bandwidth when the bandwidth would go unused. HTB seems ideal for
> this, and the TC stuff is pretty much identical to the basic one in the
> howto:
> 
> tc qdisc add dev eth0 handle 1: root htb default 11
> 
> tc class add dev eth0 parent 1: classid 1:1 htb rate 768kbit ceil 768kbit burst 15k
> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 160kbit ceil 768kbit burst 15k
> tc class add dev eth0 parent 1:1 classid 1:11 htb rate 608kbit ceil 768kbit burst 15k
> 
> tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev eth0 parent 1:11 handle 10: sfq perturb 10
> 
> tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 1.2.3.1 flowid 1:10
> 
> 
> When I start sucking a lot of data from 10.0.0.1 and 10.0.0.2 from outside
> the firewall, the packets end up in the correct classes (judging by tc -s
> -d show dev eth0). But they also are processed at equal rates, not at the
> 160:608 ratio I've specified.
> 
> What am I doing wrong?
> 
> _______________________________________________
> 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/

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

* Re: [LARTC] basic htb setup
  2002-02-28  3:25 [LARTC] basic htb setup Ben
  2002-02-28  9:00 ` Martin Devera
@ 2002-02-28  9:04 ` Stef Coene
  2002-02-28 17:50 ` Ben
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stef Coene @ 2002-02-28  9:04 UTC (permalink / raw)
  To: lartc

On Thursday 28 February 2002 04:25, Ben wrote:
> Hey all. I'm trying to set up QoS using the HTB qdisc in a very basic
> setup, but it the example shown in the howto doesn't seem to be working.
> While the packets show up in the correct classes, they appear to be
> completely ignoring the rates, meaning nothing gets shaped.
>
> My setup is that I've got a a bunch of machines behind my firewall/router:
>
>
> 1.2.3.1      +----------------------------+    10.0.0.1
> 1.2.3.2 -----+eth0  firewall/router   eth1+--- 10.0.0.2
> 1.2.3.3      +----------------------------+    10.0.0.3
>
>
> 10.0.0.1 is nat'd to 1.2.3.1, 10.0.0.2 to 1.2.3.2, etc. eth0 is attached
> to a 768Kbit DSL line, and eth1 to a 100Mb ethernet.
>
> I want to limit the output of 10.0.0.1, but let it borrow from everybody
> else's bandwidth when the bandwidth would go unused. HTB seems ideal for
> this, and the TC stuff is pretty much identical to the basic one in the
> howto:
>
> tc qdisc add dev eth0 handle 1: root htb default 11
>
> tc class add dev eth0 parent 1: classid 1:1 htb rate 768kbit ceil 768kbit
> burst 15k tc class add dev eth0 parent 1:1 classid 1:10 htb rate 160kbit
> ceil 768kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:11 htb
> rate 608kbit ceil 768kbit burst 15k
>
> tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev eth0 parent 1:11 handle 10: sfq perturb 10
You use twice handle 10:.  Typo ?

>
> tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src
> 1.2.3.1 flowid 1:10
>
>
> When I start sucking a lot of data from 10.0.0.1 and 10.0.0.2 from outside
> the firewall, the packets end up in the correct classes (judging by tc -s
> -d show dev eth0). But they also are processed at equal rates, not at the
> 160:608 ratio I've specified.
Do you use the full 768kbit ?
When you do tc -s -d class show dev eth0, do you see any packets in class 
1:11? 
Or better, post the output of that command.

Stef

-- 

stef.coene@docum.org
 More QOS info : http://www.docum.org/
 Title : "Using Linux as bandwidth manager"
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] basic htb setup
  2002-02-28  3:25 [LARTC] basic htb setup Ben
  2002-02-28  9:00 ` Martin Devera
  2002-02-28  9:04 ` Stef Coene
@ 2002-02-28 17:50 ` Ben
  2002-02-28 17:52 ` Ben
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Ben @ 2002-02-28 17:50 UTC (permalink / raw)
  To: lartc

Yep, sorry, that was a typo. The handle of the second leaf qdisc is 11:

The output of "tc -s -d class show dev eth0":

class htb 1:11 parent 1:1 leaf 11: prio 0 rate 590Kbit ceil 750Kbit burst 15Kb/8 mpu 0b cburst 2559b/8 mpu 0b quantum 7552 level 0
 Sent 7399829 bytes 6552 pkts (dropped 0, overlimits 781)
 rate 34711bps 30pps
 lended: 6552 borrowed: 0 giants: 0 injects: 0
 tokens: 150181 ctokens: 8943

class htb 1:1 root prio 0 rate 750Kbit ceil 750Kbit burst 15Kb/8 mpu 0b cburst 2559b/8 mpu 0b quantum 9600 level
 Sent 19027560 bytes 14359 pkts (dropped 0, overlimits 0)
 rate 86405bps 65pps
 lended: 4811 borrowed: 0 giants: 0 injects: 0
 tokens: 111913 ctokens: 2685

class htb 1:10 parent 1:1 leaf 10: prio 0 rate 160Kbit ceil 750Kbit burst 15Kb/8 mpu 0b cburst 2559b/8 mpu 0b quantum 2048 level 0
 Sent 11627731 bytes 7807 pkts (dropped 0, overlimits 1325)
 rate 52338bps 35pps
 lended: 2996 borrowed: 4811 giants: 0 injects: 0
 tokens: -28622 ctokens: 8943




The output of "tc -s -d class show dev eth0":

class htb 1:11 parent 1:1 leaf 11: prio 0 rate 590Kbit ceil 750Kbit burst 15Kb/8 mpu 0b cburst 2559b/8 mpu 0b quantum 7552 level 0
 Sent 8616029 bytes 7538 pkts (dropped 0, overlimits 898)
 rate 34368bps 29pps
 lended: 7538 borrowed: 0 giants: 0 injects: 0
 tokens: 141989 ctokens: 7717

class htb 1:1 root prio 0 rate 750Kbit ceil 750Kbit burst 15Kb/8 mpu 0b cburst 2559b/8 mpu 0b quantum 9600 level 3
 Sent 22251526 bytes 16692 pkts (dropped 0, overlimits 0)
 rate 86312bps 64pps
 lended: 5648 borrowed: 0 giants: 0 injects: 0
 tokens: 98400 ctokens: -10828

class htb 1:10 parent 1:1 leaf 10: prio 0 rate 160Kbit ceil 750Kbit burst 15Kb/8 mpu 0b cburst 2559b/8 mpu 0b quantum 2048 level 0
 Sent 13635497 bytes 9154 pkts (dropped 0, overlimits 1494)
 rate 51048bps 34pps
 lended: 3506 borrowed: 5648 giants: 0 injects: 0
 tokens: -45392 ctokens: -2927



On Thu, 28 Feb 2002, Stef Coene wrote:

> On Thursday 28 February 2002 04:25, Ben wrote:
> > Hey all. I'm trying to set up QoS using the HTB qdisc in a very basic
> > setup, but it the example shown in the howto doesn't seem to be working.
> > While the packets show up in the correct classes, they appear to be
> > completely ignoring the rates, meaning nothing gets shaped.
> >
> > My setup is that I've got a a bunch of machines behind my firewall/router:
> >
> >
> > 1.2.3.1      +----------------------------+    10.0.0.1
> > 1.2.3.2 -----+eth0  firewall/router   eth1+--- 10.0.0.2
> > 1.2.3.3      +----------------------------+    10.0.0.3
> >
> >
> > 10.0.0.1 is nat'd to 1.2.3.1, 10.0.0.2 to 1.2.3.2, etc. eth0 is attached
> > to a 768Kbit DSL line, and eth1 to a 100Mb ethernet.
> >
> > I want to limit the output of 10.0.0.1, but let it borrow from everybody
> > else's bandwidth when the bandwidth would go unused. HTB seems ideal for
> > this, and the TC stuff is pretty much identical to the basic one in the
> > howto:
> >
> > tc qdisc add dev eth0 handle 1: root htb default 11
> >
> > tc class add dev eth0 parent 1: classid 1:1 htb rate 768kbit ceil 768kbit
> > burst 15k tc class add dev eth0 parent 1:1 classid 1:10 htb rate 160kbit
> > ceil 768kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:11 htb
> > rate 608kbit ceil 768kbit burst 15k
> >
> > tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
> > tc qdisc add dev eth0 parent 1:11 handle 10: sfq perturb 10
> You use twice handle 10:.  Typo ?
>
> >
> > tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src
> > 1.2.3.1 flowid 1:10
> >
> >
> > When I start sucking a lot of data from 10.0.0.1 and 10.0.0.2 from outside
> > the firewall, the packets end up in the correct classes (judging by tc -s
> > -d show dev eth0). But they also are processed at equal rates, not at the
> > 160:608 ratio I've specified.
> Do you use the full 768kbit ?
> When you do tc -s -d class show dev eth0, do you see any packets in class
> 1:11?
> Or better, post the output of that command.
>
> Stef
>
> --
>
> stef.coene@docum.org
>  More QOS info : http://www.docum.org/
>  Title : "Using Linux as bandwidth manager"
>

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] basic htb setup
  2002-02-28  3:25 [LARTC] basic htb setup Ben
                   ` (2 preceding siblings ...)
  2002-02-28 17:50 ` Ben
@ 2002-02-28 17:52 ` Ben
  2002-03-01  7:54 ` Stef Coene
  2002-03-01  8:27 ` Martin Devera
  5 siblings, 0 replies; 7+ messages in thread
From: Ben @ 2002-02-28 17:52 UTC (permalink / raw)
  To: lartc

As far as I can see, no backlog is being built. How can I tell?

FYI, I lowered 768Kbit to 750Kbit and there is no difference. But anyway,
doesn't doing that mean that my dsl line will run at less than its best
possible speed?

On Thu, 28 Feb 2002, Martin Devera wrote:

> Hi,
> look whether backlog was build on htb qdisc. In your setup
> where both you and modem are limiting the flow on the same
> rate it is possible that modem is limiting "a bit more" thus
> preventing backlog to be build on qdisc.
> All non-work-conserving disciplines (shapers) must have some
> backlog to work correctly.
> As fix make HTB's rate a bit smaller (750kbit f.e.).
> devik
>
> On Wed, 27 Feb 2002, Ben wrote:
>
> > Hey all. I'm trying to set up QoS using the HTB qdisc in a very basic
> > setup, but it the example shown in the howto doesn't seem to be working.
> > While the packets show up in the correct classes, they appear to be
> > completely ignoring the rates, meaning nothing gets shaped.
> >
> > My setup is that I've got a a bunch of machines behind my firewall/router:
> >
> >
> > 1.2.3.1      +----------------------------+    10.0.0.1
> > 1.2.3.2 -----+eth0  firewall/router   eth1+--- 10.0.0.2
> > 1.2.3.3      +----------------------------+    10.0.0.3
> >
> >
> > 10.0.0.1 is nat'd to 1.2.3.1, 10.0.0.2 to 1.2.3.2, etc. eth0 is attached
> > to a 768Kbit DSL line, and eth1 to a 100Mb ethernet.
> >
> > I want to limit the output of 10.0.0.1, but let it borrow from everybody
> > else's bandwidth when the bandwidth would go unused. HTB seems ideal for
> > this, and the TC stuff is pretty much identical to the basic one in the
> > howto:
> >
> > tc qdisc add dev eth0 handle 1: root htb default 11
> >
> > tc class add dev eth0 parent 1: classid 1:1 htb rate 768kbit ceil 768kbit burst 15k
> > tc class add dev eth0 parent 1:1 classid 1:10 htb rate 160kbit ceil 768kbit burst 15k
> > tc class add dev eth0 parent 1:1 classid 1:11 htb rate 608kbit ceil 768kbit burst 15k
> >
> > tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
> > tc qdisc add dev eth0 parent 1:11 handle 10: sfq perturb 10
> >
> > tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 1.2.3.1 flowid 1:10
> >
> >
> > When I start sucking a lot of data from 10.0.0.1 and 10.0.0.2 from outside
> > the firewall, the packets end up in the correct classes (judging by tc -s
> > -d show dev eth0). But they also are processed at equal rates, not at the
> > 160:608 ratio I've specified.
> >
> > What am I doing wrong?
> >
> > _______________________________________________
> > 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/
>


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] basic htb setup
  2002-02-28  3:25 [LARTC] basic htb setup Ben
                   ` (3 preceding siblings ...)
  2002-02-28 17:52 ` Ben
@ 2002-03-01  7:54 ` Stef Coene
  2002-03-01  8:27 ` Martin Devera
  5 siblings, 0 replies; 7+ messages in thread
From: Stef Coene @ 2002-03-01  7:54 UTC (permalink / raw)
  To: lartc

On Thursday 28 February 2002 18:52, you wrote:
> As far as I can see, no backlog is being built. How can I tell?
>
> FYI, I lowered 768Kbit to 750Kbit and there is no difference. But anyway,
> doesn't doing that mean that my dsl line will run at less than its best
> possible speed?
Yes.  But you have to do this.
The reason is simple.  The devices that's the bottleneck on the link will be 
shaping the traffic.  YOU want to shape the traffic, so you have to be sure 
your modem is never filled up with traffic so his buffers are not disturbing 
you setup.  The only thing you can do is make sure you are not sending too 
nuch traffic.
So yes, you loose some bandwidth, but you win the possibility to shape the 
remaining bandwidth.

Stef

-- 

stef.coene@docum.org
 More QOS info : http://www.docum.org/
 Title : "Using Linux as bandwidth manager"
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] basic htb setup
  2002-02-28  3:25 [LARTC] basic htb setup Ben
                   ` (4 preceding siblings ...)
  2002-03-01  7:54 ` Stef Coene
@ 2002-03-01  8:27 ` Martin Devera
  5 siblings, 0 replies; 7+ messages in thread
From: Martin Devera @ 2002-03-01  8:27 UTC (permalink / raw)
  To: lartc

> As far as I can see, no backlog is being built. How can I tell?

you would see the backlog in tc -s qdisc show. It must not be there
all time but you should see some at least when link is fully used.
If you don't see it you line is probably slower than you isp claimed :)
devik
 

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

end of thread, other threads:[~2002-03-01  8:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-28  3:25 [LARTC] basic htb setup Ben
2002-02-28  9:00 ` Martin Devera
2002-02-28  9:04 ` Stef Coene
2002-02-28 17:50 ` Ben
2002-02-28 17:52 ` Ben
2002-03-01  7:54 ` Stef Coene
2002-03-01  8:27 ` Martin Devera

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.