graphing simple queues

I am working on a Mikrotik 2.9 box where we are trying to set up traffic shaping and graphing using the mangle table and simple queues. The mangle table is required because the queues deal with IP ranges which don’t fall neatly into cidr blocks and may be non-contiguous (eg, a customer may have 20-25 and 35-40), so address lists are used to mark the packets. The rules look similar to the following:

mangle:
chain=prerouting src-address-list=customer1 action=mark-packet new-packet-mark=customer1 passthrough=no
chain=prerouting dst-address-list=customer1 action=mark-packet new-packet-mark=customer1 passthrough=no

simple queue:
name=“customer1” interface=all direction=both packet-marks=customer1

What we see is that the In and Out are nearly identical, which seems unlikely. Additionally, if max-limit is set to 4MB/2MB, the In will be limited to 3MB, while the Out can be higher, though I haven’t seen it get higher than 4MB.

The goal is to be able to see both In and Out for a given customer on a single graph. The available interfaces are all, ether1, ether2, and bridge0. bridge0 uses ether1 and ether2.

I’ve noticed that the only way to get both directions graphed at all is that the mangle rule must be in the prerouting chain, and the the queue must use interface=all.

Target-address option is necessary for the ‘queue simple’ rule (it is possible to set network address into this field, it is not possible to set range there).

Probably, it is possible to use ‘queue tree’, if range is necessary for you, but then remote SNMP server should be used to gather the information for graphs from ‘queue tree’ entries.

But if the target-address is the source address, does that mean that it is not possible to use simple queues with incoming traffic? Would 0.0.0.0/0 work?

It does seem to mostly be correctly limiting traffic, just that instead of 4/2 it will tend to maintain 3/3.

It is possible to use ‘queue simple’ as for incoming as for outgoing traffic, target-address is not equal to src-address.