# Iptables / QoS / starved connections question.

## incidenta5

Is there a generally accepted solution for preventing starved connections on a Cable/DSL connection?

 *Quote:*   

> 
> 
> E.g. Here's the scenario.
> 
> On PC 1, start up a download for the latest OpenSUSE iso.
> ...

 

Browsing the web on either PC crawls to a halt but the download continues. I'd like to use ~99% of the available bandwidth (this value changes throughout the download) for the download while still being able to have a fast web browsing experience.

Will QoS solve this, or am I looking at it the wrong way?

----------

## gerdesj

What is the router in the situation described?  If its a Gentoo (or at least Linux of some sort) box then we can help.

It doesn't matter whether you are using a 300 baud acoustic coupler or a 10Gbps-1 multilink fibre trunk to get to the interwebs, its still IP you want to mess around with and generally you do your traffic policy at the "pinch point".  By that I mean the thing that you control that all your systems have to go through - that's where you do Quality of Service (QoS) 

Now you have to decide how to apportion out your available bandwidth.  You say that you want to allow a download to continue at best speed whilst allow web browsing to work at a reasonable speed.  That's a tricky one.  Trouble is that your download is probably over http and so is web browsing.

Now in my experience, I can initiate a huge download and my wife does not complain about her Facebook suddenly running slow.  I only ever use QoS for things like VoIP.  So the question remains - what is your router? 

Cheers

Jon

----------

## incidenta5

Primarily I'm using a WRTG-54GL running DD-WRT. However, I have another box running CentOS that currently serves up DNS that could serve as a router if needed.

Here's the basic layout:

 *Quote:*   

> WRT54GL  <-> Gig-E Switch <-> PCs

 

In the simplest case, improving browsing speed on the same PC as the large download would be a big help.

----------

## maxime1986

Yes you can do that with some QoS tool like tc.

I don't know about DD-WRT but Open-WRT can do that (I don't know if the WRTG-54GL CPU can handle it...).

I will be very difficult if the download use http protocol since you will have to find a way to differentiate it from your web browsing traffic.

I think you will have to shape the traffic in both uplink and downlink (event if it's generally a bad idea to do QoS in downlink).

I suggest you to look for HTB class manager, here a REALLY good tuto for QoS on GNU/Linux but it's in french :

http://www.linux-france.org/prj/inetdoc/guides/Advanced-routing-Howto/lartc.qdisc.classful.html

----------

## gerdesj

If you do go down the route (pun intended) of using another box as a router watch out for asymmetric routing.  The best way to avoid this is to use two NICs in your Linux box - one for internal and the other for external.  Don't NAT on your Linux box unless you pass through an external IP address to it from the outside - otherwise you'll have double NAT which will cause some strange things to happen.

If you have a PPPoE connection to the interwebs you could always bin your WRT and do the lot with your Linux box.  But you probably have WiFi on it as well.

To be honest I'm a bit surprised that your web browsing stalls just because of a download.  As I don't have one of these I can only suggest that you patch the WRT and see if it has any form of QoS controls.

Cheers

Jon

----------

