PCQ, high ping

After I understand how QoS is working - next thing I need to do is to limit each user by their tarrifs limitations.

So I used PCQ.

Currently I’m doing it on a test-workground with 2 servers.

First I added mangle rules:

add action=mark-connection chain=forward comment="servers marking" disabled=no new-connection-mark=servers_client_conn_up passthrough=yes src-address-list=servers
add action=mark-packet chain=forward connection-mark=servers_client_conn_up disabled=no new-packet-mark=servers_client_traffic_up passthrough=no src-address-list=servers
add action=mark-connection chain=forward disabled=no dst-address-list=servers new-connection-mark=servers_client_conn_down passthrough=yes
add action=mark-packet chain=forward connection-mark=servers_client_conn_down disabled=no dst-address-list=servers new-packet-mark=servers_client_traffic_down passthrough=no

After that I added queue types for the servers:

add kind=pcq name=PCQ_up_Servers pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=1024k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=PCQ_down_Servers pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=1024k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000

And last one I did is added queue tree:

add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=4096k name=users-total parent=global-out priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=4096k name=users-down parent=users-total priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=0 name=servers-down packet-mark=servers_client_traffic_down parent=users-down priority=8 queue=PCQ_down_Servers
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=4096k name=users-up parent=users-total priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=0 name=servers-up packet-mark=servers_client_traffic_up parent=users-up priority=8 queue=PCQ_up_Servers

And now there is a problem:
Server1 is downloading 1Gb file from internet at 1024kbits/sec, pings goes to about 200-500msec (normal is 40ms), online game launched on Server2 show latencies from 100 to 700. Ping success 60%. So one PCQ queue alone can almost ruin stable internet connection.

What I tried to do:
I tried to change queue sizes, and seen very unhappy results.

queue size 10 packets - ping success 100%, 47-80ms, not affecting performance of other PCQ queues, pioritization not working.
queue size 20 packets - ping success 90% (with torrents 70%), 150-300ms, affecting performance of other PCQ queues, prioritization not working.
queue size 50 packets - ping success 70% (with torrents 50%), 250-500ms, highly affecting performance of other PCQ queues, prioritization not working.
queue size 100 packets - ping success 95%, 400-670ms, greatly affecting performance of other PCQ queues, prioritization not working.
queue size 150 packets - ping success 100%, 400-800ms, performance of all PCQ queues are same, prioritization not working.

I don’t know why qos(with prioritization) not working. I’m doing it correct. Well, I hope I do… Anyway first I need to do is understand where I go wrong with PCQ.

Priority works only between queues with the same parent, and only on queues that don’t have children themselves. First every queue gets traffic up to limit-at. Then priority is used to fill the queue from limit-at to max-limit. Therefore you need rate limit ICMP and other server traffic in children attached to the same queue. You should set limit-at and max-limit on all the child queues. The “other traffic” qeueu should have a very low limit-at. That way there’s always enough space to fill the ICMP and other traffic queue to limit-at and ICMP goes through. Then the other traffic queue is filled to max-limit afterwards.

fewi, thanks for reply. Now prioritization seems to be working when PCQ queues disabled. But when I enable PCQ queues ping goes high again and priorities doesn’t working.

I thought prioritization will work better… when I gave icmp traffic high priority, set it’s limit-at to 32k, max-limit to 4096k (is this ok?) and stable ping 40msec goes up to 80msec under torrent load (CPU 3%, 470mb RAM free). Not so good…

Here’s my full configs:

/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=qos-up parent=global-in priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=qos-down parent=global-in priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=32k max-limit=4096k name=qos-icmp-down packet-mark=qos-icmp-down parent=qos-down priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-httpreq-down packet-mark=qos-httpreq-down parent=qos-down priority=2 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-httpreq-up packet-mark=qos-httpreq-up parent=qos-up priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-p2preq-down packet-mark=qos-p2preq-down parent=qos-down priority=5 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-p2preq-up packet-mark=qos-p2preq-up parent=qos-up priority=8 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-httpdata-down packet-mark=qos-httpdata-down parent=qos-down priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-httpdata-up packet-mark=qos-httpdata-up parent=qos-up priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=32k max-limit=4096k name=qos-dns-tcp packet-mark=qos-dns-tcp-down parent=qos-down priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=32k max-limit=4096k name=qos-dns-udp-down packet-mark=qos-dns-udp-down parent=qos-down priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=32k max-limit=4096k name=qos-dns-tcp-up packet-mark=qos-dns-tcp-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=32k max-limit=4096k name=qos-dns-udp-up packet-mark=qos-dns-udp-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-unmarked-down packet-mark=users-download parent=qos-down priority=8 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-unmarked-up packet-mark=users-upload parent=qos-up priority=8 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-cs16-down packet-mark=qos-cs16-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-wow-down packet-mark=qos-wow-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-la2-down packet-mark=qos-la2-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-cs16-up packet-mark=qos-cs16-down parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-wow-up packet-mark=qos-wow-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=4096k name=qos-la2-up packet-mark=qos-la2-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=64k max-limit=4096k name=qos-sshreq-down packet-mark=qos-sshreq-down parent=qos-down priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=64k max-limit=4096k name=qos-sshreq-up packet-mark=qos-sshreq-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=256k max-limit=4096k name=qos-skypetoskype-down packet-mark=qos-skypetoskype-down parent=qos-down priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=256k max-limit=4096k name=qos-skypetoskype-up packet-mark=qos-skypetoskype-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=32k max-limit=4096k name=qos-icmp-up packet-mark=qos-icmp-up parent=qos-up priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=users-total parent=global-out priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=users-down parent=users-total priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=servers-down packet-mark=servers_client_traffic_down parent=users-down priority=8 queue=PCQ_down_Servers
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=users-up parent=users-total priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=servers-up packet-mark=servers_client_traffic_up parent=users-up priority=8 queue=PCQ_up_Servers



/ip firewall mangle
add action=mark-connection chain=forward comment="servers marking" disabled=no new-connection-mark=servers_client_conn_up passthrough=yes src-address-list=servers
add action=mark-packet chain=forward connection-mark=servers_client_conn_up disabled=no new-packet-mark=servers_client_traffic_up passthrough=no src-address-list=servers
add action=mark-connection chain=forward disabled=no dst-address-list=servers new-connection-mark=servers_client_conn_down passthrough=yes
add action=mark-packet chain=forward connection-mark=servers_client_conn_down disabled=no dst-address-list=servers new-packet-mark=servers_client_traffic_down passthrough=no
add action=mark-packet chain=prerouting comment="qos icmp" disabled=no in-interface=ether9 new-packet-mark=qos-icmp-down passthrough=no protocol=icmp
add action=mark-packet chain=prerouting disabled=no in-interface=!ether9 new-packet-mark=qos-icmp-up passthrough=no protocol=icmp
add action=mark-packet chain=prerouting comment="qos dns" disabled=no in-interface=ether9 new-packet-mark=qos-dns-tcp-down passthrough=no protocol=tcp src-port=53
add action=mark-packet chain=prerouting disabled=no dst-port=53 in-interface=!ether9 new-packet-mark=qos-dns-tcp-up passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=ether9 new-packet-mark=qos-dns-udp-down passthrough=no protocol=udp src-port=53
add action=mark-packet chain=prerouting disabled=no dst-port=53 in-interface=!ether9 new-packet-mark=qos-dns-udp-up passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="qos skype to skype" disabled=no in-interface=ether9 layer7-protocol=skypetoskype new-packet-mark=qos-skypetoskype-down passthrough=no protocol=udp
add action=mark-packet chain=prerouting disabled=no in-interface=!ether9 layer7-protocol=skypetoskype new-packet-mark=qos-skypetoskype-up passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="qos sip" disabled=no dst-port=5060 in-interface=ether9 new-packet-mark=qos-sip-down passthrough=no protocol=udp src-port=5060
add action=mark-packet chain=prerouting disabled=no dst-port=5060 in-interface=!ether9 new-packet-mark=qos-sip-up passthrough=no protocol=udp src-port=5060
add action=mark-packet chain=prerouting comment="qos ssh requests" disabled=no in-interface=ether9 new-packet-mark=qos-sshreq-down packet-size=0-1400 passthrough=no protocol=tcp src-port=22
add action=mark-packet chain=prerouting disabled=no dst-port=22 in-interface=!ether9 new-packet-mark=qos-sshreq-up packet-size=0-1400 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos http(s) request" connection-bytes=0-500000 disabled=no in-interface=ether9 new-packet-mark=qos-httpreq-down passthrough=no protocol=tcp src-port=80,443
add action=mark-packet chain=prerouting connection-bytes=0-500000 disabled=no dst-port=80,443 in-interface=!ether9 new-packet-mark=qos-httpreq-up passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos lineage2" disabled=no in-interface=ether9 new-packet-mark=qos-la2-down passthrough=no protocol=tcp src-port=2106,7777
add action=mark-packet chain=prerouting disabled=no dst-port=2106,7777 in-interface=!ether9 new-packet-mark=qos-la2-up passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos counter strike1.6" disabled=no in-interface=ether9 new-packet-mark=qos-cs16-down passthrough=no protocol=udp src-port=27000-27150
add action=mark-packet chain=prerouting disabled=no dst-port=27000-27150 in-interface=!ether9 new-packet-mark=qos-cs16-up passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="qos world of warcraft" disabled=no in-interface=ether9 new-packet-mark=qos-wow-down passthrough=no protocol=tcp src-port=8015
add action=mark-packet chain=prerouting disabled=no dst-port=8015 in-interface=!ether9 new-packet-mark=qos-wow-up passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos http(s) data" connection-bytes=500000-0 disabled=no in-interface=ether9 new-packet-mark=qos-httpdata-down passthrough=no protocol=tcp src-port=80,443
add action=mark-packet chain=prerouting connection-bytes=500000-0 disabled=no dst-port=80,443 in-interface=!ether9 new-packet-mark=qos-httpdata-up passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos ssh data" disabled=no in-interface=ether9 new-packet-mark=qos-sshdata-down packet-size=1400-1500 passthrough=no protocol=tcp src-port=22
add action=mark-packet chain=prerouting disabled=no dst-port=22 in-interface=!ether9 new-packet-mark=qos-sshdata-up packet-size=1400-1500 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos p2preq" disabled=no in-interface=ether9 new-packet-mark=qos-p2preq-down p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting disabled=no in-interface=!ether9 new-packet-mark=qos-p2preq-up p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting comment="qos other packets" disabled=no in-interface=ether9 new-packet-mark=users-download passthrough=no
add action=mark-packet chain=prerouting disabled=no in-interface=!ether9 new-packet-mark=users-upload passthrough=no



/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=PCQ_up_Servers pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=30 pcq-rate=2048k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=PCQ_down_Servers pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=30 pcq-rate=2048k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
set default-small kind=pfifo name=default-small pfifo-limit=10

Config and problem above is actual. Please help!

QoS and prioritization works when I disable PCQ, just latencies is a bit longer than I expect on torrent load (80msec against 40msec in idle).
Real problem is when I enable PCQ even with disabled QoS and prioritization. Ping goes up to 200-600msec on torrent or http load.
When I enable QoS. prioritization and PCQ - only PCQ are working - pings are same - 200-600msec.

I don’t know where to dig…

priority in PCQ not work, only in simple queue or queue tree without PCQ classifier.

So there is no way to make prioritization AND speed limitations per user ?

Anyone ?

I think you are wrong here. Priority works with PCQ.

@Hel, at first glance the problem with your configuration is that you have attached both queues, up and down,
in the same interface, so they do interfere with each other.
Rather than attaching queues on global-in interface you should try to attach the down queue at your local interface
and the up queue at the WAN interface.

fcto, I have 3 local interfaces.
Must each interface have their own queue ? Is this correct ?

You can attach the download queue on the global-in interface
and the upload queue on the global-out interface.

you cannot create priority rule in PCQ substream, you only can create priority rule to Parent queue that have PCQ inside.

Nope, I don’t want to prioritize one user over another in PCQ queue. All I want is to apply speed limitation to my internet users AND make QoS for them… by QoS I mean prioritization of http, online games and conferences over downloads and p2p traffic. I need to do it before PCQ speed limitation.

That not seems right, here’s what I found:

http://wiki.mikrotik.com/wiki/Manual:Queue

Queue Tree

Submenu level: /queue tree

Queue tree creates only one directional queue in one of the HTBs. It is also the only way how to add queue on the separate interface. This way it is possible to ease mangle configuration - you don’t need separate marks for download and upload - only upload will get to Public interface and only download will get to Private interface.

Also it is possible to have double queuing (example:prioritization of traffic in global-in > or > global-out, limitation per client on the outgoing interface) > If you have simple queues and queue tree in the same HTB - simple queues will get traffic first.

What I have now:

QoS - upload/download on global-in.
Users limitations (using PCQ) - upload queue on wan interface and download queue on lan interface.

QoS works a bit. but pings are 80-200ms while http downloading (user limit 100% full). That’s very very bad.

Is it even posible to make ping nearly realtime? -in my case they are 40ms when internet more than 1% free.

@Martini, I got it wrong. Of course you are right, it is not possible to prioritize within PCQ substreams.

@Hel, it is normal to have a high ping when one is consuming the whole bandwidth available while downloading.
The ICMP packet does not have a high priority, it will be the last one to pass, unless you do specify
a higher priority in queues, but what’s the point of it?

Yes, I’m trying to make icmp priority to the max. How else I’ll test, if shaper working or not?

i don’t know could this do the trick
by setting icmp inside the bandwidth in higher priority
please keep it before any managle rule that can not be passthough

add action=set-priority chain=prerouting comment=ICMP disabled=no new-priority=1 passthrough=yes protocol=
icmp
add action=set-priority chain=postrouting comment=ICMP disabled=no new-priority=1 passthrough=yes protocol=
icmp


the power of mikrotik is in it’s flexibility

I tried to put mangle rule to prioritize icmp traffic with passthru=yes on top of all rules.

Ping are same bad as before…

I researched some more.
When I enable speed limitations(pcq) on RB - I see that PCQ queues does queue packets and bytes but all QoS nodes doesn’t queue bytes and packets - they are 0 everytime.
When I disable speed limitations - I see that QoS starting to queue bytes and packets.

What can be a problem here? :confused:
scrn1.png

Priority and limit-at isn’t working. Absolutely. I just lost in here. For the novice like me it’s hell. One week of smoking manuals and I’m wondering now, if it is RouterOS 5.4 bug or something, didn’t tried it on 4.17… Will check it. (UPD: Checked, same problem)

When I cut PCQ queue type to 30 packets - ping success becomes no greater than 50%… But ping have limit-at = 10K! have priority = 1! Why torrent traffic is passing, but pings are not all? Tell me please… Ping MUST pass first completely no matter what because of higher priority and limit-at, and only then torrents must pass, because the are priority=8 and no limit-at. When I disable QoS queue, and leave PCQ queues enabled - the result are much the same as with QoS.

/ip firewall mangle
add action=set-priority chain=prerouting disabled=yes new-priority=1 passthrough=yes protocol=icmp
add action=set-priority chain=postrouting disabled=yes new-priority=1 passthrough=yes protocol=icmp
add action=mark-packet chain=prerouting comment="qos icmp" disabled=no in-interface=ether9 new-packet-mark=qos-icmp-down passthrough=no protocol=icmp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=qos-icmp-up out-interface=ether9 passthrough=no protocol=icmp
add action=mark-packet chain=prerouting comment="qos dns" disabled=no in-interface=ether9 new-packet-mark=qos-dns-tcp-down passthrough=no protocol=tcp src-port=53
add action=mark-packet chain=postrouting disabled=no dst-port=53 new-packet-mark=qos-dns-tcp-up out-interface=ether9 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=ether9 new-packet-mark=qos-dns-udp-down passthrough=no protocol=udp src-port=53
add action=mark-packet chain=postrouting disabled=no dst-port=53 new-packet-mark=qos-dns-udp-up out-interface=ether9 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="qos skype to skype" disabled=no in-interface=ether9 layer7-protocol=skypetoskype new-packet-mark=qos-skypetoskype-down passthrough=no protocol=udp
add action=mark-packet chain=postrouting disabled=no layer7-protocol=skypetoskype new-packet-mark=qos-skypetoskype-up out-interface=ether9 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="qos http(s) request" connection-bytes=0-500000 disabled=no in-interface=ether9 new-packet-mark=qos-httpreq-down passthrough=no protocol=tcp src-port=80,443
add action=mark-packet chain=postrouting connection-bytes=0-500000 disabled=no dst-port=80,443 new-packet-mark=qos-httpreq-up out-interface=ether9 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos lineage2" disabled=no in-interface=ether9 new-packet-mark=qos-la2-down passthrough=no protocol=tcp src-port=2106,7770-7779
add action=mark-packet chain=postrouting disabled=no dst-port=2106,7770-7779 new-packet-mark=qos-la2-up out-interface=ether9 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos counter strike1.6" disabled=no in-interface=ether9 new-packet-mark=qos-cs16-down passthrough=no protocol=udp src-port=27000-27150
add action=mark-packet chain=postrouting disabled=no dst-port=27000-27150 new-packet-mark=qos-cs16-up out-interface=ether9 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="qos world of warcraft" disabled=no in-interface=ether9 new-packet-mark=qos-wow-down passthrough=no protocol=tcp src-port=8015
add action=mark-packet chain=postrouting disabled=no dst-port=8015 new-packet-mark=qos-wow-up out-interface=ether9 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos http(s) data" connection-bytes=500000-0 disabled=no in-interface=ether9 new-packet-mark=qos-httpdata-down passthrough=no protocol=tcp src-port=80,443
add action=mark-packet chain=postrouting connection-bytes=500000-0 disabled=no dst-port=80,443 new-packet-mark=qos-httpdata-up out-interface=ether9 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="qos p2preq" disabled=no in-interface=ether9 new-packet-mark=qos-p2preq-down p2p=all-p2p passthrough=no
add action=mark-packet chain=postrouting disabled=no new-packet-mark=qos-p2preq-up out-interface=ether9 p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting comment="qos other packets" disabled=no in-interface=ether9 new-packet-mark=users-download passthrough=yes
add action=mark-packet chain=postrouting disabled=no new-packet-mark=users-upload out-interface=ether9 passthrough=yes
add action=mark-connection chain=forward comment="servers marking" disabled=no new-connection-mark=servers_client_conn_up passthrough=yes src-address-list=servers
add action=mark-packet chain=forward connection-mark=servers_client_conn_up disabled=no new-packet-mark=servers_client_traffic_up passthrough=no src-address-list=servers
add action=mark-connection chain=forward disabled=no dst-address-list=servers new-connection-mark=servers_client_conn_down passthrough=yes
add action=mark-packet chain=forward connection-mark=servers_client_conn_down disabled=no dst-address-list=servers new-packet-mark=servers_client_traffic_down passthrough=no



/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=qos-up parent=global-out priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=4096k name=qos-down parent=global-in priority=5
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=0 name=users-down parent=ether1 priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=0 name=users-up parent=ether9 priority=8
/queue type
set default kind=pfifo name=default pfifo-limit=70
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=PCQ_up_Servers pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=2048k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=500
add kind=pcq name=PCQ_down_Servers pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=3k pcq-rate=2048k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=50
add kind=sfq name=SFQ sfq-allot=1500 sfq-perturb=5
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=10k max-limit=100k name=qos-icmp-up packet-mark=qos-icmp-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10k max-limit=100k name=qos-icmp-down packet-mark=qos-icmp-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=1M name=qos-httpreq-down packet-mark=qos-httpreq-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=1M name=qos-httpreq-up packet-mark=qos-httpreq-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-p2preq-down packet-mark=qos-p2preq-down parent=qos-down priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-p2preq-up packet-mark=qos-p2preq-up parent=qos-up priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-httpdata-down packet-mark=qos-httpdata-down parent=qos-down priority=7 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-httpdata-up packet-mark=qos-httpdata-up parent=qos-up priority=7 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10k max-limit=100k name=qos-dns-tcp packet-mark=qos-dns-tcp-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10k max-limit=100k name=qos-dns-udp-down packet-mark=qos-dns-udp-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10k max-limit=100k name=qos-dns-tcp-up packet-mark=qos-dns-tcp-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10k max-limit=100k name=qos-dns-udp-up packet-mark=qos-dns-udp-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-unmarked-down packet-mark=users-download parent=qos-down priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=qos-unmarked-up packet-mark=users-upload parent=qos-up priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=500k name=qos-cs16-down packet-mark=qos-cs16-down parent=qos-down priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=1M name=qos-wow-down packet-mark=qos-wow-down parent=qos-down priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=1M name=qos-la2-down packet-mark=qos-la2-down parent=qos-down priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=500k name=qos-cs16-up packet-mark=qos-cs16-up parent=qos-up priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=1M name=qos-wow-up packet-mark=qos-wow-up parent=qos-up priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=50k max-limit=1M name=qos-la2-up packet-mark=qos-la2-up parent=qos-up priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=100k max-limit=1M name=qos-skypetoskype-down packet-mark=qos-skypetoskype-down parent=qos-down priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=100k max-limit=1M name=qos-skypetoskype-up packet-mark=qos-skypetoskype-up parent=qos-up priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=4096k name=servers-down packet-mark=servers_client_traffic_down parent=users-down priority=5 queue=PCQ_down_Servers
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 max-limit=4096k name=servers-up packet-mark=servers_client_traffic_up parent=users-up priority=5 queue=PCQ_up_Servers
/queue interface
set ether12 queue=ethernet-default
set ether13 queue=ethernet-default
set ether11 queue=ethernet-default
set ether6 queue=ethernet-default
set ether7 queue=ethernet-default
set ether8 queue=ethernet-default
set ether9 queue=ethernet-default
set ether10 queue=ethernet-default
set ether1 queue=ethernet-default
set ether2 queue=ethernet-default
set ether3 queue=ethernet-default
set ether4 queue=ethernet-default
set ether5 queue=ethernet-default

And not only PCQ makes good-quality connection unstable. Even properly configured (by manual at mikrotik’s wiki) QoS alone increase latency in games.
I used mikrotik’s wiki manual to setup QoS, then by Sheriff’s manual from youtube, and then I tried some examples at russian forums, they didn’t work too…

So I wrote a message to reseller’s support and waiting for assistance.


But before that. Even if no one want to help or don’t know how to help. Could anyone even post an answer to these questions?

  1. Can QoS prioritize ping as much, that it’ll show same good latencies on 30% and 100% of internet connection no matter what?
  2. Can PCQ (for client’s speed limitation) work with case above?
  3. Is it possible to shape synchronous xDSL 4 MBit (IN+OUT) in PCQ queues?

You need something called Low Latency Queuing.
That is not yet implemented in Mikrotik.
I need that too.

That make sense. I’ve now searched “Low Latency Queuing” on this forum and it gives me threads with exactly the same trouble as mine.
Priority doesn’t work with low (but 100%) internet usage and yes, I have only 2 test users. But why is there so few mikrotik users with priority problems?