LWN.net Logo

How to fix it

How to fix it

Posted Jul 14, 2008 17:39 UTC (Mon) by tetromino (subscriber, #33846)
In reply to: How to fix it by epa
Parent article: Study: Attacks on package managers

> Indeed, it is strange to even have mirror sites in this day and age when we have Bittorrent.

Well, *some* of us live in North America, and are forced to use an ISP that throttles p2p
protocols.


(Log in to post comments)

How to fix it

Posted Jul 14, 2008 19:32 UTC (Mon) by drag (subscriber, #31333) [Link]

Well.. encryption helps out with that.

Plus having legal uses for bittorrent is a good thing when it comes to complaining to your ISP
about it's behavior. 


How to fix it

Posted Jul 14, 2008 20:24 UTC (Mon) by tetromino (subscriber, #33846) [Link]

Encryption on its own doesn't help. Comcast's throttler checks for anything that looks like a
torrent user, even if all the packets are encrypted. The only thing I've found that really
works is SOCKS5-over-ssh to a server outside Comcast's network. I'm guessing their algorithm
says that "a user who opens an encrypted connection to only one other machine is OK".

How to fix it

Posted Jul 15, 2008 18:51 UTC (Tue) by drag (subscriber, #31333) [Link]

I know it sounds stupid, but are you sure that they are throttling bittorrent?

I seen that Comcast had a investigation on them and all that, but for most cases I think that
it's because of bad bandwidth management on the part of end users is what is causing most
'throttling'.

For example.. At my house I use Cox Cable for Internet. For a long long time I was able to run
bittorrent quite well, but after some changes they made I started running into big issues with
losing packets and huge increases in latency of my network connection. I was only able to get
a third or a forth of the speed of the downloads that I used to get, and this was after a
'network upgrade'. And upload speeds were very poor since other peers were getting
disconnected.

At first blush it seemed very obvious that this was due to some sort of throttling or network
performance shaping on the part of Cox. But in fact it wasn't.

----------------------------------

The deal is, if I understand it correctly, is that Bittorrent is a TCP oriented network
protocol. That is when you send a packet or at least initiate a data transfer you have to have
'ack' packets acknowledge the connection. TCP is connection-oriented protocol. 

Home-style network connections are hugely asymmetrical. The download speed vastly outperforms
the upload speeds.

So Bittorrent does upload and download simultanously. As these ISPs increase their download
speeds dramatically they do little to increase their upload speeds. 

So with BT the upload becomes a huge bottleneck since even if you rarely saturate the download
it's very very likely that you saturate the upload. 

And what happens then is you end up having this huge queue of uploaded packets. Among those
packets being stuck in router limbo are those TCP ack packets, and they don't make it back up
to their destination in time you start having disconnects and all sorts of nasty network
performance problems. 

I found that the controls offered by bittorrent clients were very inadequate. This is due to
the fact that there are probably multiple BT clients running at the same time as well as other
network traffic.

So the solution is to have quality assurance rules on your home's router. You can't control
what is being sent to you, but you can have control over the priority of packets leaving your
network. So you have to throttle the ports your using for bittorrent _yourself_ and then give
very high priority to ack packets. Usually your going to have to limit your BT traffic to
80-90% of maximum network bandwidth to get the best performance.

There is a 'wondershaper' set of scripts that can do this, but I found that a modified setup
of that designed for Shoreline firewall/router is the best.

Now my bittorrent downloads are at least 4-5 times as fast as they used to be and I have no
network latency problems.


--------------------------------


So I figure if your experiencing not only slow BT downloads, but huge increases in ping
latency and some limited packet loss then it's not your ISP's fault (except for the
excessively asymmetrical nature of their network). It's your's and your router needs to be
configured to do quality assurance. 

Of course if your ISP is actually doing throttling then none of this will help you. Hopefully
you can find another company to go through. 

How to fix it

Posted Jul 16, 2008 14:29 UTC (Wed) by epa (subscriber, #39769) [Link]

Makes you wonder why Bittorrent isn't built on top of UDP?

(Indeed, HTTP GET requests might as well have been be UDP instead of TCP... but that is a
discussion for another day.)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds