Nov 18 2007
Tomato QoS on a Linksys WRT-54G v.2
Kudos to anyone who creates their own Linux based firmware and turns a $40 consumer router, into a high-end piece of kit. Truly, they all are awesome achievements. But I’ve got to say, DDR-WRT has nothing on the Tomato firmware. After hearing how happy SuperJason was with his flashed firmware, I decided to take the plunge myself and re-flash my router.
I’d first flashed my box over a year ago to the DDR-WRT firmware and was impressed, but it definitely had a few bugs. I wanted it for DHCP reservations and QoS. DHCP reservations worked, but internal name resolution did not. And the QoS implementation made my network flaky. Tomato changed everything.
First of all, the UI isn’t as nice as DDR-WRT — which does its best to duplicate the Linksys firmware. Tomato’s is a little uglier and a lot harder to find things until you get used to it. But its so much more powerful. After reading around the Internet, I think I’ve finally settled on these QoS classifications…

A note to newbs, before I launch into my explanation: make sure you turn off “Prioritize ACK” so that you don’t get flooded with BitTorrent ACK requests.
As you can see here, I place high priority on BitTorrent traffic. That’s because it drives our TV watching. Each of the things that gets higher priority than torrent downloading has a good reason:
DNS - Normal DNS requests are tiny and should get handled right away — even if the webpage itself loads slower, you don’t want to be hanging during name resolution wondering if your Internet is down.
SMTP - Outgoing mail should go when I hit send. Maybe this is odd of me, but I like hearing the “swoosh” sound in Mail.app as soon as I hit the button.
FTP - I rarely use FTP any more, unless I’m working on a website or uploading something important. On the occasion that I do need it, I want it out of the way as fast as possible.
VNC - If I need VNC its because I’m helping someone else with their computer, or I’m connecting into mine to troubleshoot a problem. In either case, I don’t want to wait for screen refreshes.
On par with BitTorrent traffic are small HTTP requests — loading the Google homepage, or even Digg, comes in at less than 50kb, so lets just get it out of the way.
Large HTTP requests — for a download, or streaming some Flash, can frankly wait a few seconds longer. Similarly, receiving mail isn’t that urgent — it only gets checked every 15 minutes, so if it takes 16 minutes instead, who’s going to notice?
Below this is essentially everything else. If a website isn’t tight enough to get in under 50kb, but not big enough that it might be interesting enough to warrant the higher priority, it gets tucked in with bulk traffic.
The effect is immediate when you turn QoS on. My WordPress admin page, with its IFrames, takes a little bit longer to load, but never looks like its hung. My homepage and Digg come up instantly. And none of our normal use has any significant impact on my BitTorrent downloads. I’m relatively new at this QoS stuff, but having watched the Chart view and studied the Detail view, I think I’ve already learned a lot. Any suggestions from anyone with more experience?
Popularity: 74% [?]

Heh, I wouldn’t call Tomato’s interface ugly. In fact, it’s much better than DD-WRT’s because it uses AJAX and lets you change things without restarting the router. DD-WRT was so annoying to me when after changing some little thing I had to restart my router each time… Ugh.
Anyway, if your settings work for you, that’s fine, but I’ve read on more than one place that you should set your DNS and only DNS requests to Highest. FTP, SMTP, etc. will do just fine in High or Medium. I don’t even think there will be any noticeable difference at all since DNS requests are small and very fast.
What I don’t understand is why you place your BitTorrent on High, even higher than your WWW! Most people would want to prioritize WWW over p2p since it uses less bandwidth
Personally, I don’t have any specific rule for BitTorrent since the “Bulk Traffic” rule catches all kinds of it. I have DNS on Highest, WWW and some services like Skype, and several games on High, large WWW requests on Low, everything else on Lowest.
I can’t say enough how awesome Tomato is… I enjoy watching how my BitTorrent uploads at 1 mbps; then I go to ImageShack.us to upload a picture (large WWW request), and my BitTorrent upload crawls down to zero for a moment… Also, I can surf, play games or w/e with p2p programs on and it doesn’t make a difference.
The AJAX part is nice — finding things in their menu tree structure is quite overwhelming until you learn where things are. I do have to agree with you (on your website) where you note that DD-WRT’s QoS does not work well!
As for why I prioritize BitTorrent traffic, let’s just say that as the resident geek, I feel that my downloads are more important than my wife’s daily scouring of Facebook.com
[...] firmware… even has a post in his blog regarding this… Jonathan also blogged about Tomato QoS in Nov 2007… I just wanted to add this as I saw an article on Lifehacker by Adam Pash and [...]
Great post, you have put a lot of time and thought into your classifications. I tried DD-WRT and I am with you, Tomato is far superior.
Thanks, Matt!
One feature that the Tomato firmware allows that I have been looking for for quite a while is that you can specify a DHCP range for guests that is outside where your statically assigned DHCP addresses live.
I like to keep servers in the .2 through .10, computers in .11 through .20, network appliances and game systems in .100 through .149, and guests that grab dynamic IP’s live in the .150 though .199 range. Static IP’s live in .200 thought .254. By setting the DHCP server to assign .150 through .199 IP’s, you can still set static IP’s in the other areas and it will assign them. Default Netgear and Linksys firmware won’t allow this.
Hey, how would you configure the QoS settings if you had a webserver (which serves large files)?
You might want to also take into account the other VNC ports in your rules. Apple’s VNC server for remote desktop doesn’t use port 5800, but most of the free VNC apps have a built in webserver that offers a Java version of the desktop. Also, listening clients use port 5500 to broadcast that they are waiting for a server to connect to them.
/Jon/
Dave, you’d need port 80 open, and you’d have to decide how much of your outgoing bandwidth you’d want to allow visitors to consume. You might want to set uploads from your internal client PC IPs (all computers other than the server) to have a higher priority then your server, so your internal users wouldn’t be constrained by visitors to your site.
Jon, yup that’s very true!
What about if voip is your highest priority.
It’s easy to set 5060 to highest but most voip devices use random ports 10000+ for the actual voice packets.
In my case I want voip to take precedence over everything else and don’t really care about the rest.
Anybody know how to set that? I’d appreciate the help.
Also, does anybody know of a QOS system that prioritizs by IP or mac address?
My new Linksys WRT…n something or other can QoS by MAC or by physical port. I’m pretty sure Tomato can too, but I’m not running it any more.
To be honest, despite what I’ve discovered to improve it, nothing has really made VoIP work well enough to be worth it for me. I’m going with a hybrid VoIP connection starting next week. A little more money, but worth it for someone else to deal with the network problems…
[...] left at their default settings with the exception that I also have QoS setup in a manner similar to this post on the man router. You can check to see the status of whether or not your routers are communicating [...]
Have you found that assigning bulk traffic to the lowest setting results in never having full bandwidth use?
I haven’t tried that, but I could see how that might cause a problem…