View Single Post
Old 30-12-2006, 15:14   #10
r00t
Inactive
 
Join Date: Nov 2006
Location: In your base =)
Services: Your pseudo 'tech' ego.
Posts: 1,062
r00t has reached the bronze age
r00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze ager00t has reached the bronze age
Re: upload speed with utorrent

Something I did for members of another forum awhile back.
Hope you find this useful.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



The effect of your speed is determined greatly on how well behaved your client is in the swarm.

That is you want to not be snubbed and reciprocate those who send to you. This is why adding to max_uploads will be the most dramatic thing you can do to increase your download speeds.

However, if you overdo it, clients will start snubbing you as you saturate your uploads (because you cant send pieces back fast enough). To determine your max_uploads take your max_upload speed and divide it by 5 (some say 10, you could do 3). Play with this and after you do a few torrents get a good idea what works for you.

Lets look at this another way:

Limit your upload speed

The upload speed affects the download speed in essentially two ways:
Bittorrent peers tend to favour those other peers that upload to them. This means that if A and B are leeching the same torrent and A is sending data to B at high speed then B will try to reciprocate. So due to this effect high upload speeds lead to high download speeds.

Due to the way TCP works, when A is downloading something from B it has to keep telling B that it received the data sent to him. (These are called acknowledgements - ACKs -, a sort of "got it!" messages). If A fails to do this then B will stop sending data and wait. If A is uploading at full speed there may be no bandwidth left for the ACKs and they will be delayed.
So due to this effect excessively high upload speeds lead to low download speeds.
The full effect is a combination of the two. The upload should be kept as high as possible while allowing the ACKs to get through without delay. A good thumb rule is keeping the upload at about 80% of the theoretical upload speed. You will have to fine tune yours to find out what works best for you. (Remember that keeping the upload high has the additional benefit of helping with your ratio.)


If you are running more than one instance of a client it is the overall upload speed that you must take into account. Some clients (e.g. Azureus) limit global upload speed, others (e.g. Shad0w's) do it on a per torrent basis. Know your client. The same applies if you are using your connection for anything else (e.g. browsing or ftp), always think of the overall upload speed.


This is also the reason using the plain clients over the newer ones works better. That is to say, there is no real formula set for what pieces should be requested. Also keep in mind the speed of your computer and how much memory and CPU it has to dedicate to your client. As you can imagine your client is very busy, all the time (watch a debug log to get an idea). If it is lagging because of computer problem it will amplify your problems in the swarm.
(Resisting temptation to pass remarks about Java and Azureus here).

The other significant part about your client is the ability of other clients to connect to it. If another client cannot connect to you it must request the piece and wait for you to send it.
Given a choice it will want pieces it can get, rather then pieces it has to wait on. For this reason you should open ports directly back to your PC. How you do this depends greatly on how your network is setup (NAT/PAT) and if you can control it.


Limit the number of simultaneous connections

Some operating systems (like Windows 9x) do not deal well with a large number of connections, and may even crash. Also some home routers (particularly when running NAT and/or firewall with stateful inspection services) tend to become slow or crash when having to deal with too many connections. There are no fixed values for this, you may try 60 or 100 and experiment with the value. Note that these numbers are additive, if you have two instances of a client running the numbers add up.


Limit the number of simultaneous uploads

Isn't this the same as above? No. Connections limit the number of peers your client is talking to and/or downloading from. Uploads limit the number of peers your client is actually uploading to. The ideal number is typically much lower than the number of connections, and highly dependent on your (physical) connection.


Default Bittorrent ports:

The first signs of shaping/throttling was undertaken mid 2004, via port control.

Anatomy of a torrent session...
GET /announce.php?info_hash=c%97%91%C5jG%951%BE%C7M%F9% BFa%03%F2%2C%ED%EE%0F&

peer_id=S588-----gqQ8TqDeqaY&port=6882&uploaded=0&downloaded=0&left =753690875 &event=started

As you can see port=6882, this is why most sign up trackers have blacklisted the default Bittorrent ports. (a range within the region 49152 through 65535 is preferable, cf.IANA). Notice that some clients, like Azureus 2.0.7.0 or higher, use a single port for all torrents, while most others use one port per open torrent. The size of the range you choose should be typically less than 10 ports wide.

There is no benefit whatsoever in choosing a wide range, and there are possible security implications.

ISPes are now wise to this and have 'tried' other methods; such as " header inspection".
More and more ISP’s are limiting throttling BitTorrent traffic on their networks. By throttling BitTorrent traffic the speed of BitTorrent downloads decrease, and high speed downloads are out of the question.

The list of ISP’s that limit BitTorrent traffic, or plan to do so is growing every day, and according to the BBC, the ‘bandwidth war’ has begun.

Are you not sure if your traffic is being throttled?

Check the list of bad ISP’s.

But there is a solution. Encrypting your torrents will prevent throttling ISP’s from shaping your traffic. I will explain how to enable encryption in Azureus, µtorrent, and Bitcomet, the three most popular torrent clients.


What does encryption Do?

The RC4 encryption obfuscates not only the header but the entire stream. This means that it’s very hard for your ISP to detect that the traffic you are generating comes from BitTorrent.

Note that RC4 uses more CPU time than the plain encryption or no encryption. It is however harder to identify for traffic shaping devices

How can I do this?

This is different for all clients; check the setting for your favorite client below.

Azureus

1.

Go to: Tools > Options > Connection > Transport Encryption
2.

Check the ‘require encrypted transport’ box.
3.

Choose RC4 in the ‘minimum encryption’ dropdown box

note that RC4 uses more CPU time than the plain encryption or no encryption. It is however harder to identify for traffic shaping devices

4.

You can choose to tick the ‘Allow non-encrypted outgoing connections if encrypted connection attempt fails’ box. This will ensure compatibility with clients that are not using encryption. However, it makes it easier for your ISP to detect BitTorrent traffic. I recommend that you try to tick this box first. If you are still not getting proper speeds untick it.

5.

Tick the ‘Allow non-encrypted incoming connections’ box.

Bitcomet

1.

Go to: Options > Preferences > Advanced > Connection
2.

Go to: ‘Protocol encryption’ You can choose between ‘auto detect’ and ‘always’. Auto detect will give you more connections but offers less protection against traffic shapers.
I would recommend to try auto detect first, if that doesn’t increase your speeds you need to switch to always.

µTorrent


1.

Go to: Options > Preferences > Bittorrent
2.

Go to ‘Protocol encryption’, you can choose between ‘enabled’ and ‘forced’. ‘Enabled’ will give you more connections but offers less protection against traffic shapers.
I would recommend to try ‘enabled’ first, if that doesn’t increase your speeds you need to swich to ‘forced’.

3.

Ticking ‘Allow legacy incoming connections’ allows non ecrypted clients to connect to you. This improves compatibility between clients but makes you more vulnerable to traffic shapers.
I would recommend to tick this box, but if that doesn’t increase your speeds, untick it!
That’s it, your Bittorrent traffic is encrypted now.

Make yourself connectable

If you are firewalled or NATed and cannot accept incoming connections.

This means that other peers in the swarm will be unable to connect to you, only you to them.

Even worse, if two peers are both in this state they will not be able to connect at all. This has obviously a detrimental effect on the overall speed.
The way to solve the problem involves opening the ports used for incoming connections (the same range you defined in your client) on the firewall and/or configuring your NAT server to use a basic form of NAT for that range instead of NAPT (the actual process differs widely between different router models and so is out of this FAQ's scope. Check your router documentation and/or support forum. You will also find lots of information on the subject at PortForward).


Just give it some time

As explained above peers favour other peers that upload to them. When you start leeching a new torrent you have nothing to offer to other peers and they will tend to ignore you. This makes the starts slow, in particular if, by change, the peers you are connected to include few or no seeders. The download speed should increase as soon as you have some pieces to share.
r00t is offline   Reply With Quote