

Limiting Bandiwidth in a Shared DSL Environment? 77
stylee asks: "We have a DSL connection that runs from a Cisco 675 DSL modem to a 24 port hub. Cat 5 cable has been run to the utility closet of each unit. The condo assoc. pays for the DSL from the monthly condo fees collected. The internet connection has been terribly slow the last few days, so I did a little snooping with ethereal and found that there is an individual who is using eDonkey 2000 to download and share movies. This user is eating up all the bandwidth. I want to set up a good router that can do load balancing so that an individual can't take up all the bandwidth and I was wondering what Slashdot would recommend. I would have to do it on the condo assoc. dime so it would have to be done on the cheap. Any suggestions?"
Mmm... Linux (Score:2, Interesting)
Re:Mmm... Linux (Score:5, Informative)
The same can of course be done with Linux, but in my (though somewhat limited to my place of work) experience, FreeBSD's traffic shaper is a bit more reliable, and much easier to set up (it's all in the handbook). In our case, that box is a transparent bridge, accessible only via ssh or from the inside interfaces, with three NICs, one for the outside router, one for the inside public systems, and a third with private addresses, where natd (man natd, also integrated with ipfw via FreeBSD's divert sockets) translates the private addresses as they go out of one of the other two interfaces. We also run nagios (network monitor), etherape (looks cool when you see the traffic real-time on a GUI), and poptop (MSCHAPv2 capable VPN server), along with IDS logging via ipfw and tcpdump/ethereal, all on an old Duron we had laying around collecting dust.
In all, our Firewall/VPN/IDS/Traffic Shaper/Network monitor cost us about $250 in hardware, and two day's labor. I saw a similar product (though in a nice 1U rackmount case) listed for $6000 at CDW, so whatever you do, you can't go wrong with Linux or FreeBSD on cheaper hardware, unless your time is worth a few thousand dollars an hour.
Re:Mmm... Linux (Score:5, Informative)
Re:Mmm... Linux (Score:2)
something else.
Take a cue from my university... (Score:5, Insightful)
Re:Take a cue from my university... (Score:2)
In my case, (I work as a sysadmin at a web-hosting company), we are considering implementing some sort of transparent bridge to limit traffic to WWW-servers in case we need to use our backup line. People can stand having slow WWW-traffic for a while, but mail/dns, especially smtp MUST work all the time.
In short, i cannot just pull the plug on our large web-servers
Re:Take a cue from my university... (Score:2)
Unplug his ass. Unplug his wire from your switch and plug it into a cheapo Linksys cablemodem router (that isn't connected to anything else) so he gets a DHCP address - but no connectivity (that part is just for fun, makes it a real bitch for him to self-diagnose an outage when he can ping the router, get a DHCP address, and his neighbor still has Internet connectivity.) When he comes up wondering why he can't get out to
Re:Take a cue from my university... (Score:2)
That would be the three-year-old's approach.
No, instead, just talk to the user first.
It is MUCH more complicated if that user is paying you money for the service (albeit not much money). If you didn't explicitly state in some sort of contract an acceptable use policy, YOU are the one wh
Re:Take a cue from my university... (Score:2)
But yes, I agree that the association needs to immediately draft a TOS (terms of service) letter with regards to the shared dataline. Unless he is
FreeBSD (Score:1)
traffic shaping (Score:1)
Re:traffic shaping (Score:1)
access-list 101 permit tcp any any eq
access-list 102 permit tcp any eq any
interface dsl 0
traffic-shape group 101 256000
interface ethernet 0
traffic-shape group 102 256000
simple and to the point. If you any more buckets go to Cisco's web site.
first off (Score:3, Interesting)
Re:first off (Score:5, Funny)
No, actually as I see it, he's the whole building's alibi. Go ahead and download music, just blame him if anyone gets caught.
Re:first off (Score:3, Interesting)
Freshmeat (Score:5, Informative)
Linux Bandwidth Arbitrator [freshmeat.net] looks like it was designed for this sort of thing...
Re:Freshmeat (Score:1)
switch! (Score:3, Informative)
Be warned... a managed switch WILL cost several times more than a normal switch.
But apart from that, your only other choice is to use some sort of arbitrary setup to limit bandwidth to certain IP addresses and force each user to have one static IP (virtually impossible to enforce with your setup)
Not too hard, cut him loose (Score:4, Insightful)
If he's illegally sharing files, he won't squawk too loudly.
OpenBSD or FreeBSD (Score:5, Insightful)
FreeBSD also has built-in support via the altq facility that is a part of the ipfw firewall.
My druthers would be to use OpenBSD for this as it's not a CPU-bound problem and security on your router should be very high on your list of priorities.
--Paul
elcheapo box with linux (Score:2, Informative)
So I just run "tc qdisc add dev eth1 root tbf rate 250kbit latency 20ms burst 2kb". This keeps the network running at full speed with all the downloads going.
Checkout the Bandwidth Limiting HOWTO on tldp.org
Re:elcheapo box with linux (Score:2)
It requires the hosts on the inside side of the shaper to regulate their own traffic, via TCP throttling from packet loss. Unfortunately, TCP only knows about the single stream that it's dealing with. Most P2P clients these days have *scads* of TCP connections open at any given time. Which mea
Is he running a Windows box? (Score:2)
DSL shaping system (Score:5, Informative)
Get a Linux box. Get two NICs (c'mon, NICs are cheap these days, and the DSL modem only needs a 10Mbit one).
Set up bridging on the Linux box.
ifconfig eth0 0.0.0.0
ifconfig eth1 0.0.0.0
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
If your boxes use DHCP, you might want to give your shaper an outside IP address (so that it can run ntp and the like, if nothing else). Use br0 as the interface -- this tripped me up at first.
dhclient br0
Add per-host rate limiting. There are two *excellent* solutions to do this automatically under Linux -- esfq and wrr. Both automatically detect IP addresses on one side and spread bandwidth out evenly. Neither is apparently actively maintained, unfortunately, so if you're using a 2.6 kernel, you're out of luck. Your best bet is probably HTB (which *is* included in 2.6 and I believe current 2.4 kernels). HTB requires you to manually create a child of the main HTB qdisc for each IP address, and filter based on source IP address (or source MAC address, which is probably more appropriate if you have a single Ethernet segment and dynamically assigned IP addresses) but lets you filter traffic differently for each host. For a small network, this may be feasible. I'd hang another qdisc off of the HTB that reduces the priority of P2P *within* each host's account, so that someone can use spare bandwidth for eDonkey or whatever, but still retains reasonably snappy SSH, even on their own box.
You must set the maximum flow of the HTB just below the DSL modem's data transfer rate, or else the modem's buffer will fill up when outbound traffic fills up its (big) buffer, making interactive use impossible. Keep reducing the limit and then ping flooding (ping -f) the outside world from an inside box. Keep a regular ping running in another terminal, and monitor it. When your system is working right *ping times should not climb above 150 or 200ms or so on a box*. No 1000ms latency. You should simply start seeing packet loss.
I must say that setting something like this up was a huge pain in the ass, and that if I had the script handy at the moment, I'd post it. The Linux networking/filtering/routing system is not as well documented as it should be, and is *not* always the most intuitive thing in the world. It is, apparently, pretty powerful, based on what I've read from folks that have used other systems, though. [shrug]
Speaking of which, I can't figure out why sfq is in mainstream Linux but esfq is not. SFQ is, to my mind, almost useless for most people. Who on earth wants to balance all their TCP flows evenly? Even per-host bandwidth allocation is a *far* more common problem, and one that vanilla Linux (and any 2.6 kernel) cannot handle well.
I did not find it necessary to use ebtables or ipchains to produce an effective traffic shaper. YMMV.
Re:DSL shaping system (Score:3, Informative)
And by this I mean that all the commands that you'll have to use that I didn't already list should start with tc.
Re:DSL shaping system (Score:2)
ifconfig br0 1.2.3.4 [or whatever your IP is]
ifconfig br0 up
Options on Freshmeat (Score:2)
I don't think Freshmeat is currently a good place to go when looking for a traffic shaping system to do this sort of thing.
pump/dhclient followup (Score:3, Informative)
Oh, speaking of DHCP, big tip for Red Hat/Fedora users. Absolutely do not use the vanilla ifup scripts that Red Hat provides. They *suck*. If you are on any kind of a consumer DSL connection, every now and then (perhaps rare, perhaps common) you will lose your connection, for whatever reason. For some reason, Red Hat sets up their copy of dhclient to *give up* if it fails to get a dhcp lease, which means I frequently en
HTB matching (Score:3, Informative)
You may want to toy with the idea of having a perl script or something look at unmatched packets or maybe scrape the ARP cache (arp -a) to automatically add new entri
IPCop (Score:3, Informative)
Simple solution... (Score:5, Funny)
Re:Simple solution... (Score:2)
Re:Simple solution... (Score:2)
The better bittorrent clients let you do exactly that, specifying a limit to how much bandwidth it can consume. ^^
Re:Simple solution... (Score:2)
>The better bittorrent clients let you do exactly that, specifying a limit to how much bandwidth it can consume.
>
The better bittorrent clients let you limit the UPLOAD speed, I have yet to see one that lets you limit the DOWNLOAD speed, which is what the original poster was asking. If you know of one, please share, because I have been looking for one.
Re:Simple solution... (Score:2)
The way bittorrent works is that your upload speed sets your download speed. If you don't upload at all, you won't be able to download. That's why it works!
Re:Simple solution... (Score:2)
If there is a download/upload ratio, presumably based on my numbers it is greater than 10/1.
I would like my download to be capped at 20K, but I haven't found a bittorrent client that lets me do that yet.
Re:Simple solution... (Score:2)
Q: I don't want you stealing my bandwidth! How can I stop it from uploading?
A: You could hack the source to not upload, but then your download rate would suck. BitTorrent downloaders engage in tit-for-tat with their peers, so leeches have very little success downloading.
Re:Simple solution... (Score:1)
Re:Simple solution... (Score:2)
http://groups.yahoo.com/group/BitTorrent/message/ 4 912 [yahoo.com]
Re:Simple solution... (Score:2)
Of course. The problem user has one already, assuming his version of eDonkey is reasonably current.
Re:Simple solution... (Score:2)
More to the point, a traffic shaper knows about the current demands that all the computers are putting on the network. Each individual computer with throttling capabilities does not. Sure, Bob can throttle his traffic down to 3KBps, but that means that when nobody else is using the network, he isn't taking advantage o
M0n0Wall (Score:5, Informative)
Didja try asking him? (Score:5, Insightful)
Re:Didja try asking him? (Score:2)
Linux Advanced Routing and Traffic Control. (Score:2)
It's difficult to understand, much less set up, but essentially the stuff from this site can solve your problem by tightly controlling outbound traffic (since it is possible to have perfect control over what packets you release to the network) and by loosely attempting to control inbound traffic (since it isn't really possible to perfectly control what packets other people send you).
For example, my home setup has four priority classes:
Class 0:10 is for high priority traffic: ping replie
Re:Linux Advanced Routing and Traffic Control. (Score:2)
Re:Linux Advanced Routing and Traffic Control. (Score:2)
http://lartc.org/howto/lartc.adv-filter.policing. h tml [lartc.org]
(If that isn't easy to understand, keep in mind it's section 12 of a long HOWTO with lots of conceptual material. If you start reading from the beginning, and skip sections that don't involve your problem, everything should start making sense.)
For example:
tc filter add dev $DEV parent ffff: \
protocol ip pri
Re:Linux Advanced Routing and Traffic Control. (Score:1)
Traffic Conditioning For Inexpensive Installations
Business-Class Performance From Free Software and Commodity Hardware
By Michael Spencer
Broadband internet connections don't handle heavy server loads very well. When many
connections are in contention for the same limited upstream bandwidth, problems occur
that degrade overall link performance. I have found a solution that can be implemented
with inexpensive
throttled (Score:3, Informative)
I used to use CarraFix, but Throttled whips the shit out of it.
I had to play around with the startup file for a few hours to get it working right. Here's my relevant modifications, if anyone's interested:
Cisco has declared the 675 router dead. (Score:2)
Cisco has declared the 675 router dead, and stopped supporting it. Before they declared it dead, there were frequent security upgrades, giving the impression that it might not be secure now. Cisco had bought the 675 technology from another company; it was not designed as a Cisco product.
So, maybe it would be sensible to buy a new router, and maybe that router would have load balancing. SMC [smc.com] seems to be a reputable company, but I don't see any SMC routers with balancing.
Re:Cisco has declared the 675 router dead. (Score:1)
Give the RIAA a call ? (Score:4, Interesting)
Alex
Re: (Score:2)
Re:Have the Windows user run Netlimiter (Score:3, Informative)
http://bandwidthcontroller.com/
Is a fairly decent gateway traffic shaper - not quite as configurable as linux solutions, but fairly easy to set up and you can limit by a number of options, port, protocol, etc.
Free trial version to so you can see if it works for you. $50 to buy.
N.
Some problems with traffic shaping (Score:2)
Apart from such queer
Dummynet is the way to go! (Score:1)
Quote from the above linked page:
Unlike other traffic shaping packages which run in userland, dummynet has a very little overhead, as all processing is done within the kernel. There is no data copying involved to move packets through pipes, just a bit of pointer shuffling, and the implementation is able to handle thousands of pipes with O(log N) cost, where N is the number of active pipes.
All you need is an old PC, two NICs. You can boot Dummynet (running on PicoBSD) from a floppy..
Linksys 54G wireless router (Score:2)
www.Freesco.org to the rescue... (Score:2)
The biggest issue I have had with freesco was a) bad floppies and b) finding supported nics. 3Com 3C509s and 3C905s both work great. On the ISA ones make sure you turn off PnP.
I've used this product for over 2 years without an issue. I'd reboot it once a month just because, but I can't think of a time I had to.
Good Luck
Vertical
MIkrotik? (Score:2)
Shorewall has traffic shaping built in (Score:1)
I've successfully down this to allow bittorrent transfers to take a lower priority than my VoIP traffice from my phone. It seems so far to have worked quite well. I had some trouble getting the qos-htb and tc qdisc stuff to work. Possibly because of the versions, bu
I use FreeBSD 5.2.1 + pf/altq (Score:1)
Re:I use FreeBSD 5.2.1 + pf/altq (Score:1)
don't limit when quiet; the PRIO chain (Score:2)
but it's a lot of work for the everyday DSL people who have a brother who runs eDonkey 24/7.
Really it would be nice is something was available to balance all ports equally so that:
-=WHEN THE BANDWIDTH IS FREE IT IS NOT LIMITED=-
I guess the "prio" chain may be help with this. It isn't as well documented as htb. If anyone can figure out how to balance everything in as little lines as possible using something like prio, please share it as that would
Maybe a little late here (Score:2)
Just lock the ports for all of the popular P2P apps that have fixed ports down to 50kbps up and down, and call it a day. If I was on a shared DSL, I'd completely understand this, and even appreciate tha
A mix of hardware and software (Score:1)
nevermind the bandwidth... (Score:2)
as for the bandwidth issue, 24 households sharing a single DSL line is a bit of a stretch, especially if some houses have several comp