- Router,DrayOS 4
Quality of Service Configuration & Setup Examples
VI. Feature Setup
The Quality of Service system available on DrayTek routers allows for full control of how traffic is prioritised and bandwidth is reserved, with five queues available.
The router assigns sessions to each one of these queues and schedules packets to be sent through the router in order of priority instead of "first come, first served", with reserved bandwidth available to each queue, to ensure that important data can always be sent.
Prioritisation
The Class 1, Class 2 and Class 3 classes are configurable and used to prioritise traffic over each lower priority class, with the lowest class being unclassified traffic, referred to as the Others class.
This is useful to avoid delays for traffic that depends on low latency such as prioritising VoIP over Email traffic. Packets in the higher priority queues are sent as quickly as possible by delaying packets in the lower priority queues.
Bandwidth Reservation
The priority Classes 1, 2 and 3 can have a reservation for bandwidth if the available bandwidth amount needs to be guaranteed. If for example there are multiple VoIP calls in progress, they may require a certain amount of bandwidth reserved while calls are in progress, so normal internet traffic could be throttled back slightly. This is done by setting the percentage to reserve for the class and is only active while that traffic is detected in that class.

Configuring Quality of Service to match your requirements is recommended to get the best results from it.
It's not ideal to use a default configuration for Quality of Service settings; bandwidth reservations and priorities will differ significantly between different Internet connections (throughput) and with different network requirements.
Connection Speeds
Quality of Service requires the router to be aware of the Bandwidth available (speeds that can be achieved) on each Internet connection to be able to prioritise correctly. This allows the router to properly schedule packets, so that they can be transmitted through the Internet connection at the correct speed and bandwidth is shared correctly between different Priority queues.
ADSL / VDSL Internet Connections
DrayTek Vigor routers that have an integrated ADSL or VDSL modem will automatically determine the Quality of Service Bandwidth values. DrayTek Vigor routers that connect to ADSL or VDSL with a modem connected to the router's Ethernet WAN port will need the Bandwidth to be set manually.
Ethernet-based Internet Connections
When using an Ethernet WAN interface, the router will need to have the Bandwidth for the WAN configured manually. This method is necessary when using an ADSL or VDSL modem with the router's Ethernet WAN port.
There are two ways to determine this:
- Bypass the DrayTek router, by connecting a PC directly to the Internet connection and perform a Speed Test using any popular speed testing site or App:

- Disable Quality of Service on the router and perform the speed test using that Internet connection - this is the less reliable method as other devices could be using the Internet connection
Once the available Bandwidth on the Internet connection has been determined, go to [Bandwidth Management] > [Quality of Service] and click Setup for the Internet connection being configured.
Set the Bandwidth values to be 90-95% of the maximum achievable on that Internet connection to get the best results from Quality of Service.
Note: If the bandwidth boxes are greyed out then they don't need to be set. DrayTek Vigor routers with an integrated ADSL or VDSL modem will automatically determine the line speed.

Following the above "speed test" example, the Bandwidh of this Internet connection is set to around 90% of that throughput.
Values are specified in Kilobits or Megabits per second; be careful to avoid using Kilobyte or Megabyte values when specifying QoS Bandwidth values. A Kilobyte is 8 times larger than a Kilobit.
Configuring Priority Classes
From [Bandwidth Management] > [Quality of Service], click Setup for the Internet connection to configure QoS for each interface that QoS will be applied to.
| Enable the QoS Control |
Tick this option to enable QoS on this interface. Set the direction that QoS will affect, the default is "OUT", which affects outbound / upload only. Setting this to "BOTH" will affect both directions, upload and download traffic. |
| Reserved Bandwidth Ratio |
Each Class can be left on its default setting of 25% and give good results with QoS. When changing the values, the four classes must add up to 100% total. A good example of bandwidth reservation would be a Voice over IP system where there are 10 phones that could all make calls at the same time. They will each use a VoIP codec that can use up to 100Kbps in each direction, therefore they would ideally have a reservation of 1000Kbps (1 Megabit) in each direction. If the Internet connection has 4000Kbps in each direction, this would be a 25% reservation. Higher priority classes can use the bandwidth percentages available to lower priority classes when required. Traffic types that use a small amount of data but require low latency can use a smaller reserved bandwith percentage to minimise impact on other queues. |
| Enable UDP Bandwidth Control | Used to throttle the amount of bandwidth available for UDP traffic, it is recommended to leave this disabled when using VoIP as this could significantly limit available bandwidth to UDP based VoIP traffic. |
| Outbound TCP ACK Prioritise | Used to prioritise TCP packet acknowledgements, it can be beneficial when there isn't enough upload bandwidth for TCP ACK packets to respond quickly, which could result in lower download speeds, as TCP sessions would not be able to respond in time so that the next packet can be sent. |

Click OK to apply the changes for the Quality of Service configuration for that interface.
It is recommended to test each setting to check whether it benefits or impacts network performance depending on the configuration.
Classes
These are used to group the services or IP addresses to prioritise, with Class 1 being the highest priority queue and Others (traffic not otherwise classified) being the lowest priority.
Each class needs to have rules assigned to it to classify traffic.
To configure a QoS Class, go to [Bandwidth Management] > [Quality of Service] click the Edit for Class 1, 2 or 3. This will display a list of Rules for each Class.
Click Add to create a new QoS Rule for that Class:

| ACT | Enables the QoS Rule |
| Ethernet Type | Set this to define whether it is classifying IPv4 or IPv6 traffic |
| Local Address | Used to define the local IP address as a single IP, range IP or subnet IP |
| Remote Address | Used to define the internet / VPN address as a single IP, range IP or subnet IP |
| DiffServ CodePoint |
If the IP traffic has a DSCP packet tag applied to it, this can be used to classify that traffic. It can often be configured on switches / phones for different traffic types |
| Service Type | Used to specify which TCP / UDP / protocol that would be classified |
Service Types
These are used to specify the traffic types for the QoS Class Rules, there are some predefined Service Types that can be selected when making a new QoS Class Rule such as HTTP or FTP.
There are some Service Types that cannot be easily defined, for instance RTP (Real Time Protocol) used for VoIP audio packets could potentially use any UDP port between 1 and 65535, which would limit the effectiveness of QoS. In this situation, it's best to determine which ports are used specifically by the service on your network and create Service Types for that specific range.
To create a new Service Type, go to [Bandwidth Management] > [Quality of Service] and in the [Service Type] section, click Edit and enter the details for the service:

DrayTek's Quality of Service system displays the amount of traffic in each priority queue, which can be useful for understand how each queue is used or troubleshooting the QoS configuration.
This can be accessed for each Internet connection / WAN interface from the [Bandwidth Management] > [Quality of Service] section by clicking Online Statistics - Status for that WAN interface:

This will display the QoS Online Statistics for that Internet connection, each queue is displayed with upstream and downstream traffic. The statistics will update once every 5 seconds, which is configured by setting the "Refresh Interval" or manually clicking "Refresh".

DrayTek's Quality of Service system can automatically detect Voice over IP calls that use SIP (Session Initiation Protocol) and the accompanying audio traffic.
If this is enabled, the router will prioritise VoIP traffic that it detects into the VoIP class, which is the highest priority queue.
This is enabled from the [Bandwidth Management] > [Quality of Service] page, tick the "Enable the First Priority for VoIP SIP/RTP" option, set the required SIP Port and click OK to save the setting:

This can be seen in operation when a call is in progress, from the main Quality of Service page by clicking Online Statistics > Status for the WAN interface:

VoIP Call Statistics
This feature is available from 3.8.4 firmware onwards.
To view the statistics for VoIP calls that have been detected by the router, go to [Bandwidth Management] > [Quality of Service] and click on this VoIP call statistics:

This will display the details of calls that have occurred while the router has been on-line:

The table displays this information for each call:
- Whether the call is still in progress (Status icon)
- The Internet connection used to make the call
- The Local IP and Remote (Peer) IP of the call
- Delay - The delay between each packet that is decided when the call is set up. In the example above, both calls are using a 20ms delay between RTP audio packets, the deviation from this 20ms delay is referred to as Jitter
- Jitter - This is the delay between one packet arriving and the next one in sequence arriving. If the packets are out of sequence or the delay is unpredictable, this causes high amounts of Jitter. Most phones compensate for this with a small Jitter buffer to play back audio data packets in a consistent order but significant Jitter can disrupt calls.
- Packet Loss - This is displayed as a percentage; because the RTP audio protocol uses UDP (Unified Datagram Protocol), it does not re-transmit lost packets because this would cause additional delays. High amounts of Packet Loss will cause the audio to break up.
- Time and Duration of each call
{tab-ex Prioritise Voice over IP}
There are multiple ways to prioritise Voice over IP traffic, with each one being beneficial in its own way. The ideal setup would prioritise only the SIP (Session Initiation Protocol) packets used for call setup and the RTP (Real Time Protocol) packets that contains the call's audio data:
- Prioritising SIP & RTP traffic - Requires knowledge of the SIP & RTP ports that will be used, could prioritise other UDP traffic that isn't Voice over IP
- Prioritise traffic to the IP of the hosted / remote PBX - Requires knowing the IP address of the SIP trunks / PBX systems, does not work with hostnames
- Prioritise traffic for the IP addresses of the local IP phones & PBX system - Works well but can result in prioritising web interface or other traffic, does not work with DHCP addresses and would not work very well with soft-phones
- Prioritise VoIP traffic that has a DSCP / priority packet tag - Can require configuration on the IP phones used but works well
Prioritise the SIP & RTP traffic
This requires manually configuring a QoS Service Type for the RTP range that the phones will be using, to do that, create a Service Type entry for RTP traffic by going to the main Quality of Service page and under the Service Type section click the Edit link. Create a new Service Type entry by clicking Add and configure a service type for RTP:
- Service Type - UDP
- Port Configuration - Range
- Port Number - Check phone / PBX configuration, this can be specific to the phone / SIP provider.

This example shows UDP 15050 - 20000, check the RTP range that your SIP provider / phones are using to prioritise this accurately.
In the Quality of Service - Class 1 Rules the new Service Type can be added:

Prioritise traffic to the IP of the hosted / remote PBX
To do this, you would set up a QoS rule that specifies the remote IP address of the hosted / remote PBX system. To do that, create the rule and specify the Remote Address:

Prioritise traffic for the IP addresses of the local phones / PBX system
If you are setting up QoS for an IPPBX system connected to the router or for phones in a defined IP address range, setting up the quality of service to prioritise based on those IPs is the simplest method, just put the Local Address into the Quality of Service rule:

Prioritise VoIP traffic based on DSCP packet tag
If the phones are configured to specify a packet tag for voice traffic or if similar packet tags have been added on the switch they're connected to, the Quality of Service can prioritise based on that tag. In the rule you'd select the EF class to match Priority 5 on a Vigorphone 350:

On the Vigorphone 350, you would set up the packet tagging under the [General Sip Settings] - [Other Settings] section:

{tab-ex Prioritise VPN traffic}
Prioritise Remote Dial-In Users
To prioritise dial in users, you would need to be aware of their IP address, either by setting their IP in the VPN profile or by prioritising all VPN Dial-In users. In the Quality of Service rule, you would configure that IP / range as a Remote Address, this example shows the full DHCP pool being prioritised, which will only affect VPN users because only those users would have a remote address with a local IP:

Prioritise LAN to LAN VPN connections
To do this, you would configure a Quality of Service rule with the Remote Address set to the remote subnet of the VPN; this example shows the subnet 192.168.2.0/24 being prioritised:

How do you rate this article?
Add a comment to this article
NOTE : All comments are reviewed before publication and may not be posted or may be redacted if the editors do not consider them helpful. The use of offensive or obscene language, copyrighted material, or advertising or promotion or linking to any other product or service is prohibited. By submitting your comment, you confirm that you are the original author and assign copyright of the content to DrayTek indefinitely and irrevocably.
