TCP Receive Window Size and Window Scaling

Started by Lazybones, July 23, 2011, 03:27:45 PM

Previous topic - Next topic

Lazybones

http://msdn.microsoft.com/en-us/library/ms819736.aspx

So I got smacked by this in a big way with a major project underway... In the recent past this was only an issue for very large companies with long high bandwidth links or telcos.

But now that broadband connections regularly are over 1.5 Mbit (including up-link) this is something you should know about.

Also this very much explains several things that in the past did not make much sense to me:
1. Why do multi part down-loaders work so well?
- I used to think it was bandwidth limits per link placed on the server
- Turns out it is probably just TCP windowing and latency higher than about 50ms to the server

2. Why are P2P networks moving to UDP or uTP for transfers
- I used to think it was just for avoiding filtering since it is much harder to track UDP
- Turns out that P2P is nearly always HIGH latency, thus these using UDP or uTP avoids the TCP window problem

3. Why are network transfers using windows shares over a WAN sometimes fast sometimes slow?
- I used to just chalk this up to OS compatibly since Vista and later offer new transfer methods.
- It is likely just as much to do with the fact that Windows can use TCP and OR UDP for these transfers and there is little documentation that I have found as to why.

4. Why people want low ping in gaming.
- Thought it was just a matter of time of action to response
- It is also a sever limit on the amount of data that can be transfered

So should you mess with your TCP window size if you have a very fast connection?
Pro:
- If your link is over 1.5Mbit and you do a lot of single session transfers it could make a huge difference
- if your up-link is over 1-2Mbit it could also drastically improve performance.

Con:
- Setting it wrong can make things slower
- Some home routers and firewalls do not support scaling over the original TCP spec and will not like the change causing poor performance.

Don't want to mess with the registry?
SG TCP Optimizer

Tom

Good tips.

I used to have to manually tweak the window and buffer parameters, but since a year ago or so, linux auto calibrates it based on the network conditions. It may not be 100% optimal, but its a lot better than the old defaults.
<Zapata Prime> I smell Stanley... And he smells good!!!

Lazybones

Quote from: Tom on July 23, 2011, 07:31:18 PM
Good tips.

I used to have to manually tweak the window and buffer parameters, but since a year ago or so, linux auto calibrates it based on the network conditions. It may not be 100% optimal, but its a lot better than the old defaults.

Windows XP, Vista, & etc do as well, however they do not always detect the optimal value.

Tom

Quote from: Lazybones on July 23, 2011, 07:35:26 PM
Quote from: Tom on July 23, 2011, 07:31:18 PM
Good tips.

I used to have to manually tweak the window and buffer parameters, but since a year ago or so, linux auto calibrates it based on the network conditions. It may not be 100% optimal, but its a lot better than the old defaults.

Windows XP, Vista, & etc do as well, however they do not always detect the optimal value.
Yeah, it can be hard to get right.

Luckily, for my uses, linux's auto detection has been decent. I used to have to tweak all kinds of parameters to get anywhere near max GbE speeds. Now I don't have to touch a thing, and I get 90MB/s+.

As for the internet, I still have to tweak the buffering stuff, to cut down on latency. AQM isn't something the kernel does yet, at least not by default.
<Zapata Prime> I smell Stanley... And he smells good!!!