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.
Table of Contents
Introduction
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.
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
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:
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
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
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
EdgeRouter - Quality of Service (QoS)
EdgeRouter - Quality of Service (QoS) Shaper for Upload/Download and VoIP
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