Howto: Setup QOS on Tomato router

Share your tips, tricks and best practise ideas for Fongo services in here!
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Howto: Setup QOS on Tomato router

Post by laurent »

It's capital that the router knows how to detect voice traffic and put it at the upmost priority for reliable calls. I just finished tweaking my setup and running the tests, so here's my setup..

In QoS section, set these parameters. It's also extremely important to run bandwidth tests with NOTHING running on any computer that uses bandwidth in order to determine the maximum upload and maximum download speeds. The Tomato router will then use these values to calculate ratios of what different types of traffic are allowed to use. As you can see, my actual connection is not quite fast, but that's allright :)
qos-1.PNG
qos-2.PNG
In the Classification screen, erase everything that is already there and put the following rules. Their order in the list is extremely important, so use the up/down green arrows to order them accordingly. Yes I could have brought DNS 512 lower it makes no difference.
qos-3.PNG
Note that I've used a number of tricks to detect voip traffic because not all rules apply all the time.<

The traffic is detected if any of these is true:
1. Connects to FreePhoneLine's main voip server.
2. Any UDP packet going anywhere, and flagged with layer-7 SIP
3. Any UDP packet going anywhere, and flagged with layer-7 RTP
4. Any UDP packet in the 5xxx port range

The rest of the rules are also important because they force "anything else" to be lower priority. General web traffic (top two rules) assigns a high priority (but not top priority) to small web traffic (loading webpages) and lwoer priority for larger transfers (downloads).

Finally, DNS traffic is put to the top just to help your casual web browsing experience.
You do not have the required permissions to view the files attached to this post.
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Re: Howto: Setup QOS on Tomato router

Post by laurent »

Finally, in the View Details page, I can confirm that my current call is rated top priority:
qos-check.PNG
For this test call, I was doing a double-conference call just because it's fun. I call my cellphone from FPL, then I press flash on my phone and make a 2nd call to my cellphone. On the cell I answer and conference. I finally press flash again on the phone to conference those two as well.

The result is mayhem. I think I saw the future.

Enjoy!
You do not have the required permissions to view the files attached to this post.
pitcritter
Active Poster
Posts: 54
Joined: 08/09/2010
SIP Device Name: Obi100/Obi110
ISP Name: eBox DSL
Computer OS: Win7 Ultimate x64
Router: Buffalo N300 w/ DD-WRT
Location: Niagara Falls ON/NY

Re: Howto: Setup QOS on Tomato router

Post by pitcritter »

Thanks Laurent! It's great for me that you're using the exact same version of Tomato I am. It made it really easy. You must not like throttling either ;)
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Re: Howto: Setup QOS on Tomato router

Post by laurent »

No kidding! The throttling isn't just "managing network peaks", I had almost-dialup speed 23 hours per day! Ridiculous.
pitcritter
Active Poster
Posts: 54
Joined: 08/09/2010
SIP Device Name: Obi100/Obi110
ISP Name: eBox DSL
Computer OS: Win7 Ultimate x64
Router: Buffalo N300 w/ DD-WRT
Location: Niagara Falls ON/NY

Re: Howto: Setup QOS on Tomato router

Post by pitcritter »

The QOS is working great for VOIP, but does this also limit the speed on connections between machines on my internal network? When copying files wirelessly between machines, my speeds seem way too low. I don't know if this is new since I setup QOS or not.
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Re: Howto: Setup QOS on Tomato router

Post by laurent »

QoS only manages the "routing" part of the device, which is the link between the internal network and the internet. It should not do any change for your lan.
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

I have just upgraded my router to Tomato USB and implemented these settings. Thank you.

However, I have also recently set up service with 3web, a Rogers reseller - a service that obviously suffers from congestion issues throughout the evening.

My service worked fine during these hours before moving to Tomato but now I have been unable to hear or be heard on conversations this evening - this is the first congested period during which I've had Tomato running.

Any suggestions? Anything else I might be missing?
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Re: Howto: Setup QOS on Tomato router

Post by laurent »

What kind of problem are you having? No voice at all? Both ways? How long does it last?
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

Can make and receive calls but no voices heard on either end it seems. Long distance calls earlier, the recipients phone was ringing but all I heard was silence.

Tomato USB 2.6 is on an Asus RT-N16.
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

An update, outgoing calls seem to work fine. Bit of an echo but that's not a big deal.

Incoming there is no communication either way.
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Re: Howto: Setup QOS on Tomato router

Post by laurent »

Try disabling QoS from the router and try again. Perhaps a setting had an adverse effect on VoIP traffic?
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

No, that has no effect. I only implemented the QoS as a potential solution.

Ever since I loaded the Tomato firmware, I'm getting no voice on either end on incoming and rarely get voice on both ends on outgoing.

The ATA is connected and recognized by the network, I've got a dial tone, when I dial a complete number the other phone will ring though you can't hear ringing and when the call is answered there is no voice on either end. I can call voicemail just fine.

When I call the FPL number, there is ringing but, like outgoing, there is no voice on either end when you answer it.
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

I have forwarded UDP ports 13000, 13001, 5060, 5061, 6060 and 6061. Have turned QoS on and off. Have DMZed the ATA. All result in being able to make outgoing calls - albeit with an echo - but no incoming calls are getting voice in either direction.
domptg
Quiet One
Posts: 44
Joined: 10/14/2010
SIP Device Name: PAP2T-NA
Firmware Version: 5.1.6(LS)
ISP Name: Xplornet
Computer OS: Vista
Router: TP-Link WR841N
Location: GTA

Re: Howto: Setup QOS on Tomato router

Post by domptg »

ATA line one under preferred codec only -set to NO.
If this is the case you should be able to receive incoming calls ;)
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

I temporarily solved this problem by replacing the router. As much as I like all the other features of Tomato USB, I need the phone to work. My older router is more than a little unstable so I am giving Tomato USB another spin.

Since my post, I have rolled Tomato USB back to an earlier version at the suggestion of a poster on a Tomato USB forum. It had no apparent effect. I am looking for a complete solution to this problem so I can 'move on'.

To recap, my ATA is a D-Link DVG-2001S. I bought it second hand. I wish I had just bought the unit sold by FPL and acknowledge that doing so likely will solve my problem, or at least give me more support in order to solve the problem. Before I do that though, I want to try to get this one working.

When the ATA is connected to the older router, a Netgear, it works fine. When I plug it back into the RT-N16, however, problems occur.

I have forwarded UDP ports 13000, 13001, 6060, 6061, 5060 and 5061 to the ATA address.
Image

Previously, I couldn't make outgoing or receive incoming calls. Using the advice above, I seem to be able to reliably make outgoing calls with 2 way voice, incoming calls get booted straight to voicemail.
Image

Long story short: under an older router, my FPL service works fine. With my new RT-N16 running Tomato USB firmware, ports forwarded, all boxes on router firewall unchecked, and placed in the DMZ I can make calls well enough but incoming goes straight to voicemail.

Any insight? I guess it boils down to why would the device work fine under an older Netgear router (I can get model/firmware if someone thinks it would be helpful) and not with a Tomato USB enabled router.
tbrummell
Tried and True
Posts: 330
Joined: 09/21/2010
SIP Device Name: PIAF/Mitel/PolyCom/Cisco
Firmware Version: Asterisk 1.8
ISP Name: Rogers
Computer OS: CentOS/Windows2008/Win7/Android
Router: pfSense/Neoware thin client
Location: Ottawa

Re: Howto: Setup QOS on Tomato router

Post by tbrummell »

Have you tried enabling G711? I thought I read somewhere that FPL uses 711 on inbound?
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

tbrummell wrote:Have you tried enabling G711? I thought I read somewhere that FPL uses 711 on inbound?

When I go 3rd, 2nd, 1st, don't use: neither party can hear the other on incoming or outgoing but calls go through and ring.

When I go 2nd, 3rd, 1st, don't use: an outgoing call works sometimes works fine and sometimes doesn't, incoming doesn't work at all.

When I go don't use, don't use, 1st, don't use: an outgoing call works from what I tried, incoming goes to voicemail.
dan68
Just Passing Thru
Posts: 4
Joined: 12/04/2010

Re: Howto: Setup QOS on Tomato router

Post by dan68 »

davemay wrote:Can make and receive calls but no voices heard on either end it seems. Long distance calls earlier, the recipients phone was ringing but all I heard was silence.

Tomato USB 2.6 is on an Asus RT-N16.
I have Tomato USB 2.6 + Asus RT-N16 + PAP2T-NA and is working perfectly.
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

Thanks for the info. I am close to closing the book on this and buying FPL's ATA unit.

One other interesting thing to note is that even though my system works for the most part (can make outgoing calls, can get phone to ring on incoming and all calls are registered by the call log, the FPL portal always says 'userAgent: not connected' and under SIP registration status: offline. Is that normal?
tbrummell
Tried and True
Posts: 330
Joined: 09/21/2010
SIP Device Name: PIAF/Mitel/PolyCom/Cisco
Firmware Version: Asterisk 1.8
ISP Name: Rogers
Computer OS: CentOS/Windows2008/Win7/Android
Router: pfSense/Neoware thin client
Location: Ottawa

Re: Howto: Setup QOS on Tomato router

Post by tbrummell »

davemay wrote:Thanks for the info. I am close to closing the book on this and buying FPL's ATA unit.

One other interesting thing to note is that even though my system works for the most part (can make outgoing calls, can get phone to ring on incoming and all calls are registered by the call log, the FPL portal always says 'userAgent: not connected' and under SIP registration status: offline. Is that normal?
No, that's not normal. And that's why you can't receive calls. You're not registered. Double check username & password on the ATA.
tbrummell
Tried and True
Posts: 330
Joined: 09/21/2010
SIP Device Name: PIAF/Mitel/PolyCom/Cisco
Firmware Version: Asterisk 1.8
ISP Name: Rogers
Computer OS: CentOS/Windows2008/Win7/Android
Router: pfSense/Neoware thin client
Location: Ottawa

Re: Howto: Setup QOS on Tomato router

Post by tbrummell »

And it's probably a good idea to set your keepalive timer to 120 seconds or so.
dan68
Just Passing Thru
Posts: 4
Joined: 12/04/2010

Re: Howto: Setup QOS on Tomato router

Post by dan68 »

forward your RTP ports, if you don't know which one try 10000-20000(13000,13001 are for the softphone)
laurent
*Go-To Guy*
Posts: 532
Joined: 08/06/2010
SIP Device Name: Grandstream HT-502
Firmware Version: 1.0.1.63
ISP Name: DSL TekSavvy
Computer OS: OSX Snow Leopard
Router: Linksys WRT54GL w/tomato

Re: Howto: Setup QOS on Tomato router

Post by laurent »

It's 10000 and 10001.

Also, the codec thing discussed above is an absolute MUST. Without G711 enabled, you will NOT receive any phone calls.
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

Thanks all for your help. The problem persists.

My understanding forwarding ports 10000 and 10001 is equivalent to RTP 10000 and 10001. Is that correct?

I don't have a keepalive timer - at least anything by that name. Is it possible that it goes by something else?

I have set G.729 to be first, G711a 3rd and G711u to be 2nd. This setup allows me to make outgoing calls pretty consistently. Incoming calls ring but neither party can hear the other.

According to my ATA, I appear to be registered.
Image

But the FPL portal says I am unconnected.

I can confirm I replace my RT-N16 with my Netgear WRT-624 and I can fully make and receive calls without a problem - without changing a setting on the ATA and FPL still saying I'm offline. Only change I made was unplugging and plugging in the other unit.
davemay
Just Passing Thru
Posts: 15
Joined: 11/10/2010
SIP Device Name: DVG-2001S
ISP Name: TekSavvy 15/1
Computer OS: Windows 7/Ubuntu 10.10
Router: Asus RT-N16 running DD-WRT

Re: Howto: Setup QOS on Tomato router

Post by davemay »

I have replaced the unit with a Linksys PAP2. FPL portal now says I'm connected...but the problem I am discussing here (no voice in either direction on incoming call) *seems* to persist. Have only had 1 call fail in this regard.

Regardless I will move this discussion elsewhere given I am not in the least talking about QoS.

Thanks for all your efforts to help.