EdgeRouter - Quality of Service (QoS) Shaper for Upload/Download and VoIP
Overview
Readers will learn how to configure the Quality of Service (QoS) Shaper Traffic Policy.
Configuring Shaper Policies
Example network demonstrating the directions in which the different QoS Shaper policies are applied.
EdgeOS can use various QoS (Quality of Service) policies are to limit traffic in different ways. In the example above, the EdgeRouter is configured with two interfaces, WAN (eth0) and LAN (eth1). The Shaper policies are applied in the egress (out) direction on the interfaces and can be configured to limit the upload and download speeds of hosts. The upload speed is limited by applying a Shaper policy to the WAN interface, whereas the download speed is limited by applying the policy to the LAN interface.
With a Shaping 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 that limits the download speed to 100Mbit/s and the upload speed to 50Mbit/s while also guaranteeing bandwidth to VoIP related traffic:
1. Enter configuration mode.
configure
2. Define the download policy name and specify the available bandwidth for default traffic.
set traffic-policy shaper download bandwidth 100mbit
set traffic-policy shaper download default bandwidth 75%
set traffic-policy shaper download default ceiling 100%
3. Specify the available bandwidth for VoIP related traffic.
set traffic-policy shaper download class 10 bandwidth 20%
set traffic-policy shaper download class 10 ceiling 100%
set traffic-policy shaper download class 10 match rtp ip dscp 46
set traffic-policy shaper download class 20 bandwidth 5%
set traffic-policy shaper download class 20 ceiling 100%
set traffic-policy shaper download class 20 match sip ip dscp 24
4. Define the upload policy name and specify the available bandwidth for default and VoIP related traffic.
set traffic-policy shaper upload bandwidth 50mbit
set traffic-policy shaper upload default bandwidth 50%
set traffic-policy shaper upload default ceiling 100%
set traffic-policy shaper upload class 10 bandwidth 40%
set traffic-policy shaper upload class 10 ceiling 100%
set traffic-policy shaper upload class 10 match rtp ip dscp 46
set traffic-policy shaper upload class 20 bandwidth 10%
set traffic-policy shaper upload class 20 ceiling 100%
set traffic-policy shaper upload class 20 match sip ip dscp 24
5. Attach the download policy to the LAN interface in the egress (out) direction.
set interfaces ethernet eth1 traffic-policy out download
6. Attach the upload policy to the WAN interface in the egress (out) direction.
set interfaces ethernet eth0 traffic-policy out upload
7. Commit the changes and save the configuration.
commit ; save
Related Articles
EdgeRouter - Quality of Service (QoS)
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