Get Linux to share bandwidth evenly across network connections

1

This is similar to How can I prioritise network bandwidth on a per application basis?, but does not require control over priorities.

I am working on an Ubuntu 11.04 laptop connected to a rather slow 1 Mbps Internet connection. When there is a connection that saturates the network (such as streaming a YouTube video), I find it difficult to load other pages or otherwise use the network. It seems that Linux is not as smart as Windows when multiple connections need to share bandwidth--in Windows, the system will try to distribute bandwidth relatively evenly across all active connections. This also happens with an older openSUSE-based system I had used as well.

Is there something I can do to make the system share bandwidth across the programs that need it more evenly, so that streaming video does not interfere with other web browsing, for example? I'd like to avoid low-level changes such as kernel reconfiguration, preferring a relatively simple userspace solution.

bwDraco

Posted 2012-06-28T22:24:19.363

Reputation: 41 701

1Nothing will really work well. Normal residential Internet access is just not designed to do this. The problem is that by the time your computer receives a packet, the earliest you can do something about it, it has already consumed your bandwidth, so it's already too late. Priority needs to be enforced on the other end of the link, the side that controls what packets get put on the link, how large the queue is, and so on. – David Schwartz – 2012-06-28T22:31:53.157

Then why does Windows cope better with multiple simultaneous connections? – bwDraco – 2012-06-28T22:36:40.060

I don't think it does. Windows doesn't make any special attempt to distribute bandwidth evenly. How could it -- it just receives the packets and passes the data to the applications. (It's possible that you are using some applications on Linux that do particularly boneheaded things such as disabling Nagle. Applications can have an effect.) – David Schwartz – 2012-06-28T22:57:28.423

Answers

1

You should look at traffic shaping. It doesn't share traffic on a per application basis, but will prioritize based on ports being used. Shrinking your maximum TCP window size may also help. Some approaches to traffic shaping are designed to shrink windows when too much data is flowing. Generally, traffic is shaped to consume less than the full available bandwidth, usually about 90% or so.

BillThor

Posted 2012-06-28T22:24:19.363

Reputation: 9 384