QoS Upload & Download Setup

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

stilllearning
Posts: 12
Joined: Wed Aug 18, 2010 12:19 am

QoS Upload & Download Setup

Post by stilllearning »

Hi All,

I would greatly appriciate you help in setting up the above. Here is my setup.

Linksys AG300 Bridged
Linksys WRT54GS with Gargoyle Version:1.3.4 [IP:192.168.1.1]

Asterisk Server on IP 192.168.1.10

I also have 2 other computers on the same network

Computer 1 IP:192.168.1.5
Computer 2 IP:192.168.1.6

When I browse the internet or I am downloading a file, whilst trying to make a call the quality of the call is terrible, I have googled for hours and have tried to play around with the QoS Upload & Download but just cannot get it to work, I am sure I have set it up wrong could some kind sould please help me set this up properly.

Thanks once again for the nice firmware.

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

Re: QoS Upload & Download Setup

Post by pbix »

Well I will start by saying that you can probably benefit from upgrading to v1.3.5 which includes a new QoS features that you may like.

First you should turn off all QoS and on a quiet LAN run a speed test utility like speakeasy.net to determine your maximum upload and download throughput. You will need these numbers later. Then re-enable QoS.

To configure QoS you need to make a class to handle your VoIP traffic. The class (VoIP) should have your minimum bandwidth parameter set to 80kbps x the number of phones you want to simultaneously use. The percent at capacity can be 1% and the maximum set to unlimited. We need this class in both the upload and download pages.

Now we need a rule to assign VoIP traffic to the class. I have never used Asterisk myself but as I understand it all the VoIP traffic is routed through that box. Make a download rule that places all traffic destined for the 192.168.1.10 in the VoIP class. Make a upload rule that places all traffic sourced from 192.168.1.10 in the VoIP class.

You need one other class, the default class for all other traffic. This class has minimum bandwidth=0, percent=99% and maximum at unlimited. Set the default rule to this class.

So when you are done you have one rule and two classes.

With v1.3.4, set the download bandwidth=70% of the value you measured in step one. Set the upload bandwidth=90% of the value you measured.

With v1.3.5, set the download bandwidth=100% of the value you measured and the upload to 95% of value you measured. Then enabled the congestion controller at the bottom of the page.

When you test make sure you are not using the Asterisk box for any Internet. You should have good voice even in all cases.

If you need to use your Asterisk box then thing get a little more complicated. We will deal with this if necessary.

Try the above and report your results.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

stilllearning
Posts: 12
Joined: Wed Aug 18, 2010 12:19 am

Re: QoS Upload & Download Setup

Post by stilllearning »

Thankyou very much for your prompt reply and detailed explanation. This is going to be a long reply as I was to be as detailed as possible

I have done the following as you have instructed.
pbix wrote:Well I will start by saying that you can probably benefit from upgrading to v1.3.5 which includes a new QoS features that you may like.
Done

I am using a test setup at the moment as I dont want to go poking around on a working setup so here goes what I have done.

I ran a ping test and these are the results.
Download=1.28M/bs
Upload=0.20M/bs

I have configured QoS Upload as follows
QoS (Upload) -- Service Class


Default Service Class = Fast
Total (Upload) Bandwidth: 190 kbit/s

Service Class Name = VOIP
Percentage Bandwidth at Capacity = 1%
Minimum Bandwidth = 80 kbit/s
Maximum Bandwidth = Unlimited

Service Class Name = Fast
Percentage Bandwidth at Capacity = 99%
Minimum Bandwidth = zero
Maximum Bandwidth = Unlimited

Add New Classification Rule:

Match Criteria
Source IP: 192.168.1.10/255.255.255.0
Source Port: 5060-5061
Transport Protocol: UDP

Classification
VOIP

Match Criteria
Source IP: 192.168.1.10/255.255.255.0
Source Port: 4569
Transport Protocol: UDP

Classification
VOIP

Match Criteria
Source IP: 192.168.1.10/255.255.255.0
Source Port: 9000-9500 >>RTP
Transport Protocol: UDP

Classification
VOIP

I have configured QoS Download as follows
QoS (Download) -- Service Classes


Default Service Class = Fast
Total (Upload) Bandwidth: 1280 kbit/s

Service Class Name = VOIP
Percentage Bandwidth at Capacity = 1%
Minimum Bandwidth = 80 kbit/s
Maximum Bandwidth = Unlimited

Service Class Name = Fast
Percentage Bandwidth at Capacity = 99%
Minimum Bandwidth = zero
Maximum Bandwidth = Unlimited

Add New Classification Rule:

Match Criteria
Destination IP:: 192.168.1.10/255.255.255.0
Destination Port: 5060-5061
Transport Protocol: UDP

Classification
VOIP

Match Criteria
Destination IP:: 192.168.1.10/255.255.255.0
Destination Port: 4569
Transport Protocol: UDP

Classification
VOIP

Match Criteria
Destination IP: 192.168.1.10/255.255.255.0
Destination Port: 9000-9500 >>RTP
Transport Protocol: UDP

Classification
VOIP

QoS (Download) -- Active Congestion Control

Enable active congestions control (Download Direction) Ticked Box

NOTE:

I have noticed the following..

1. For some unknow reason I cannot setup Source Ports, 10000-20000 as this is the standard RTP ports required by Asterisk. Gargoyle firmware will only accept 4 digits not 5 digits. This is why I had to use 9000-9500 but it looks like I am having audio issues.

2. When I tick the box [Enable active congestions control (Download Direction)] if I reboot the router or recycle the power the box is unticked.

Would greatly appriciate if you could go through the above settings and let me know if its ok.

Thanks for you help once again

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

Re: QoS Upload & Download Setup

Post by pbix »

I would say your setup looks OK. 5060-5061 are your SIP ports and its not necessary to put them in the VoIP class. The important ports are the RTP ports.

Now to your notes. I tried both source/dest ports as 10000-20000 on my WRT54G-TM running v1.3.5. I have no problem entering and saving such values. I checked the back end and the iptables rules are correct so I cannot reproduce this issue. What browser are you using? I am using Firefox v3.6.6.

After you ticked "Enable Active Congestion Control" did you press "Save" at the bottom. I also do not have this issue either. I wonder again if it might be browser related? Below this tick is the controller status section. If it says "DISABLED" then something is wrong and your tick did not stick. If you cannot enable it you can still use the other method from v1.3.4. Both work with v1.3.5 so just reduce your download to 70% and your upload to 90%.

You can confirm that your RTP traffic is properly marked by looking at the status->connection list page. You should see your connections using 9000-9500 ports all classified as VoIP and no other connections in this class.

Did you do any testing? If voice quality seems to suffer you might try increasing your 80kbps - 200kbps. I do not know what CODEC you are using. Some you more than others. I like G.729 when it works but sometimes an older one is needed with some older PSTN.

Are you capable of using SSH? We can do some more diagnostics with that if needed.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

stilllearning
Posts: 12
Joined: Wed Aug 18, 2010 12:19 am

Re: QoS Upload & Download Setup

Post by stilllearning »

Hi pbix,

Thankyou for your reply, I have answered your questions below.
pbix wrote:I would say your setup looks OK. 5060-5061 are your SIP ports and its not necessary to put them in the VoIP class.


I only did this because I have several remote extensions and have a few VSP accounts so I want to give it priority on my lan for registrations etc.
pbix wrote:The important ports are the RTP ports.
Correct
pbix wrote:Now to your notes. I tried both source/dest ports as 10000-20000 on my WRT54G-TM running v1.3.5. I have no problem entering and saving such values. I checked the back end and the iptables rules are correct so I cannot reproduce this issue. What browser are you using? I am using Firefox v3.6.6.
Try as I may I cannot get it to work, I am using Firefox v3.6.8
pbix wrote:After you ticked "Enable Active Congestion Control" did you press "Save" at the bottom. I also do not have this issue either. I wonder again if it might be browser related? Below this tick is the controller status section.


When I enable this box and save the settings it show Status:WAIT and all the associated details. If I recycle the power or reboot the unit once the router comes back up again it shows "DISABLED"
pbix wrote:You can confirm that your RTP traffic is properly marked by looking at the status->connection list page. You should see your connections using 9000-9500 ports all classified as VoIP and no other connections in this class.


Yes this is what it shows
pbix wrote:Did you do any testing? If voice quality seems to suffer you might try increasing your 80kbps - 200kbps. I do not know what CODEC you are using. Some you more than others. I like G.729 when it works but sometimes an older one is needed with some older PSTN.
I have increased this to 200kbps, but the result is still the same, I am using the g729 codec, I have also tried ilbc but still have the same results, here are some images of the QoS charts. I can only add 2 images I will attache the other 2 in another post.
VOIP Call with no web browsing
VOIP Call with no web browsing
qos_upload_no_web.jpg (13.44 KiB) Viewed 9804 times
VOIP Call with no web browsing
VOIP Call with no web browsing
qos_download_no_web.jpg (14.09 KiB) Viewed 9810 times
pbix wrote:Are you capable of using SSH? We can do some more diagnostics with that if needed.
If you tell me what to do I could give it a try.
Last edited by stilllearning on Thu Sep 09, 2010 10:08 pm, edited 2 times in total.

stilllearning
Posts: 12
Joined: Wed Aug 18, 2010 12:19 am

Re: QoS Upload & Download Setup

Post by stilllearning »

Here are the other 2 QoS images, it looks like the web browsing is dominating the download connection.
VOIP call with web browsing call quality is bad
VOIP call with web browsing call quality is bad
qos_upload_with_web.jpg (13.39 KiB) Viewed 9800 times
VOIP call with web browsing call quality is bad
VOIP call with web browsing call quality is bad
qos_download_with_web.jpg (13.27 KiB) Viewed 9801 times

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

Re: QoS Upload & Download Setup

Post by pbix »

Regarding the tick that won't stick. There have been several reports on the forum of issues with getting settings to save. So far no one has been able to document a scenario that can be reproduced by Eric or myself. For the moment I do not want to work on this issue because I like to work on only one thing at a time.

Lets try and get the VoIP issue resolved.

You said that the controller enabled once you did a save. So lets see what it can do. For the moment just don't reboot the router once it is enabled.

The graphs you posted are not too helpful in analyzing the situation. These graphs show the total transferred bytes but what is required for VoIP is the rate and that packets are not delayed. The rate required for G729 is 80kbps on my setup in each direction. If you can get that rate with limited packet delays your quality should be acceptable. The only graph that shows the rate in Gargoyle is the "Bandwidth Usage" screen but it has a rather long time constant so you have to talk awhile before the rates displayed there stabilize.

Leave the VoIP class at 200kbps as you have it. With the controller active (no reboot) check the voice quality. Did you say you have multiple phones? If so how is the quality from internal phone to internal phone? Is it garbled also? Is the voice quality poor in both directions?

Does the controller change from the WAIT state to any other state? If you start heavy downloading then it should move to the WATCH state and you should see the ping times being updated. I am interested to see this section next time. The controller will not exit the WAIT state until the load reaches 70% of what you entered as your download bandwidth. If you cannot reach this level for some reason enter 1000kbps as your download bandwidth.

By default the controller controls congestion between your router and your ISPs gateway. But you can change this to check congestion between the router and your SIP provider by ticking the "Use non-standard ping target" and entering the address of your SIP provider. Again press save but do not reboot.

So there's some stuff to try and report about. If we can get the VoIP working we can take a look at why your settings don't save.

Sorry you are having trouble. I myself have VoIP and have a 1000kbps download, 320kbps upload DSL link. I use the congestion controller and do not suffer voice quality problems. I hope we can make it work for you.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

stilllearning
Posts: 12
Joined: Wed Aug 18, 2010 12:19 am

Re: QoS Upload & Download Setup

Post by stilllearning »

Thankyou for your prompt responce.

Just an update..

I have a spare WRT54GL which had the stock Linksys firmware on it, I did a factory reset on it and I installed the latest Gargoyle 1.3.5 Firmware once the firmware was installed I did a "Restore Default Configuration". I then carried out all the configs as my above post and I found that I was able to do the following which I could not do on my WRT54GS router.

1. Was able to add ports 10000-20000 on both QoS upload & Download.
2. Was able to tick the QoS (Download) -- Active Congestion Control
box save the setting and reboot or power down the router, once the router booted up ok the TICKED box stayed, to test I did about a dozen of these cycles and it is perfect, its got me stumped too.

Will try the WRT54GS and report back on this issue.
pbix wrote:Lets try and get the VoIP issue resolved.
pbix wrote:The rate required for G729 is 80kbps on my setup in each direction.
This is fairly high if you are using the g729 codec as with overheads the g729 codec should only use 31.2kbps, the g711 codec with overheads should use about 87.2 kbps http://www.interphonex.com/index.php?op ... &Itemid=78
pbix wrote:Did you say you have multiple phones? If so how is the quality from internal phone to internal phone? Is it garbled also? Is the voice quality poor in both directions?
These are perfect no problems with voice quality, I can make upto 5 outgoing call simultanously and the call quality is good. At the moment I have tried 3 simultanously calls and downloaded a big file and the quality is perfect, I am sure this would attribute to being able to use the proper rtp ports and being able to tick the QoS (Download) -- Active Congestion Control box.
pbix wrote:Does the controller change from the WAIT state to any other state? If you start heavy downloading then it should move to the WATCH state and you should see the ping times being updated. I am interested to see this section next time. The controller will not exit the WAIT state until the load reaches 70% of what you entered as your download bandwidth. If you cannot reach this level for some reason enter 1000kbps as your download bandwidth.
Yes this works perfect now and goes from WAIT > WATCH > FREE > CHILL, I have a 335kb video of the changes when its happening if you pm me an email address I could send it across to you.

Thanks once again for all your kind help, I will install Gargoyle on my WRT54GS and see if I could replicate the problem.

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

Re: QoS Upload & Download Setup

Post by pbix »

Yeah I guess you are right and I am actually using g711 on account of the problems I have seen with calling some numbers. I am easily confused.

If you are using g729 setting your VoIP class minimum to 40kbps x number of simulateous calls should do the trick for you.

Glad to hear that you have a working system with your GL. Any insight you could gain into why the GS is not working would be a huge benefit to the community here. Probably an OpenWRT issue in my opinion and not specific to Gargoyle.

The congestion controller is new and to my knowledge a Gargoyle feature that can be found no where else. I am interested in how its performing for folks. In particular in your case how far down does it throttle your download bandwidth in order to eliminate congestion. A video of it in operation while you saturate you link can be sent to pbix@bigfoot.com

Later.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

stilllearning
Posts: 12
Joined: Wed Aug 18, 2010 12:19 am

Re: QoS Upload & Download Setup

Post by stilllearning »

pbix wrote:If you are using g729 setting your VoIP class minimum to 40kbps x number of simulateous calls should do the trick for you.
So what your saying is that having the setting at 200kbps should give me 5 calls is this correct.
pbix wrote:Glad to hear that you have a working system with your GL. Any insight you could gain into why the GS is not working would be a huge benefit to the community here.
Will post back.
pbix wrote:The congestion controller is new and to my knowledge a Gargoyle feature that can be found no where else. I am interested in how its performing for folks. In particular in your case how far down does it throttle your download bandwidth in order to eliminate congestion.
I totally agree so far in testing this is the best I could say, poles apart from the others.
pbix wrote:A video of it in operation while you saturate you link can be sent to pbix@bigfoot.com
Sent you the video hope it helps let me know what you think of it.

Once again thankyou for your kind assistance.

A big thankyou to Eric for making this firmware it will only get better from here on.

Cheers

Post Reply