Set up Simple Queues with FQ-Codel and Mikrotik RouterOSv7

MikroTik introduces FQ-Codel to RouterOSv7
June 22, 2022
Set up Simple Queues with FQ-Codel and Mikrotik RouterOSv7

MikroTik has powerful methods for managing packet flows using Queues and Firewall Mangle. Although this works exceptionally well and will always have its place within RouterOS, this method requires a lot of configuration and ‘know-how’ to achieve decent results. For those looking for a more straightforward solution, a new Queue type is available in RouterOSv7, which significantly reduces time spent on configuration with impressive performance.

Note: the video covers all of the contents of this article and includes more visuals.

FQ-CoDel

FQ-CoDel is a technique that was designed to combat buffer delays known as ‘bufferbloat’ introduced into queues with high amounts of traffic. Reducing these delays significantly improves latency and, by extension, a better overall QoS experience.

From Mikrotik’s user manual:

“CoDel - Fair Queuing (FQ) with Controlled Delay (CoDel) uses a randomly determined model to classify incoming packets into different flows and is used to provide a fair share of the bandwidth to all the flows using the queue. Each flow is managed using CoDel queuing discipline which internally uses a FIFO algorithm”

Note: find further detail on Queues and FQ-CoDel in MikroTik's help website.

Since an algorithm is doing traffic classification for us, it’s not necessary to mark each connection and packet in many situations. It also means that you can achieve excellent results with just one queue.

Configuration

There is no fq-codel queue type available by default, so it must be created.

In Winbox go to Queues then Queue Type and create a new one called fq-codel and set the Kind as fq-codel. You can leave all other settings default.

 

FQ-Codel Configuration Step 1

CLI: queue/type/add name=fq-codel kind=fq-codel


Next step, go to Queues > General, and create a simple queue and specify the relevant Target and/or Destination as well as connection speed for upload/download. In this example we will only be using the 'Target' field which will affect all traffic through our ether1 interface. In our test we used a max up/down limit of 20Mbps.

FQ-Codel Configuration Step 2

Move to the Advanced tab and select ‘fq-codel’ as the Queue Type.

FQ-Codel Configuration Step 3

Lastly, in the Total tab, select ‘fq-codel’ as the Total Queue Type.

FQ-Codel Configuration Step 4

CLI: queue/simple/add name=fq-codel-test target=ether1 max-limit=20M/20M queue=fq-codel/fq-codel total-queue=fq-codel


Note: 'Simple Queues' will not take effect unless 'Fast Track' is disabled in IP > Firewall.

Test Results

We used Flent for benchmarking since this tool allowed us to simulate a network under load and visualize how the queue manages the traffic and latency. We compared the 'default-small' queue type with ‘fq-codel’ and received impressive results.

FQ-Codel Configuration Step 3

FQ-Codel Configuration Step 3

FQ-Codel Configuration Step 3

FQ-CoDel offers a far better overall experience while keeping latency low. This makes it ideal for all use cases but would be particularly useful for real-time applications like VoIP and Video Conferencing.

While testing, we ran an independent ping test under full load and found the latency to be the same or better than when the queue was idle. We would highly recommend using this type of queue in many situations but be aware of the CPU usage when under full load. FQ-CoDel can be rather resource intensive.



Blog post by Tim Symonds
Copyright © 2024 Scoop Distribution (Pty) Ltd. All rights reserved.