Draytek, SIP, and QoS

If you make SIP calls from behind a Draytek router, you are likely to experience bad sound quality (dropped frames, stuttery sound) if your internet connection is used for other traffic at the same time. Good candidates for crippling your voice call are heavy FTP uploads, and sending large attachments via e-mail.

Luckily most Draytek models these days can be configured to use Quality of Service (QoS).
However, the control panes to configure this can be a bit difficult to understand. Here is how I solved soundproblems with a Draytek Vigor 2910 and a SNOM 300 phone connected to one of the NAT-ed ethernet ports. All configuration is done via the Draytek's web management interface.

Add a custom Service Type for RTP

Your actual voice packets are carried via RTP). RTP can use lots of different ports, so you'll need to manually configure this.

In the main menu, go to Bandwidth Management -> Quality of Service. In the Class Rule box, under Service Type, click Edit.

Create, or select the first User Defined Service Type , click Edit, and give it the following properties:

Service name: RTP
Service type: UDP
Type: Range
Port number: 49152 - 65534

Make sure that the port range is the same as the RTP port range that your SNOM phone uses. If unsure, use the webinterface of the SNOM to check this out!

Add class rules for your VoIP traffic

Go back to the main menu, Bandwidth Management -> Quality of Service. In the Class Rule box, click the edit link for Class 1.

Give it a name like VOIP, and add two lines:

ACT: selected (this is an abbreviation of ACTIVE)
Local address: ANY (or if you have only one SIP device or it has a fixed IP/net/range, then choose that)
Remote address: ANY (or if your SIP server has a fixed address, choose that specific one)
DiffServ codepoint: EF Class (this will give the highest priority to this traffic)
Service Type: RTP

ACT: selected
Local address: ANY (or if you have only one SIP device or it has a fixed IP/net/range, then choose that)
Remote address: ANY (since your voice data might come from anywhere, keep this set to ANY)
DiffServ codepoint: ANY (This will be the call setup traffic, so less critical then the actual call. Choose EF Class if you experience problems setting up calls).
Service Type: SIP(UDP:5060) (should be predefined)

Click OK and once again go back to Bandwidth Management -> Quality of Service.

The model used here is a 2910, which has two WAN uplinks. Since we'll be using just one here, in the General Setup, click the Setup link for WAN1.

Check the Enable the QoS Control checkbox, and select BOTH.
Now fill in the WAN Inbound Bandwidth and WAN Outbound Bandwidth.
IMPORTANT - It does not matter if you fill in everything correctly, stuff will not work unless you deliberately misconfigure the bandwidth. According to my ISP, my up/downstream are 1024/4096 Kbps. If I fill this in nothing happens, voice quality is still bad. It turns out that you have to use lower values for both. In my case I used 768/3500 Kbps.
Don't ask me why this is. I do know that I've seen the behavior before with QoS in Linux kernels.

I assume the bandwidth configured here should be absolutely available for the Draytek.
The numbers from your ISP are a bit too optimistic, and if filled in probably break the queuing algorithm.

Now you should give your new VOIP class (Class 1) some bandwidth. This depends on your internet connection.
It is safe to be overly generous for your VOIP traffic, because this bandwidth is only used when your VoIP apps need it.
When no calls are made, your other applications will use it.
So type in 50, 10, 10. The last percentage will automatically jump to 30 now.
You can leave rest set at the default values.

At this point, you can test the setup by making a SIP call, then start a large FTP upload or send a 10 Mb attachment by email, and listen carefully for any dropped frames, pops, and other crippled audio.
You can toggle the Enable the QoS Control checkbox the check whether it really works.

See Also

Created by: usr_local_dick, Last modification: Tue 13 of May, 2014 (14:54 UTC) by improlabs
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+