PDA

View Full Version : TCP Window Scaling: Increase your download speed (Over high latency networks)



SBcheater
19.09.09, 21:08
Sometimes you hop on an older torrent, with less seeds or something strange is happening and it seems like it will take forever to download that movie you want to watch NOW. Sometimes the problem isn't that the seeders don't have fast connections, but the latency (ping) to those seeds is abnormally high.

I came up with a simple solution to this problem and would like to share it with my sb-innovation mates

NOTE:

This Guide is for Windows XP and below ONLY. This guide will provide absolutely no benefit for Vista, Mac or Linux users (if you use linux you should know this already). If you have Vista DO NOT DO THIS.


Lets start working but first you will have to learn something first.

First, a little discussion about what actually happens in network connections, and what 'speed' and 'bandwidth' really is. Bandwidth is made up of two components, latency and throughput. Latency is how long it takes for a message to get from one place to the other. Throughput is how much data you can send in one message.

TCP (the protocol that bittorrent uses) has quality of service guarantees that have trade offs. 1) You are going to get all of the data across the network. 2) It will be in order. To do this TCP has to have a number of messages going both directions (this is why you have to cap your upload at 80-85% of your upload limit).

Networks function much like the post office. You put a letter in the mail and send it off with an address on it. TCP adds the following check, whenever the person you are sending a letter to receives a letter they give you a phone call. When you receive the phone call you can put another letter in the mailbox. Now, lets imagine you want to send an entire encyclopedia set to one of your friends. This encyclopedia set consists of 32 HUGE books. You can't put an entire encyclopedia in a regular letter at once, so you have to tear the pages out and put them in the small envelopes a few at a time. You can't send the entire set of encyclopedia's all at once either. You can only send one letter at a time, and wait till they call you and tell you they got it. As you can imagine, this would take a while to send the entire encyclopedia set to your friend.

Basically, this is the way Windows XP and below handles networking. One letter at a time. Wouldn't it be better to send an entire book at once? Or all of the books at once? This is what TCP Window Scaling does. It allows you to send the entire book at once, or a book shelf... or the entire house. Vista, Mac and Linux do this automatically. Windows XP doesn't.

Once again. This will help Windows XP users ONLY.

Step 1: Download DrTCP from dslreports.com
DrTCP windows tcp tuning and tweaking - dslreports.com (http://www.dslreports.com/drtcp)

Step 2: Check the tweak tool at dslreports.com
Tweaking for speed - dslreports.com (http://www.dslreports.com/tweaks)

Step 3: Use correct values as inputs to DrTCP.
"Correct Values" varies wildly. I am not going to recreate something that is already avalible online, and potentially of higher quality than I can create.
Go here: DRTCP: How do I use it and what are all these settings? Tweaking FAQ - dslreports.com (http://www.dslreports.com/faq/578)

Things to note. This will not fix 'everything'. Sometimes your download speeds will still be slow, but if your peers are far away then this should improve your download speeds. I see it everyday in my torrents list. I have a fairly high ping to everyone else in the world. I can upload at a consistent 200+ KB/s (yes kilobytes/second) to correctly configured hosts around the world (or linux/mac/vista users). Hosts with default configuration will receive much lower speeds (30-40KB/s).




!!!Please give me feedback on this implementation !!!

anon
19.09.09, 21:20
Awesome post, rep added! :top:

As an extra tip, please it's not advisable to set your TCP window size very high:

"I've most often seen [poor performance] with people running on Windows who 'tweak' their TCP send and receive buffers to be very large in search of higher bandwidth. Buffered data is obsolete data and causes serious problems in the responsiveness of the protocol to changes in the peer state. Since data and requests share the same TCP socket, buffering lots of data means that your request for a block may have to wait 10's of seconds before it even gets transmitted, by which time the peer you are talking to may have decided that you aren't interested in his data after all, or your own client may decide that the peer you are talking to is snubbing you. Either of these is disastrous to download rates."

Increase download speed - AzureusWiki (http://azureuswiki.com/index.php?title=Increase_download_speed#A_tip_for_ RcvWin.2FTcpWindowSize_tweakers)

I have observed an 10-20kB/s increase in BitTorrent download speed after reducing my window size from 256960 to 32767. You can do this with the program "TCP Optimizer".

SBcheater
19.09.09, 21:54
I have observed an 10-20kB/s increase in BitTorrent download speed after reducing my window size from 256960 to 32767. You can do this with the program "TCP Optimizer".

Thats a fairly noticeable increment I will soon give a try to TCP Optimizer