QoS · Topic 2 of 2

One Simple Queue for the Whole Network with PCQ

Share bandwidth fairly among all hosts with a single simple queue and PCQ queue types, including the pcq-classifier, pcq-rate and pcq-limit settings.

  • 5 min
  • Includes a diagram
In a nutshell
  • PCQ splits traffic into sub-streams and shares the limit among them.
  • A PCQ queue type is created with kind=pcq.
  • Use dst-address as the classifier for download and src-address for upload.

What it is

PCQ lets one simple queue share bandwidth fairly among all hosts of a network.

Writing one queue per host does not scale. With PCQ, which stands for per connection queuing, you create a queue type once, and the router splits the traffic into sub-streams by address. Each sub-stream is a host or connection group that gets its own share.

The result is that every host gets an equal part of the link, and no single host can take it all.

All LAN hostsone simple queuePCQ classifierSub streamsone per hostequal shareInternet linkmax limit

How it works

You define PCQ queue types for each direction, and then attach them to one simple queue.

The PCQ queue type

A queue type is created in the queue type menu with kind=pcq.

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

The classifier decides how traffic is split into sub-streams. For download, traffic goes to the LAN hosts, so the destination address identifies the host. For upload, traffic comes from the hosts, so the source address identifies it.

DirectionClassifier
Downloaddst-address
Uploadsrc-address

Other classifiers exist, such as ports, but the address is the usual choice for a simple fair share.

Using the queue types

One simple queue for 192.168.88.0/24 with max-limit 20M/20M uses pcq-up to split upload by source address and pcq-down to split download by destination address, giving one sub-stream per host. One simple queue ties both queue types to the whole network.

/queue simple add name=all-lan target=192.168.88.0/24 max-limit=20M/20M queue=pcq-up/pcq-down

The queue setting takes two values, in the same upload/download order as the limits. The first is the queue type for upload and the second is the one for download.

The max-limit is the total the whole network may use. PCQ then divides this total among the active hosts.

If one host is active, it can use the whole limit. If ten hosts are active, each gets about a tenth. When a host goes quiet, its share returns to the others.

The pcq-rate setting

pcq-rate sets a fixed rate limit for each sub-stream.

ValueEffect
0No per host limit, so the total is shared equally
A rate such as 2MEach sub-stream is held to that rate

With pcq-rate=0, hosts share the total equally, and a single host can use all of it when the others are idle. With a rate such as 2M, each host is held to that rate, even when the link has room.

/queue type add name=pcq-down-2m kind=pcq pcq-classifier=dst-address pcq-rate=2M

A fixed rate is useful for plans where every customer gets the same speed. Equal sharing is better when you want to use the whole link at all times.

The pcq-limit setting

pcq-limit is the size of the queue of one sub-stream. It sets how much data can wait for each host before the router starts to drop packets.

/queue type add name=pcq-down kind=pcq pcq-classifier=dst-address pcq-rate=0 pcq-limit=50KiB

A larger queue absorbs bursts and avoids dropping packets, but it adds delay. A smaller queue keeps delay low but drops sooner. A related setting, pcq-total-limit, caps the combined size of all sub-streams.

If hosts see long delays under load, a smaller pcq-limit can help. If downloads are slow because of drops, a larger one may help.

Exam tip

Start with the default queue sizes and change pcq-limit only when you see delay or drops under load.

PCQ compared with one queue per host

ApproachEffortBehaviour
One simple queue per hostOne entry for every hostFixed share for each host, easy to give special rates
One simple queue with PCQOne queue plus two typesFair share among all active hosts automatically

Use PCQ for a large or changing network. Use separate simple queues when particular hosts need different limits.

You can combine them. Place the special host queues above the PCQ queue, so that they match first, and let PCQ handle everyone else.

Checking the queue

/queue simple print stats
/queue type print

The statistics show how much traffic the queue handles and whether packets are being dropped. If the counters stay at zero, the target may not match, or FastTrack may be taking the traffic first.

Watch out

Do not forget to exclude shaped traffic from FastTrack, because fast tracked connections bypass simple queues.

What to remember for the exam

Seven facts cover this topic.

  • PCQ splits traffic into sub-streams and shares the limit among them.
  • A PCQ queue type is created with kind=pcq.
  • Use dst-address as the classifier for download and src-address for upload.
  • The queue setting of a simple queue takes the upload type first and the download type second.
  • pcq-rate=0 means an equal share with no fixed per host limit.
  • A value in pcq-rate holds each sub-stream to that rate.
  • pcq-limit is the queue size of a single sub-stream.

Common mistakes

These four mistakes are common.

Swapping the classifiers. Using the source address for download splits traffic by the wrong side.

Swapping the queue types. The upload type must come first in the queue setting.

Setting pcq-rate too low. Each host is then held below what the link can give.

Expecting PCQ to work on fast tracked traffic. FastTrack bypasses simple queues.

Check yourself

Work through these three questions.

  • Which classifier do you use for download and which for upload?

    Use dst-address for download and src-address for upload. The classifier splits traffic by the address of the LAN host.

  • What does pcq-rate=0 do?

    It sets no per host limit, so the total limit is shared equally among the active hosts. One host can use everything when the others are idle.

  • What does pcq-limit control?

    It sets the queue size of a single sub-stream. A larger queue absorbs bursts but adds delay.

Topic 2 of 2 in QoS

Test yourself on QoS

The full MikroTik MTCNA question bank has 558 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.