Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been looking through the source code for the kernel packet scheduler, and I'm pretty sure I could code what I want manually, if necessary, but I'd love to know if it is possible without recompiling the kernel.

I'm using and RT-N66U router running the Tomato r105 firmware from

Can I set up a QoS algorithm using tc, without recompiling the kernel, to share bandwidth evenly between computers on the internal network?

Specifically, I'd like a single FIFO queue for every IP on the internal network, and to have packets processed round-robin from those queues (such that, if only one computer is on the network, it can use 100% of the bandwidth, but if more are active, no one user will be able use all of it).

Importantly, each user's share of bandwidth should include incoming and outgoing packets.

It looks like this might be possible with ESFQ, but I'd love some help if anyone knows how to achieve this.

share|improve this question
I think you'll find this just doesn't work very well no matter what you do. Your ISP decides what packets to put on the wire to you. What are you going to do if you receive some unfair packets? If you drop them, they'll just get transmitted over your precious Internet link a second time. The only information your ISP could use to provide fairness is the inside IP of the connection, and NAT hides this from them. You can manage outbound traffic though. – David Schwartz Feb 11 '13 at 8:20
That's a good point. I didn't really think about where the download bottleneck was. Given that, even if I set up the packets to be processed how I want, I'd just end up with one queue always filled, and the others more or less empty, in the situations where one user is downloading a large file or something comparable? – Meyer Jacobs Feb 11 '13 at 8:27
That's right. The only good way to deal with this problem is to drop (or delay) outbound UDP packets on the same 'connection' to throttle inbound UDP packets and to "modify" outbound TCP packets (to adjust the advertised window size) to throttle inbound TCP packets. So far as I know, there's no easy way to get Tomato to do that. There are all kinds of "not awful" solutions, but no good ones. If you wish to preserve latency, they all require you to intentionally waste about 10% of your inbound bandwidth. Otherwise, they can never act until it's too late. – David Schwartz Feb 11 '13 at 8:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.