collectively rate limiting multiple classes

Adam Nieścierowicz <[email protected]>
Newsgroups org.kernel.vger.lartc
Message-ID <[email protected]>
You can use classfull qdisc like:

level1: qdisc 1:0 eth0

leve1: class 1:1 1Gbps

level1: class 1:2 parrent 1:1 speed 100Mbps

level2: qdisc 2:0 on class 1:2

level2: class 2:1 speed 100Mbps

level2: class 2:2 parrent 2:1 speed 70Mpb fwmark 0x7

level2: class 2:3 parrent 2:1 speed 80Mpb fwmark 0x8

filter level1: attache to qdisc 1:0 redirect traffic to class 1:2 base
on ip src/dst address
filter leve2: attache to qdisc 2:0 redirect traffic to class 2:x base on
fwmark dont use ip src/dst filter here



W dniu 06.09.2018 o 05:35, Martin A. Brown pisze:
> 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
>

-- 
---
Pozdrawiam
Adam Nieścierowicz
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEDUKvPzclxUwWJxzqAOadbZUSWVMFAluQ7/AACgkQAOadbZUS
WVMDAQ/+L4uP5NAsHHlZDbMxXFL36+SW7lLzDiZw5A8mXCt8gOcxXK8oeSE6KHbx
TcE7bp8HGViNSFS+Ftl2vjEKeKcHPl659FJKkPuwAQkDTp7WBusFEgY3ACotga2S
vUDcGgNWMrEzhJParbD4ZFRIbMqn6GTfxEpyRiGCs/DYZq+4n+RLJD0gDL51IAX9
EWyEuwb1sKXNTTteTG3L4abz0FbjfbSpHQ0PtPMK5lG2/RMf0rZ+tnHtdaObFcpt
ggZD7wnhMjNATLFQO7bQqY64FFBnrZfajLmPcvKTPB3bk2WFlVNWaaL+ppHNwQEV
Wb5f2DAkaaBffn3dzjhaZA5ESU6WKdeiUtH+f9RED5uivoUa0LYlkfF/h1F4osjC
pR8yGdbEe4IsuypRjMUDca90DBxw7gOVpLQUXooci4Anv8QGa89IQMlJXiJfVwM0
CoOu3PBWc+8ZKHIh1ryxGnM3T7eBuoDxsoFFZ8iG1e90giO53b5K/H+uL4gAiMzN
ZWmJ1mvjMpCTta87uaR7/QWn1InCQ0UdWXfAhppvAgM5c1gc92ON65cAWCj4vt9+
4ENWeW+i6r5bMFAOPqipvwMYcmxpaepYXxpP++yNVAUcBPdYIoo3U9lhW3GzdnIg
Mx6SnS9J3Jfmk5lqDpPZQ6EuMBDYvFVgEnnd8ESuXTjPaiCFV8s=
=mI63
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.