Linux Traffic Shaping

Dan Egli ddavidegli at gmail.com
Wed Mar 20 01:35:07 MDT 2013


*> Sure it's possible, and you can probably do it with a stock dd-wrt or*

*> tomato router firmware, right from the GUI.*

* *

*That's handy, but I wanted to accomplish it from the actual gateway, which
is not the router but a physical Linux PC acting as the server/firewall.
Doing it in the router would perhaps make sense if the machine was running
through the router (would that even work if the router was only being used
as a bridge?) before hitting the 'net. But only some of my machines would
be going through the bridge. Others are only running through a simple
gigabit hub to reach the gateway machine.*

* *

*> However, except for throttling Bittorrent, I really don't see the point*

*> of throttling your other traffic items, unless you plan to live with*

*> unruly roommates. Traffic shaping doesn't make sense unless your link*

*> is saturated 100% of the time, which I cannot see your home network ever*

*> doing.*

*> Also, throttling ssh would seem to be a mistake to me. Do you really*

*> want to artificially restrict the download speeds for rsync or scp?*

* *

*To a point, yes. However, the point of this idea (and perhaps there are
better ways to go about it, if so please enlighten me) was to ensure that
all programs got fair access and no program was ever crowded out. *

* *

*First, I wasn't aware that rsync (which I admit I failed to mention) used
the SSH ports. Doesn't it use it's own port? Then, as far as throttling ssh
(which I put in the wrong category by not thinking of scp, my bad) I don't
necessarily WANT it throttled, but at the same time, if I have my 10 mbit
link and I'm scp'ing something then try to download some mail from Gmail
(or others), my experience of the past has indicated that while everything
will continue to function, the mail especially will really slow down since
the scp is using so much bandwidth. I freely admit my link wouldn't be
saturated 100% of the time. But some complete saturation is in fact
completely expected. And I don't mean bursts of a few seconds, I mean
thirty or forty minutes of continuous saturation. Remember that one of the
things I like to do is purchase media. If I was to download a HD movie,
even at 10 mbits it's going to take at least 20 minutes, maybe longer. I
think the file sizes are going up from the DVD size files to much larger
(like near Blu-Ray sized files). I'd like to have my system setup so that I
can ensure that everything gets a chance, and at least LOOKS speedy.
Admittedly 3 mbits isn't much for scp (I was thinking of only the actual
interactive ssh, not it's derivatives), so I could move it up to the #2
priority that gives 9mbits. Maybe even 9.5 mbits. But I've seen the
slowdowns when I have a file downloading (via scp or http or ftp or other
doesn't matter) and I try to view a web page with a few graphics, or I try
to download my mail. It works, no arguments. But the slowdown is apparent.
What I'd like to accomplish is that the low bandwidth items (like imap &
smtp) always get a bit of room, even if it's only 256kbits, then normal
operational things that would create heavy bandwidth (http, scp, etc...)
would get the lion's share, and what's left over goes to whatever other
bandwidth gobbler there is, be it a online game (maybe an MMORPG or
something) or downloading the latest movie, or transferring other large
files, be it on Bittorrent, or a file sharing network like gnutella2 or
kazaa or others. And the problem with telling the program itself to
throttle is that it will ALWAYS throttle. The other point was that in
instances where nothing else is happening (I'm typing something up locally,
or I'm not even at the computer, or whatever) the major bandwidth gobblers
like file sharing and Bittorrent can have free reign to saturate the link.*

* *

*Hopefully that explains it better. If there's a better way to handle the
situation than traffic shaping then please enlighten me. The only one that
came to mind was shaping, but I will easily bow to superior wisdom if it is
presented to me.*

* *

*--- Dan Egli*


On Mon, Mar 18, 2013 at 8:36 PM, Michael Torrie <torriem at gmail.com> wrote:

> On 03/18/2013 12:05 AM, Dan Egli wrote:
> > For example, let's suppose I have a 10Mbps link to the 'net (that's what
> > I'm expecting anyway). I want mail (imap(s) and (s)smtp) to take priority
> > #1 and use up to 8Mbps. Then I want web traffic (http(s)) to be priority
> > #2, using up to 9Mbps of the ten. Then ssh, vnc, rdesktop and X11 traffic
> > to take priority #3, and use up to 3Mbps (they don't need much), and the
> > last priority would be anything else (i.e. file sharing, bittorrent,
> > etc...) using up to 5Mbps.
> >
> > Is this even possible using the Linux traffic shaping tools? And if so,
> > how do I set something like that up? I've never seen any books on it, and
> > the last couple of web references I read left me scratching my head
> saying
> > "Huh?". They seem to assume that you already have a basic understanding
> of
> > some kind of network mechanic that I either don't have or am not
> > understanding a link to.
>
> Sure it's possible, and you can probably do it with a stock dd-wrt or
> tomato router firmware, right from the GUI.
>
> However, except for throttling Bittorrent, I really don't see the point
> of throttling your other traffic items, unless you plan to live with
> unruly roommates.  Traffic shaping doesn't make sense unless your link
> is saturated 100% of the time, which I cannot see your home network ever
> doing.  Short of a college apartment, I don't know of anyone who uses or
> needs shaping on their home internet connections.  I think you'll find
> your ISP already does shaping to protect their own upstream pipe.
>
> Also, throttling ssh would seem to be a mistake to me.  Do you really
> want to artificially restrict the download speeds for rsync or scp?
>
> Bittorrent is best shaped by simply telling your bittorrent peer program
> (say, rtorrent) to throttle itself.
>
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>


More information about the PLUG mailing list