Re: collectively rate limiting multiple classes

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello there,

>  I'm having a hard time determining the best approach for
>collectively rate limiting multiple classes of traffic.
>
>  I think the best way to describe what I'm trying to accomplish is by
>example.  Let's say that you do not want to allow more than 100Mb/s
>out of an interface.   But you also want to impose additional limits
>on certain types of traffic.  So for example, you want traffic with
>fwmark 0x7 limited to at most 70Mb/s and traffic with fwmark 0x8
>limited to at most 80Mb/s.  What kind of setup would be recommended
>for this type of scenario?

Others on this list who have more current experience with the 
traffic control tooling may have a better answer for a recommended 
setup, however, I will offer my answer below, to your question about 
HTB and setting up nested classes.

>  One idea was having a root HTB class for the interface with a rate
>and ceil of 100Mb/s.   Then have subclasses with rate 0 and ceils of
>80Mb/s and 70Mb/s.  However, I'm not allowed to set a zero rate.

>  I don't want to guarantee any amount of bandwidth for a particular
>class, I only want to impose limits.  I get the feeling that I should
>use an entirely different approach.   Does anyone have a suggestion?

Why not use 1Mb/s rate for each of the leaf classes?  Or, actually, 
anything non-zero.

I think there's a conceptual piece you are missing with HTB.  When 
you set the rate, you are not actually reserving anything at all.  
You are simply setting the rate at which the borrowing / sharing 
mechanisms kick into play.

What you want to avoid is a case where the sum of the rates of the 
leaf(most) classes exceed the ceiling of any of the parent classes.  
Last I knew, HTB had no detection of this, so you could essentially 
write a configuration that would allow you to send more in the 
leaf(most) classes than a ceil in a parent class.

So, probably pick some very low bitrate for your fwmark 0x8 and 
fwmark 0x7 classes and then set the ceil to be the maximum for each 
class.

Good luck,

-Martin

-- 
Martin A. Brown
http://linux-ip.net/



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux