Traffic prioritization

Hi!

(виде на русском)

Very simple task but i do not see any solution exactly for my case.
I have some core at mikrotiks (it’s small RBs and too much wireless links, here no customers - just a abstract traffic) and all traffic in network with prio != 0 have dscp value > 0.
I said that we already have marked traffic (and may easy mark packets by dscp - just make mapping in mangle if needed).
We do not know about slowest link in the network, we can’t make QTree cuz in QTree we SHOULD use speed limit but here no speed limitation - only prioritization.

Am asking help about idea: how we can create some analog of queue type kind which will be pooling queue for transmitting into wire (wireless) based on dscp or some prio value?
For example:
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1
Packet 3: priority 0
Packet 4: priority 3
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 2
Packet 9: priority 0

Tick 1: select from queue packets with highest prio.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1
Packet 3: priority 0
Packet 4: priority 3 → transmit
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 2
Packet 9: priority 0

Tick 2: refilling queue.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1
Packet 3: priority 0
Packet 4: empty → putting there new incoming packet, for example priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 2
Packet 9: priority 0

will be:
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 2
Packet 9: priority 0

Tick 3: select from queue packets with highest prio.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 2 → transmit
Packet 9: priority 0

Tick 4: refilling queue.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: empty → putting there new incoming packet, for example priority 0
Packet 9: priority 0

Tick 5: select from queue packets with highest prio.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 1 → transmit
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 0
Packet 9: priority 0

Tick 6: refilling queue.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: empty → putting there new incoming packet, for example priority 0
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 0
Packet 9: priority 0

Tick 7: select from queue packets with highest prio.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: priority 0
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1 - transmit first at tick #5
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 0
Packet 9: priority 0

Tick 8: refilling queue.
[INTERFACE QUEUE]
Packet 1: priority 0
Packet 2: empty → putting there new incoming packet, for example priority 0
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 1
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 0
Packet 9: priority 0

Tick 9: select from queue packets with highest prio.
[INTERFACE QUEUE]
Packet 1: priority 0 → (no highest prio, use fifo) -< transmit
Packet 2: priority 0
Packet 3: priority 0
Packet 4: priority 0
Packet 5: priority 0
Packet 6: priority 0
Packet 7: priority 0
Packet 8: priority 0
Packet 9: priority 0

And so on.

This is very simple but as i see no such functional now. Please comment.

This is already done in wireless as a standard feature. Not configurable.
The wireless has a couple of queues (not 8, usually 4) and the 8 levels from DSCP are mapped to the queues.
See the manual. http://wiki.mikrotik.com/wiki/Manual:WMM

Thanks!
Partially it’s may be used as solution in some cases for AP/Clients with OS version starting from v6.x priority can be set from DSCP by setting from-dscp-high-3-bits.

Generally we have functions for keeping a lot of data in RAM then forwarding but this is not used properly. In some cases I may want to move all forwarding processes from HW to software exactly for prioritization in extremely cases.

UPD: In QTree we can control queue size, statistics and this is important info but then WMM used - it’s another story.

I use Qtree in combination with priority from DSCP 3 bits, but as you suggest it is only useful on links with a fixed rate.
E.g. on a point-to-point link with fixed speed we use this very successfully. The Qtree starts with a queue at slightly
below the interface rate, and below that are 8 queues for each priority with a lower limit-at, so the higher DSCP priority
takes priority in the queue but the highest priority is not able to take out the entire line.
This works perfectly. On WiFi we are forced to rely on the WMM because the line rate is not exactly predictable.