Viewing Article

No StarNo StarNo StarNo StarNo Star | Feb 4 2013, 9:42 AM |
VOIP issues behind a Draytek Router/Firewall

If you make SIP calls from behind a Draytek router, you may 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. In this example we see how to solve sound problems with a 
Draytek Vigor 2910 and a SNOM 300 phone connected to one of the NAT-ed ethernet ports (other devices may be similar). 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 set on the Draytek is the same as the RTP port range that your SNOM phone uses. If unsure, use the web interface of the SNOM to confirm.


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, voice quality will not improve unless you deliberately misconfigure the bandwidth. To determine your available bandwidth, please run three
(refreshing the page between each test) back to back speeedtests using our speedtest server at speedtest.sharedband.net (if prompted, please choose the city located closest to you).

Please then use run the following calculations on the average of these results:
Upstream average x 0.75 = WAN Inbound Bandwidth
Downstream average x 0.85 = WAN Outbound Bandwidth

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 501010. The last percentage will automatically jump to 30 now.
You can leave the 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.