Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Why BitTorrent Causes Latency and How To Fix It

kdawson posted more than 5 years ago | from the first-mile-downstream-would-still-hurt dept.

Networking 315

Sivar recommends an article by George Ou examining why BitTorrent affects performance so much more than other types of file transfer and a recommendation on how to fix it. The suggestion is to modify P2P clients so that, at least on upload, they space their traffic evenly in time so that other applications have a chance to fit into the interstices. "[Any] VoIP [user] or online gamer who has a roommate or a family member who uses BitTorrent (or any P2P application) knows what a nightmare it is when BitTorrent is in use. The ping (round trip latency) goes through the roof and it stays there making VoIP packets drop out and game play impossible."

cancel ×

315 comments

Sorry! There are no comments related to the filter you selected.

QoS? (5, Funny)

Opportunist (166417) | more than 5 years ago | (#23620975)

Hey, I have a really spiffy idea. How about creating a router that can determine which packets take precedence? I'll make millions off that idea...

What? Oh, damn Linux! What? Oh, Windows can do it too now? Why do I always have the good ideas about 10 years too late?

Speaking of that... (0)

Anonymous Coward | more than 5 years ago | (#23620991)

DD-WRT [dd-wrt.com] released v24 a week ago.

Your client can do this. George Ou is a tool. (-1, Troll)

Odder (1288958) | more than 6 years ago | (#23621563)

Most clients come with upload limits and most people know this.

Why is slashdot linking to stories by a troll like George Ou? His treatment of Peter Gutmann [cypherpunks.to] is unforgivable. His articles look reasonable, but you can never tell with that guy. He's using all M$, so his results are suspect even if he were honest. Then again, the conclusion - don't burn up all of your upload bandwith - is something most people already know. The question it begs, why are cable networks so crappy, is never asked. If Slashdot must cover such basic information, it should do so from a reputable source.

Re:QoS? (2, Informative)

Anonymous Coward | more than 5 years ago | (#23621063)

OpenWRT or DDWRT can run some nice QoS scripts to filter based on ip/port/service

Re:QoS? (3, Insightful)

ILuvRamen (1026668) | more than 5 years ago | (#23621183)

yeeeeeah or for free, you could just cap the bandwidth your client uses. I cap it at 25KBps up and 400 down out of my approximate 70 up and 850 down (Road Runner) and I play MMORPGs under those conditions just fine.

Re:QoS? (1)

Draconix (653959) | more than 5 years ago | (#23621233)

Uhhh... DD-WRT is free. I use it on my WRT54GL, and it works marvelously.

Re:QoS? (0)

satoshi1 (794000) | more than 5 years ago | (#23621319)

Your WRT54GL wasn't free. It's safe to assume that many people still don't use routers with their cable modems, especially those with only one internet capable device.

Re:QoS? (2, Funny)

JK_the_Slacker (1175625) | more than 6 years ago | (#23621475)

They got a cable connection just for their internet-enabled toaster? Now THAT'S luxury!

Re:QoS? (-1, Flamebait)

Spokehedz (599285) | more than 6 years ago | (#23621495)

So, no hardware firewall for you then? I'm amazed your computer worked good enough to post on slashdot.

The last time I went on without any h/w firewall, I started getting hacks within minutes. Then I turned on the software firewall, and it went to maybe a couple more minutes.

Re:QoS? (2, Insightful)

WhatAmIDoingHere (742870) | more than 6 years ago | (#23621595)

It's called a "Mac." They come from this new start-up company in California called "Apple." A silly name, I know, but you'd be surprised at how secure their OS is!

Re:QoS? (5, Funny)

Donjo (797935) | more than 6 years ago | (#23621883)

Was it some guy from 127.0.0.1? I used Zone Alarm once and that guy was always trying to hack me. To bad I showed him, I made a batch file and pinged him thousands of times a second. Then my computer lagged so I stopped but I think I probably got him pretty good. /sarcasm

Re:QoS? (5, Insightful)

cgdiaz (1199643) | more than 6 years ago | (#23621529)

Well, since the article is about how to stop other users on the network from ruining your net experience, I think we assume they will be on a router of some sort.

Re:QoS? (1, Interesting)

glitch23 (557124) | more than 6 years ago | (#23621661)

yeeeeeah or for free, you could just cap the bandwidth your client uses. I cap it at 25KBps up and 400 down out of my approximate 70 up and 850 down (Road Runner) and I play MMORPGs under those conditions just fine.

I hope you don't pay too much for that service. I have Road Runner too but I get 5Mbps down and I've been able to get up to 360kbps up. I don't know what the advertised upload bandwidth is off hand. I get that for $45/mo.

Re:QoS? (2)

phantomcircuit (938963) | more than 6 years ago | (#23621741)

Did you even read the article? The entire thing was about how you could avoid having to ask other people to use the network with a lighter touch.

Re:QoS? (5, Informative)

pin0chet (963774) | more than 5 years ago | (#23621193)

OpenWRT and Tomato feature impressive QoS capabilities as well.

L7-filter can even manage traffic at the application layer. Just set Bittorrent to "Bulk" and put Skype and Xbox live as "Premium."

Managing traffic on the router level is a lot easier than on the PC level, especially when you have several devices on a single network competing for scarce bandwidth.

QoS, but only on the Telco Side (4, Informative)

corsec67 (627446) | more than 5 years ago | (#23621203)

While I prefer Tomato [polarcloud.com] on a WRT-54GL, that would do absolutely nothing at all to solve this issue. A router behind a modem can really only regulate the upload, and can't easily prevent a flood of data on the downstream side.

This issue is with the queue on the Telco's DSLAM, or on the other side of the cable from the modem. This is more like an invited DDOS, which no amount of filtering at or behind the modem can resolve, because the modem is getting the traffic from the DSLAM after it goes through the queue.

The only way to have QOS solve this issue would be to ask the telco to do the QOS for you, and the amount of processing power to do that nicely isn't trivial.

Re:QoS, but only on the Telco Side (0)

Anonymous Coward | more than 5 years ago | (#23621279)

While I prefer Tomato [polarcloud.com] on a WRT-54GL, that would do absolutely nothing at all to solve this issue. A router behind a modem can really only regulate the upload, and can't easily prevent a flood of data on the downstream side.
Really, that is not much of an issue. People's down pipes are usually 8-10x larger.

Re:QoS, but only on the Telco Side (1)

corsec67 (627446) | more than 5 years ago | (#23621323)

"usually" doesn't mean always.

My upload and download are the same.

But, why does it matter what the upload/download ratio is? P2P programs try to maximize transfer, and if several people are uploading to a single person, that could easily overwhelm a normal download pipe, like a bittorrent that has many seeders and few downloaders.

Re:QoS, but only on the Telco Side (2, Informative)

tomhudson (43916) | more than 6 years ago | (#23621565)

Upload speed makes a huge difference ... so cutting your torrent upload to half your upload bandwidth solves the problem:

1. the fewer packets your torrent app sends, the fewer replies it receives, so more bandwidth available for other data such as web pages, gaming data, etc.
2. the fewer packets your torrent app sends, the more upstream bandwidth your other apps have to request data such as web pages, gaming data, etc.

Re:QoS, but only on the Telco Side (3, Informative)

corsec67 (627446) | more than 6 years ago | (#23621607)

That is all true, if the upload link is the bottleneck.

But that isn't what the article is about. The article is looking at a download link that is saturated from P2P transfers from other people. Since the DSLAM queue isn't in the users control, it is a bit harder to prevent the P2P traffic from saturating the link.

Re:QoS, but only on the Telco Side (1, Informative)

tepples (727027) | more than 6 years ago | (#23621755)

The article is looking at a download link that is saturated from P2P transfers from other people.
In BitTorrent, the more slowly you upload, the more slowly you download.

Re:QoS, but only on the Telco Side (5, Interesting)

WhatAmIDoingHere (742870) | more than 6 years ago | (#23621623)

I use between 50 and 80% of my max upload for torrents. I'm able to play TF2 and ping in the 20s. This article is addressing an issue that has been covered in every single "So, you want to use BitTorrent" article EVER.

Hell, Azureus has a plugin to test ping an IP address/website, and if it takes longer than a set time, it slows down your uploads. uTorrent has a feature like that, as well.

Re:QoS, but only on the Telco Side (3, Insightful)

wintermute000 (928348) | more than 6 years ago | (#23621583)

Hear, hear

I love these home geek "i know how to flash DD-WDT and click on a GUI" networking experts, who fail to grasp your point above (i.e. QoS = OUTBOUND).

Since downstream QoS from telco aggregation router is not practical to implement, the best fix is to throttle the clients on the end user PCs, free and just a few clicks away.

Or if you want to be really advanced, QoS outbound from a second router (or linux gateway or firewall etc.) behind your WAN router but really that's overkill for 99% of users.

Re:QoS, but only on the Telco Side (4, Informative)

silas_moeckel (234313) | more than 6 years ago | (#23621839)

Funny I'm a network guy and grok normal QOS. DD WRT and the like are capable of inbound QOS to some degree via inbound rate shaping. You loose some bandwidth and you can do the same with cisco kit and some creative use of it's rate shaping. It's not as good as QOS but it works.

Re:QoS, but only on the Telco Side (1)

tepples (727027) | more than 6 years ago | (#23621747)

A router behind a modem can really only regulate the upload, and can't easily prevent a flood of data on the downstream side.
Can't a router delay ACKs for "bulk" level services?

Re:QoS? (2, Interesting)

yabos (719499) | more than 5 years ago | (#23621393)

The 3rd party firmware products like dd-wrt and tomato only does upstream QoS by default. You can make your own iptables script for the down stream though. I'm not sure how it works in implementation but I've set mine to give http full bandwidth over nntp on a certain port.

When I'm not using http to download something then nntp can download at full speed. When I do something on http it will get the full bandwidth. It's not instant though so it takes a few seconds to kick in. I suspect it's dropping ACKs for the nntp traffic or something like that so that the nntp server stops sending so much data.

You could do the same thing with bittorrent as long as you know the ports.

Re:QoS? (1)

ATMD (986401) | more than 5 years ago | (#23621433)

I've set QoS up on my (Gentoo) router manually using tc, and it helps a bit but the internet is definately a lot slower when people are torrenting. I'm not even talking about stuff with low latency requirements - simple web browsing becomes several times slower, and if someone's set their BT client to unlimited upload then even with my QoS, about a third of HTTP connections time out or never establish in the first place.

I don't want to use L7 because I'm trying to /reduce/ lag, not spend precious milliseconds figuring out what's inside each packet. The quoted detection time for BT was multiple seconds, last I looked.

Does anyone have a decent tc/iptables setup that actually removes the horrible effect BitTorrent has on every other form of net usage? Because I'd very much like to hear from them. Two more people are moving in soon and we're all geeks. We desperately need decent QoS!

Re:QoS? (4, Informative)

Dolda2000 (759023) | more than 6 years ago | (#23621635)

It sounds like you're doing it wrong. I've set up HTB shaping with tc on Linux as well, and it works very well. Flawlessly, I might even say.

There are two key points:

  • You absolutely need to limit to absolute maximum outbound bandwidth (on the root qdisc, in other words) to a value slightly below your real outbound bandwidth. This point is critical. Without it, there's no point in even trying to shape the traffic, since the modem will start buffering.
  • It helps very greatly if it is possible for you to classify torrent traffic into a HTB class with lower priority than whatever class the packets you care about go into. There are several possibilities for going about that:
    • If the program in question supports setting the DSCP field of the packets (where the TOS field went previously), you can use iptables with -m dscp to set the fwmark on them to classify more precisely (remember to clear the DSCP field before sending the packets out from your network, though).
    • If a program running locally on the router does not support setting DSCP values, you can create a group, set the program to SGID to that group, and use iptables with -m owner --gid-owner $GROUPNAME to set the fwmark. The same method can be used to set the DSCP field on packets from a Linux machine other than the router.
For reference, here is the script that I use to set up the traffic shaping. It might prove useful to you.

#!/bin/sh

# Current bandwidth allocation:
# 1:11 1:121 1:122 1:13 1:14 1:15 1:1
# (25 + (175 + 75) + 125 + 175 + 25) = 600

tc qdisc add dev wan root handle 1: htb default 122
# Root
tc class add dev wan parent 1: classid 1:1 htb rate 600kbit ceil 600kbit cburst 1500 burst 50kb
# TOS Min-Delay
tc class add dev wan parent 1:1 classid 1:11 htb prio 0 rate 25kbit ceil 50kbit burst 10kbit
# Bulk
tc class add dev wan parent 1:1 classid 1:12 htb prio 1 rate 250kbit ceil 600kbit burst 10kb
# HTTP
tc class add dev wan parent 1:1 classid 1:13 htb prio 1 rate 125kbit ceil 600kbit burst 50kb
# FTP (Needs iptables support)
tc class add dev wan parent 1:1 classid 1:14 htb prio 1 rate 175kbit ceil 600kbit burst 10kb
# Low priority
tc class add dev wan parent 1:1 classid 1:15 htb prio 2 rate 25kbit ceil 500kbit
burst 10kb
# TOS Max-Bandwidth
tc class add dev wan parent 1:12 classid 1:121 htb prio 1 rate 175kbit ceil 600kbit
# Default
tc class add dev wan parent 1:12 classid 1:122 htb prio 1 rate 75kbit ceil 600kbit
# TOS Min-Cost (Needs iptables support)
tc class add dev wan parent 1:15 classid 1:151 htb prio 2 rate 5kbit ceil 400kbit burst 10kb
# Auxiliary low prio bands
tc class add dev wan parent 1:15 classid 1:152 htb prio 2 rate 5kbit ceil 400kbit burst 10kb
tc class add dev wan parent 1:15 classid 1:153 htb prio 2 rate 5kbit ceil 400kbit burst 10kb
tc class add dev wan parent 1:15 classid 1:154 htb prio 2 rate 5kbit ceil 400kbit burst 10kb
tc class add dev wan parent 1:15 classid 1:155 htb prio 2 rate 5kbit ceil 400kbit burst 10kb

# Filters
tc filter add dev wan parent 1: protocol ip prio 1 handle 11 fw flowid 1:151
tc filter add dev wan parent 1: protocol ip prio 1 handle 12 fw flowid 1:152
tc filter add dev wan parent 1: protocol ip prio 1 handle 13 fw flowid 1:153
tc filter add dev wan parent 1: protocol ip prio 1 handle 14 fw flowid 1:154
tc filter add dev wan parent 1: protocol ip prio 1 handle 15 fw flowid 1:155
tc filter add dev wan parent 1: protocol ip prio 2 handle 1 fw flowid 1:14
tc filter add dev wan parent 1: protocol ip prio 3 u32 match ip tos 0x10 0x1e flowid 1:11
tc filter add dev wan parent 1: protocol ip prio 3 u32 match ip tos 0x08 0x1e flowid 1:121
tc filter add dev wan parent 1: protocol ip prio 3 u32 match ip sport 80 0xffff flowid 1:13
tc filter add dev wan parent 1: protocol ip prio 3 u32 match ip sport 443 0xffff flowid 1:13

# Leaf nodes
tc qdisc add dev wan parent 1:11 handle 2: sfq perturb 10
tc qdisc add dev wan parent 1:121 handle 3: sfq perturb 10
tc qdisc add dev wan parent 1:122 handle 4: sfq perturb 10
tc qdisc add dev wan parent 1:13 handle 5: sfq perturb 10
tc qdisc add dev wan parent 1:14 handle 6: sfq perturb 10
tc qdisc add dev wan parent 1:151 handle 7: sfq perturb 5
tc qdisc add dev wan parent 1:152 handle 8: sfq perturb 5
tc qdisc add dev wan parent 1:153 handle 9: sfq perturb 5
tc qdisc add dev wan parent 1:154 handle 10: sfq perturb 5
tc qdisc add dev wan parent 1:155 handle 11: sfq perturb 5

Re:QoS? (2, Informative)

ATMD (986401) | more than 6 years ago | (#23621727)

That's similar to what I have, albeit with more rules and finer-grained control. Mine basically says that if the outgoing packet is > 1kb then it's probably part of a high-traffic connection and needs to be shunted to the back of the queue (low priority).

The key point that I've missed is the master speed throttler at the trunk of the tree - of course the router's just throwing stuff at the modem as fast as it can so its queues are never full.

Thankyou for taking the time to reply, and making my kick myself! Greatly appreciated :)

Re:QoS? (1)

Dolda2000 (759023) | more than 6 years ago | (#23621543)

Oh, can Windows do it, too? How does one go about to set that up?

(All-important disclaimer: I don't use Windows myself, of course, but I might at least be able to help people who do)

Re:QoS? (1)

Opportunist (166417) | more than 6 years ago | (#23621893)

Ok, I admit, I have no idea how to do it in Windows. I just saw some QoS feature on Windows some time ago, could well be that it's as much a placebo as its firewall feature.

Re:QoS? (1)

Cynic.AU (1205120) | more than 6 years ago | (#23621639)

Hey, I have a really spiffy idea. How about creating a router that can determine which packets take precedence? I'll make millions off that idea... What? Oh, damn Linux! What? Oh, Windows can do it too now? Why do I always have the good ideas about 10 years too late?
Can't remember the last time I convinced my ISP to let me install software on their DSLAM router :D

short answer: (3, Funny)

Anonymous Coward | more than 5 years ago | (#23620987)

Don't download porn while playing WoW.

Re:short answer: (0)

Anonymous Coward | more than 6 years ago | (#23621603)

Fuck you, I'll download Japanese Guaver models like Miri Hanai [flickr.com] while hosting ranked Gears of War matches if I want. And I'll scream ridiculous racial slurs, some of which I'm sure to misunderstand and thus use incorrectly, in the voice of a 12 year old british boy while doing it!

Who's downloading torrents?!!! (1)

pure_chownage (1297733) | more than 5 years ago | (#23621005)

Although I do like to download a air few torrents here and there, I like to dabble in the odd online game although not as much as I used to. The amount of arguments and fights that come from people 'torrenting' in my gaming time is ridiculous. Almost as many as back in the day when we had 56k dial up and one phone line :P

Re:Who's downloading torrents?!!! (1, Troll)

SpaceLifeForm (228190) | more than 5 years ago | (#23621117)

You had 56K? NOT.

No one ever had 56K, no one. If you got over 50, you were doing good.

These days, the darkside^Wtelcos are degrading dialup on purpose.

Re:Who's downloading torrents?!!! (1)

Vectronic (1221470) | more than 5 years ago | (#23621309)

Why the hell is this +1 Insightful?

The OP was simply saying he got in fights over who could use the line for telephone, and who could use the line for internet on a 56K modem.

Not that he got 56K out of his modem.

But argueing against that, I ocasionally had 96K (bursts, lasting about 15 seconds) out of my 56K (USRobotics v.92), ie: 12 kilobytes a second rather than 7 kilobytes a second (Telus dial-up, on brand new phone lines around 2002) and almost a perminent 7kb/s (donwload).

Re:Who's downloading torrents?!!! (1)

marcansoft (727665) | more than 6 years ago | (#23621791)

But argueing against that, I ocasionally had 96K (bursts, lasting about 15 seconds) out of my 56K (USRobotics v.92)

It's called data compression [wikipedia.org] .

Re:Who's downloading torrents?!!! (1)

ATMD (986401) | more than 6 years ago | (#23621479)

These days, the darkside^Wtelcos are degrading dialup on purpose.

Do they really need to do that? I mean, really?

Re:Who's downloading torrents?!!! (1)

Llamalarity (806413) | more than 6 years ago | (#23621507)

No one ever had 56K, no one. If you got over 50, you were doing good.

Real crappy ISDN? Mine rocked! Two rock solid, honest to goodness, true 64K connections. Of course the overhead was on a separate 'B' channel, but it was most certainly over 50K:) Now true dial-up I agree with you, mid 40s was the best I ever got and that was rare.

Re:Who's downloading torrents?!!! (1)

Zak3056 (69287) | more than 6 years ago | (#23621611)

Of course the overhead was on a separate 'B' channel,

BRI ISDN is 2 64kb B-channels, and 1 16kb D-channel.

My Roommate owes me 5000g (3, Funny)

fragmentate (908035) | more than 5 years ago | (#23621011)

Do you know how many times I've died in WoW because of his porn downloading?

He's paying up, I need my epic flying mount...

Re:My Roommate owes me 5000g (5, Funny)

Midnight Thunder (17205) | more than 5 years ago | (#23621275)

Do you know how many times I've died in WoW because of his porn downloading?

As long as you haven't signed a contract with your roommate, then you could throttle him ;)

Re:My Roommate owes me 5000g (5, Funny)

Vectronic (1221470) | more than 5 years ago | (#23621353)

"...then you could throttle him"

eewww. he no doubt can handle that himself.

Re:My Roommate owes me 5000g (0, Redundant)

Torvaun (1040898) | more than 5 years ago | (#23621381)

More trouble than it's worth, you've got to hide the body, and answer a bunch of questions from the police, and it's all a pain in the ass. Much easier just to throttle his bandwidth.

Re:My Roommate owes me 5000g (0)

Anonymous Coward | more than 5 years ago | (#23621435)

He's paying up, I need my epic flying mount...

Stop being jealous, just because he's got his already.

At least, in video.

Buy a better router (1, Informative)

Anonymous Coward | more than 5 years ago | (#23621043)

Good routers can prioritize traffic and limit the latency increase to the time it takes one bulk traffic packet to be sent.

Most P2P programs also have ways to limit the upstream bandwidth, which is sufficient if you are in control of your side of the bandwidth bottleneck. Just set the limit so that all bulk transfers combined leave enough room for realtime applications and the latency will sort itself out (because there won't be any queues of bulk packets building up in the router).

Re:Buy a better router (0)

Anonymous Coward | more than 5 years ago | (#23621119)

Read the article next time

Next on /. (5, Funny)

this great guy (922511) | more than 5 years ago | (#23621051)

Why BitTorrent causes network bandwidth to be used. And network packets to be sent & received. Really sometimes I wonder.

Re:Next on /. (1, Funny)

Anonymous Coward | more than 5 years ago | (#23621285)

What do you wonder about? Why the admins keep pushing slop through because they want ad clicks and we seem content to just do it? Or do you wonder why the fuck we do it? Cause lately I sure wonder why I bother coming here. Hell I can't even bother to login.
The captcha is crooks. Man sometimes the jokes right themselves.

Re:Next on /. (0, Troll)

blahplusplus (757119) | more than 6 years ago | (#23621849)

"Why BitTorrent causes network bandwidth to be used. And network packets to be sent & received. Really sometimes I wonder."

Remember not everbody that is a nerd knows the specifics nor has the inclination to learn about the technology in sufficient depth. Most people are timestrapped or disinterested when it comes to domains outside their areas of job or area of their perosnal interests.

Really, it's like complaining we have to teach brand new people the same things over and over again many people figured out many millenia ago.

I think people forget that, not everyon is into tech, or is old enough yet to have become accustomed to it.

slashvertisement shenanigans again (0)

Anonymous Coward | more than 5 years ago | (#23621127)

i use torrents extensively (to distribute some home-made videos between a largeish group of members) and i have never seen the issues that blogger describes, despite me being the lone seeder for extensive periods of time.

the only "management" i ever do is shape the torrent traffic so that there is bandwidth left for other apps -- and i do that in the torrent software itself.

Re:slashvertisement shenanigans again (-1, Flamebait)

Anonymous Coward | more than 5 years ago | (#23621253)

home made? like your mom getting fucked by the dog? good stuff.

Re:slashvertisement shenanigans again (0)

Anonymous Coward | more than 6 years ago | (#23621569)

Stop raiding my private collection, asshat.
(Not the original AC)

Shaping the traffic? (1)

silverdr (779097) | more than 5 years ago | (#23621165)

How is that news that good P2P download can saturate the bandwidth? And how is the question answered thousands if not millions of times in traffic shaping gateways comes in 2008 again?

I used to have this problem... (0)

Anonymous Coward | more than 5 years ago | (#23621185)

fixed it by buying a different cable modem (motorola). my linksys cable model got totally hosed by torrent traffic. no clue why, and I couldnt believe that the cable modem turned out to be the problem. I can torrent now whenever I want and it doesn't slow down traffic or increase ping or cause packetloss.. It's awsome!!

good way to deal with it (1)

arbiter1 (1204146) | more than 5 years ago | (#23621221)

Most router support QOS so if you run bt on one comp you can set that port priority to very low and it will help. if you got say Dlink DGL router. (http://support.dlink.com/emulators/dgl4300/Basic_Internet.html go under advanced then, click gamefuel)you can set up connections through certain ports to be limit its priority, usin that on mine i got 1mbit upload i can use 90-100kB/s up and nplay games with only at most 10ms increase

Re:good way to deal with it (1)

John Hasler (414242) | more than 6 years ago | (#23621485)

But that would violate "network neutrality"! Evil, evil, EVIL!

Simpler solution (2, Insightful)

Frozen-Solid (569348) | more than 5 years ago | (#23621229)

Use the bandwidth capping abilities in all modern P2P clients. If you're trying to torrent, max it's upload and download capabilities below your total network bandwidth. I have a 1Mbit up and 10Mbit connection. Capping my total upload in KTorrent to 100KByte/s and my down to 900KByte/s allows me to do anything else on the internet without issue. Very few online games or other uses of the internet require more than a 100KB down and 30KB or so up. Learn to properly manage your P2P programs and you won't have a problem.

Re:Simpler solution (3, Informative)

Deltaspectre (796409) | more than 6 years ago | (#23621449)

I have my torrents capped to 1/10 of the advertised connection speeds, but latency still affects me (very visible in ssh sessions to my remote irssi server)

Re:Simpler solution (5, Insightful)

flerchin (179012) | more than 6 years ago | (#23621523)

Read the bloody article. He shows that bittorent traffic capped to 10% of total bandwidth still causes more latency than an http download using 90% of the pipe. The total latency hit is small, but still significant for VOIP or high intensity gaming.

Re:Simpler solution (3, Informative)

tknd (979052) | more than 6 years ago | (#23621555)

That doesn't address the number of open connections issue. Bittorrent clients can often have hundreds of open connections while a browser or a game may only have 1 or 2 connections open. So when the game sends a packet, the router gets it and recognizes that it is connection 99 of 100 open connections. If the router equally prioritizes every packet, then the app that only utilizes a single connection can still wait before being serviced.

It also doesn't solve the problem of having a roommate who will leave bittorrent on indefinitely.

The real solution is to come up with a way to analyze packets and determine which packets should have the highest priority. This is called Quality of Service (QoS). Linux and routers based on linux have access to a number of different QoS schemes, but the off the shelf routers may not have good enough hardware to run it. For example I bought a ddwrt compatible router. I dumped the original factory firmware and installed ddwrt. I turned on QoS and put http and other types of traffic at higher priority than the rest. It worked great when the router could handle the traffic. I could let the bittorrent client eat as much as it wanted but when I hit a webpage, the page loaded just as fast. But every once in a while the router would crash or become really slow and inaccessible (can't access it through ssh or http). Turning off QoS alleviated that issue but of course bittorrent would starve out the other apps. In the future I plan on buying a router with a faster cpu so I can leave QoS on.

Re:Simpler solution (1)

Jesus_666 (702802) | more than 6 years ago | (#23621673)

How fast is your router? I want to know beforehand whether or not turning on QoS would make sense on my device.

Re:Simpler solution (1)

Dolda2000 (759023) | more than 6 years ago | (#23621949)

I don't know about his WRT router, but I used to be using HTB shaping on a Pentium II 400 MHz box, without ever seeing it take even so much as a percent of its CPU cycles.

Wait, wait wait! (2, Insightful)

drolli (522659) | more than 5 years ago | (#23621231)

So, if the ISPs do traffic shaping "to improve the service" it's bad, but we admit that on the small scale (when it affects ourselfs) there is a real need for traffic shaping! Thats interesting....

Re:Wait, wait wait! (4, Interesting)

Just Some Guy (3352) | more than 5 years ago | (#23621321)

So, if the ISPs do traffic shaping "to improve the service" it's bad, but we admit that on the small scale (when it affects ourselfs) there is a real need for traffic shaping!

I don't mind traffic shaping [slashdot.org] at all, anywhere. QoS is a good thing, even when the ISPs do it. What I mind a whole awful lot is traffic blocking, ala Comcast.

Uh, yeah? (5, Insightful)

Anonymous Coward | more than 5 years ago | (#23621327)

And we admit that on a small scale, we need to control our eating, but we don't want the grocery store telling us how much of things we can buy.

Re:Wait, wait wait! (2, Insightful)

rossz (67331) | more than 5 years ago | (#23621329)

What ISPs are doing is not traffic shaping. They are doing traffic elimination. I don't have a problem with traffic shaping. It's often necessary to get different things to play nice with each other.

Re:Wait, wait wait! (1)

SlashJoel (1145871) | more than 5 years ago | (#23621379)

TFA makes your point, too, but that doesn't make it a good one:

Unfortunately, these types of QoS services may never see the light of day if poorly conceived Net Neutrality legislation gets passed that ban the sale of packet prioritization.
It's bad when someone else decides on your behalf which packets to give priority to. The point of Net Neutrality is to stop an ISP from deciding which packets get through and which don't. But that's not the only way to prioritize packets; in fact, I suspect there would be much rejoicing if individuals were given the opportunity to set the priority for themselves.

Re:Wait, wait wait! (1)

dissy (172727) | more than 5 years ago | (#23621417)

So, if the ISPs do traffic shaping "to improve the service" it's bad, but we admit that on the small scale (when it affects ourselfs) there is a real need for traffic shaping! Thats interesting....
Despite the fact slashdot is not one mind, i still don't believe any sensible person here on slashdot has ever had a problem with traffic shaping.

Sure, there are a ton of people complaining about liars (IE they do traffic shaping to an extreme and lie about that fact claiming they don't, wasting hours of resources on our end tracking down a problem that is their fault), and when an ISP simply lies on their bills claiming you used more bandwidth than they sold you and is stated you will get in their ads, and we have a problem with traffic blocking, and charging different prices for one bit vs a different bit depending on the destination ip, but never QoS or traffic shaping.

Re:Wait, wait wait! (0)

Anonymous Coward | more than 6 years ago | (#23621831)

You're absolutely right. We have a problem with telcos using traffic shaping for their own benefit, cheating us out of the service we paid for, and claiming to be doing it for the sake of customers.

If there had been any initiative by the telcos to use traffic shaping to deliver better service to customers, there wouldn't be such rabid knee-jerk opposition. Instead, every effort we hear about turns out to be an effort to prevent customers from making full use of the services they bought or to provide privileged access to paying business partners.

So I say ban it. Our experience shows that despite the potentially valuable applications, telcos aren't going to use it for anything except screwing subscribers.

Re:Wait, wait wait! (1)

nurb432 (527695) | more than 5 years ago | (#23621419)

Not interesting at all.

If its MY network with MY router, i have the choice of what sort of bandwidth usage will occur.

When i PAY for bandwidth from my ISP, they shouldn't limit it.

Re:Wait, wait wait! (2, Informative)

amirulbahr (1216502) | more than 6 years ago | (#23621539)

Injecting TCP RST packets is not traffic shaping. It is sneaky interference with legitimate network access.

Re:Wait, wait wait! (0)

Anonymous Coward | more than 6 years ago | (#23621705)

If you told your roommate he would have full access to your entire bandwidth with unlimited data transfer, it would be wrong to throttle him too.

How clever (4, Funny)

blue l0g1c (1007517) | more than 5 years ago | (#23621237)

Homebrew traffic shaping. *facepalm*

Finally a correct solution! (0, Redundant)

Geak (790376) | more than 5 years ago | (#23621311)

I read the article. He's absolutely correct, and this would also solve the problems ISP's have with bittorrent. Instead of throttling bandwidth to all their customers and screwing them over, manage the traffic properly. It might slow down bittorrent downloads slightly, but not enough to seriously affect it. In the end however it doesn't make business sense for a monopolistic company like Bell to cater to it's customer's needs. They would rather force their customers to dump bittorrent and use their new video download service instead.

Hey George (0, Redundant)

nyet (19118) | more than 5 years ago | (#23621313)

Why not just configure your p2p app to cap its own upload rate? Pretty much every single p2p app w/o exception has this option. Some dynamically cap their upload rate for you by periodically using ping (or measuring some other round trip time) to determine latency and continuously vary the cap until the ping stabilizes.

Traffic shaping works but fair-queue works better. (4, Interesting)

m.dillon (147925) | more than 5 years ago | (#23621343)

Traffic shaping and QOS will help a little, but the real problem is simply that you can't afford to delay priority traffic by more then one or two full-sized packets on any connection less then a few megabits (meaning: just about all home interconnects). If you wait any longer then that, it becomes noticeable.

Traffic shaping and QOS are not usually able to make that guarantee. A straight priority queue with bandwidth guarantees can, as long as you are able to actually classify the torrent traffic differently from your other traffic.

Part of the problem is that it is often not possible to distinguish between the batch and the interactive traffic with Shaping/QOS. Not only is QOS almost universally set wrong, but the simple fact is that one can mix interactive and batch traffic over the SAME ports (http, ssh, dynamically allocated ports)and that can make it virtually impossible to use traffic shaping or QOS to keep the mess away from your interactive traffic.

The best general solution is to use a straight priority mechanic with minimum bandwidth settings to separate as much of the bulk traffic out as you can, and then run fair-queueing at each priority level to take care of any that leaks through. This will do a very good job cleaning up the traffic. DragonFly has a fair-queue implementation for PF that does this. There is also at least one fair-queue implementation for PF in the wild.

Fair-queueing essentially classifies connections (the one in DFly uses PF's keep-state to classify connections), generates a hash and indexes a large array of mini-queues. One packet is then pulled off the head of each mini-queue. One enhancement I would like to make to the DFly implementation which I haven't done yet is to use the keep-state to actually determine which connections are batch and which are interactive, and have a parameter that allows the queue to give additional priority to the interactive connections by occasionally skipping the hoppers related to the batch connections. A quick and dirty way to do that is to simply check the queue length for each mini-queue.

In anycase, its a problem for which solutions are available. Regardless of what you use it has become apparent in the last few years that the only way one can classify the traffic well enough to properly queue it is by building keep-state knowledge on a connection by connection basis.

-Matt

Re:Traffic shaping works but fair-queue works bett (0)

Anonymous Coward | more than 6 years ago | (#23621609)

It has been a little while since I worked with it, but Iptables for Linux (others?) basically had every options I could think of and then some. You can certainly prioritize things, set up different classes, etc, etc. Basically you can shape your upload so that uploads are only a little slower, perhaps only a few KB/sec. It will then correctly dynamically prioritize everything else.

Of course, the Iptables interface take a bit of reading. Perhaps someone knows a nice gui to recommend to generate the script.

Of course, some bittorrent clients can adjust their upload rate. For the casual downloader, it wouldn't be hard to keep that just under your connection speed to preserve latency and then maybe reduce it a bit more, or just pause it, when a call comes in to give some bandwidth for that.

Re:Traffic shaping works but fair-queue works bett (2, Informative)

wintermute000 (928348) | more than 6 years ago | (#23621629)

You forgot protocol inspection

NBAR on any current cisco IOS feature set will detect pretty much anything you need to prioritise without seriously impacting performance.

Juniper has something similar on their gear as well.

Easy QoS: Low latency queueing = fair queue with a priority queue as you described.

tag real time traffic as priority queue and allocate enough bandwidth depending on your capacity engineering. tag your important apps and put them in the second queue. Rest in default class.

This is really all you need, I have seen VOIP for over 500 extensions hold up as that sites link is over 90% for an hour And this is Cisco callmanager i.e. the remote phones and gateways bork and go into fallback mode if the keepalives are lost.

Just need to remember it needs to be end to end and in both directions

Re:Traffic shaping works but fair-queue works bett (3, Interesting)

m.dillon (147925) | more than 6 years ago | (#23621709)

IMHO, Cisco has the best packet queueing mechanisms that I know of. I've been using their fair-queue stuff for years, and it has only gotten better with each iteration of IOS.

When I went from a T1 to a DSL line to save some money I immediately noticed the missing cisco. That little 2620 was so nice. PF couldn't hold a candle to what the 2620's fair-queue could do so I sat down and wrote a fair-queue implementation for PF (for DragonFly). It still isn't as good as what Cisco has, but it gets a lot closer then the other PF queuing mechanisms get.

I think the bit I'm missing is the batch classification. My fair-queue can still get overwhelmed by dozens of batch TCP connections if I happen to not be able to classify their traffic (and they wind up on the standard queue instead of the bulk queue). The set-up is a priority queue with minimum bandwidth guarantees plus a fair-queue at each priority level.

I keep hoping someone will take up the flag and finish it.

-Matt

Re:Traffic shaping works but fair-queue works bett (1)

wintermute000 (928348) | more than 6 years ago | (#23621859)

Yeah Cisco QoS is fantastic if configured properly. Work was nice enough to send two of us on the proper QoS course (straight out of the CCVP syllabus) so we got to see first hand how effective it is.

The config is actually pretty simple IMHO, its getting the correct understanding that is the hard bit. (why do Cisco insist on their stupid bucket analogy!!)

Why don't you put your dragonfly (BSD I assume) box IN FRONT of the 2620? i.e.

WAN --> modem --> dragonfly --> 2620 --> switch

Then you can do your QoS, NAT and all your internal routing on your faithful 2620 :) I hate wrestling with iptables commands but you could also do your routing / NAT on the dragonfly and only use the 2620 for Qos, its up to yu - heck you could even NAT twice if you want to be difficult LOL

Re:Traffic shaping works but fair-queue works bett (1)

Barny (103770) | more than 6 years ago | (#23621733)

Not sure about other clients but Azureus at least allows you to set a QoS designator on all outgoing packets, leaving a router a very easy job of scheduling.

At least one ISP here in AUS is looking at ways for customers to adjust their own shaping on the ISP end, so that you can get the perfect connection :)

Use randomized time rather than even spacing (5, Informative)

karl.auerbach (157250) | more than 5 years ago | (#23621363)

We long ago learned that when inserting time between protocol events that it is far better to use a time randomized between an upper and lower bound than to use a repeating interval.

When fixed repeating intervals are used, separate instances of a protocol (and other protocols that use repeating intervals) slowly tend to fall into lock-step patterns with pulsating waves of traffic in accord with those patterns.

In other words, fixed protocol timers can create the traffic equivalent of the Tacoma Narrows bridge.

By-the-way, ping (ICMP Echo request/reply) is a terrible way to measure network latency. ICMP is often a disfavored form of traffic as it crosses routers, sometimes even rate limited.

There are better tools for measuring link properties, for example there is "pchar" - http://www.kitchenlab.org/www/bmah/Software/pchar/

I worked on a method to do even better measurements, but I put it aside several years ago: Fast Path Characterization Protocol at http://www.cavebear.com/archive/fpcp/fpcp-sept-19-2000.html

Re:Use randomized time rather than even spacing (2, Interesting)

dissy (172727) | more than 6 years ago | (#23621463)

By-the-way, ping (ICMP Echo request/reply) is a terrible way to measure network latency. ICMP is often a disfavored form of traffic as it crosses routers, sometimes even rate limited.

There are better tools for measuring link properties, for example there is "pchar" - http://www.kitchenlab.org/www/bmah/Software/pchar/ [kitchenlab.org]
Ok, I've been out of network management for a couple years now, but I have never heard of pchar.
Looking at the URL you gave, there is nearly zero description about the software or how it works or how to use it.
In addition, i went ahead and downloaded the source hoping there might be some documentation giving a clue about this, and then i noticed:

As of pchar-1.5, this program is no longer under active development, and no further releases are planned.
So, to me it seems like you are saying ICMP, which is supported by literally every single device that speaks IP, is disfavored, and the current method is to use a program that has not been worked on for 3 years and never will be again.

Like i said, ive been out of network engineering for a few years, but i still have to question this method as 'better'

Re:Use randomized time rather than even spacing (1)

marxmarv (30295) | more than 6 years ago | (#23621677)

It's far from [freenix.fr] the only [sourceforge.net] TCP measurement tool [internet2.edu] . Besides, don't you think attacking ICANN's corporate land-grab from within is a better use of someone's time than spinning version numbers on a stable program that talks to a stable API?

Re:Use randomized time rather than even spacing (1)

testednegative (843833) | more than 6 years ago | (#23621651)

someone mod this guy up, interesting stuff!

mountains out of molehills? (1, Informative)

Eil (82413) | more than 6 years ago | (#23621471)

Wow, talk about solving a problem the hard way. Why not just use a bittorrent client which has rate limiting built-in? Which, by the way, is almost all of them? (I use rtorrent, an excellent command-line client.)

what about? (1)

thatskinnyguy (1129515) | more than 6 years ago | (#23621503)

What about the upstream being flooded with ACKs?

Layer7 traffic shaping (2, Informative)

Gothmolly (148874) | more than 6 years ago | (#23621513)

Except, wait for it, almost all p2p clients allow you to throttle your bandwidth anyway.

Re:Layer7 traffic shaping (1)

m.dillon (147925) | more than 6 years ago | (#23621551)

That only works to a point. If you have a single computer you can control the traffic quite well. But if your home network has more then a few computers, all doing different things, PLUS consumer devices such as Apple TV, TiVO, and many other internet-connected devices, the story changes. You will not have control over all the equipment and your only recourse will be active filtering with some sort of queueing mechanic.

Even a home with only computers under your control may not be entirely under your control. If you have a sibling he is not likely going to let you mess around with his downloads.

-Matt

Uplink vs Downlink (3, Informative)

m.dillon (147925) | more than 6 years ago | (#23621521)

It is always easier to manage uplink bandwidth from downlink bandwidth, simply by virtue of the fact that you control the actual packet queues.

Downlink bandwidth can be controlled in numerous ways. The easiest way is to actually run the incoming packets through a bandwidth limiter with a very large packet queuing capability. This will cause a ton of packets to build up in front of the limiter and eventually fill the TCP windows of the senders. The packets that get through the limiter will cause a stream of ACKs back from your machines at the desired data rate. The combination of the two will cause the remote senders to band-limit the packets they send to the bandwidth you desire.

when running incoming packets through a limiter you still need to traffic-shape/QOS, priority-queue, or priority-queue + fair-queue the packets going through the limiter. If you don't then your interactive traffic can wind up getting stuck in a packet queue with hundreds of packets in it. In addition to that you may have to control the advertised TCP window or even implement RED on your limiter to prevent the hundreds of packets built up in front of the limiter from turning into thousands of packets.

If you can classify the bulk traffic then you can use virtually any queueing mechanic. If you can't classify all of the bulk traffic then the only mechanic that will work reasonably well is, again, going to be a fair-queue.

Fair-queueing is not the holy grail but it is typically the most effective mechanism when combined with another queueing mechanic, such as a priority queue.

-Matt

Not "any P2P application" (1, Funny)

Anonymous Coward | more than 6 years ago | (#23621553)

BitTorrent does indeed cause noticeable slowdowns, but I use eMule all the time and I can even play games while downloading and uploading to hundreds of different peers.

Relevant article to me (1)

Cctoide (923843) | more than 6 years ago | (#23621619)

I've wondered about this before, and I have tried, as many are suggesting, using QoS before. However, on our Linksys WAG354G QoS doesn't seem to do anything at all (when, luckily, all the latency is caused by traffic coming through under three ports, otherwise there aren't enough text fields in the QoS dialog to fit more), and in fact the router just seems to lose the DSL connection and not reconnect after a while, although I'm not 100% sure that's caused by QoS.

So, basically, when I want to play online nobody can use BitTorrent or P2P at all on the LAN... or indeed when anybody wants to browse, as BitTorrent lag sometimes gets so bad Firefox will wait several minutes on a connection that is never established, forcing you to hit stop and then refresh. At lower speeds it just stops it from downloading stylesheets (for some reason FF considers them optional), which is nearly as annoying.

Ok, I'll bite... (1)

Marton (24416) | more than 6 years ago | (#23621793)

Technology for mortals?

"Incoming data from from multiple sources via the fast core of the Internet can sometimes clump closely together when multiple sources happen to transmit data around the same time."

More like technology for idiots.

It's simple. TCP/IP has a built-in backoff mechanism. It works wonderfully when two or three TCP (and other similar, more or less polite) streams compete for bandwidth. The mechanism is stream-based and not port-based, so when one app (one port) has 200-300 active streams, you're SoL no matter how polite those streams are. I guess one can approach the "BitTorrent corporation" with some crackpot idea about breaking TCP, but I wouldn't do it, unless you like to be laughed out of rooms.

What may work is a port-based backoff mechanism on top of the existing stream-based one, but no app vendor is going to be able to help you with that. Or get QoS configured on your router. Alternatively, just get your roommate to use BT traffic throttling. It's there for a reason.

Now can /. get back to actual nerd stuff?

Does George Ou have ANY credibility left? (2, Informative)

jamrock (863246) | more than 6 years ago | (#23621807)

Any whatsoever? His part in the Maynor/Ellch debacle was a serious low point for tech journalism; he makes Rob Enderle look good, fer chrissakes. Even if the article were in fact insightful and informative, the simple fact that his name is attached to it guarantees that I'm not going to read it. Someone please tell me what it says.

Re:Does George Ou have ANY credibility left? (1)

EllynGeek (824747) | more than 6 years ago | (#23621841)

It says he's still lacking in clues.

Step 1: TCP ACKs (1)

Piranhaa (672441) | more than 6 years ago | (#23621869)

Saturating your upstream (maxing your upload) means your downstream will suffer because you will be unable to send TCP ACKs as fast resulting in your internet to appear slower. Setting a worldwide limit on your entire outgoing traffics to just slightly below your maximum attainable upload will allow you to take advantage of giving maximum priority to your ACKs. Of course, on top of this one can also setup hierarchical queues for low bandwidth, high bandwidth and default queues (to keep it simple), but maxing your overall upload to just below your maximum attainable and giving priority to TCP ACKs are the best place to start...
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>