Community discussions

MikroTik App
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

queue tree - mutiple wan interfaces - what should be the parent ?

Thu Dec 15, 2016 10:57 am

ROS 6.7

I have a queue tree with wan1,wan2,wan3 interfaces with packet classifieres priority 1-8.

In my queue tree I have six top(parnet) nodes, up/down per each wanX interface with max-limit set specifically for each wanX interface,

What should be the _parent_ of these top six nodes ?
global ? or interface name, e.g, wan1 for wan1_download, wan2_upload nodes.
 
kujo
Member Candidate
Member Candidate
Posts: 169
Joined: Sat Jun 18, 2016 10:17 am
Location: Ukraine
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Thu Dec 15, 2016 2:43 pm

Good question! Some problem. Wan interface for upload streams, lan interface for download stream. Global for input/output chain. But what interface we install in download stream if have multiple wan with different bandwidth ?? We need create correct mangle for each interface! Mangle for wan1, wan2...???


Sent from my iPhone using Tapatalk
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Thu Dec 15, 2016 7:09 pm

I guess we have no choice,

If I set top node parent in que tree to 'wan1', the queu tree dont work, there is no average kbs, queue nodes show no averages kbs, as if nothing was going through the queue
only setting parent=global works
 
kujo
Member Candidate
Member Candidate
Posts: 169
Joined: Sat Jun 18, 2016 10:17 am
Location: Ukraine
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Thu Dec 15, 2016 9:26 pm

Maybe incorrect mangle? Need more info about traffic type, source and dst... You can learn a traffic flow diagram...


Sent from my iPhone using Tapatalk
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Thu Dec 15, 2016 9:37 pm

interfaces wan1, wan2, wan3
lan interfaces (vlan) admin => wan1, szkola => wan2, ( internat, mieszkania) => wan3
/ip firewall mangle
add chain=forward comment="local net => local net" dst-address-list=local-net \
    src-address-list=local-net
add action=mark-connection chain=forward comment="big downloads tcp" \
    connection-bytes=3000000-0 connection-mark=!p8 new-connection-mark=p8 \
    protocol=tcp
add action=mark-connection chain=forward comment="big downloads udp" \
    connection-bytes=3000000-0 connection-mark=!p8 new-connection-mark=p8 \
    protocol=udp
add action=mark-connection chain=forward comment="new dns UDP" \
    connection-mark=no-mark connection-state=new dst-port=53 \
    new-connection-mark=p1 protocol=udp
add action=mark-connection chain=forward comment="new ICMP" connection-mark=\
    no-mark connection-state=new new-connection-mark=p1 protocol=icmp
add action=mark-connection chain=forward comment="new admin lan" \
    connection-mark=no-mark connection-state=new in-interface=admin \
    new-connection-mark=p4
add action=mark-connection chain=forward comment="new szkola lan" \
    connection-mark=no-mark connection-state=new in-interface=szkola \
    new-connection-mark=p5
add action=mark-connection chain=forward comment="new szkola lan" \
    connection-mark=no-mark connection-state=new in-interface=mieszkania \
    new-connection-mark=p5
add action=mark-connection chain=forward comment="new internat lan" \
    connection-mark=no-mark connection-state=new in-interface=internat \
    new-connection-mark=p7
add action=jump chain=forward comment="wan3 down" in-interface=wan3 \
    jump-target=w3_d
add action=jump chain=forward comment="wan3 up" jump-target=w3_u \
    out-interface=wan3
add action=jump chain=forward comment="wan1 down" in-interface=wan1 \
    jump-target=w1_d
add action=jump chain=forward comment="wan1 up" jump-target=w1_u \
    out-interface=wan1
add action=jump chain=forward comment="wan2 down" in-interface=wan2 \
    jump-target=w2_d
add action=jump chain=forward comment="wan2 up" jump-target=w2_u \
    out-interface=wan2
add chain=forward comment="unmarked VPN i<=> int"
add action=mark-connection chain=output comment=\
    "out wan1 => mark connection router_wan1" connection-state=new \
    new-connection-mark=router_wan1 out-interface=wan1
add action=mark-routing chain=output comment="route to wan1 if input wan1" \
    connection-mark=router_wan1 new-routing-mark=wan1
add action=mark-packet chain=output comment="router => wan1  => w1_u_p1" \
    connection-mark=router_wan1 new-packet-mark=w1_u_p1 passthrough=no
add action=mark-connection chain=output comment=\
    "out wan2 => mark connection router_wan2" connection-state=new \
    new-connection-mark=router_wan2 out-interface=wan2
add action=mark-routing chain=output comment="route to wan2 if input wan2" \
    connection-mark=router_wan2 new-routing-mark=wan2
add action=mark-packet chain=output comment="router => wan2 => w2_u_p1" \
    connection-mark=router_wan2 new-packet-mark=w2_u_p1 passthrough=no
add action=mark-connection chain=output comment=\
    "out wan3 => mark connection router_wan3" connection-state=new \
    new-connection-mark=router_wan3 out-interface=wan3
add action=mark-routing chain=output comment="route to wan3 if input wan3" \
    connection-mark=router_wan3 new-routing-mark=wan3
add action=mark-connection chain=input comment="new-con-mark=router_wan1" \
    connection-state=new in-interface=wan1 new-connection-mark=router_wan1
add action=mark-packet chain=input comment="wan1 => router => w1_d_p1" \
    in-interface=wan1 new-packet-mark=w1_d_p1 passthrough=no
add action=mark-connection chain=input comment="new-con-mark=router_wan2" \
    connection-state=new in-interface=wan2 new-connection-mark=router_wan2
add action=mark-packet chain=input comment="wan2 => router => w2_d_p1" \
    in-interface=wan2 new-packet-mark=w2_d_p1 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p8" connection-mark=p8 \
    new-packet-mark=w1_d_p8 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p1" connection-mark=p1 \
    new-packet-mark=w1_d_p1 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p2" connection-mark=p2 \
    new-packet-mark=w1_d_p2 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p3" connection-mark=p3 \
    new-packet-mark=w1_d_p3 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p4" connection-mark=p4 \
    new-packet-mark=w1_d_p4 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p5" connection-mark=p5 \
    new-packet-mark=w1_d_p5 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p6" connection-mark=p6 \
    new-packet-mark=w1_d_p6 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p8" connection-mark=p8 \
    new-packet-mark=w1_u_p8 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p1" connection-mark=p1 \
    new-packet-mark=w1_u_p1 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p2" connection-mark=p2 \
    new-packet-mark=w1_u_p2 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p3" connection-mark=p3 \
    new-packet-mark=w1_u_p3 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p4" connection-mark=p4 \
    new-packet-mark=w1_u_p4 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p5" connection-mark=p5 \
    new-packet-mark=w1_u_p5 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p6" connection-mark=p6 \
    new-packet-mark=w1_u_p6 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p7" connection-mark=p7 \
    new-packet-mark=w1_u_p7 passthrough=no
add action=mark-packet chain=w1_u comment="pmark p8 default" new-packet-mark=\
    w1_u_p8 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p8" connection-mark=p8 \
    new-packet-mark=w2_d_p8 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p1" connection-mark=p1 \
    new-packet-mark=w2_d_p1 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p2" connection-mark=p2 \
    new-packet-mark=w2_d_p2 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p3" connection-mark=p3 \
    new-packet-mark=w2_d_p3 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p4" connection-mark=p4 \
    new-packet-mark=w2_d_p4 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p8" connection-mark=p8 \
    new-packet-mark=w2_u_p8 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p1" connection-mark=p1 \
    new-packet-mark=w2_u_p1 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p2" connection-mark=p2 \
    new-packet-mark=w2_u_p2 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p3" connection-mark=p3 \
    new-packet-mark=w2_u_p3 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p4" connection-mark=p4 \
    new-packet-mark=w2_u_p4 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p5" connection-mark=p5 \
    new-packet-mark=w2_u_p5 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p6" connection-mark=p6 \
    new-packet-mark=w2_u_p6 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p7" connection-mark=p7 \
    new-packet-mark=w2_u_p7 passthrough=no
add action=mark-packet chain=w2_u comment="pmark p8 default" new-packet-mark=\
    w2_u_p8 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p8" connection-mark=p8 \
    new-packet-mark=w3_d_p8 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p7" connection-mark=p7 \
    new-packet-mark=w3_d_p7 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p1" connection-mark=p1 \
    new-packet-mark=w3_d_p1 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p2" connection-mark=p2 \
    new-packet-mark=w3_d_p2 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p3" connection-mark=p3 \
    new-packet-mark=w3_d_p3 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p4" connection-mark=p4 \
    new-packet-mark=w3_d_p4 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p5" connection-mark=p5 \
    new-packet-mark=w3_d_p5 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p6" connection-mark=p6 \
    new-packet-mark=w3_d_p6 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p8" connection-mark=p8 \
    new-packet-mark=w3_u_p8 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p7" connection-mark=p7 \
    new-packet-mark=w3_u_p7 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p1" connection-mark=p1 \
    new-packet-mark=w3_u_p1 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p2" connection-mark=p2 \
    new-packet-mark=w3_u_p2 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p3" connection-mark=p3 \
    new-packet-mark=w3_u_p3 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p4" connection-mark=p4 \
    new-packet-mark=w3_u_p4 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p5" connection-mark=p5 \
    new-packet-mark=w3_u_p5 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p6" connection-mark=p6 \
    new-packet-mark=w3_u_p6 passthrough=no
add action=mark-packet chain=w3_u comment="pmark p8 default" new-packet-mark=\
    w3_u_p8 passthrough=no
add chain=prerouting comment="local net => local net" dst-address-list=\
    local-net src-address-list=local-net
add action=mark-routing chain=prerouting comment="DNS queries przez wan1" \
    dst-port=53 new-routing-mark=wan1 passthrough=no protocol=udp
add action=mark-routing chain=prerouting comment="DNS queries przez wan1" \
    dst-port=53 new-routing-mark=wan1 passthrough=no protocol=tcp
add action=mark-routing chain=prerouting comment="zspserwer przez wan1-3" \
    disabled=yes new-routing-mark=wan2 passthrough=no src-address=\
    10.172.88.10
add action=mark-routing chain=prerouting comment="svr1.int.zsp przez wan1-3" \
    disabled=yes new-routing-mark=wan1 passthrough=no src-address=10.177.88.3
add action=mark-routing chain=prerouting comment=\
    "route internat via wan3 id=route-internat" dst-address-list=!local-net \
    in-interface=internat new-routing-mark=wan_all passthrough=no
add action=mark-packet chain=w1_d comment="pmark p7" connection-mark=p7 \
    new-packet-mark=w1_d_p7 passthrough=no
add action=mark-packet chain=w1_d comment="pmark p8 default" new-packet-mark=\
    w1_d_p8 passthrough=no
add action=mark-packet chain=w3_d comment="pmark p8 default" new-packet-mark=\
    w3_d_p8 passthrough=no
add action=log chain=postrouting comment="debug NAT logging" disabled=yes \
    dst-address=8.8.4.4 dst-address-list="" log-prefix=POSTROUTE protocol=\
    icmp
add action=mark-connection chain=input comment="new-con-mark=router_wan3" \
    connection-state=new in-interface=wan3 new-connection-mark=router_wan3
add action=mark-packet chain=input comment="wan3 => router => w3_d_p1" \
    in-interface=wan3 new-packet-mark=w3_d_p1 passthrough=no
add action=mark-packet chain=output comment="router => wan3 => w3_u_p1" \
    connection-mark=router_wan3 new-packet-mark=w3_u_p1 passthrough=no
add action=mark-routing chain=prerouting comment=\
    "route szkola via wan2 id=route-szkola" dst-address-list=!local-net \
    dst-address-type="" in-interface=szkola new-routing-mark=wan2 \
    passthrough=no
add action=mark-routing chain=prerouting comment=\
    "route admin via wan2 id=route-admin" dst-address-list=!local-net \
    dst-address-type="" in-interface=admin new-routing-mark=wan1 passthrough=\
    no
add action=mark-routing chain=prerouting comment=\
    "route admin via wan2 id=route-mieszkania" dst-address-list=!local-net \
    dst-address-type="" in-interface=mieszkania new-routing-mark=wan_all \
    passthrough=no
add action=mark-packet chain=w2_d comment="pmark p5" connection-mark=p5 \
    new-packet-mark=w2_d_p5 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p6" connection-mark=p6 \
    new-packet-mark=w2_d_p6 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p7" connection-mark=p7 \
    new-packet-mark=w2_d_p7 passthrough=no
add action=mark-packet chain=w2_d comment="pmark p8 default" new-packet-mark=\
    w2_d_p8 passthrough=no
 
kujo
Member Candidate
Member Candidate
Posts: 169
Joined: Sat Jun 18, 2016 10:17 am
Location: Ukraine
Contact:

queue tree - mutiple wan interfaces - what should be the parent ?

Tue Dec 20, 2016 12:35 pm

Can you attach screenshots of queue tree and mangle from winbox?


Sent from my iPhone using Tapatalk
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Tue Dec 20, 2016 1:54 pm

Here they come
You do not have the required permissions to view the files attached to this post.
 
cherepaxa
just joined
Posts: 1
Joined: Mon Jan 09, 2017 3:31 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Jan 09, 2017 3:33 pm

Colleagues, did you find the solution?
I have almost same situation
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Jan 09, 2017 7:12 pm

> I have almost same situation
namely ?
 
jondavy
Member Candidate
Member Candidate
Posts: 143
Joined: Tue May 12, 2009 11:14 pm
Location: Brasil

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Wed Mar 22, 2017 5:49 pm

me too
Here we have link from 2 ISP
With 1 ISP I used HTB to guarantee bandwidth
Now with 2 ISP link how to make sure band when one of them fall?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Wed Mar 22, 2017 5:56 pm

You have to set up a tree for each WAN interface, with each root queue's max-limit set to whatever that ISP's upstream bandwidth actually is.

You can re-use the same packet marks for each queue tree, though, so at least you shouldn't need to make the mangle table even larger.
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Fri Aug 04, 2017 3:41 pm

Thank you for the advice.

Please can you help me with the following:

We have 2 WAN connections load balanced etc.
How do I define the different upload and download speeds for each WAN connections using the Queue Trees? - I understand how to get the Upload limit defined by setting the Interface of each WAN as the parent of the queue tree, but how would I get the different download speeds recognised by the queue?

Thank you in advance
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Fri Aug 04, 2017 3:55 pm

2 wans, define 4 queues each parent of global
wan1_upload, wan1_download, wan2_upload, wan2_download
then you can control each queue wanX_down/up limits

here is sample from my 3x wan config
/queue tree
add max-limit=20M name=w3_d parent=global queue=default
add comment=w3_d_p1 limit-at=15M max-limit=20M name=w3_d_p1 packet-mark=\
    w3_d_p1 parent=w3_d priority=1 queue=pcq-download
add comment=w3_d_p2 limit-at=10M max-limit=20M name=w3_d_p2 packet-mark=\
    w3_d_p2 parent=w3_d priority=2 queue=pcq-download
add comment=w3_d_p3 max-limit=20M name=w3_d_p3 packet-mark=w3_d_p3 parent=\
    w3_d priority=3 queue=pcq-download
add comment=w3_d_p4 limit-at=10M max-limit=20M name=w3_d_p4 packet-mark=\
    w3_d_p4 parent=w3_d priority=4 queue=pcq-download
add comment=w3_d_p5 limit-at=10M max-limit=20M name=w3_d_p5 packet-mark=\
    w3_d_p5 parent=w3_d priority=5 queue=pcq-download
add comment=w3_d_p6 max-limit=20M name=w3_d_p6 packet-mark=w3_d_p6 parent=\
    w3_d priority=6 queue=pcq-download
add comment=w3_d_p7 limit-at=10M max-limit=20M name=w3_d_p7 packet-mark=\
    w3_d_p7 parent=w3_d priority=7 queue=pcq-download
add comment=w3_d_p8 limit-at=10M max-limit=15M name=w3_d_p8 packet-mark=\
    w3_d_p8 parent=w3_d queue=pcq-download
add max-limit=1550k name=w3_u parent=global queue=default
add comment=w3_u_p1 limit-at=900k max-limit=1550k name=w3_u_p1 packet-mark=\
    w3_u_p1 parent=w3_u priority=1 queue=pcq-upload
add comment=w3_u_p2 limit-at=900k max-limit=1550k name=w3_u_p2 packet-mark=\
    w3_u_p2 parent=w3_u priority=2 queue=pcq-upload
add comment=w3_u_p3 max-limit=1550k name=w3_u_p3 packet-mark=w3_u_p3 parent=\
    w3_u priority=3 queue=pcq-upload
add comment=w3_u_p4 limit-at=600k max-limit=1550k name=w3_u_p4 packet-mark=\
    w3_u_p4 parent=w3_u priority=4 queue=pcq-upload
add comment=w3_u_p5 limit-at=600k max-limit=1550k name=w3_u_p5 packet-mark=\
    w3_u_p5 parent=w3_u priority=5 queue=pcq-upload
add comment=w3_u_p6 max-limit=1550k name=w3_u_p6 packet-mark=w3_u_p6 parent=\
    w3_u priority=6 queue=pcq-upload
add comment=w3_u_p7 limit-at=600k max-limit=1550k name=w3_u_p7 packet-mark=\
    w3_u_p7 parent=w3_u priority=7 queue=pcq-upload
add comment=w3_u_p8 limit-at=600k max-limit=1M name=w3_u_p8 packet-mark=\
    w3_u_p8 parent=w3_u queue=pcq-upload
add max-limit=29M name=w2_d parent=global queue=default
add comment=w2_d_p1 limit-at=20M max-limit=29M name=w2_d_p1 packet-mark=\
    w2_d_p1 parent=w2_d priority=1 queue=pcq-download
add comment=w2_d_p2 limit-at=20M max-limit=29M name=w2_d_p2 packet-mark=\
    w2_d_p2 parent=w2_d priority=2 queue=pcq-download
add comment=w2_d_p3 max-limit=29M name=w2_d_p3 packet-mark=w2_d_p3 parent=\
    w2_d priority=3 queue=pcq-download
add comment=w2_d_p4 limit-at=15M max-limit=29M name=w2_d_p4 packet-mark=\
    w2_d_p4 parent=w2_d priority=4 queue=pcq-download
add comment=w2_d_p5 limit-at=15M max-limit=25M name=w2_d_p5 packet-mark=\
    w2_d_p5 parent=w2_d priority=5 queue=pcq-download
add comment=w2_d_p6 max-limit=29M name=w2_d_p6 packet-mark=w2_d_p6 parent=\
    w2_d priority=6 queue=pcq-download
add comment=w2_d_p7 limit-at=15M max-limit=29M name=w2_d_p7 packet-mark=\
    w2_d_p7 parent=w2_d priority=7 queue=pcq-download
add comment=w2_d_p8 limit-at=10M max-limit=25M name=w2_d_p8 packet-mark=\
    w2_d_p8 parent=w2_d queue=pcq-download
add max-limit=14M name=w2_u parent=global queue=default
add comment=w2_u_p1 limit-at=10M max-limit=14M name=w2_u_p1 packet-mark=\
    w2_u_p1 parent=w2_u priority=1 queue=pcq-upload
add comment=w2_u_p2 limit-at=10M max-limit=14M name=w2_u_p2 packet-mark=\
    w2_u_p2 parent=w2_u priority=2 queue=pcq-upload
add comment=w2_u_p3 max-limit=14M name=w2_u_p3 packet-mark=w2_u_p3 parent=\
    w2_u priority=3 queue=pcq-upload
add comment=w2_u_p4 limit-at=10M max-limit=14M name=w2_u_p4 packet-mark=\
    w2_u_p4 parent=w2_u priority=4 queue=pcq-upload
add comment=w2_u_p5 limit-at=10M max-limit=14M name=w2_u_p5 packet-mark=\
    w2_u_p5 parent=w2_u priority=5 queue=pcq-upload
add comment=w2_u_p6 max-limit=14M name=w2_u_p6 packet-mark=w2_u_p6 parent=\
    w2_u priority=6 queue=pcq-upload
add comment=w2_u_p7 limit-at=10M max-limit=14M name=w2_u_p7 packet-mark=\
    w2_u_p7 parent=w2_u priority=7 queue=pcq-upload
add comment=w2_u_p8 limit-at=6M max-limit=10M name=w2_u_p8 packet-mark=\
    w2_u_p8 parent=w2_u queue=pcq-upload
add max-limit=20M name=w1_d parent=global queue=default
add comment=w1_d_p1 limit-at=8M max-limit=20M name=w1_d_p1 packet-mark=\
    w1_d_p1 parent=w1_d priority=1 queue=pcq-download
add comment=w1_d_p2 limit-at=3M max-limit=20M name=w1_d_p2 packet-mark=\
    w1_d_p2 parent=w1_d priority=2 queue=pcq-download
add comment=w1_d_p3 max-limit=20M name=w1_d_p3 packet-mark=w1_d_p3 parent=\
    w1_d priority=3 queue=pcq-download
add comment=w1_d_p4 limit-at=9M max-limit=20M name=w1_d_p4 packet-mark=\
    w1_d_p4 parent=w1_d priority=4 queue=pcq-download
add comment=w1_d_p5 limit-at=4M max-limit=20M name=w1_d_p5 packet-mark=\
    w1_d_p5 parent=w1_d priority=5 queue=pcq-download
add comment=w1_d_p6 max-limit=20M name=w1_d_p6 packet-mark=w1_d_p6 parent=\
    w1_d priority=6 queue=pcq-download
add comment=w1_d_p7 limit-at=10M max-limit=20M name=w1_d_p7 packet-mark=\
    w1_d_p7 parent=w1_d priority=7 queue=pcq-download
add comment=w1_d_p8 limit-at=8M max-limit=12M name=w1_d_p8 packet-mark=\
    w1_d_p8 parent=w1_d queue=pcq-download
add max-limit=1550k name=w1_u parent=global queue=default
add comment=w1_u_p1 limit-at=900k max-limit=1550k name=w1_u_p1 packet-mark=\
    w1_u_p1 parent=w1_u priority=1 queue=pcq-upload
add comment=w1_u_p2 limit-at=900k max-limit=1550k name=w1_u_p2 packet-mark=\
    w1_u_p2 parent=w1_u priority=2 queue=pcq-upload
add comment=w1_u_p3 max-limit=1550k name=w1_u_p3 packet-mark=w1_u_p3 parent=\
    w1_u priority=3 queue=pcq-upload
add comment=w1_u_p4 limit-at=600k max-limit=1550k name=w1_u_p4 packet-mark=\
    w1_u_p4 parent=w1_u priority=4 queue=pcq-upload
add comment=w1_u_p5 limit-at=600k max-limit=1550k name=w1_u_p5 packet-mark=\
    w1_u_p5 parent=w1_u priority=5 queue=pcq-upload
add comment=w1_u_p6 max-limit=1550k name=w1_u_p6 packet-mark=w1_u_p6 parent=\
    w1_u priority=6 queue=pcq-upload
add comment=w1_u_p7 limit-at=600k max-limit=1550k name=w1_u_p7 packet-mark=\
    w1_u_p7 parent=w1_u priority=7 queue=pcq-upload
add comment=w1_u_p8 limit-at=600k max-limit=1M name=w1_u_p8 packet-mark=\
    w1_u_p8 parent=w1_u queue=pcq-upload
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Sat Aug 05, 2017 8:54 am

Thank you so much

What mangle rules do I need to place?

I have prerouting in-interface=wan1 mark-packet=wan1_upload and
Postrouting in-interface=wan1 mark-packet=wan1_download

Would this be correct?
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Sat Aug 05, 2017 10:11 am

I did mangling in Forward chain both in/out face are available in forward chain.

/ip firewall mangle chain=forward
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Sun Aug 06, 2017 11:42 am

Would this be right?

Mangle Rules:
 0    chain=forward action=mark-packet new-packet-mark=W1_Upload passthrough=no in-interface=ether1 log=no log-prefix="" 

 1    chain=forward action=mark-packet new-packet-mark=W1_Download passthrough=no out-interface=ether1 log=no log-prefix="" 

 2    chain=forward action=mark-packet new-packet-mark=W2_Upload passthrough=no in-interface=ether5 log=no log-prefix="" 

 3    chain=forward action=mark-packet new-packet-mark=W2_Download passthrough=no out-interface=ether5 log=no log-prefix="" 

 4    ;;; DNS
      chain=prerouting action=mark-connection new-connection-mark=DNS passthrough=yes connection-state=new protocol=udp port=53 

 5    chain=postrouting action=mark-connection new-connection-mark=DNS passthrough=yes connection-state=new protocol=udp port=53 

 6    chain=postrouting action=mark-packet new-packet-mark=DNS passthrough=no connection-mark=DNS 

 7    ;;; VOIP
      chain=prerouting action=mark-connection new-connection-mark=VOIP-TCP passthrough=yes protocol=tcp dscp=46 

 8    chain=prerouting action=mark-connection new-connection-mark=VOIP-UDP passthrough=yes protocol=udp dscp=46 

 9    chain=prerouting action=mark-connection new-connection-mark=VOIP-UDP passthrough=yes protocol=udp port=16000-17023,5060 log=no log-prefix="" 

10    chain=prerouting action=mark-connection new-connection-mark=VOIP-TCP passthrough=yes protocol=tcp dscp=26 

11    chain=prerouting action=mark-connection new-connection-mark=VOIP-UDP passthrough=yes protocol=udp dscp=26 

12    chain=prerouting action=mark-packet new-packet-mark=VOIP-TCP passthrough=no connection-mark=VOIP-TCP 

13    chain=prerouting action=mark-packet new-packet-mark=VOIP-UDP passthrough=no connection-mark=VOIP-UDP 

14    ;;; UDP
      chain=prerouting action=mark-connection new-connection-mark=UDP passthrough=yes connection-state=new protocol=udp 

15    chain=prerouting action=mark-packet new-packet-mark=UDP passthrough=no connection-mark=UDP 

16    ;;; ICMP
      chain=prerouting action=mark-connection new-connection-mark=ICMP passthrough=yes connection-state=new protocol=icmp 

17    chain=postrouting action=mark-connection new-connection-mark=ICMP passthrough=yes connection-state=new protocol=icmp 

18    chain=postrouting action=mark-packet new-packet-mark=ICMP passthrough=no connection-mark=ICMP 

19    ;;; ACK
      chain=postrouting action=mark-packet new-packet-mark=ACK passthrough=no tcp-flags=ack protocol=tcp packet-size=0-123 

20    chain=prerouting action=mark-packet new-packet-mark=ACK passthrough=no tcp-flags=ack protocol=tcp packet-size=0-123 

21    ;;; HTTP
      chain=prerouting action=mark-connection new-connection-mark=HTTP passthrough=yes connection-state=new protocol=tcp port=80,443,8080 
 0    chain=forward action=mark-packet new-packet-mark=W1_Upload passthrough=no in-interface=ether1 log=no log-prefix="" 

 1    chain=forward action=mark-packet new-packet-mark=W1_Download passthrough=no out-interface=ether1 log=no log-prefix="" 

 2    chain=forward action=mark-packet new-packet-mark=W2_Upload passthrough=no in-interface=ether5 log=no log-prefix="" 

 3    chain=forward action=mark-packet new-packet-mark=W2_Download passthrough=no out-interface=ether5 log=no log-prefix="" 

 4    ;;; DNS
      chain=prerouting action=mark-connection new-connection-mark=DNS passthrough=yes connection-state=new protocol=udp port=53 

 5    chain=postrouting action=mark-connection new-connection-mark=DNS passthrough=yes connection-state=new protocol=udp port=53 

 6    chain=postrouting action=mark-packet new-packet-mark=DNS passthrough=no connection-mark=DNS 

 7    ;;; VOIP
      chain=prerouting action=mark-connection new-connection-mark=VOIP-TCP passthrough=yes protocol=tcp dscp=46 

 8    chain=prerouting action=mark-connection new-connection-mark=VOIP-UDP passthrough=yes protocol=udp dscp=46 

 9    chain=prerouting action=mark-connection new-connection-mark=VOIP-UDP passthrough=yes protocol=udp port=16000-17023,5060 log=no log-prefix="" 

10    chain=prerouting action=mark-connection new-connection-mark=VOIP-TCP passthrough=yes protocol=tcp dscp=26 

11    chain=prerouting action=mark-connection new-connection-mark=VOIP-UDP passthrough=yes protocol=udp dscp=26 

12    chain=prerouting action=mark-packet new-packet-mark=VOIP-TCP passthrough=no connection-mark=VOIP-TCP 

13    chain=prerouting action=mark-packet new-packet-mark=VOIP-UDP passthrough=no connection-mark=VOIP-UDP 

14    ;;; UDP
      chain=prerouting action=mark-connection new-connection-mark=UDP passthrough=yes connection-state=new protocol=udp 

15    chain=prerouting action=mark-packet new-packet-mark=UDP passthrough=no connection-mark=UDP 

16    ;;; ICMP
      chain=prerouting action=mark-connection new-connection-mark=ICMP passthrough=yes connection-state=new protocol=icmp 

17    chain=postrouting action=mark-connection new-connection-mark=ICMP passthrough=yes connection-state=new protocol=icmp 

18    chain=postrouting action=mark-packet new-packet-mark=ICMP passthrough=no connection-mark=ICMP 

19    ;;; ACK
      chain=postrouting action=mark-packet new-packet-mark=ACK passthrough=no tcp-flags=ack protocol=tcp packet-size=0-123 

20    chain=prerouting action=mark-packet new-packet-mark=ACK passthrough=no tcp-flags=ack protocol=tcp packet-size=0-123 

21    ;;; HTTP
      chain=prerouting action=mark-connection new-connection-mark=HTTP passthrough=yes connection-state=new protocol=tcp port=80,443,8080 
22    chain=prerouting action=mark-connection new-connection-mark=HTTP_BIG passthrough=yes protocol=tcp connection-mark=HTTP connection-bytes=500000-0 

23    chain=prerouting action=mark-packet new-packet-mark=HTTP passthrough=no connection-mark=HTTP 

24    chain=prerouting action=mark-packet new-packet-mark=HTTP_BIG passthrough=no connection-mark=HTTP_BIG 

25    ;;; OTHER
      chain=prerouting action=mark-connection new-connection-mark=OTHER passthrough=yes connection-mark=no-mark 

26    chain=prerouting action=mark-packet new-packet-mark=OTHER passthrough=no connection-mark=OTHER log=no log-prefix="" 

27    ;;; Beginning Load Balancing
      chain=input action=mark-connection new-connection-mark=WAN1_conn passthrough=yes in-interface=ether1 log=no log-prefix="" 

28    chain=input action=mark-connection new-connection-mark=WAN2_conn passthrough=yes in-interface=ether5 log=no log-prefix="" 

29    chain=output action=mark-routing new-routing-mark=to_WAN1 passthrough=yes connection-mark=WAN1_conn log=no log-prefix="" 

30    chain=output action=mark-routing new-routing-mark=to_WAN2 passthrough=yes connection-mark=WAN2_conn log=no log-prefix="" 

31    chain=prerouting action=accept dst-address=10.0.0.0/24 in-interface=LAN log=no log-prefix="" 

32    chain=prerouting action=mark-connection new-connection-mark=WAN1_conn passthrough=yes dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:2/0 log=no 
      log-prefix="" 

33    chain=prerouting action=mark-connection new-connection-mark=WAN1_conn passthrough=yes dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:2/1 log=no 
      log-prefix="" 

34    chain=prerouting action=mark-connection new-connection-mark=WAN2_conn passthrough=yes dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:2/2 log=no 
      log-prefix="" 

35    chain=prerouting action=mark-routing new-routing-mark=to_WAN1 passthrough=yes connection-mark=WAN1_conn in-interface=LAN log=no log-prefix="" 

36    chain=prerouting action=mark-routing new-routing-mark=to_WAN2 passthrough=yes connection-mark=WAN2_conn in-interface=LAN log=no log-prefix="" 
Queue Tree
 0   name="MASTER_UP" parent=global packet-mark=W1_Upload limit-at=0 queue=default priority=8 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 1   name="MASTER_DOWN" parent=global packet-mark=W1_Download limit-at=0 queue=default priority=8 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 2   name="VOIP-TCP_U" parent=MASTER_UP packet-mark=VOIP-TCP limit-at=0 queue=default priority=1 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 3   name="VOIP-TCP_D" parent=MASTER_DOWN packet-mark=VOIP-TCP limit-at=0 queue=default priority=1 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 4   name="ACK_U" parent=MASTER_UP packet-mark=ACK limit-at=6M queue=default priority=2 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 5   name="ACK_D" parent=MASTER_DOWN packet-mark=ACK limit-at=6M queue=default priority=2 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 6   name="DNS_U" parent=MASTER_UP packet-mark=DNS limit-at=6M queue=default priority=3 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 7   name="DNS_D" parent=MASTER_DOWN packet-mark=DNS limit-at=6M queue=default priority=3 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 8   name="UDP_U" parent=MASTER_UP packet-mark=UDP limit-at=6M queue=default priority=4 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

 9   name="UDP_D" parent=MASTER_DOWN packet-mark=UDP limit-at=6M queue=default priority=4 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

10   name="ICMP_U" parent=MASTER_UP packet-mark=ICMP limit-at=6M queue=default priority=5 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

11   name="ICMP_D" parent=MASTER_DOWN packet-mark=ICMP limit-at=6M queue=default priority=5 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

12   name="HTTP_U" parent=MASTER_UP packet-mark=HTTP limit-at=6M queue=default priority=6 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

13   name="HTTP_D" parent=MASTER_DOWN packet-mark=HTTP limit-at=6M queue=default priority=6 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

14   name="HTTP_BIG_U" parent=MASTER_UP packet-mark=HTTP_BIG limit-at=6M queue=default priority=7 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

15   name="HTTP_BIG_D" parent=MASTER_DOWN packet-mark=HTTP_BIG limit-at=6M queue=default priority=7 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

16   name="OTHER_U" parent=MASTER_UP packet-mark=OTHER limit-at=6M queue=default priority=8 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

17   name="OTHER_D" parent=MASTER_DOWN packet-mark=OTHER limit-at=6M queue=default priority=8 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

18   name="VOIP-UDP_D" parent=MASTER_DOWN packet-mark=VOIP-UDP limit-at=0 queue=default priority=1 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

19   name="VOIP-UDP_U" parent=MASTER_UP packet-mark=VOIP-UDP limit-at=0 queue=default priority=1 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

20   name="MASTER_UP2" parent=global packet-mark=W2_Upload limit-at=0 queue=default priority=8 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

21   name="ACK_U2" parent=MASTER_UP2 packet-mark=ACK limit-at=2M queue=default priority=2 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

22   name="DNS_U2" parent=MASTER_UP2 packet-mark=DNS limit-at=2M queue=default priority=3 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

23   name="HTTP_BIG_U2" parent=MASTER_UP2 packet-mark=HTTP_BIG limit-at=2M queue=default priority=7 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

24   name="HTTP_U2" parent=MASTER_UP2 packet-mark=HTTP limit-at=2M queue=default priority=6 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 
25   name="ICMP_U2" parent=MASTER_UP2 packet-mark=ICMP limit-at=2M queue=default priority=5 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

26   name="OTHER_U2" parent=MASTER_UP2 packet-mark=OTHER limit-at=2M queue=default priority=8 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

27   name="UDP_U2" parent=MASTER_UP2 packet-mark=UDP limit-at=2M queue=default priority=4 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

28   name="VOIP-TCP_U2" parent=MASTER_UP2 packet-mark=VOIP-TCP limit-at=0 queue=default priority=1 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

29   name="VOIP-UDP_U2" parent=MASTER_UP2 packet-mark=VOIP-UDP limit-at=0 queue=default priority=1 max-limit=4M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

30   name="MASTER_DOWN2" parent=global packet-mark=W2_Download limit-at=0 queue=default priority=8 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

31   name="ACK_D2" parent=MASTER_DOWN2 packet-mark=ACK limit-at=6M queue=default priority=2 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

32   name="DNS_D2" parent=MASTER_DOWN2 packet-mark=DNS limit-at=6M queue=default priority=3 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

33   name="HTTP_BIG_D2" parent=MASTER_DOWN2 packet-mark=HTTP_BIG limit-at=6M queue=default priority=7 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

34   name="HTTP_D2" parent=MASTER_DOWN2 packet-mark=HTTP limit-at=6M queue=default priority=6 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

35   name="ICMP_D2" parent=MASTER_DOWN2 packet-mark=ICMP limit-at=6M queue=default priority=5 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

36   name="OTHER_D2" parent=MASTER_DOWN2 packet-mark=OTHER limit-at=6M queue=default priority=8 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

37   name="UDP_D2" parent=MASTER_DOWN2 packet-mark=UDP limit-at=6M queue=default priority=4 max-limit=9M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

38   name="VOIP-TCP_D2" parent=MASTER_DOWN2 packet-mark=VOIP-TCP limit-at=0 queue=default priority=1 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 

39   name="VOIP-UDP_D2" parent=MASTER_DOWN2 packet-mark=VOIP-UDP limit-at=0 queue=default priority=1 max-limit=10M burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 
Thank you so much
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Sun Aug 06, 2017 8:39 pm

give it a try, I am poor in mapping export rules to behaviour
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 8:28 am

I have run it yesterday, everything is mapped only to upload on the WAN1 queue
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 11:09 am

Show winbox screens as in post 7, make sure you have showing columns as in post 7.
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 11:18 am

Here they are, thank you
You do not have the required permissions to view the files attached to this post.
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 11:32 am

For now simplify, remove 3rd level of nodes (ack, dns...),
I dont think you need 3rd level, at all, see post 7

leave only two levels

In top nodes (one that is parent to global) you must specify max limit
Child nodes should have max limit < parent max limit.

what ROS version do you have ?
I am running 6.7, there were changes to packet flow between between ROS versions.
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 11:34 am

Running V6.40.1
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 11:52 am

Would I have to jump in the forward chain all the 3rd level children so that the queues will pick it up properly?
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 11:56 am

You must not have two nodes in queue tree with the same packet mark.

When you marking packets in the mangle, make the INTERFACE (w.g, wan1,wan2), DIRECTION (up, down) part of the mark name, this way easier to catch mistakes in the queueu tree.
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 12:01 pm

Would I have to jump in the forward chain all the 3rd level children so that the queues will pick it up properly?
I dont understand that
For now try to simplify the rules till you get up/down rate control working, then you can fine tune with more rules/categories.
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 12:13 pm

Like this?
You do not have the required permissions to view the files attached to this post.
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 1:42 pm

I suspect the new flows will only work with Postrouting and input chains?
You do not have the required permissions to view the files attached to this post.
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 2:07 pm

flow you quoted is for bridged mode, you are using routed mode (lan + wan(s))

In case of UDP download (VOIP video streams) you cannot control anything, even if you reject the UDP packet the bandwidth is already wasted, the sender will not slow down the rate of UDP packets (as it would in case of TCP stream) because there is no ACKs and sliding window in UDP.

that is why you must count UDP downloads (wan1_download_udp) with priority 1 and assign it a max download value for the interface.
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 3:39 pm

I think I have it sorted.
I set this up on my spare router and the queues seem to be working now based on the Interface.

ether1 is the new WAN interface
You do not have the required permissions to view the files attached to this post.
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 4:05 pm

You must not have two nodes in queue tree with the same packet mark.
say mark "DNS", if QT sees "DNS" mark, how will it decide if it belongs to master UP or Down queue ?
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 4:08 pm

You must not have two nodes in queue tree with the same packet mark.
say mark "DNS", if QT sees "DNS" mark, how will it decide if it belongs to master UP or Down queue ?
I have changed it to DNS-WAN1-Down and then DNS-WAN1-Up

Thank you
 
korcom
just joined
Posts: 16
Joined: Fri Aug 04, 2017 3:38 pm
Location: Johannesburg
Contact:

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 4:23 pm

This is how I achieved this:

Mangle Rules:
/ip firewall mangle
add action=mark-connection chain=prerouting comment=DNS-WAN1 \
    connection-state=new new-connection-mark=DNS passthrough=yes port=53 \
    protocol=udp
add action=mark-connection chain=postrouting connection-state=new \
    new-connection-mark=DNS passthrough=yes port=53 protocol=udp
add action=mark-packet chain=prerouting connection-mark=DNS in-interface=\
    ether1 new-packet-mark=DNS-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=DNS new-packet-mark=\
    DNS-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting comment=DNS-WAN2 connection-mark=DNS \
    in-interface=ether1 new-packet-mark=DNS-WAN2-In passthrough=no
add action=mark-packet chain=postrouting comment=DNS-WAN2 connection-mark=DNS \
    new-packet-mark=DNS-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-connection chain=prerouting comment=VOIP-WAN1 dscp=46 \
    new-connection-mark=VOIP-TCP passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dscp=46 new-connection-mark=\
    VOIP-UDP passthrough=yes protocol=udp
add action=mark-connection chain=prerouting new-connection-mark=VOIP-UDP \
    passthrough=yes port=4500 protocol=udp
add action=mark-connection chain=prerouting dscp=26 new-connection-mark=\
    VOIP-TCP passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dscp=26 new-connection-mark=\
    VOIP-UDP passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark=VOIP-TCP \
    in-interface=ether1 new-packet-mark=VOIP-TCP-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=VOIP-TCP \
    new-packet-mark=VOIP-TCP-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting connection-mark=VOIP-UDP \
    in-interface=ether1 new-packet-mark=VOIP-UDP-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=VOIP-UDP \
    new-packet-mark=VOIP-UDP-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting comment=VOIP-WAN2 connection-mark=\
    VOIP-TCP in-interface=ether5 new-packet-mark=VOIP-TCP-WAN2-In \
    passthrough=no
add action=mark-packet chain=postrouting connection-mark=VOIP-TCP \
    new-packet-mark=VOIP-TCP-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-packet chain=prerouting connection-mark=VOIP-UDP \
    in-interface=ether5 new-packet-mark=VOIP-UDP-WAN2-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=VOIP-UDP \
    new-packet-mark=VOIP-UDP-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-connection chain=prerouting comment=UDP-WAN1 \
    connection-state=new new-connection-mark=UDP passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark=UDP in-interface=\
    ether1 new-packet-mark=UDP-WAN1-IN passthrough=no
add action=mark-packet chain=postrouting connection-mark=UDP new-packet-mark=\
    UDP-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting comment=UDP-WAN2 connection-mark=UDP \
    in-interface=ether5 new-packet-mark=UDP-WAN2-IN passthrough=no
add action=mark-packet chain=postrouting connection-mark=UDP new-packet-mark=\
    UDP-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-connection chain=prerouting comment=ICMP-WAN1 \
    connection-state=new new-connection-mark=ICMP passthrough=yes protocol=\
    icmp
add action=mark-connection chain=postrouting connection-state=new \
    new-connection-mark=ICMP passthrough=yes protocol=icmp
add action=mark-packet chain=prerouting connection-mark=ICMP in-interface=\
    ether1 new-packet-mark=ICMP-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=ICMP \
    new-packet-mark=ICMP-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting connection-mark=ICMP in-interface=\
    ether5 new-packet-mark=ICMP-WAN2-In passthrough=no
add action=mark-packet chain=postrouting comment=ICMP-WAN2 connection-mark=\
    ICMP new-packet-mark=ICMP-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-packet chain=postrouting comment=ACK-WAN1 new-packet-mark=\
    ACK-WAN1-Out out-interface=ether1 packet-size=0-123 passthrough=no \
    protocol=tcp tcp-flags=ack
add action=mark-packet chain=prerouting in-interface=ether1 new-packet-mark=\
    ACK-WAN1-In packet-size=0-123 passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting comment=ACK-WAN2 new-packet-mark=\
    ACK-WAN2-In out-interface=ether5 packet-size=0-123 passthrough=no \
    protocol=tcp tcp-flags=ack
add action=mark-packet chain=prerouting in-interface=ether5 new-packet-mark=\
    ACK-WAN2-Out packet-size=0-123 passthrough=no protocol=tcp tcp-flags=ack
add action=mark-connection chain=prerouting comment=HTTP-WAN1 dst-port=\
    80,443,8080 new-connection-mark=HTTP passthrough=yes protocol=tcp \
    src-address-list=internal-nets
add action=mark-connection chain=prerouting connection-bytes=500000-0 \
    connection-mark=HTTP new-connection-mark=HTTP_BIG passthrough=yes \
    protocol=tcp
add action=mark-packet chain=prerouting connection-mark=HTTP in-interface=\
    ether1 new-packet-mark=HTTP-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=HTTP \
    new-packet-mark=HTTP-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting connection-mark=HTTP_BIG \
    in-interface=ether1 new-packet-mark=HTTP_BIG-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=HTTP_BIG \
    new-packet-mark=HTTP_BIG-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting comment=HTTP-WAN2 connection-mark=\
    HTTP in-interface=ether5 new-packet-mark=HTTP-WAN2-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=HTTP \
    new-packet-mark=HTTP-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-packet chain=prerouting connection-mark=HTTP_BIG \
    in-interface=ether5 new-packet-mark=HTTP_BIG-WAN2-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=HTTP_BIG \
    new-packet-mark=HTTP_BIG-WAN2-Out out-interface=ether5 passthrough=no
add action=mark-connection chain=prerouting comment=OTHER-WAN1 \
    connection-mark=no-mark new-connection-mark=OTHER passthrough=yes
add action=mark-packet chain=prerouting connection-mark=OTHER in-interface=\
    ether1 new-packet-mark=OTHER-WAN1-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=OTHER \
    new-packet-mark=OTHER-WAN1-Out out-interface=ether1 passthrough=no
add action=mark-packet chain=prerouting comment=Other-WAN2 connection-mark=\
    OTHER in-interface=ether5 new-packet-mark=OTHER-WAN2-In passthrough=no
add action=mark-packet chain=postrouting connection-mark=OTHER \
    new-packet-mark=OTHER-WAN2-Out out-interface=ether5 passthrough=no

Queue Tree:
/queue tree
add max-limit=512k name=MASTER_DOWN parent=global queue=default
add max-limit=512k name=VOIP-TCP_D packet-mark=VOIP-TCP-WAN1-In parent=\
    MASTER_DOWN priority=1 queue=default
add max-limit=128k name=ACK_D packet-mark=ACK-WAN1-In parent=MASTER_DOWN \
    priority=2 queue=default
add max-limit=128k name=DNS_D packet-mark=DNS-WAN1-In parent=MASTER_DOWN \
    priority=3 queue=default
add max-limit=128k name=UDP_D packet-mark=UDP-WAN1-IN parent=MASTER_DOWN \
    priority=4 queue=default
add max-limit=128k name=ICMP_D packet-mark=ICMP-WAN1-In parent=MASTER_DOWN \
    priority=5 queue=default
add max-limit=128k name=HTTP_D packet-mark=HTTP-WAN1-In parent=MASTER_DOWN \
    priority=6 queue=default
add max-limit=128k name=HTTP_BIG_D packet-mark=HTTP_BIG-WAN1-In parent=\
    MASTER_DOWN priority=7 queue=default
add max-limit=128k name=OTHER_D packet-mark=OTHER-WAN1-In parent=MASTER_DOWN \
    queue=default
add max-limit=512k name=VOIP-UDP_D packet-mark=VOIP-UDP-WAN1-In parent=\
    MASTER_DOWN priority=1 queue=default
add max-limit=128k name=MASTER_UP parent=global queue=default
add max-limit=128k name=VOIP-TCP_U packet-mark=VOIP-TCP-WAN1-Out parent=\
    MASTER_UP priority=1 queue=default
add max-limit=64k name=ACK_U packet-mark=ACK-WAN1-Out parent=MASTER_UP \
    priority=2 queue=default
add max-limit=64k name=DNS_U packet-mark=DNS-WAN1-Out parent=MASTER_UP \
    priority=3 queue=default
add max-limit=64k name=UDP_U packet-mark=UDP-WAN1-Out parent=MASTER_UP \
    priority=4 queue=default
add max-limit=64k name=ICMP_U packet-mark=ICMP-WAN1-Out parent=MASTER_UP \
    priority=5 queue=default
add max-limit=64k name=HTTP_U packet-mark=HTTP-WAN1-Out parent=MASTER_UP \
    priority=6 queue=default
add max-limit=64k name=HTTP_BIG_U packet-mark=HTTP_BIG-WAN1-Out parent=\
    MASTER_UP priority=7 queue=default
add max-limit=64k name=OTHER_U packet-mark=OTHER-WAN1-Out parent=MASTER_UP \
    queue=default
add max-limit=128k name=VOIP-UDP_U packet-mark=VOIP-UDP-WAN1-Out parent=\
    MASTER_UP priority=1 queue=default
add max-limit=512k name=MASTER_DOWN2 parent=global queue=default
add max-limit=128k name=ACK_D2 packet-mark=ACK-WAN2-In parent=MASTER_DOWN2 \
    priority=2 queue=default
add max-limit=128k name=DNS_D2 packet-mark=DNS-WAN2-In parent=MASTER_DOWN2 \
    priority=3 queue=default
add max-limit=128k name=HTTP_BIG_D2 packet-mark=HTTP_BIG-WAN2-In parent=\
    MASTER_DOWN2 priority=7 queue=default
add max-limit=128k name=HTTP_D2 packet-mark=HTTP-WAN2-In parent=MASTER_DOWN2 \
    priority=6 queue=default
add max-limit=128k name=ICMP_D2 packet-mark=ICMP-WAN2-In parent=MASTER_DOWN2 \
    priority=5 queue=default
add max-limit=128k name=OTHER_D2 packet-mark=OTHER-WAN2-In parent=\
    MASTER_DOWN2 queue=default
add max-limit=128k name=UDP_D2 packet-mark=UDP-WAN2-IN parent=MASTER_DOWN2 \
    priority=4 queue=default
add max-limit=512k name=VOIP-TCP_D2 packet-mark=VOIP-TCP-WAN2-In parent=\
    MASTER_DOWN2 priority=1 queue=default
add max-limit=512k name=VOIP-UDP_D2 packet-mark=VOIP-UDP-WAN2-In parent=\
    MASTER_DOWN2 priority=1 queue=default
add max-limit=128k name=MASTER_UP2 parent=global queue=default
add max-limit=64k name=ACK_U2 packet-mark=ACK-WAN2-Out parent=MASTER_UP2 \
    priority=2 queue=default
add max-limit=64k name=DNS_U2 packet-mark=DNS-WAN2-Out parent=MASTER_UP2 \
    priority=3 queue=default
add max-limit=64k name=HTTP_BIG_U2 packet-mark=HTTP_BIG-WAN2-Out parent=\
    MASTER_UP2 priority=7 queue=default
add max-limit=64k name=HTTP_U2 packet-mark=HTTP-WAN2-Out parent=MASTER_UP2 \
    priority=6 queue=default
add max-limit=64k name=ICMP_U2 packet-mark=ICMP-WAN2-Out parent=MASTER_UP2 \
    priority=5 queue=default
add max-limit=64k name=OTHER_U2 packet-mark=OTHER-WAN2-Out parent=MASTER_UP2 \
    queue=default
add max-limit=64k name=UDP_U2 packet-mark=UDP-WAN2-Out parent=MASTER_UP2 \
    priority=4 queue=default
add max-limit=128k name=VOIP-TCP_U2 packet-mark=VOIP-TCP-WAN2-Out parent=\
    MASTER_UP2 priority=1 queue=default
add max-limit=128k name=VOIP-UDP_U2 packet-mark=VOIP-UDP-WAN2-Out parent=\
    MASTER_UP2 priority=1 queue=default
Thank you for all your assistance !
 
boo9
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Sat Jul 09, 2011 5:19 pm

Re: queue tree - mutiple wan interfaces - what should be the parent ?

Mon Aug 07, 2017 4:29 pm

Post #28 viewtopic.php?f=2&t=115711&p=612064#p612029

you cannot throttle UDP packets in download direction !!!!
once they (UDP download packets) get to the router they have already consumed the bandwidth !!!,
even if you DROP them in firewall rules they will keep consuming the download bandwidth !
The only way to throttle them so they dont consume your download bandwith is to throttle at ISP router, imposibility in almost all cases.
throwing them out is useless and corrupts correct download queue average, makes qt think there is more bandwidth available than really is becuase if it throws out those UDP packets it thinks that the bandwidth by those packets was not consumed, but it was !!!

mark/mangle all download UDP packets with wan1_udp_down
and make these packets top priority node with max limit equal to that of the parent max limit.

for example,
say download on wan1 is 500kbs, a remote computer sends 500kbs UDP packets to your router (voice stream),
there is no way in QT to lower the priority of these UDP packets to slow down the rate they arrive to your router, so they arrive after high priority packets, the UDP incoming stream of packets competes with other packets (tcp, icmp, ...), at your ISP router, all you can do is to keep track of how much bandwith they (UDP packets) consume so the QT can control remaining (TCP streams) using remaining bandwith

Who is online

Users browsing this forum: Google [Bot] and 90 guests