dslreports logo
Search similar:


uniqs
7094
Mango
Use DMZ and you get a kick in the dick.
Premium Member
join:2008-12-25
www.toao.net
·TekSavvy Cable

Mango

Premium Member

[Epic] Tomato QoS Tests

tl;dr: The inbound limits of Tomato QoS settings must add up to 100% for things to work properly. Same goes for the outbound limits on the left side. I was able to set up outbound traffic so that the router automatically reduced the speed of low priority traffic when a VoIP call was made. Inbound traffic has to be permanently rate limited.

I've read so much conflicting information about Tomato's QoS, and I had some spare time this weekend. So, in my quest for bulletproof QoS, I decided to give it a workout so that I could see for myself exactly how it worked.

I connected to a nice fast SFTP and an FTP server, verified that the server's transfer speed was faster than my internet connection so that it would not be the bottleneck, and set up classification rules so that SFTP and FTP would be classified separately.

The first thing I noticed is that rules named High, Medium, Low, etc, are just names. They don't actually give the traffic high, medium, or low priority unless you set them that way. You could set up High traffic as 10% and Low as 90% if you wanted. (But don't do that; it would be confusing.)

The second thing I noticed is that None means different things depending on if it's applied to Outbound or Inbound traffic. With Inbound traffic, None means no limit. If the actual download speed of my internet connection is 5 Mbps, and to be conservative I set Max Bandwidth to 3.3 Mbps, traffic limited to 100% could run as high as 3.3 Mbps. Traffic limited to None could run as high as 5 Mbps.

With Outbound traffic, None on the left side means zero, in other words, a class set this way is not guaranteed any traffic at all. None on the right side means the right side will be equal to the left side.

I set my Max Bandwidth quite low in order to do the next tests. This is because I didn't want the results to be limited by the speed of my internet connection. I set the both High and Low traffic to 100%/100%. Then I caused some traffic that would be classified as High and Low. The traffic used 200% of my Outbound Max Bandwidth.

I then set both High and Low to 50%/100%. Each class used up to 100% on its own, and dropped to 50% when traffic on the other class was introduced.

Therefore, the left side (minimums) of the outbound settings must add up to 100% (or less) in order for things to work properly!

For inbound traffic, there is no minimum and maximum. The inbound limits act as the left side of the outbound limits do. Therefore, the inbound limits must also add up to 100% or less. I was not able to find a way to use lots of inbound traffic when no VoIP calls were in progress, and automatically throttle it when there were.

Based on this, I decided to use two classes: High for VoIP and Low for everything else. Inbound traffic required some math. My internet connection is rated for "up to 6 Mbps". The actual speed is 5120 kbps. I wanted to be conservative because I want to sacrifice speed for low packet loss, jitter, and latency, so I set my max bandwidth to 66% of 5120, which is 3380 kbps. I don't expect to ever have more than 3 calls in progress, so allowing the Low class to use up to 90% should be appropriate.

For outbound traffic, I set up the High class as 80%/100% and the Low class as 20%/100%. My "up to 1 Mbps" connection runs at 680 kbps, so I set the max bandwidth to 450 kbps.

Since I have control over all the computers in my network, this is appropriate for me. However, it means that HTTP traffic can be impacted by, for example, P2P traffic, since these are grouped in the same class. If I didn't have control over P2P users, I would use High, Medium, and Low. Medium and Low would share 45% each of the inbound traffic. This wouldn't be a perfect solution but it should result in perfect VoIP calls.

For testing VoIP, I called an echo test on my PBX. I also monitored how many packets my phone lost. As a control, I decided to make a call with QoS disabled. It is interesting to note that when my internet connection was maxed out with just the SFTP or FTP connections, and I made a VoIP call, I noticed very little quality loss. On the other hand, when I opened 40 tabs at once in my browser, there was significant quality loss that would have made VoIP unusable.

With QoS turned on, there were no VoIP packets lost. During periods of high network traffic, the phone reported up to 10ms jitter. However, I didn't aurally detect any problems, even with Network Jitter Level set to Low and Jitter Buffer Adjustment set to Disable.

m.
deskjockey
join:2005-04-17
Charlotte, NC

deskjockey

Member

Mango

Thanks for your work. Better than a lot of the speculation that has taken place.

Motofreak
Premium Member
join:2009-08-03
Oshawa, ON

Motofreak to Mango

Premium Member

to Mango
Mango have you tried Tomato RAF ? the QOS function has been updated with DSCP

I just got lazy and set DSCP Class to EF ( TOS 0xb8 RTP ) & AF31 (TOS 0x68 aka SIP) to the highest along with DNS, and left the rest alone at 100% and started a few sftp session to my seed-box and maxed out my uploading to one of my public web server.

Then I started a 4 voip calls, my family didn't get a packet drop or voice breakup etc.. . But my sftp sessions all slowed down.

Its just too bad my ISP ( ROGERS ) filters out all inbound TOS/DSCP IP headers.

mau108
Mau
Premium Member
join:2001-10-07
Thornhill, ON

mau108 to Mango

Premium Member

to Mango
Moto freak, I have Tomato RAF on my RT-N16, can you advise on how to setup the QOS feature so VOIP gets highest priority and anything else is well below that.

Motofreak
Premium Member
join:2009-08-03
Oshawa, ON

2 edits

Motofreak

Premium Member

Note: I'm still learning and i'm not a professional in this field, so this post may have errors.

DSCP QOS was added (or I noticed) in Firmware RAF1.28.8950 MIPSR2_RAF K26 USB VPN-BT

you will have to check your soft-phones and adapters/IP phones, Cisco 2102 ATA use TOS HEX, Bria soft phones uses DSCP in HEX numbers only , others like Asterisk is set in Class name or TOS hex, that add QOS header to the IP header table.

check out this great chart for more info »www.tucny.com/Home/dscp-tos

My 2102 use TOS HEX 0x68 that is DSCP AF31 SIP & TOS 0xb8 / DSCP EF, for RTP from that chart.

I also made sure to set my Bria soft phones & asterisk to use the same, because to its just easier to create the rule once In the router under QOS/Classification: you need two create two rules one for SIP:

Create an empty rule and only set the DSCP Class to AF31 (hex: 0x1a) and set the class to highest or high. Same goes with RTP traffic, instead use EF / 0x2e.

You will need to make sure that all other traffic is set to a lower class, to ensure nothing is fighting over bandwidth. Correctly set your basic settings ie, MAX bandwidth and default class for me is set to lowest settings & Qdisc Scheduler is set to "pfifo".

Some people may suggest to turn down the max limits for each class, I left everyone one them at 95% or 100%. Too me, I wanted to max everything until a phone rings, I noticed my transfer rates drops on all the lower classes when someone picks up the phone. the only thing I noticed was a higher ping but no one noticed voice quality issues.

I hope this helps, but your internet connection may require a bit more tweaking with lowering class limits.

Edit: this is only for upload bandwidth, since my ISP removes the DSCP tag so you will need to add another rule with src IP of your VoIP server or servers and assign it to the highest class. so that all traffic from that rule with be above the rest traffic coming to you.

Moto