All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Creating a contended section of bandwidth with HTB and IMQ
@ 2007-02-27 11:20 Charles Price
  2007-03-04 12:29 ` Ivan Vladimirov
  2007-03-04 15:10 ` John Arthur
  0 siblings, 2 replies; 3+ messages in thread
From: Charles Price @ 2007-02-27 11:20 UTC (permalink / raw)
  To: lartc

Hi All,

I'm trying to create a contended section of bandwidth using IMQ. I have the 
imq0 device up and running, with traffic passing through it.

Firstly, I need to throttle the entire device imq0 to 2mbit/s.

I would then like to add throttle rules for individual IP addresses, allowing 
them to pass up to 512kbit/s each, as long as imq0 has not reached its 
2mbit/s.

The configuration I currently have is as follows:

tc qdisc add dev imq0 root handle 1: htb default 1
tc class add dev imq0 parent 1: classid 1:1 htb rate 2mbit burst 15k

# IP 10.0.0.10
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 512kbit
tc qdisc add dev imq0 parent 10 handle 10: sfq
tc filter add dev imq0 protocol ip parent 1: prio 10 u32 \
  match ip src 10.0.0.10/32 flowid 1:10

# IP 10.0.0.20
tc class add dev imq0 parent 1:1 classid 1:20 htb rate 512kbit
tc qdisc add dev imq0 parent 20 handle 20: sfq
tc filter add dev imq0 protocol ip parent 1: prio 20 u32 \
  match ip src 10.0.0.20/32 flowid 1:20


Both IP addresses (10.0.0.10 and 10.0.0.20)  aquire their 512kbit/s without 
problem. However, when I add more classes like the ones above and pass 
plently of traffic, each IP address still obtains its full 512kbit/s - 
regardless of the 2mbit/s limit in the root class.

Is there a way to achieve this?

Thanks in advance,

Charlie
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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

* Re: [LARTC] Creating a contended section of bandwidth with HTB and IMQ
  2007-02-27 11:20 [LARTC] Creating a contended section of bandwidth with HTB and IMQ Charles Price
@ 2007-03-04 12:29 ` Ivan Vladimirov
  2007-03-04 15:10 ` John Arthur
  1 sibling, 0 replies; 3+ messages in thread
From: Ivan Vladimirov @ 2007-03-04 12:29 UTC (permalink / raw)
  To: lartc

Charles Price wrote:
> Hi All,
>
> I'm trying to create a contended section of bandwidth using IMQ. I have the 
> imq0 device up and running, with traffic passing through it.
>
> Firstly, I need to throttle the entire device imq0 to 2mbit/s.
>
> I would then like to add throttle rules for individual IP addresses, allowing 
> them to pass up to 512kbit/s each, as long as imq0 has not reached its 
> 2mbit/s.
>
> The configuration I currently have is as follows:
>
> tc qdisc add dev imq0 root handle 1: htb default 1
> tc class add dev imq0 parent 1: classid 1:1 htb rate 2mbit burst 15k
>
> # IP 10.0.0.10
> tc class add dev imq0 parent 1:1 classid 1:10 htb rate 512kbit
> tc qdisc add dev imq0 parent 10 handle 10: sfq
> tc filter add dev imq0 protocol ip parent 1: prio 10 u32 \
>   match ip src 10.0.0.10/32 flowid 1:10
>
> # IP 10.0.0.20
> tc class add dev imq0 parent 1:1 classid 1:20 htb rate 512kbit
> tc qdisc add dev imq0 parent 20 handle 20: sfq
> tc filter add dev imq0 protocol ip parent 1: prio 20 u32 \
>   match ip src 10.0.0.20/32 flowid 1:20
>
>
> Both IP addresses (10.0.0.10 and 10.0.0.20)  aquire their 512kbit/s without 
> problem. However, when I add more classes like the ones above and pass 
> plently of traffic, each IP address still obtains its full 512kbit/s - 
> regardless of the 2mbit/s limit in the root class.
>
> Is there a way to achieve this?
>
> Thanks in advance,
>
> Charlie
> _______________________________________________
> LARTC mailing list
> LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
>
>
>   
You can try using HFSC for such low speeds here is an example

tc qdisc add dev imq0 root handle 1: hfsc default 7
tc qdisc add dev imq1 root handle 1: hfsc default 7
###########################
#Defining root class U/D###
###########################
tc class add dev imq0 parent 1: classid 1:1 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 2mbit
tc class add dev imq1 parent 1: classid 1:1 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 2mbit
###########################
#7Mi klas NOT FILTRED #####
###########################
tc class add dev imq0 parent 1:1 classid 1:7 hfsc ul m1 8kbit d 500 m2
8kbit ls m1 8kbit d 500 m2 8kbit
tc class add dev imq1 parent 1:1 classid 1:7 hfsc ul m1 8kbit d 500 m2
8kbit ls m1 8kbit d 500 m2 8kbit

######################################################################################
tc class add dev imq0 parent 1:1 classid 1:10 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit
tc class add dev imq1 parent 1:1 classid 1:10 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit

tc class add dev imq0 parent 1:1 classid 1:11 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit
tc class add dev imq1 parent 1:1 classid 1:11 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit

tc class add dev imq0 parent 1:1 classid 1:12 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit
tc class add dev imq1 parent 1:1 classid 1:12 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit

tc class add dev imq0 parent 1:1 classid 1:12 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit
tc class add dev imq1 parent 1:1 classid 1:12 hfsc ul m1 2mbit d 500 m2
2mbit ls m1 2mbit d 500 m2 512kbit

This is an example for fair sharing when every subscriber  gets  2mbit 
if it is alone  or  512kbit  if  there are other subscribers on line
 
the speed of imq device never pass 2mbit or whatever you put on class 1:1

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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

* RE: [LARTC] Creating a contended section of bandwidth with HTB and IMQ
  2007-02-27 11:20 [LARTC] Creating a contended section of bandwidth with HTB and IMQ Charles Price
  2007-03-04 12:29 ` Ivan Vladimirov
@ 2007-03-04 15:10 ` John Arthur
  1 sibling, 0 replies; 3+ messages in thread
From: John Arthur @ 2007-03-04 15:10 UTC (permalink / raw)
  To: lartc

Hi Charlie,

That's because for HTB rate is the guaranteed minimum it will get when
requesting bandwidth so the sum of all your rates should not 
Exceed your root (2mbit) or things will get ugly.

You want something like this (ceil)

htb rate 52kbit ceil 512kbit

This is guaranteeing a minimum 52k and setting a max
Bandwidth of 512kbit

Regards John


_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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

end of thread, other threads:[~2007-03-04 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-27 11:20 [LARTC] Creating a contended section of bandwidth with HTB and IMQ Charles Price
2007-03-04 12:29 ` Ivan Vladimirov
2007-03-04 15:10 ` John Arthur

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.