QoS with Tomato Firmware

I noticed that using BitTorrent made my internet connection effectively useless for other things: web browsing, video chat, VOIP, etc. To fix this, I installed Tomato by Shibby firmware on my Linksys E2500 router and turned on the QoS (Quality of Service) settings. Here's how I configured QoS.

1. Determine Upload/Download Speeds

The first step in setting your QoS settings is to determine your internet speed. I used the tests at TestMy.net: Upload Test / Download Test. I got the results below:

Upload Download
1,100 kbps 18,100 kbps

2. Stress Test

Next, I started downloading a bunch of legal torrents to try to max out my internet connection. I used Ubuntu torrents for this. This gave me 14 several-gigabyte torrents with a large number of seeders. My internet connection was quickly saturated. I did another speed test, and the results show how badly bogged down my internet connection was:

Upload Download
30 kbps 51 kbps

3. Set QoS Classifications

In order to tell the router how to prioritize your internet traffic, you first have to tell it how to classify each type of traffic on your network. I used the Wi-Fi Planet settings with a few modifications (under QoS > Classification):

4. Set QoS Basic Settings

I kept my QoS Basic settings as simple as possible. Probably the most important part of these settings at this point is that the default class is "3-Medium". This class is prioritized over BitTorrent because it could contain other things like VOIP, but it's not much higher than BitTorrent because BitTorrent is hard to classify. Any BitTorrent connections that leak out will get lumped into this category too.

5.Fine-tune QoS Bandwidth Limits

Finally, I had to fine-tune the Inbound and Outbound Max Bandwidth Limits. I did this in a relatively straight-forward manner. While my connection was saturated with the Ubunutu torrents, I set the limits to different values and re-ran the upload and download tests. My results are below:

Outbound Max Bandwidth Limit Upload Speed
1100 736
1045 742
990 764
935 722
880 696
825 650
770 607
715 534
660 487
990 819
Inbound Max Bandwidth Limit Download Speed
18100 1800
17195 2400
16290 3000
15385 2600
14480 5200
13575 11800
12670 11000
11765 10200
10860 9500
13575 11700

I highlighted the bandwidth limits that gave me the best results. Each setting that I tested was 5% lower than the previous setting, and the maximum setting was 100% of the upload/download speeds I got with an idle network.

There's an important trade-off that should be understood here. If you set the bandwidth limits too high, then QoS will never step in and throttle back your torrents to make room for web browsing. This will result in really bad web browsing performance when you have torrents or downloads running. On the other hand, if you set the bandwidth limits too low, then QoS will be throttling all of your traffic all of the time. This will result in slower torrents, slower downloads, and slower web browsing.

Photo by Torkild Retvedt