Community discussions

MikroTik App
 
ejmerkel
newbie
Topic Author
Posts: 33
Joined: Wed Jun 03, 2009 8:26 pm

Queue Tree Parent with PCQ

Wed Feb 17, 2010 6:41 pm

I have an MT router (v4.5) that has 3 interfaces. Ether1/Wlan1 (bridge1), ether2 (point to point backhaul to core network), ether3 (point to point backhaul to core network). Bridge1 is the where the customers connections are made ether thru the wireless or ethernet port. All of the customers have REAL IP's so there is no NATing. Ether2 and Ether2 are load balanced equally back into the core network using OSPF to hit two separate upstream routers.

I am wanting to setup an PCQ HTB queue tree using to limit the customers upload and download speeds. My total download has a parent of bridge1 and that works fine. Where I am getting confused is what interface to set the upload parent to be. If I am only using 1 point to point connection out I can set the parent of the upload to be ether2 (or ether3) and it works. If both backhauls are in use and load balanced what should the parent of the upload queue tree be? I've tried Global-Out but this is picking up traffic coming in and going out so the traffic is in essence cut in half of what I want it to be.

Here is my config just using the ether2 not load balanced.
/ip firewall mangle
add action=mark-connection chain=prerouting comment=\
    "Mark Surfer_Basic client taffic" disabled=no new-connection-mark=\
    Surfer_Basic_conn passthrough=yes src-address-list=Surfer_Basic
add action=mark-packet chain=prerouting comment="" connection-mark=\
    Surfer_Basic_conn disabled=no new-packet-mark=Surfer_Basic_Traffic \
    passthrough=no
add action=mark-connection chain=prerouting comment=\
    "Mark Premium_SOHO client taffic" disabled=no new-connection-mark=\
    Premium_SOHO_conn passthrough=yes src-address-list=Premium_SOHO
add action=mark-packet chain=prerouting comment="" connection-mark=\
    Premium_SOHO_conn disabled=no new-packet-mark=Premium_SOHO_Traffic \
    passthrough=no
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=10M name=Total_Download packet-mark="" parent=bridge1 priority=\
    1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=10M name=Total_Upload packet-mark="" parent=ether2 priority=1
/queue type
set default kind=pfifo name=default pfifo-limit=50
set ethernet-default kind=pfifo name=ethernet-default pfifo-limit=50
set wireless-default kind=sfq name=wireless-default sfq-allot=1514 \
    sfq-perturb=5
set synchronous-default kind=red name=synchronous-default red-avg-packet=1000 \
    red-burst=20 red-limit=60 red-max-threshold=50 red-min-threshold=10
set hotspot-default kind=sfq name=hotspot-default sfq-allot=1514 sfq-perturb=\
    5
add kind=pcq name=Surfer_Basic_Download pcq-classifier=dst-address pcq-limit=\
    50 pcq-rate=768000 pcq-total-limit=2000
add kind=pcq name=Surfer_Basic_Upload pcq-classifier=src-address pcq-limit=50 \
    pcq-rate=256000 pcq-total-limit=2000
add kind=pcq name=Premium_SOHO_Download pcq-classifier=dst-address pcq-limit=\
    50 pcq-rate=1024000 pcq-total-limit=2000
add kind=pcq name=Premium_SOHO_Upload pcq-classifier=src-address pcq-limit=50 \
    pcq-rate=512000 pcq-total-limit=2000
set default-small kind=pfifo name=default-small pfifo-limit=10
/queue simple
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=Surfer_Basic_Download packet-mark=Surfer_Basic_Traffic \
    parent=Total_Download priority=1 queue=Surfer_Basic_Download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=Surfer_Basic_Upload packet-mark=Surfer_Basic_Traffic \
    parent=Total_Upload priority=1 queue=Surfer_Basic_Upload
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=Premium_SOHO_Download packet-mark=Premium_SOHO_Traffic \
    parent=Total_Download priority=1 queue=Premium_SOHO_Download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=Premium_SOHO_Upload packet-mark=Premium_SOHO_Traffic \
    parent=Total_Upload priority=1 queue=Premium_SOHO_Upload
/queue interface
set ether1 queue=ethernet-default
set ether2 queue=ethernet-default
set ether3 queue=ethernet-default
set wlan1 queue=wireless-default
set bridge1 queue=default

Any suggestions on how I can set upload to count traffic going out both ether2 and ether3?

Thanks,
Eric
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Queue Tree Parent with PCQ

Wed Feb 17, 2010 6:51 pm

use global-out, but you should mark upload packets and download packets separately
 
ejmerkel
newbie
Topic Author
Posts: 33
Joined: Wed Jun 03, 2009 8:26 pm

Re: Queue Tree Parent with PCQ

Wed Feb 17, 2010 7:05 pm

Ok, I will give that try and see how it goes.

Thank you!
 
ejmerkel
newbie
Topic Author
Posts: 33
Joined: Wed Jun 03, 2009 8:26 pm

Re: Queue Tree Parent with PCQ

Wed Feb 17, 2010 9:27 pm

Ok, I think I got this working correctly. Anyone see any problems with how this is setup?
/ip firewall mangle
add action=mark-connection chain=prerouting comment=\
    "Mark Surfer_Basic client Upload traffic" disabled=no in-interface=\
    bridge1 new-connection-mark=Surfer_Basic_Upload_conn passthrough=yes \
    src-address-list=Surfer_Basic
add action=mark-packet chain=prerouting comment="" connection-mark=\
    Surfer_Basic_Upload_conn disabled=no new-packet-mark=\
    Surfer_Basic_Upload_Traffic passthrough=no
add action=mark-connection chain=forward comment=\
    "Mark Surfer_Basic client Download traffic" disabled=no dst-address-list=\
    Surfer_Basic in-interface=ether2 new-connection-mark=\
    Surfer_Basic_Download_conn passthrough=yes
add action=mark-connection chain=forward comment="" disabled=no \
    dst-address-list=Surfer_Basic in-interface=ether3 new-connection-mark=\
    Surfer_Basic_Download_conn passthrough=yes
add action=mark-packet chain=forward comment="" connection-mark=\
    Surfer_Basic_Download_conn disabled=no new-packet-mark=\
    Surfer_Basic_Download_Traffic passthrough=no
add action=mark-connection chain=prerouting comment=\
    "Mark Premium_SOHO client Upload traffic" disabled=no in-interface=\
    bridge1 new-connection-mark=Premium_SOHO_Upload_conn passthrough=yes \
    src-address-list=Premium_SOHO
add action=mark-packet chain=prerouting comment="" connection-mark=\
    Premium_SOHO_Upload_conn disabled=no new-packet-mark=\
    Premium_SOHO_Upload_Traffic passthrough=no
add action=mark-connection chain=forward comment=\
    "Mark Premium_SOHO client Download traffic" disabled=no dst-address-list=\
    Premium_SOHO in-interface=ether2 new-connection-mark=\
    Premium_SOHO_Download_conn passthrough=yes
add action=mark-connection chain=forward comment="" disabled=no \
    dst-address-list=Premium_SOHO in-interface=ether3 new-connection-mark=\
    Premium_SOHO_Download_conn passthrough=yes
add action=mark-packet chain=forward comment="" connection-mark=\
    Premium_SOHO_Download_conn disabled=no new-packet-mark=\
    Premium_SOHO_Download_Traffic passthrough=no

/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=\
    10M name=Total_Download packet-mark="" parent=bridge1 priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=\
    10M name=Total_Upload packet-mark="" parent=global-out priority=1
/queue type
set default kind=pfifo name=default pfifo-limit=50
set ethernet-default kind=pfifo name=ethernet-default pfifo-limit=50
set wireless-default kind=sfq name=wireless-default sfq-allot=1514 sfq-perturb=5
set synchronous-default kind=red name=synchronous-default red-avg-packet=1000 \
    red-burst=20 red-limit=60 red-max-threshold=50 red-min-threshold=10
set hotspot-default kind=sfq name=hotspot-default sfq-allot=1514 sfq-perturb=5
add kind=pcq name=Surfer_Basic_Download pcq-classifier=dst-address pcq-limit=50 \
    pcq-rate=768000 pcq-total-limit=2000
add kind=pcq name=Surfer_Basic_Upload pcq-classifier=src-address pcq-limit=50 \
    pcq-rate=256000 pcq-total-limit=2000
add kind=pcq name=Premium_SOHO_Download pcq-classifier=dst-address pcq-limit=50 \
    pcq-rate=1024000 pcq-total-limit=2000
add kind=pcq name=Premium_SOHO_Upload pcq-classifier=src-address pcq-limit=50 \
    pcq-rate=512000 pcq-total-limit=2000
set default-small kind=pfifo name=default-small pfifo-limit=10
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
    name=Surfer_Basic_Download packet-mark=Surfer_Basic_Download_Traffic parent=\
    Total_Download priority=1 queue=Surfer_Basic_Download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
    name=Surfer_Basic_Upload packet-mark=Surfer_Basic_Upload_Traffic parent=\
    Total_Upload priority=1 queue=Surfer_Basic_Upload
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
    name=Premium_SOHO_Download packet-mark=Premium_SOHO_Download_Traffic parent=\
    Total_Download priority=1 queue=Premium_SOHO_Download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
    name=Premium_SOHO_Upload packet-mark=Premium_SOHO_Upload_Traffic parent=\
    Total_Upload priority=1 queue=Premium_SOHO_Upload
/queue interface
set ether1 queue=ethernet-default
set ether2 queue=ethernet-default
set ether3 queue=ethernet-default
set wlan1 queue=wireless-default
set bridge1 queue=default

Who is online

Users browsing this forum: Amazon [Bot] and 78 guests