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
Attachment:
signature.asc
Description: OpenPGP digital signature