EdgeRouter - Quality of Service (QoS) Advanced Queue


Overview


Readers will lean how to configure and implement the Quality of Service (QoS) using the Advanced Queue.

NOTES & REQUIREMENTS:
Applicable to the latest EdgeOS firmware on all EdgeRouter models. Knowledge of the Command Line Interface (CLI) and advanced networking knowledge is required. Please see the Related Articles below for more information.
 
Device used in this article:

Table of Contents


  1. Introduction
  2. Configuring the Advanced Queue using the Command Line
  3. Related Articles

Introduction


Back to Top

ATTENTION: Traffic to which QoS policies have been applied cannot also take advantage of the EdgeRouter's Offloading feature. See the Hardware Offloading article for more information.

EdgeOS can use various QoS (Quality of Service) policies are to limit traffic in different ways. The policies are usually applied on an interface in the egress (out) direction. Starting from the v1.8.0 EdgeOS firmware release, the Advanced Queue is another available QoS feature. One of the advantages of the Advanced Queue is that the QoS policies can be applied globally. This means that the policies can be easily applied to all traffic passing through the device, depending on which traffic types are matched.

NOTE: The Advanced Queue can either be applied globally or to a specific interface.

Using the Advanced Queue, we can match on specific traffic types (such as source IP network ranges) and apply different QoS policies. The Advanced Queue is hierarchical, this means that a QoS tree is created with root, branch and leaf nodes. Filters are then used to classify the traffic and attach it to a specific node. The following queue types are available when using the Advanced Queue:

  • FQ-CODEL Fair Queuing (FQ) with Controlled Delay (CoDel).
  • HFQ Host Fairness Queuing.
  • PFIFO Packet limited First In, First Out queue (default).
  • SFQ Stochastic Fairness Queuing.

Configuring the Advanced Queue using the Command Line


Back to Top

topology.png

Example network in which the Advanced Queue QoS policy is applied globally for both the wired and wireless client networks.


In the example diagram above, the EdgeRouter is configured with three interfaces, WAN (eth0) and two LAN interfaces (eth1 and eth2). The total available bandwidth for this example network is 100Mbit/s, which is divided in 75Mbit/s for download and 25Mbit/s for upload.

The download speed is further divided for both LAN networks. The 192.168.1.0/24 network will be queued using FQ-CODEL and is guaranteed 50Mbit/s, whereas the 192.168.2.0/24 network will be queued using HFQ and is guaranteed 25Mbit/s. The Host Fairness Queuing will further allow the EdgeRouter to divide the 25Mbit/s for each individual client in the 192.168.2.0/24 network to 1Mbit/s. Follow the steps below to configure the Advanced Queue QoS policy:

CLI: Access the Command Line Interface. You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Enter configuration mode. 

configure

2. Define the root queue and attach it globally. 

set traffic-control advanced-queue root queue 1 attach-to global
set traffic-control advanced-queue root queue 1 bandwidth 100mbit

3. Define the download branch queue and specify the available bandwidth.

set traffic-control advanced-queue branch queue 10 bandwidth 75mbit
set traffic-control advanced-queue branch queue 10 description download
set traffic-control advanced-queue branch queue 10 parent 1

4. Add a filter that places the download traffic in the previously created branch queue.

set traffic-control advanced-queue filters match 10 attach-to 1
set traffic-control advanced-queue filters match 10 description download
set traffic-control advanced-queue filters match 10 ip destination address 192.168.0.0/22
set traffic-control advanced-queue filters match 10 target 10

5. Define the FQ-CODEL and HFQ queue types that will be used for the leaf queues.

set traffic-control advanced-queue queue-type fq-codel fqcodel1

set traffic-control advanced-queue queue-type hfq hfq1 host-identifier dip
set traffic-control advanced-queue queue-type hfq hfq1 max-rate 1mbit
set traffic-control advanced-queue queue-type hfq hfq1 subnet 192.168.2.0/24
NOTE: Host Fairness Queuing supports prefix lengths up to /22. The host-identifier can match on source or destination IP addresses. 

6. Define the download leaf queues for both networks referring to the previously created queue types.

set traffic-control advanced-queue leaf queue 100 bandwidth 50mbit
set traffic-control advanced-queue leaf queue 100 description download-lan1
set traffic-control advanced-queue leaf queue 100 parent 10
set traffic-control advanced-queue leaf queue 100 queue-type fqcodel1

set traffic-control advanced-queue leaf queue 110 bandwidth 25mbit
set traffic-control advanced-queue leaf queue 110 description download-lan2
set traffic-control advanced-queue leaf queue 110 parent 10
set traffic-control advanced-queue leaf queue 110 queue-type hfq1

7. Add filters that place the download traffic for both networks in the previously created leaf queues.

set traffic-control advanced-queue filters match 100 attach-to 10
set traffic-control advanced-queue filters match 100 description download-lan1
set traffic-control advanced-queue filters match 100 ip destination address 192.168.1.0/24
set traffic-control advanced-queue filters match 100 target 100

set traffic-control advanced-queue filters match 110 attach-to 10
set traffic-control advanced-queue filters match 110 description download-lan2
set traffic-control advanced-queue filters match 110 ip destination address 192.168.2.0/24
set traffic-control advanced-queue filters match 110 target 110

8. Define the upload leaf queue and specify the available bandwidth, while also referring to the previously created queue type.

set traffic-control advanced-queue leaf queue 20 bandwidth 25mbit
set traffic-control advanced-queue leaf queue 20 description upload
set traffic-control advanced-queue leaf queue 20 parent 1
set traffic-control advanced-queue leaf queue 20 queue-type fqcodel1
NOTE: The upload traffic does not use a branch queue in this example. It is possible to attach leaf queues directly to the root queue.

9. Add a filter that places the upload traffic for both networks in the previously created leaf queue.

set traffic-control advanced-queue filters match 20 attach-to 1
set traffic-control advanced-queue filters match 20 description upload
set traffic-control advanced-queue filters match 20 ip source address 192.168.0.0/22
set traffic-control advanced-queue filters match 20 target 20

10. Commit the changes and save the configuration.

commit ; save

Related Articles


Back to Top

EdgeRouter - Quality of Service (QoS) Shaper for Upload/Download and VoIP

EdgeRouter - Quality of Service (QoS)

EdgeRouter - Hardware Offloading

EdgeRouter - How to Access the EdgeRouter

EdgeRouter - Access the CLI from the Web UI

Intro to Networking - How to Establish a Connection Using SSH


We're sorry to hear that!