EdgeRouter - Quality of Service (QoS)


Overview


Readers will learn about the different types of Quality of Service (QoS) Traffic Policies supported by EdgeOS.

NOTES & REQUIREMENTS:
Applicable to the latest EdgeOS firmware on all EdgeRouter models. Knowledge of the Command Line Interface (CLI) and basic 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 Ingress and Egress Policies
  3. Configuring the Smart Queue
  4. 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.

topology1.png

Example network demonstrating the directions in which different QoS policies can be applied, egress (out) and ingress (in).


EdgeOS can use various QoS (Quality of Service) policies are to limit traffic in different ways. The policies are applied in the egress (out) or ingress (in) direction on an interface (depending on which direction is supported). In the example above, the EdgeRouter is configured with two interfaces, WAN (eth0) and LAN (eth1). QoS policies can be applied to either of these two interfaces in different directions, depending on the manner in which traffic should be limited. See the section below for more information on the supported directions for the different QoS policies.


Configuring Ingress and Egress Policies


Back to Top

There are many different types of QoS Traffic Policies, each with its different use and limitations. Policies can only be applied in a single direction. Several of the policies supported by EdgeOS that can be applied in the egress (out) direction are:

  • Tail Drop (FIFO) Queues and drops packets based on a First In / First Out (FIFO)  approach.
  • Random Early Detection (RED) Queues and drops packets based on random probability.
  • Rate Control Limits traffic to a pre-defined rate.
  • Fair Queue Queues and transfers packets based on the Stochastic Fairness Queuing  approach.
  • Shaper Buffers and transfers packets based on a pre-defined bitrate.

The policy supported by EdgeOS that can be applied in the ingress (in) direction is:

  • Limiter Drops incoming packets that do not conform to the pre-defined policy.

When using Tail Drop queuing, new packets will be dropped when the queue size reaches the pre-defined limit. The queue does not distinguish between different types of traffic and is configured with a single parameter, the maximum queue size (limit). Follow the steps below to create a Tail Drop (FIFO) 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 policy name and specify the maximum queue size size in packets.

set traffic-policy drop-tail <name> queue-limit 100
NOTE: The available queue size range is 1-4294967295 packets.

3. Attach the policy to an interface in the egress (out) direction.

set interfaces ethernet eth0 traffic-policy out <name>

4. Commit the changes and save the configuration.

commit ; save

When using Random Early Detection (RED), new packets will be dropped at random when the queue starts to increase in size. When the queue is empty, new packets will be accepted and forwarded. As the queue starts to grow in size, the probability for dropping incoming packets will grow as well. Like the Drop Tail queuing, RED does not distinguish between traffic types.

The following options are available when configuring RED:

  • precedence RED can use different limits for each IP precedence value.
  • mark-probability The probability (1 / N) at which the packets will be dropped.
  • minimum-threshold Queue size at which RED will start dropping packets.
  • maximum-threshold RED will drop packets packets at an increasing rate as the queue length increases.

Follow the steps below to create a RED policy:

CLI: Access the Command Line Interface.

1. Enter configuration mode. 

configure

2. Define the policy name, precedence value and thresholds.

set traffic-policy random-detect <name> precedence 0 mark-probability 25
set traffic-policy random-detect <name> precedence 0 maximum-threshold 100
set traffic-policy random-detect <name> precedence 0 minimum-threshold 50
NOTE: This example policy will drop 1/25 packets when the queue size reaches the maximum threshold.

3. Attach the policy to an interface in the egress (out) direction.

set interfaces ethernet eth0 traffic-policy out <name>

4. Commit the changes and save the configuration.

commit ; save

When using Rate Control, the traffic is limited to a pre-defined rate. Like the Drop Tail and RED queuing, Rate Control does not distinguish between traffic types. Follow the steps below to create a Rate Control policy:

CLI: Access the Command Line Interface.

1. Enter configuration mode. 

configure

2. Define the policy name and specify the maximum queue size size in packets.

set traffic-policy rate-control <name> bandwidth 20mbit
NOTE: This example policy will limit outgoing traffic to 20Mbit/s.

3. Attach the policy to an interface in the egress (out) direction.

set interfaces ethernet eth0 traffic-policy out <name>

4. Commit the changes and save the configuration.

commit ; save

The Fair Queue policy uses the Stochastic Fairness Queuing approach to separate traffic flows into different buckets and have the router service each bucket one by one. The separation is done using a hash of the source/destination IP addresses and the source port. Since the fairness is probabilistic, in some cases multiple flows may be put into the same bucket; this can potentially cause unfairness. To minimize effects, you can adjust the hash interval parameter to change the hashing algorithm at fixed time intervals. Follow the steps below to create a Fair Queuing policy:

CLI: Access the Command Line Interface. 

1. Enter configuration mode. 

configure

2. Define the policy name and specify the hash interval.

set traffic-policy fair-queue <name> hash-interval 10

3. Attach the policy to an interface in the egress (out) direction.

set interfaces ethernet eth0 traffic-policy out <name>

4. Commit the changes and save the configuration.

commit ; save

With a Shaping QoS policy, the traffic is buffered to conform to a certain bitrate. Shaping uses the Hierarchical Token Bucket  technique and the policy can be customized to provide different bandwidth guarantees to different traffic classes.

Some of the options that are available when configuring Shaping are:

  • class Match on a certain traffic type (for example a DSCP value).
  • queue-type Can be either set to Fair Queue, Tail Drop, RED or Priority queuing.
  • bandwidth The guaranteed bandwidth set as a flat rate or percentage.
  • ceiling The bandwidth limit set as a flat rate or percentage.

Follow the steps below to create a Shaping policy:

CLI: Access the Command Line Interface. 

1. Enter configuration mode. 

configure

2. Define the policy name and specify the maximum queue size size in packets.

set traffic-policy shaper <name> bandwidth 100mbit
set traffic-policy shaper <name> default bandwidth 75%
set traffic-policy shaper <name> class <nr> bandwidth 25%
set traffic-policy shaper <name> class <nr> match <name> ip dscp 46
NOTE: This example policy will guarantee 75% of the available bandwidth (set to 100Mbit/s in this example) to default traffic. Traffic marked with IP DSCP value 46 will be guaranteed 25% of the bandwidth. 

3. Attach the policy to an interface in the egress (out) direction.

set interfaces ethernet eth0 traffic-policy out <name>

4. Commit the changes and save the configuration.

commit ; save

The Limiter policy is used to drop incoming packets that do not conform to the policy. The policy can be customized to match on different traffic types (classes) and limit each class individually. Follow the steps below to create a Limiter policy:

CLI: Access the Command Line Interface. 

1. Enter configuration mode. 

configure

2. Define the policy name and specify the classes and bandwidth limits.

set traffic­-policy limiter <name> class <nr> bandwidth 1mbit
set traffic­-policy limiter <name> class <nr> match <name> ip protocol icmp
set traffic­-policy limiter <name> default bandwidth 20mbit
NOTE: This example policy will limit all incoming traffic to 20Mbit/s, with the exception of ICMP traffic that is limited to 1Mbit/s.

3. Attach the policy to an interface in the ingress (in) direction.

set interfaces ethernet eth1 traffic-policy in <name>
NOTE: The policy is more effective when it is limiting traffic directed at the router itself, instead of traffic that passes through the router.

4. Commit the changes and save the configuration.

commit ; save

Configuring the Smart Queue


Back to Top

topology2.png

Smart Queue QoS policy applied on the WAN interface (eth0), limiting the traffic of the LAN hosts to a pre-defined rate.


Starting from the v1.7.0 EdgeOS firmware release, there is another available QoS feature that can be used to limit traffic on the WAN interface. The Smart Queue is designed to allow you to easily limit upload and download speeds to a pre-defined rate. The most common option used with the Smart Queue feature are:

  • WAN Interface The WAN interface of the router.
  • Upload Rate Specify the upload rate in either Mbit/s, Kbit/s or bit/s.
  • Download Rate Specify the upload rate in either Mbit/s, Kbit/s or bits/s.

Follow the steps below to configure the Smart Queue:

GUI: Access the EdgeRouter Web UI.

1. Navigate to the Smart Queue tab in the QoS section.

QoS > Smart Queue

2. Specify the policy name, WAN interface (eth0) and the upload and download rate (100/20 Mbit/s in this example).

Policy name: <name>
WAN Interface: eth0
Upload Rate: 20 Mbit/sec
Download Rate: 100 Mbit/sec

3. Apply the changes.


The above configuration can also be set using the CLI:

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 policy name and specify the upload and download rate.

set traffic-control smart-queue <name> wan-interface eth0
set traffic-control smart-queue <name> upload rate 20mbit
set traffic-control smart-queue <name> download rate 1000mbit

3. 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) Advanced Queue

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!