P2P Traffic Shaping For Home Use?
An anonymous reader writes "My housemate uses an aggressive P2P client, that when in use makes the Internet unusable for everyone else connected to the network. After hearing about various ISPs shaping traffic to reduce P2P traffic, I was wondering if there was a solution for managing P2P traffic on a home network. I have a Linksys WRT54G available for hacking. Can Slashdot recommend a way to reduce the impact of P2P on my network and make it usable again?"
How about just nicely explaining the problem to him, and requests he runs his P2P stuff overnight when no one is using the connection?
If that doesn't work, well, his port on the switch might mysteriously fail during waking hours.
Oolite: Elite-like game. For Mac, Linux and Windows
Seriously. An arms race is not going to solve your problem.
Just set up QoS such that VOIP, SMTP, HTTP, HTTPS, and whatever else you care about gets prioritized.
In the days of Napster, a nephew of mine spent a year living with me while going to college nearby.
His use of Napster would make the cable modem connection unusable. In response, I'd go to the home firewall device (had one of the early Linksys models) and block the traffic.
He thought the cable company was doing it.
Beat the shit out of the fucker.
Switch to Comcast!
a. 1st off and most importantly make sure the internet connection isn't in your name so you are not the one who gets sued by the RIAA b. go get DD-WRT (check your WRT54G version..later one's suck) then set up the traffic shaping QoS feature. http://www.dd-wrt.com/wiki/index.php/Quality_of_Service
actually I am happy to see you, however that is in fact a banana in my pocket.
Raise priority for
- Web (Http and https, maybe also 8080)
- DNS (UDP:53)
- Mail (SMTP, IMAP, POP3 (including SSL versions))
- IRC (if you use)
- FTP
- SSH, Telnet
- All TCP acknowledgement packets.
- Maybe some gaming protocols (Directplay, WoW, etc - these unfortunately require checking docs for each game)
that way, you have whitelisted most of the "interactive" protocols that suffer from loaded link. No need to keep chasing after the latest encrypted, onion routed P2P application that happens to be flavor of the month. The biggest problem is the online gaming stuff.
I love how people pimp their own client. But nearly every PTP client I've touched, has bandwidth limiting. Some of them, uTorrent included, allows you to schedule your bandwidth.
The real problem here isn't traffic shaping, but about traffic courtesy. Your housemate may not know how much trouble their causing. Talk to them. Get them to set their max speeds to 1/2 or 1/4 of the available bandwidth.
They may be surprised when their OWN web browsing gets better.
Yet this does all hinge on you talking to said housemate. Go talk. I've had the "talk" and been the person talking to the housemate. It usually works out well.
You would have to be crazy to be sane in this world. -Nero
My housemate has a machine setup for bittorrent, when we first moved in together it was very annoying as he seemed oblivious that running it all the time meant that my connections were slow, dropping all the time & unusable.
So I spoke to him, you know - in a rational way. It's now scheduled for the nights & days when we're either asleep or at work with a few hours in between & most of the weekends where it's either throttled down to 10k/s (by uTorrent) or stopped completely.
On top of that we've got a Smoothwall box with packet prioritization for ssh/web/email/im etc. but no bandwidth throttling.
At the end of the day, if you cant come to an agreement then it's probably just gonna get worse for you two and there's nothing you can do to stop him being an asshole.
Simple - take a BIG HAMMER to his computer.
Most of the stuff on
tell him that his .torrent-ing is adversely affecting your social life on WoW. He'll either understand, or not.
If not, just use some DPS and hide behind the couch....
http://games.dlink.com/products/?pid=370
Works well, but is rather expensive. Has an oversized NAT table to help with UDP server pings, so this will remedy and torrent problems you might have with your current setup.
QoS system is fairly flexible with an intuitive GUI and many preconfigured service options.
Has an option to pack the output frames completely (harms XBox Live possibly) as well as delay non-prio packets in favour of VOIP/gaming/as you configure.
Matt
http://www.openbsd.org/cgi-bin/man.cgi?query=pf.conf 'nuf said
Good point. How 'bout a wikipedia link for the WRT54G, with entries on available firmware?
Don't tell me to get a life. I'm a gamer; I have LOTS of lives!
Or install Tomato and go to the QOS tab. It is pretty simple to get QOS going on Tomato
If I have nothing to hide, don't search me
Any WRT54G model before v5 can be modified easily, v5+ can sometimes be modified with DD-WRT. And of course they still sell the GL, which is quite worth the price ($60 on amazon) because of how useful it becomes with this alternate firmware. The GL can also be modified and has the advantage of still being sold under a clear model number, so you know you can mod it, unlike others.
On the other hand, there is awesome shaping available in tomato firmware, it can classify traffic and show you what percentage of your traffic was in each class.
http://www.polarcloud.com/img/ssqosc108.png
http://www.polarcloud.com/img/ssqosg108.png
http://www.polarcloud.com/tomato
As someone mentioned in a previous post, it's much easier to just whitelist priorized services such as ssh, telnet or gaming protocols than wasting too much CPU cycles on detecting obscure P2P protocols with layer 7 filters.
... ...
Personally, I use iptables & tc to setup a simple HTB (Hierarchical Token Bucket filter) system with 3 priority levels:
- Interactive: SSH (with Minimize-Delay TOS-Flag), Telnet, Jabber,
- Medium: HTTP, IMAP, SMTP, POP3,
- Low: All the rest
Shaping the upload speed is my only concern. All 3 classes may use the complete upload bandwidth. The interactive HTB class gets a guaranteed 90% of the bandwidth and a high burst value. The lowest HTB class has a burst of 0 and about 5% guaranteed upload speed.
While this is only primitive setup, it allows lag-free ssh with an unlimited upload in the background.
An in-depth how-to about the Linux Traffic Control system: http://www.tldp.org/HOWTO/Traffic-Control-HOWTO/index.html
A short pragmatic example using HTB & SFQ can be found here: http://gentoo-wiki.com/HOWTO_Packet_Shaping
Instead of cheaping out spend $30 a month for your own cable or DSL connection. Or, as many have suggested, just talk to the guy.
Barring that just connect the 220v dryer line to the wall socket in his room and hope that he got his power bar for $5.99 at WalMart.
Or even better please all of your room-mates and just move.
Three Squirrels
I'm sure the reaction of physical violence isn't one most Slashdot readers would take. All that heavy breathing would just tire us out too quickly.
Give a man a fire and he'll be warm for a day. But light a man on fire and he'll be warm for the rest of his life.
but you want to tell everything you know about "P2P traffic shaping for home use" and be useful to more people.
This won't be directly helpful to the submitter (he's working with a WRT54G), but this is how I do it in Linux. Set up the shaping rules with tc. Classify traffic with iptables. Examples follow:
In order, those commands establish a htb scheduler with a celing of 632,320bit/s (you have to set this around 70-80% less than your actual upload to force the packets to queue at your box and not the dsl/cable modem), then establishs children underneth it for each class of traffic. The children will get AT LEAST the specified rate and when extra is available will borrow it according to their priority number. Prio 0 gets all extra bandwidth until satisifed or no more exists, then prio 1, prio 2, etc, etc.
The second set of commands attaches a fair queuing algorithm so individual connections within those classes will share the bandwidth (more) fairly.
From there it's just a matter of using iptables to classify the traffic. This example shoves all bittorrent traffic into the lowest queues. We assume that anything coming from 172.25.42.254 is bittorrent traffic because we add that as a second IP address on the client behind NAT and make Azureus bind to that IP (all other traffic goes out on the default IP).
Those commands
I want peace on earth and goodwill toward man.
We are the United States Government! We don't do that sort of thing.
Honestly, this is the reason ISPs are moving toward throttling, packet shaping, and simply capping the bandwidth. There's a minority of bit torrent users hoarding the bandwidth so that they can hoard piles and piles of movies, music, and games that they have no reasonable expectation of using. "hey check it out man, I have the entire Simpson's series dubbed in Japanese!"
New! Device Legs: These legs will help your poor OEM installed product escape any hamfistedness it may encounter. Ava
The best piece of professional advice I ever received was this:
"Don't use software to solve social problems"
This seems pretty apt here - instead of spending money and time trying to do this the hard way....
Just fucking smack him, and tell him to behave responsibly or lose his internet privileges.