PCQ Help

Hello,

I have just installed my first RB1200 for a customer yesterday. The customer has a need to manage traffic a bit. They have a connection that yields about 15Mbps down and 2Mbps up. People on the internal network often have a need to upload very large files to various FTP or HTTP sites. These sustained uploads bring internet access to a slow a crawl. I have implemented PCQ to just limit per connection uploads to 1Mbps each. There is probably a more dynamic way to do this. Can somebody help me out? Here’s the relevant config:

[dsmithson@MikroTik] /queue> simple print
Flags: X - disabled, I - invalid, D - dynamic
0 name=“queue1” target-addresses=10.10.10.0/24 dst-address=0.0.0.0/0 interface=all parent=none direction=both
priority=8 queue=PCQ_upload/PCQ_download limit-at=0/0 max-limit=0/0 burst-limit=0/0 burst-threshold=0/0
burst-time=0s/0s total-queue=default-small
[dsmithson@MikroTik] /queue> tree print
Flags: X - disabled, I - invalid
0 name=“queue1” parent=global-in packet-mark=all limit-at=0 queue=PCQ_download priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s

1 name=“queue2” parent=global-out packet-mark=all limit-at=0 queue=PCQ_upload priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
[dsmithson@MikroTik] /queue> type print
0 name=“default” kind=pfifo pfifo-limit=50

1 name=“ethernet-default” kind=pfifo pfifo-limit=50

2 name=“wireless-default” kind=sfq sfq-perturb=5 sfq-allot=1514

3 name=“synchronous-default” kind=red red-limit=60 red-min-threshold=10 red-max-threshold=50 red-burst=20
red-avg-packet=1000

4 name=“hotspot-default” kind=sfq sfq-perturb=5 sfq-allot=1514

5 name=“PCQ_download” kind=pcq pcq-rate=14M pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000
pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32
pcq-src-address6-mask=128 pcq-dst-address6-mask=128

6 name=“PCQ_upload” kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000
pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32
pcq-src-address6-mask=128 pcq-dst-address6-mask=128

7 name=“default-small” kind=pfifo pfifo-limit=10

Thank you for your help. Much appreciated.

This is a very easy thing to set up, and probably my favorite feature of Mikrotik. If you are just looking for a basic flat PCQ setup, go ahead and just use simple queues. Mixing Simple Queues and Queue Trees is just going to cause a headache down the road. (Simple Queues generate their own Queue Trees and mangle rules)

With your setup, the thing you are missing is Max-Limit in the simple Queue. Max-limit is the total bandwidth of the internet connection. Without it, none of the QoS works. Go into your simple queue, and set the Max-limit to 15M for download and 2M for upload. If you find the connection doesn’t always give the advertised bandwidth, lower these limits a little. If you can’t reach the speeds set in Max-limit, the QoS won’t work well, and in my experience, users are happier with 12Mbit and working PCQ over 15Mbit and broken PCQ.

Personally, I would then go in to the PCQ_download and PCQ_upload definitions and remove the pcq-rate, since there is usually no reason a user in a small business can’t use all the bandwidth when it is available. Limit-at is typically used by ISPs to handle individual subscriber caps. I’m not saying there isn’t specific times it is useful, I just generally don’t find it so with small/medium business.

If you haven’t seen them yet, here are the examples out of the wiki. They explain the relation of Max-limit and PCQ-rate nicely:

Thank you for your help on this. I find that the documentation in the wiki is sparse in certain areas. I had actually followed a confusing example from the wiki which is why I ended up mixing trees and simple queues. May I ask where does one really learn the magic? Do I have to attend MUM or get certified or what?

# Self Learning / R&D is the key to success,
# Read , Read, Read and do practicals / practice in your lab.
# Attend MUM’s to see how people are using this product in there customized environment
# Get Proper Training > Certification
# Finally Earn by Consulting :slight_smile:~

Almost all my knowledge has come from trial & error and reading these forums. Trying to answer questions and help others has given me a much stronger understanding of a lot of the basics.

Training classes and certifications were fun, but to be honest I learned more from these forums than the classes.