Home / Mikrotik Router Configuration / Explanation of Queue Tree & PCQ and its Application in Mikrotik

Explanation of Queue Tree & PCQ and its Application in Mikrotik

Explanation of Queue Tree & PCQ and its Application in Mikrotik

Bandwidth settings and management in Mikrotik can not be separated from the Queue feature. There are two types of Queue that can be used in Mikrotik, the Simple Queue, and Queue Tree. For an explanation of the Simple Queue I’ve discussed here:
How to Limit the Bandwidth with Mikrotik Simple Queue
Well, this time we will discuss Explanation Queue Tree & PCQ (Per Connection Queue) and its application in Mikrotik.

Queue Tree
Queue Tree serves to implement a more complex function in the bandwidth limits on Mikrotik where the use of its packet mark has a better function. Used to restrict one-way connection either download or upload. In general, this Queue Tree does not look any different from the Simple Queue.

The difference that we can see directly is only from the side of how to use or use it. Where Queue Simple is specifically designed for ease of configuration while Queue Tree is designed to perform more complex queuing tasks and requires a good understanding of traffic flow.

Some Differences Simple Queue and Queue Tree:
1. Queue Simple

  • Having a very strict order rule, the queue is processed from the top to the very bottom.
  • Set the packet flow bi-directional (bidirectional).
  • Able to limit traffic based on IP address.
  • One queue is able to restrict two-way traffic at once (upload/download).
  • If using Queue Simple and Queue Tree together, Queue Simple will be processed earlier than Queue Tree.
  • Supports the use of PCQ so as to share bandwidth equitably and evenly.
  • Can apply marked queue through packets in / firewall mangle.
  • Be able to divide bandwidth on a fixed basis.
  • As the name implies, the settings are very simple and tend to be static, very suitable for admins who do not want complicated with traffic control in / firewall mangle.

2. Queue Tree

  • Having no sequence, each queue will be processed together.
  • Set the packet flow in directional (one way)
  • Requires setting/firewall mangle to limit traffic per IP.
  • Requires setting/firewall mangle first to distinguish download and upload traffic.
  • Dinomorduakan after Queue Simple.
  • Supports the use of PCQ so as to share bandwidth equitably and evenly.
  • Pure queue settings through packets marked in / firewall mangle.
  • Be able to divide bandwidth on a fixed basis.
  • More flexible and need a good understanding in / firewall mangle especially about traffic control.

Queue Tree in Mikrotik

Explanation of some arguments in the Queue Tree:
1. Parent: useful to determine whether the selected queue is assigned as child queue
There are several default options in the parent queue tree that are typically used for the parent queue:
– Global-in :
Represents all input interfaces in general. It means here the interface that receives data input/traffic before it is filtered like upload traffic
– Global-out :
Represents all output interfaces in general. It means here the interface that outputs data output/traffic that has been filtered like download traffic
– Global-total :
Represents all input and output interfaces simultaneously, in other words, is a union of global in and global-out.
– <interface name> : ex: lan or wan:
Represents one of the outbound interfaces. This means that only traffic coming out of this interface will be disguised.

2. Packet Mark: Used to mark packets that have been marked in the / IP firewall mangle.

3. Priority (1 s / d 8): Used to prioritize child queue from other child queues. Priority does not work on parent queue. Child Queue that has priority one (1) will reach the limit at first then the child queue the priority (2).

4. Queue Type: Used to select type queue that can be made specifically in the queue types
– Limit At: Minimum bandwidth obtained by Target / IP diqueue
– Max Limit: The maximum bandwidth that can be achieved by the target / ip diqueue.
– Burst limit: The maximum bandwidth that can be reached by the target / ip that diqueue when the burst is active
– Burst time: The time period in seconds, where the average data rate is calculated.
– Burst Threshold: Used when the Rate data is below burst threshold value then burst is allowed. When Data Rate is equal to burst threshold burst value is prohibited. To optimize burst the burst threshold value must be above the Limit At and below values
Max Limit.

PCQ (Per Connection Queuing)
Used to recognize the direction of current and use because it can be a fair, uniform and massive bandwidth. PCQ on Mikrotik is used together with Queue feature, either Simple Queue or Queue Tree.

To more easily understand the concept of PCQ, please refer to the following analogy:
I have 10 PCs that I will share a maximum bandwidth of 1 Mb and the minimum bandwidth of each PC 256 kb. If only one of my PCs is online then he will be able to BW max 1 Mb, but if there are two PCs that are online BW divided by 2, and so on up to 10 with evenly distributed bandwidth.

Well, to create a configuration like this, I have to create 1 rule parent Queue and 10 rule child Queue for each client. For the current condition that only 10 PC’s, it’s ok. But imagine if there are 100 PCs? 200? What if I manage is a WiFi Hotspot network with a client who got its number? Do I have to create hundreds of rules for each client?

Tired doing. Therefore, I can use this PCQ feature to massive bandwidth management to all clients on a large scale. By using this PCQ, although the number of clients is not necessarily and very much, we only need to create one or two Queue configuration. Delicious right? Although the number of clients is not necessarily and very much, we only need to create one or two Queue configuration. Delicious right? Although the number of clients is not necessarily and very much, we only need to create one or two Queue configuration. Delicious right?

Queue Tree

Explanation of Some Arguments in PCQ:

PCQ Classifier functions to classify connection direction, For example, if the Classifier used is src-address on Local interface, then pcq stream will become an upload connection. So also with dst-address will be pcq download.

PCQ rate serves to limit the maximum bandwidth that can be obtained. By entering a number at this rate (default: 0) then the maximum download that will be obtained per IP will be limited eg. 128k (kbps).

PCQ rate in mikrotik

Limit works to limit the number of parallel connections allowed for each IP. Meaning that if we put the value 50, then only 50 simultaneous connections that can be obtained by 1 IP address (be it source/destination).

Total Limit is the total number of parallel connections allowed for all IP address (either source or destination).

Examples of the application of PCQ and Queue Tree in Mikrotik :

Combining Layer7 and packet marking features using mangles to mark commonly downloaded files for later limited bandwidth downloads using Queue Tree + PCQ. So each client will get a limited download connection and unlimited browsing.

Download after limit
[\hide]

About admin

Check Also

Load Balance 2 WAN in Mikrotik

How to Load Balance 2 WAN in Mikrotik

How to Load Balance 2 WAN in Mikrotik This article again discusses Load Balancing, which …

Leave a Reply

Your email address will not be published. Required fields are marked *