Setting QoS for VoIP?

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Setting QoS for VoIP?

Post by cj_mack »

Hi,
I have a VoIP unit, and will be porting my main phone number to this shortly. However, I want to make sure that the VoIP unit will always have enough bandwidth to make calls efficiently.

I have a WRT54GL with Gargoyle 1.2.3

VoIP unit is a Grandstream Handytone 486. This has a static IP assigned via MAC address, and a quota.

The codec preference order is as follows:
1. iLBC
2. G729A/B
3. G723.1
4. G726-32
5. PCMA
6. PCMU
7. PCMA

I also have a bunch of UDP ports forwarded. Any help on QoS would be appreciated, as I don't really have a clue how to do it. I only need enough bandwidth for the calls, no more than that.

Thanks.

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Setting QoS for VoIP?

Post by DoesItMatter »

What kind of bandwidth do you have available up/down ?

Looks like, from internet searching, the bandwidth usage
would be max of 32Kbps or 64Kbps (not sure about the 64K)

Depending on your upload/download speeds, and what you
are doing on the router at any given time, you might not even
need to add this to QoS.

BUT... always a BUT in there... what kind of router and what
kind of usage is running at any given time?

If this is a slower router (200mhz processor) and you tend to run
a lot of torrents, you will have to tone those down if you want to
get reliable VoIp performance.

I used to do testing on a Fon 2201+ (poor little thing finally died)
I had overclocked it to 200mhz, and when I had a bunch of
torrents running on it, even though I had plenty of bandwidth
left over for other stuff, the processor couldn't keep up and just
normal web browsing would be moving at a snail's pace!

More info needed on your end.
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Setting QoS for VoIP?

Post by cj_mack »

Current download speed is around 1.7mbit, and upload is capped at 128k.

Router is a Linksys WRT54GL.

As far as I know, nobody is doing torrents, but the flatmate does his best to max out the connection at times.

wilsonhlacerda
Posts: 18
Joined: Mon Mar 08, 2010 5:47 pm

Re: Setting QoS for VoIP?

Post by wilsonhlacerda »

My QoS settings. Works 100% for VoIP. This is ok for any codec.
(Fonera and 1MB down/300up)

First you have to configure all your ATA/softphones to do:
SIP signaling on ports 5060~5062
RTP packets on ports 8000~8050

Now in Gargoyle:

QoS (Upload)

Default Service Class: Medium
Total (Upload) Bandwidth: 260

Service Classes
Fastest 50% 100 kbit/s unlimited (if you use G722 codec or do 2, 3 concurrent calls you should use 200 or 300 instead of 100)
Fast 30% zero unlimited
Medium 15% zero unlimited
Slow 5% zero unlimited

Source Port: 5060-5062, Transport Protocol: UDP Fastest (THIS IS FOR VOIP SIP)
Destination Port: 5060-5062, Transport Protocol: UDP Fastest (THIS IS FOR VOIP SIP)
Source Port: 8000-8050, Transport Protocol: UDP Fastest (THIS IS FOR VOIP RTP)
Destination Port: 8000-8050, Transport Protocol: UDP Fastest (THIS IS FOR VOIP RTP)
Destination: 208.122.63.0/255.255.255.0 Fastest (THIS IS FOR VOIP WITH FRING. IP DEPENDS ON YOUR COUNTRY)
Destination Port: 53 Fast
Source Port: 53 Fast
Destination Port: 80 Fast
Destination Port: 443 Fast
Source Port: 5000, Transport Protocol: TCP Fast
Destination Port: 5000, Transport Protocol: TCP Fast
Source Port: 1900, Transport Protocol: UDP Fast
Destination Port: 1900, Transport Protocol: UDP Fast

QoS (Download)

Default Service Class: Medium
Total (Download) Bandwidth: 900

Service Classes
Fastest 40% 100 kbit/s unlimited (if you use G722 codec or do 2, 3 concurrent calls you should use 200 or 300 instead of 100)
Fast 30% zero unlimited
Medium 20% zero unlimited
Slow 10% zero unlimited


Destination Port: 5060-5062, Transport Protocol: UDP Fastest (THIS IS FOR VOIP SIP)
Source Port: 5060-5062, Transport Protocol: UDP Fastest (THIS IS FOR VOIP SIP)
Destination Port: 8000-8050, Transport Protocol: UDP Fastest (THIS IS FOR VOIP RTP)
Source Port: 8000-8050, Transport Protocol: UDP Fastest (THIS IS FOR VOIP RTP)
Source: 208.122.63.0/255.255.255.0 Fastest (THIS IS FOR VOIP WITH FRING. IP DEPENDS ON YOUR COUNTRY)
Source Port: 53 Fast
Destination Port: 53 Fast
Source Port: 80 Fast
Source Port: 443 Fast
Source Port: 5000, Transport Protocol: TCP Fast
Destination Port: 5000, Transport Protocol: TCP Fast
Source Port: 1900, Transport Protocol: UDP Fast
Destination Port: 1900, Transport Protocol: UDP Fast


This is only a possible solution. You can use it as a basis for your own.

pbix
Developer
Posts: 1371
Joined: Fri Aug 21, 2009 5:09 pm

Re: Setting QoS for VoIP?

Post by pbix »

I recommend that you make a class setting the minimum bandwidth to 80kbps. Then assign the class to your phone using the static IP address. Do this on both the upload and download sides.

Finally, get your upload and download total speed settings at about 90% of what you can achieve with a DSL speed test program.

I designed Gargoyle QoS for optimum VoIP performance. If you look at the screen shots on the left you will see my setup for VoIP.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Setting QoS for VoIP?

Post by cj_mack »

Hi,

Thanks for your help, however there are so many settings that I am confused!

I have just done a speedtest on the new ISP: http://www.speedtest.net/result/886764786.png
The download is sometimes higher, up to 2mb/s, but the upload is about the same.

The VoIP system is SIP, with only 1 line. Which settings need to be changed to what? I have no clue!

pbix
Developer
Posts: 1371
Joined: Fri Aug 21, 2009 5:09 pm

Re: Setting QoS for VoIP?

Post by pbix »

You should look at the screenshots QoS pages on the Gargoyle web site. (Left side of your screen).

Make a class called "phone" as was done there with the settings shown. Assign a static IP address to your phone adapter. In my case my adapter was 192.168.1.99. Do this in both the upload and download pages.

For your downlink speed put in 850kbps (85% of your measured speed) and for your uplink speed put in 90% of the value you measured.

FYI, SIP is for signaling. The actual voice traffic goes via RTP packets for these phones.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Setting QoS for VoIP?

Post by cj_mack »

Thanks for your help guys! I seem to have it working now.

Post Reply