Community discussions

MikroTik App
 
excel4x
just joined
Topic Author
Posts: 15
Joined: Sat Nov 10, 2012 9:51 pm

Simple Queues with Parents - queue order

Wed May 10, 2017 6:15 am

I am confused how parent queues of simple queues should be ordered. Another post stated "your parent queue should be below the child queues." In experimenting with some queues I am encountering problems. I am running RouterOS v6.36.2

I started with a list of 50+ simple queues with no parents - let's call them Q1-50.
1) I added a parent queue at the bottom: P1, with max limit = limted-at = 20M
2) I changed Q3's parent from none to P1
3) At this point, Q3 stopped displaying statistics (bytes, packets..)
4) I moved P1 right underneath Q3 and and both Q3 and P1 started displaying statistics

Could someone please clarify:
1) Why would the position of P1 matter, given that Q3's matched the packets and it's position did not change?

2) Do parent queues need to be ordered immediately under their child queues?

3) My understanding is that first simple queue that matches a packet will grab it and no other queues will see the packet. How does this ordering affect parent queues? For example, if a parent queue matches a packet above the corresponding child queue, which queue gets that packet and how is it processed?

4) If parent queues must follow child queues, how can scripts create a set of parent/child queues, since the parent must exist before a child can refer to it? But, if the parent is created first, the child will be lower than it on the list of queues.

Thanks much for your help!
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Simple Queues with Parents - queue order

Wed May 10, 2017 12:45 pm

Can you do an export of your queues so we can see what exactly you had set.
What I have found is your parent queue needs to be below the queues that are its children. but it does not matter if there are other queues above it that are not linked to the parent queue. The second thing that I found is the target set must cover all the children queues. ie if you have a child queue of 172.17.0.0/24 and second children queue of 172.17.1.0/24 the parent target should be 172.17.0.0/23 to cover both subnets.
 
excel4x
just joined
Topic Author
Posts: 15
Joined: Sat Nov 10, 2012 9:51 pm

Re: Simple Queues with Parents - queue order

Wed May 10, 2017 10:03 pm

Here is an example list of simple queues in order.

#5 is the parent of #1. As listed, #1 is limiting bandwidth. However, if I move #5 down below #6, then #1 stops limiting bandwidth. I realize the #6 is a more inclusive rule that #1 -. I want #1 to limit a subset of the traffic of matched by #6. It appears that even though #1 matches some traffic, #6 will preclude the parent/child set from working if it is below #1 but above the parent.

0 name="spec_stable-ping" target="" parent=none packet-marks=ping-packet
priority=3/3 queue=default-small/default-small limit-at=0/0
max-limit=20M/20M burst-limit=20200k/20200k
burst-threshold=20100k/20100k burst-time=4s/4s bucket-size=0.1/0.1

1 name="spec_ww_to_p2_hi" target=192.168.0.0/16 dst=10.0.2.1/32
parent=test parent packet-marks="" priority=8/8
queue=default-small/default-small limit-at=0/0 max-limit=1M/1M
burst-limit=1200k/1200k burst-threshold=1100k/1100k burst-time=4s/4s
bucket-size=0.1/0.1

2 name="spec_rflow_10x_med" target=10.0.0.0/8 dst=192.168.1.41/32
parent=none packet-marks="" priority=8/8
queue=default-small/default-small limit-at=20M/20M max-limit=20M/20M
burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s
bucket-size=0.1/0.1

3 name="spec_10x_to_10x_low" target=10.0.0.0/8 dst=10.0.0.0/8 parent=none
packet-marks="" priority=8/8 queue=default-small/default-small
limit-at=0/0 max-limit=20M/20M burst-limit=20200k/20200k
burst-threshold=20100k/20100k burst-time=4s/4s bucket-size=0.1/0.1

4 XI name="spec_10x_to_192x_med" target=10.0.0.0/8 dst=192.168.0.0/16
parent=none packet-marks="" priority=8/8
queue=default-small/default-small limit-at=0/0 max-limit=20M/20M
burst-limit=20200k/20200k burst-threshold=20100k/20100k
burst-time=4s/4s bucket-size=0.1/0.1

5 name="test parent" parent=none packet-marks="" priority=8/8
queue=default-small/default-small limit-at=20M/20M max-limit=20M/20M
burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s
bucket-size=0.1/0.1

6 name="spec_192x_to_10x_low" target=192.168.0.0/16 dst=10.0.0.0/8
parent=none packet-marks="" priority=3/3
queue=default-small/default-small limit-at=0/0 max-limit=20M/20M
burst-limit=20200k/20200k burst-threshold=20100k/20100k
burst-time=4s/4s bucket-size=0.1/0.1

I'm not clear on the rules for ordering parents and child queues. It appears that in some cases, the first leaf that matches traffic may not really grab that traffic. Please clarify.
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Simple Queues with Parents - queue order

Wed May 10, 2017 11:25 pm

Your targets and destinations are to broad.
as you have done your child queues needs to be above the parent queue. the next issue you have is the parent queues are operating in order and so if you move 5 below 6 . rule 6 being so broad means it matches all the traffic and so child queue is no longer valid.
If you can stipulate what you would like your queues to do then we can advise the best simple queues to meet your requirements.
 
excel4x
just joined
Topic Author
Posts: 15
Joined: Sat Nov 10, 2012 9:51 pm

Re: Simple Queues with Parents - queue order

Thu May 11, 2017 1:56 am

Thanks for the clarifications.

Here's what am trying to achieve:
internal queues (at top - specify internal targets/destinations)
* limit internal traffic between some specific segments so it does not hog bandwidth (e.g. winbox)
* allow some internal traffic higher levels of bandwidth
external queues (activity for users from internal nodes to the internet) - not shown above example
* these cover specific segments - 10.0.x.x/32, etc.

Yes, some of these targets are large by design. With no parents, this work fine. The first queue that matches manages that traffic. subsequent queues will catch other traffic or traffic not previously specified.

It sounds like parent/child queues need to be synchronized in scope. For example
* Two leaf queues Q1 and Q2 can both match a packet (Q2 more general than Q1)
* P1 as parent of Q1, must be above Q2, otherwise Q2 will interfere with P1

My plan was to have one parent for internal traffic and several parents for external traffic. I'm not sure this is possible give the order/scope constraints. I have several internal queues for different segments. It may not be possible to construct one parent queue that can will match this combination of addresses, but not interfere with other queues.

Matching addresses between parents and children also significantly increases the complexity and management of the queues. If a child queue changes or moves between parents, the parent addresses and order may need to change. Testing and maintaining proper configuration is also more complex.

My assumption/hope was that parent queues would not need to match addresses, since they are only aggregating leaf queues which already specify this information. Apparently this assumption was incorrect.
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Simple Queues with Parents - queue order

Thu May 11, 2017 1:28 pm

I would generate 1 parent queue for internal 1 parent queue for external. If you have mutiple wans you can rethink that. I would the create the queues with the more specific queues ie a queue for a server at the top of the child queues placing the broader queues at the bottom. ie if I need lan traffic from 1 segment to a server on another segment to have a higher or lower speed I would place this at the top of the child queues because it has a specific destination. I would then place the broader lan segment to lan segment queue below that.
 
excel4x
just joined
Topic Author
Posts: 15
Joined: Sat Nov 10, 2012 9:51 pm

Re: Simple Queues with Parents - queue order

Fri May 12, 2017 6:31 am

Thanks for the info and recommendations!
 
midnightman
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Sun Sep 19, 2010 5:22 pm

Re: Simple Queues with Parents - queue order

Sun Oct 15, 2017 7:50 pm

so guys.....how to use parent queues and child queues ?? Have same problem...my parent queue is not covering all child queues (but all child queues are under parent queue)

the problem is ordering.. (I think)

Parent queue muste have highest number? or lowest?


then what with more parent queues? for example...I have 4 parent queues (every parent queue have childs) how ordering then?

thanks a lot.