> On Wed, Nov 29, 2023 at 12:12:02AM +0300, 4 wrote:
>> i haven't used queues for a long time, but now there is a need. previously, 
>> queues had not only a hierarchy, but also a priority. now there is no 
>> priority, only the hierarchy exists. i was surprised, but i thought that 
>> this is quite in the way of Theo, and it is possible to simplify the queue 
>> mechanism only to the hierarchy, meaning that if a queue standing higher in 
>> the hierarchy, and he priority is higher. but in order for it to work this 
>> way, it is necessary to allow assigning packets to any queue, and not just 
>> to the last one, because when you assign only to the last queue in the 
>> hierarchy, then in practice it means that you have no hierarchy and no 
>> queues. and although the rule with the assignment to a queue above the last 
>> one is not syntactically incorrect, but in practice the assignment is not 
>> performed, and the packets fall into the default(last) queue. am i missing 
>> something or is it really idiocy that humanity has not seen yet?
>> 
> How long ago is it that you did anything with queues?

> the older ALTQ system was replaced by a whole new system back in OpenBSD 5.5
> (or actually, altq lived on as oldqeueue through 5.6), and the syntax is both
> very different and in most things much simpler to deal with.

> The most extensive treatment available is in The Book of PF, 3rd edition
> (actually the introduction of the new queues was the reason for doing that
> revision). If for some reason the book is out of reach, you can likely
> glean most of the useful information from the relevant slides in the
> PF tutorial https://home.nuug.no/~peter/pftutorial/ with the traffic
> shaping part starting at https://home.nuug.no/~peter/pftutorial/#68

looks like i'm phenomenally dumb :(

queue rootq on $ext_if bandwidth 20M
        queue main parent rootq bandwidth 20479K min 1M max 20479K qlimit 100
             queue qdef parent main bandwidth 9600K min 6000K max 18M default
             queue qweb parent main bandwidth 9600K min 6000K max 18M
             queue qpri parent main bandwidth 700K min 100K max 1200K
             queue qdns parent main bandwidth 200K min 12K burst 600K for 3000ms
        queue spamd parent rootq bandwidth 1K min 0K max 1K qlimit 300
--
this is a flat model. no hierarchy here, because no priorities. it looks as 
hierarchy exists, but this is "fake news" :\ i can't immediately come up with 
at least one task where such a thing would be needed.. probably no such task 
exist.

pass proto tcp to port ssh set prio 6
--
hard coded eight queues/priorities and no bandwidth controls. but this case is 
at least is useful, because priorities is much more important than bandwidth 
limits.

i have a feeling that the person who came up with this is Mad Hatter from the 
Wonderland :\ what was wrong with the cbq engine where all was in one?
here is a simple task, there are millions of such tasks. there is an internet 
connection, and although it is declared as symmetrical 100mbit it's 100 for 
download, but for upload it depends on the time of day, so we can forget about 
the channel width and focus on the only thing that matters- priorities. we make 
three queues, hierarchically connect them to one another:
root
-|
-high
--|
--normal
---|
---low
but hierarchy is not enough, we need priorities, since each of these three 
queues can contain other queues. for example, the "high" queue may contain, in 
addition to the "normal" queue, "icmp" and "ssh" queues, which are more 
important than the "normal" queue, in which, for example, we will have http, 
ftp and other non-critical traffic. therefore, we assign priority 0 to the 
"normal" queue, priority 1 to the "ssh" queue and limit its maximum bandwidth 
to 10mb(so that ssh does not eat up the entire channel when copying files), and 
assign priority 2 to the "icmp" queue(icmp is more important than ssh). i.e. 
icmp packets will leave first, then ssh packets, and then packets from the 
"normal" queue and its subqueues(or they won't leave if we don't restrict ssh 
and it eats up the entire channel). now:
root
-|
-high[normal(0),ssh(1),icmp(2)]
--|
--normal[low(0),default(1),http(2),ftp(2)]
---|
---low[bittorrent(0),putin(0),vodka(0)]
yes, all this can be make without hierarchy, only with priorities(because 
hierarchy it's priorities), but who and why decided that eight would be enough? 
the one who created cbq- he created it for practical tasks. but this "hateful 
eight" and this "flat-earth"- i don't understand what use they are, they can't 
even solve such the simplified task :\
so what am i missing?

Reply via email to