Torrent Woes

FrgMstr

Just Plain Mean
Staff member
2FA
Joined
May 18, 1997
Messages
58,690
The worst thing about pirating tons of free movies, TV shows, and music….er I mean downloading open source content like Linux distributions, is the fact that torrents have a tendency to hose your friggin connection when it comes to doing much else with it that is the slightest bit latency sensitive. Like gaming maybe? But the goombas that built this blog page (that looks more like a site advertising a couple of ambulance chasing lawyers) have some interesting insight to what the actual cause is and how at least part of it could be fixed.
After running these tests, I am beginning to conclude that it isn't so much the amount of data that causes excessive latency; it's the uniformity of data transmission. If the transmissions are spaced evenly, other packets from other applications can slip in between the packets rather than getting stuck behind multiple packets in the transmit queue. So would it be possible to engineer BitTorrent to transmit data uniformly and what would be the effect? I came up with the following chart to illustrate what this could mean for peaceful coexistence between VoIP/Gaming and BitTorrent/P2P.
 
these jokers need to try QoS

and my problem is usually too many connections for the networking equipment (even the ones outside of my control)
 
In my experience if the performance is horrible its the router or ISP
If its moderate your are normal
if you are still fast and happy, you probably have QOS.
 
Using a WRT54GL with DD-WRT and QoS enabled, you can just create profiles for all your games to run in Priority Mode or just reduce Torrent traffic to the lowest priority setting and your all set. I can play BF2 and suffer no increase in lag. Hell I play on drunken masters server with ping ranging from 50ms to 80ms. You can even go so far as to lower the priority on all other ports on the router, so when both my sisters are browsing YouTube on different rigs my ping doesn't suffer.
 
lulzwut..

DD-WRT
- max ports 4096 enabled
- TCP/UDP timeout 300 sec
- operating @ 240 MHz

Then on the torrent machine set up max connections and bandwidth limiting to 80% of your upload and however much download is necessary for the session. Also set a schedule so everything changes depending on what hour of the day it is.. like have it at full speed while you're at work/sleep and have limited speed while you're home web browsing or gaming.
 
How did this make the news, srsly. All the above posts are the proper way to deal with this problem, not trying to re-engineer the protocol.
 
well, YEARS ago, there was a program called CFoSSpeed, and before that, netlimiter.

and, oh look , both app's are still around. in fact, CFoS's whole product line is client-side QoS apps just to handle latency and application traffic, running p2p and games/voip simultaneously. it won't stop or slow down a connection that's receiving too much data from an external source, but for sharing the net or doing things while downloading, it's perfect.

obviously if your router can do decent QoS, use that instead, or invest some HW running pfSense to share the network, or a linux firewall/router instead, etc.
 
There's also something in XP and Vista called the TCP/IP Security Limit that gets triggered by Bit Torrent. Normally, your PC makes 50 outgoing connections at a time, but when this limit is triggered (by a Virus, or Bit Torrent), Windows scales it back to 10, leading to a queue as things wait to get out. So while Bit Torrent keeps chugging along fine, web browsing and other things slow to a crawl.

This happened to me under XP and I located the fix and it was smooth sailing from there. I work at an Internet Help Desk and come across this same problem quite often with customers. I tell them about the problem but leave it up to them to fix it or just close down bit torrent while they're trying to accomplish other tasks.

And yes, the Linksys WRT-54G routers have that problem with the connection timeouts being too long. Lowering the timeout to something less ridiculous also helps.
 
Like many have said, QoS is helpful. My DGL-4300 has a number of QoS related settings that can make all of your traffic play nice.
 
Ok, since everyone here is apparently smarter than me, exactly how is QOS on your router going to get the ISP's DSLAM to send those packets it's holding back?

QOS only helps you within your network. It doens't do shit if the problem is with your ISP, unless your ISP implements QOS. Of course, if you've been in any of the net neutrality postings on [H], you know that many actually oppose QOS, because they think that's discrimination :rolleyes:
 
Packet queuing (don't confuse this with QoS) is similar to what is being described but with out special timing or modification of the packet. I do this a lot myself and sure your ISP may not help the situation but prioritizing the traffic before it leaves your network should help things upstream as well.

Now as for ISPs doing QoS, I really don't think any one has complained to much about that. How ever an ISP that decides to outright kill off connections is an entirely different situation, and so is "tiered" access level packages. Net Neutrality isn't about ISPs doing QoS at all, but about charging extra for special privileges to certain services or privileges and discrimination against specific traffic. The problem is what can ISPs trust in the traffic to determine if it should have a higher priority then others with out invading privacy? What can they look for in the IP header or TCP header that would allow it to determine if it really should have a higher priority and not just some one patching their gateway to flag the high priority bit?
 
Xipher, I would have thought the same thing with respect to ISP QoS, but I promise you a few weeks ago there was some talk back thread where it came up, and there were several posters who said just that.

I think that ISP's have to have to prioritize packets. I love Torrents, and I use it a lot, but I also think that the packets deserve very low priority (not to be confused with packet resets) compared to other traffic. Video, Audio/IP Phone service are more important. Web browsing is too (because that's what most people use their service for), but not as high as the others.

I'm not all that knowledgeable about IP headers, nor am I a security expert, but off the top of my head, I'd say they'd have to use some sort of a cert using encrypted public/private key. That, I suspect, would allow the ISP to validate the traffic was generated by a recognized higher priority packet.
 
Ok, since everyone here is apparently smarter than me, exactly how is QOS on your router going to get the ISP's DSLAM to send those packets it's holding back?

QOS only helps you within your network. It doens't do shit if the problem is with your ISP, unless your ISP implements QOS. Of course, if you've been in any of the net neutrality postings on [H], you know that many actually oppose QOS, because they think that's discrimination :rolleyes:

Exactly. Also, the sheer number of connections that P2P uses often overwhelms most routers, especially the beloved WRT's.
 
QoS will definitely make a big difference for home connections... I used to use DGL4300 and now just use shorewall/tc.... and the more fine tuning you do the better results you might get... but IMO this is just a bandaid.... the real solution is just increase bandwidth everywhere. If 1500 byte packets take too long to send.... don't make the packet smaller, just increase the bandwidth to send them faster.

IMO all schedulers have this problem of trying to fix impossible problems... Linux kernel has many scheduelers you get to pick for I/O or CPU time.... for I/O... I've lost faith with both Anticipatory and Deadline... CFQ is just so simple and just works. If you're I/O limited or Bandwidth limited or CPU limited even the most impressive schedueler will not overcome a hardware limitation. Considering that software is begging to lag behind hardware less time should be put into optimizing hardware. Less than a year we'll have 8 core CPUs.... why waste time tryign to figure out which process to put on the cpu first when we can just put 8 on at the same time... or with I/O... why waste time tryign to figure out which goes first when soon we'll SSDs are going to be doing random reads insanely fast... why waste time trying to micromanage a 56KB/sec uplink when we need to be laying out fiber to the house.

I'm not saying go for no logic FIFO but lets not try to do the impossible... if your bandwidth limited that's it... no software will fix this.

I first got my DGL-4300 for QoS and i had 25KB/sec up I think? Then I had 50KB/sec... and it still was nice... now its 250KB/sec and has much less an impact. If it was 8mbits up it'd be almost trivial.

Also you can semi-limit latency from your isp by delaying acks and not letting your download link be saturated... if I let bittorrent go without limits it'll fill 2MB/sec down and affect phone and web access... if I limit it to 1.5MB/sec it resolves all issues basically.
 
There's also something in XP and Vista called the TCP/IP Security Limit that gets triggered by Bit Torrent. Normally, your PC makes 50 outgoing connections at a time, but when this limit is triggered (by a Virus, or Bit Torrent), Windows scales it back to 10, leading to a queue as things wait to get out. So while Bit Torrent keeps chugging along fine, web browsing and other things slow to a crawl.

This happened to me under XP and I located the fix and it was smooth sailing from there. I work at an Internet Help Desk and come across this same problem quite often with customers. I tell them about the problem but leave it up to them to fix it or just close down bit torrent while they're trying to accomplish other tasks.

And yes, the Linksys WRT-54G routers have that problem with the connection timeouts being too long. Lowering the timeout to something less ridiculous also helps.

This is true, but you seem to have mangled a bit of that. If you've hit the problem (you probably have TONS of times) you'll see in your event view (in control panel -> administrative tools) in "system" it comes up as a warning and is known as Event Id 4226 (source will show as TCPIP). Here is how Microsoft defines it.

Mentioning this on other forums in the past, some people have argued with me after pointing this out but for example right now I'm sitting here at my parent's and this computer doesn't even have bit torrent installed on it and I just got the event today. Doing things like restoring a session of say 10 tabs in Firefox can cause this and it does slow down things like that.

How? So it limits "half open connections".. this means basically when you request to connect to something to a server (website, a seeder on a torrent) but the server hasn't responded this is considered a half open connection. You are allowed 10 of these in windows XP past SP2 and it various in Vista its 25 (unless you have home basic.. its 2 (!) in that). Before SP2 the limit was 65,535 (no limit). Server editions of windows do not have this limit and so far as I can tell most Linux distributions don't have a limit either (or if it is, its something like 1,024). Consider the fact that when you visit one website there is more than just 1 "request" for information. For instance on hardocp each banner has its own separate connect as they connect to a different server, the ad agency which is providing it. Then its even worse if you do any sort of "faster fox" or similar speed enhancements to Firefox. This is different than established connections that have data already going through them. So you can kinda see how this especially hits bit torrent the worst, but can slow your net connection ALOT in situations like opening up 20 tabs at once in Firefox, or session restore.

Whats the fix? :)
For Vista, this is a bitch of sorts... especially if you have the 64 bit version of vista as this version (until recently you'd have to, during every boot, hit f8 and select to do without it) it forces all drivers installed to be signed. It took me all sorts of searching before I finally found the solution for Vista SP1 and it seems both 32 and 64 have fixes that increase the number.
http://www.yaronmaor.net/repair.htm - Has downloads.
http://www.mydigitallife.info/2008/...vista-sp1-v668-to-patch-tcpipsys-60600117052/ - Has instructions and a download
I can confirm both are basically the same download, but yaronmaor is the source and seems more up to date.

Windows XP has a much easier and streamlined version of this TCPIP patch, its been available for awhile here: http://www.lvllord.de/ (look in downloads). This use to get detect by NOD32 (not sure about others) as a virus because it could potentially allow a worm to spread faster.
EDIT:You can tell some are clearly mislabeling it here: http://www.virustotal.com/analisis/aef0020fc2a3ea2c0a68d14cbd9b1d2b (take a look at Ewido and AVG). Its not a virus, more here: http://www.wilderssecurity.com/showthread.php?t=110122. If you don't like that it could enable a worm to spread faster, that's the downside of this. As a side note I'd recommend a value of 100-500 if you want to set it beyond the defaults those patchers set. Really you'll be limited to 4096 anyway if you have a basic router (paid less than $200) and its probably less if you don't have some sort of 3rd party firmware on it (dd-wrt, tomato.

More information about this can be found at:
http://torrentfreak.com/optimize-vista-for-bittorrent-emule-p2ptv/
http://blog.davidkaspar.com/archives/2005/04/windows-xp-sp2-and-event-id-4226.php
http://en.wikipedia.org/wiki/Half-open_connection
 
Yea I didn't feel like proof reading that long post much, I figured there was an edit button (edit in there was done while I was writing so i didn't have to rewrite it all ;p). Anyway should be "when you request to connect to a computer such as a website or a seeder on a torrent but it hasn't responded".
 
The majorety of the latency issues comes from having a saturated upload since most trackers will quite happily guzzle what limited upload people have. If you cap the upload to about 70% of what your line can handle and do the same for download, gaming is perfectly possible. Having a good router which can route large queues of packets quickly also helps.
 
QoS will definitely make a big difference for home connections... I used to use DGL4300 and now just use shorewall/tc.... and the more fine tuning you do the better results you might get... but IMO this is just a bandaid.... the real solution is just increase bandwidth everywhere. If 1500 byte packets take too long to send.... don't make the packet smaller, just increase the bandwidth to send them faster.

Increasing bandwidth will not fix the problem. Japan has huge pipes, and it too is overwhelmed by torrents.

I'm not saying go for no logic FIFO but lets not try to do the impossible... if your bandwidth limited that's it... no software will fix this.

Again, that wasn't what the article was really about. The most important part of the article dealt with the fact that even if you don't upload very much (George used 10KB/s on a pipe that could handle around 50kbs, give or take) you still got signifiant lag spikes. The only thing that changed was the frequency of the spikes.

That problem is caused by the ISP, not the user, and having greater bandwidth will not solve it.
 
BLAH

"Increasing bandwidth will not fix the problem. Japan has huge pipes, and it too is overwhelmed by torrents."

The article seems to come up with idea that 1500byte packets are a problem and program should send smaller packets to decrease the time they take to send... I say this is retarded... either you cut the packet in half the time it takes to send in half... or you just send it twice as fast to cut the time it takes in half.

All the rest of the article is dealing with FIFO buffer problems... the explanation for his data is that basically with large number of connections the stream of data is not even and you get bursts taht fill FIFO buffers creating large delays for VoIP packets... thats good and all but then the solution is given as simply sending smaller packets at regular intervals... which makes no sense.... look up how TCP connection works... plus add to the fact that this doesn't even solve issue... FIFO buffers will still get filled... only with twice as many small packets... problem isn't fixed at all.

The way you solve FIFO buffer issues is SQ/SFQ where each connection has its own queue and is serviced round robin... this means the max delay will be (NumberOfConnections)*(1500bytes)/(LinkBandwidth).

And the comment on net neutrality is not supported by the data he provides.
 
bexamous, I'd suggest you leave your comment in the comments section of Ou's site. I'd be ineterested to see the discussion. For the most part, he seems to respond to most.
 
Back
Top