Gentoo Archives: gentoo-user

From: Daniel D Jones <ddjones@××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Linux traffic shaper setup advice
Date: Sat, 21 Feb 2009 20:37:55
Message-Id: 200902211537.46695.ddjones@riddlemaster.org
In Reply to: [gentoo-user] Linux traffic shaper setup advice by "Aleksey V. Kunitskiy"
1 On Monday 09 February 2009 12:34:01 Aleksey V. Kunitskiy wrote:
2 > Hi Gentoo community,
3 > I have several computers at home and one Gentoo-powered router. I want to
4 > setup a very simple traffic shaper that will give each computer almost
5 > equal(the best choice - with some weight coefficient on each ip address)
6 > speed, without counting number of connections and etc. So, someone using
7 > torrent won't load whole pipe. One most important problem with it that I
8 > have fixed speed to the world and fixed speed to local resourses in my
9 > city, so I can't fix my up/down link speed to one fixed number, I actually
10 > have 2 speeds, depending on the IP address I'm accessing to.
11 >
12 > Any suggestions?
13
14 First, when you say you have a "Gentoo-powered router," what exactly do you
15 mean? Are you running a dedicated hardware router where you've installed
16 Gentoo or are you using a PC with multiple NICs as a router? This may or may
17 not be important, depending on exactly what you end up implementing.
18 Personally, I'd recommend using purpose built router software, such as DD-WRT
19 or Tomato. They're Linux based but they're specifically customize for routing
20 and are probably going to be much easier to configure, and they run on a lot
21 of different commercially available hardware. A $50 Linksys WRT54G with DD-
22 WRT can match a $1000 Cisco router in capability and performance in many
23 circumstances.
24
25 Second, how familiar are you with networking in general and traffic shaping in
26 particular? If I'm understanding you correctly, what you're trying to do
27 above would be difficult and quite inefficient. For example, if you do a hard
28 limit on bandwidth per IP, then much of your capacity will be idle because
29 it'll be reserved for systems which aren't using it. For example, if system A
30 is downloading a file, it would be restricted in speed if bandwidth is being
31 reserved for systems B, C, etc., even if no one is using those systems! So
32 unless all of your systems are in use maxing out their allotted bandwidth at
33 the same time, you're always going to have bandwidth that is sitting idle.
34 That's quite inefficient.
35
36 If your goal is to ensure that a bittorrent download on one system doesn't bog
37 down a VoIP call or a WOW gaming session on another system, then you'd be much
38 better off going with some sort of CBQ (Class Based Queuing.) This won't put
39 a hard limit on the bandwidth usable by any particular system or IP, but it
40 will prioritize traffic and prevent bittorrent, etc. from clobbering all your
41 bandwidth.
42
43 There's a good introduction to traffic shaping with Linux here:
44
45 http://lartc.org/howto/
46
47 Note that manually configuring traffic shaping with iproute2 can get quite
48 technical and require some indepth rule writing. Depending on your level of
49 knowledge and the time and effort you're willing to put in, that may or may
50 not be an issue.