Community discussions

MikroTik App
 
cornbread
just joined
Topic Author
Posts: 5
Joined: Fri Dec 13, 2019 7:18 pm

Queue Tree with Child Queues

Fri Dec 13, 2019 8:02 pm

I'm not necessarily new to MT but I am new to queuing and I am struggling with a setup I need to deploy. I'm trying to learn how queues function and I am very new to them so please bear with me! Thank you in advance to anyone who is offering advice!

Situation:
#Multiple queues for different clients
#All queues need to have a cap on the bandwidth for the entire vlan, not per device
#A couple queues need to have access to any extra available bandwidth that is not currently being used
#Some specific devices on a single vlan may need to be targeted for minimum bandwidth as well. I assume creating an additional address list for them should work like the others.

Here is a simplified version of the config I am working on. I've only tested on a single device but the cap is working on the one device. In this example I would like for vlan 1 to be able to access any available bandwidth from the circuit and have a minimum of 5M. Vlan 1 needs to be limited dynamically as the other vlans utilize bandwidth All other vlans can hit their respective caps and fight over the scraps if the circuit is saturated as there aren't any other priority connections.

Interfaces
ether1 is LAN
ether2 is WAN
/interface vlan
add name=int-vlan1 vlan-id=1 interface=ether1
add name=int-vlan2 vlan-id=2 interface=ether1

/ip firewall address-list
add address=10.10.10.0/24 list=list-vlan1
add address=10.10.20.0/24 list=list-vlan2

/queue tree
add max-limit=10M limit-at=5M name=tree-vlan1-down parent=int-vlan1
add max-limit=10M limit-at=5M name=tree-vlan1-up parent=ether2

add max-limit=10M name=tree-vlan2-down parent=int-vlan2
add max-limit=10M name=tree-vlan2-up parent=ether2

/queue type
add kind=pcq name=type-vlan1-down pcq-classifier=dst-address
add kind=pcq name=type-vlan1-up pcq-classifier=src-address

add kind=pcq name=type-vlan2-down pcq-classifier=dst-address
add kind=pcq name=type-vlan2-up pcq-classifier=src-address

/queue tree
add name=tree-limit-vlan1 packet-mark=packmark-vlan1 parent=tree-vlan1-down queue=type-vlan1-down
add name=tree-limit-vlan1 packet-mark=packmark-vlan1 parent=tree-vlan1-up queue=type-vlan1-up

add name=tree-limit-vlan2 packet-mark=packmark-vlan2 parent=tree-vlan2-down queue=type-vlan2-down
add name=tree-limit-vlan2 packet-mark=packmark-vlan2 parent=tree-vlan2-up queue=type-vlan2-up

/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=conmark-vlan1 passthrough=yes src-address-list=list-vlan1
add action=mark-packet chain=prerouting connection-mark=conmark-vlan1 new-packet-mark=packmark-vlan1 passthrough=no

add action=mark-connection chain=prerouting new-connection-mark=conmark-vlan2 passthrough=yes src-address-list=list-vlan2
add action=mark-packet chain=prerouting connection-mark=conmark-vlan2 new-packet-mark=packmark-vlan2 passthrough=no
 
cornbread
just joined
Topic Author
Posts: 5
Joined: Fri Dec 13, 2019 7:18 pm

Re: Queue Tree with Child Queues

Tue Dec 17, 2019 6:39 pm

I started from scratch and built a new config. I can't get the download queues to kick in and apply the policies. Any idea why the upload will work but the download wont? While monitoring in Winbox I don't even see any traffic register in the download queues.

Not working:
Download queues not registering any traffic

Working:
Upload parent will limit the child queues with max limit set
Upload child max limit
Connection and Packet marks in Mangle
/ip firewall address-list
add address=10.10.40.0/24 list=all-vlan-400-list
add address=10.10.40.10 list=spec-vlan-400-list
add address=10.10.40.0-10.10.40.9 list=remain-vlan-400-list
add address=10.10.40.11-10.10.40.254 list=remain-vlan-400-list

/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=vlan-400-cmark passthrough=yes src-address-list=all-vlan-400-list
add action=mark-packet chain=prerouting connection-mark=vlan-400-cmark log-prefix=remain-pmark new-packet-mark=remain-vlan-400-pmark passthrough=no src-address-list=remain-vlan-400-list
add action=mark-packet chain=prerouting connection-mark=vlan-400-cmark log-prefix=spec-pmark new-packet-mark=spec-vlan-400-pmark passthrough=no src-address-list=spec-vlan-400-list

/queue tree
add max-limit=20M name=vlan-400-dnld parent=vlan-400-int
add max-limit=3M name=vlan-400-upld parent=ether10
add limit-at=5M max-limit=10M name=spec-vlan-400-dnld packet-mark=spec-vlan-400-pmark parent=vlan-400-dnld priority=7
add max-limit=2500k name=spec-vlan-400-upld packet-mark=spec-vlan-400-pmark parent=vlan-400-upld priority=7
add limit-at=10M max-limit=15M name=remain-vlan-400-dnld packet-mark=remain-vlan-400-pmark parent=vlan-400-dnld
add limit-at=2M max-limit=5M name=remain-vlan-400-upld packet-mark=remain-vlan-400-pmark parent=vlan-400-upld

/queue type
add kind=pcq name=vlan-400-qtype-dnld pcq-classifier=dst-address
add kind=pcq name=vlan-400-qtype-upld pcq-classifier=src-address
add kind=pcq name=spec-vlan-400-qtype-dnld pcq-classifier=dst-address
add kind=pcq name=spec-vlan-400-qtype-upld pcq-classifier=src-address
add kind=pcq name=remain-vlan-400-qtype-dnld pcq-classifier=dst-address
add kind=pcq name=remain-vlan-400-qtype-upld pcq-classifier=src-address

/queue tree
add name=vlan-400-dnld-limit packet-mark=vlan-400-pmark parent=vlan-400-dnld queue=vlan-400-qtype-dnld
add name=vlan-400-upld-limit packet-mark=vlan-400-pmark parent=vlan-400-upld queue=vlan-400-qtype-upld
add name=vlan-400-spec-dnld-limit packet-mark=spec-vlan-400-pmark parent=spec-vlan-400-dnld queue=spec-vlan-400-qtype-dnld
add name=vlan-400-spec-upld-limit packet-mark=spec-vlan-400-pmark parent=spec-vlan-400-upld queue=spec-vlan-400-qtype-upld
add name=vlan-remain-dnld-limit packet-mark=remain-vlan-400-pmark parent=remain-vlan-400-dnld queue=remain-vlan-400-qtype-dnld
add name=vlan-remain-upld-limit packet-mark=remain-vlan-400-pmark parent=remain-vlan-400-upld queue=remain-vlan-400-qtype-upld
 
User avatar
pcunite
Forum Guru
Forum Guru
Posts: 1345
Joined: Sat May 25, 2013 5:13 am
Location: USA

Re: Queue Tree with Child Queues

Tue Dec 17, 2019 7:47 pm

Make sure you don't have FastTrack enabled.
 
cornbread
just joined
Topic Author
Posts: 5
Joined: Fri Dec 13, 2019 7:18 pm

Re: Queue Tree with Child Queues

Tue Dec 17, 2019 7:54 pm

Make sure you don't have FastTrack enabled.
Thank you for the reply. I haven't enabled fast track but I did check just to be sure and it has not been enabled.
 
cornbread
just joined
Topic Author
Posts: 5
Joined: Fri Dec 13, 2019 7:18 pm

Re: Queue Tree with Child Queues

Tue Dec 17, 2019 8:14 pm

I modified the config I posted earlier to simplify it and remove several lines that looked redundant to me. Still with the same problems. As noted above fast track is not enabled.

Working:
Connection and Packet marks are being applied
Upload parent queue caps will apply and prevent child queues from exceeding parent bandwidth
Upload child queues function and max limits apply

Not Working:
Download queues never apply to parent or child and I can use the entire circuit while downloading
While monitoring no traffic shows on the avg rate column due to the policy not applying

/ip firewall address-list
add address=10.10.40.0/24 list=nat
add address=10.10.40.0/24 list=all-vlan-400-list
add address=10.10.40.10 list=spec-vlan-400-list
add address=10.10.40.0-10.10.40.9 list=remain-vlan-400-list
add address=10.10.40.11-10.10.40.254 list=remain-vlan-400-list

/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=vlan-400-cmark passthrough=yes src-address-list=all-vlan-400-list
add action=mark-packet chain=prerouting connection-mark=vlan-400-cmark new-packet-mark=remain-vlan-400-pmark passthrough=no src-address-list=remain-vlan-400-list
add action=mark-packet chain=prerouting connection-mark=vlan-400-cmark new-packet-mark=spec-vlan-400-pmark passthrough=no src-address-list=spec-vlan-400-list

/queue tree
add max-limit=20M name=vlan-400-dnld parent=vlan-400-int
add max-limit=5M name=vlan-400-upld parent=ether10

/queue type
add kind=pcq name=spec-vlan-400-qtype-dnld pcq-classifier=dst-address
add kind=pcq name=spec-vlan-400-qtype-upld pcq-classifier=src-address
add kind=pcq name=remain-vlan-400-qtype-dnld pcq-classifier=dst-address
add kind=pcq name=remain-vlan-400-qtype-upld pcq-classifier=src-address

/queue tree
add limit-at=5M max-limit=10M name=spec-vlan-400-dnld packet-mark=spec-vlan-400-pmark parent=vlan-400-dnld priority=7 queue=remain-vlan-400-qtype-upld
add limit-at=2M max-limit=2M name=spec-vlan-400-upld packet-mark=spec-vlan-400-pmark parent=vlan-400-upld priority=7 queue=spec-vlan-400-qtype-upld
add limit-at=10M max-limit=15M name=remain-vlan-400-dnld packet-mark=remain-vlan-400-pmark parent=vlan-400-dnld queue=remain-vlan-400-qtype-dnld
add limit-at=2M max-limit=3M name=remain-vlan-400-upld packet-mark=remain-vlan-400-pmark parent=vlan-400-upld queue=remain-vlan-400-qtype-upld
 
cornbread
just joined
Topic Author
Posts: 5
Joined: Fri Dec 13, 2019 7:18 pm

Re: Queue Tree with Child Queues  [SOLVED]

Mon Dec 30, 2019 1:49 am

Solved this on my own.

Ether 10 is WAN
Address list to identify targets/ranges
Mangle for up and down packet marks for targets/ranges
Queue types for each target/range
Queue tree for each target/range, parent and child
/interface vlan
add interface=ether1 name=vlan-int vlan-id=10

/ip firewall address-list
add address=192.168.0.1=192.168.0.249 list=dhcp-vlan-list
add address=192.168.0.250-192.168.0.254 list=specific-devices-list

/ip firewall mangle
add action=mark-packet chain=forward dst-address-list=dhcp-vlan-list new-packet-mark=dhcp-vlan-pmark-down passthrough=no
add action=mark-packet chain=forward new-packet-mark=dhcp-vlan-pmark-up passthrough=no src-address-list=dhcp-vlan-list
add action=mark-packet chain=forward dst-address-list=specific-devices-list new-packet-mark=specific-vlan-pmark-down passthrough=no
add action=mark-packet chain=forward new-packet-mark=specific-vlan-pmark-up passthrough=no src-address-list=specific-devices-list

/queue type
add kind=pcq name=whole-vlan-qtype-down pcq-classifier=dst-address
add kind=pcq name=whole-vlan-qtype-up pcq-classifier=src-address
add kind=pcq name=dhcp-vlan-qtype-down pcq-classifier=dst-address
add kind=pcq name=dhcp-vlan-qtype-up pcq-classifier=src-address
add kind=pcq name=specific-vlan-qtype-down pcq-classifier=dst-address
add kind=pcq name=specific-vlan-qtype-up pcq-classifier=src-address

/queue tree
add limit-at=10M max-limit=15M name=whole-vlan-down packet-mark=dhcp-vlan-pmark-down parent=vlan-interface queue=whole-vlan-qtype-down
add limit-at=10M max-limit=15M name=whole-vlan-up packet-mark=dhcp-vlan-pmark-up parent=ether10 queue=whole-vlan-qtype-up
add limit-at=1M max-limit=1M name=dhcp-vlan-down packet-mark=dhcp-vlan-pmark-down parent=whole-vlan-down queue=dhcp-vlan-qtype-down
add limit-at=1M max-limit=1M name=dhcp-vlan-up packet-mark=dhcp-vlan-pmark-up parent=whole-vlan-up queue=dhcp-vlan-qtype-up
add limit-at=2M max-limit=5M name=specific-vlan-down packet-mark=dhcp-vlan-pmark-down parent=whole-vlan-down queue=specific-vlan-qtype-down
add limit-at=2M max-limit=5M name=specific-vlan-up packet-mark=dhcp-vlan-pmark-up parent=whole-vlan-up queue=specific-vlan-qtype-up

Who is online

Users browsing this forum: Bing [Bot], MauriceW and 39 guests