PDA

View Full Version : Why is my unscaled RWIN 256?



Dirk Munk
06-08-14, 02:27 PM
I ran the SG TCP/IP Analyzer and got these results:


SpeedGuide.net TCP Analyzer Results
Tested on: 2014.06.08 14:12
IP address: 94.212.xx.xx
Client OS/browser: Windows 7 (Firefox 29.0)

TCP options string: 020405b40103030801010402
MSS: 1460
MTU: 1500
TCP Window: 65536 (NOT multiple of MSS)
RWIN Scaling: 8 bits (2^8=256)
Unscaled RWIN : 256
Recommended RWINs: 64240, 128480, 256960, 513920, 1027840
BDP limit (200ms): 2621kbps (328KBytes/s)
BDP limit (500ms): 1049kbps (131KBytes/s)
MTU Discovery: ON
TTL: 51
Timestamps: OFF
SACKs: ON
IP ToS: 00000000 (0)


My download speed is 180Mbps, so I set GlobalMaxTcpWindowSize to 4111360 (1460 * 44 * 64). So why does my unscaled RWIN show up as 256, and how can I change it?

Philip
06-08-14, 10:26 PM
Window 7 uses an auto-tuning algorithm that detects "network conditions" and changes the RWIN value with every packet... That's why the Analyzer can only display the current advertised RWIN value. All you can do is adjust how aggressively the TCP Window is advertised, but we can't directly change RWIN to a fixed value with newest OSes.

KEiGHT
06-10-14, 09:29 AM
In other words, in windows 7 or 8 it's irrelevant to set TcpWindowSize and GlobalMaxTcpWindowSize
Am I right ?

Philip
06-10-14, 04:25 PM
Yes, generally.

There is one exception, if you set: netsh int tcp set global autotuninglevel=disabled
Then you can set the RWIN value manually, however, it limits it to 65535 (no RWIN scaling/TCP1323 options).

There is more info here: http://www.speedguide.net/articles/windows-7-vista-2008-tweaks-2574

KEiGHT
06-10-14, 04:54 PM
So , in this case , if my RWIN is 65320(autotuninglevel=disabled) , I must disable TCP1323 options ? this will decrease my throughput ?

Then can I set RWIN as I wish ?

example :

TcpWindowSize=522560
GlobalMaxTcpWindowSize=522560

setting auto-tune=disabled has awful impact in browsers , it will reduce the speed of download drastically !
I recommend autotuninglevel=highlyrestricted + Tcp1323Opts enabled instead for best throughput, because autotuninglevel=highlyrestricted use MSS multiple!

Philip
06-12-14, 12:11 AM
I use normal/aggressive autotuninglevel for larger RWIN values. Yes, there may be a little negative impact if it is not multiple of MSS, but only if the whole TCP Window is full, and is negligible compared to the positive effect of a larger TCP Window.

If you disable auto-tuning, Tcp1323Opts should have no impact, I believe it restricts RWIN to 65535. You only need/use Tcp1323Opts with larger RWIN values, there is no TCP scaling under 65535. I wouldn't recommend disabling auto tuning with broadband connections because of this restriction.

KEiGHT
06-12-14, 08:30 AM
Thanks for a full explanation ! :) I agree !

Dirk Munk
06-12-14, 09:45 AM
I wonder if all these MSS based RWIN calculations are correct.

First of all MSS is based on MTU, and MTU is by no means a fixed value. It is true that in many cases MTU will be 1500 byte (the maximum ethernet packet size), but it can also be slightly smaller, or much bigger (Jumbo frames). In all these cases RWIN will not be a multiple of MSS.

The original TCP specification had a maximum window size of 64KiB, and that is still the maximum. The RFC 1323 Opts setting multiplies the TCP window size by a power of 2. I think it is save to assume that you can not set the TCP window as soon as you enable the RFC 1323 Options, the TCP window size will be set at 64KiB. In other words, RWIN must be 64KiB * 2^n. So in my case (at the start of the thread) GlobalMaxTcpWindowSize should not be 4111360, but instead 4194304, or 400000 hex (64 * 64KiB).

KEiGHT
06-12-14, 02:32 PM
in Windows Vista/7/8 doesn't work anymore fixed RWIN through registry ! it will be ignored, I've tested all values, nothing happened !

from my researches, these are the BEST PRACTICE ;


netsh int ipv4 set subinterface "Local Area Connection" mtu=1500 store=persistent
netsh int ip set global taskoffload=enabled
netsh int tcp set global autotuninglevel=highlyrestricted
netsh int tcp set global congestionprovider=ctcp
netsh int tcp set global ecncapability=disabled
netsh int tcp set global chimney=automatic
netsh int tcp set heuristics wsh=disabled
netsh int tcp set global netdma=enabled
netsh int tcp set global dca=enabled
netsh int tcp set global rss=enabled
netsh int ip add dns "Local Area Connection" 208.67.222.222
netsh int ip add dns "Local Area Connection" 208.67.220.220 index=2

Philip
06-15-14, 10:47 AM
I wonder if all these MSS based RWIN calculations are correct.

First of all MSS is based on MTU, and MTU is by no means a fixed value. It is true that in many cases MTU will be 1500 byte (the maximum ethernet packet size), but it can also be slightly smaller, or much bigger (Jumbo frames). In all these cases RWIN will not be a multiple of MSS.

The original TCP specification had a maximum window size of 64KiB, and that is still the maximum. The RFC 1323 Opts setting multiplies the TCP window size by a power of 2. I think it is save to assume that you can not set the TCP window as soon as you enable the RFC 1323 Options, the TCP window size will be set at 64KiB. In other words, RWIN must be 64KiB * 2^n. So in my case (at the start of the thread) GlobalMaxTcpWindowSize should not be 4111360, but instead 4194304, or 400000 hex (64 * 64KiB).

Dirk,

First, MTU is generally 1500, the only common exception being PPPoE (additional headers limiting it to 1480, or 1494, depending on the OS). Jumbo frames are only relevant to Gigabit LANs, they're not common in broadband internet connections.
Second, in all Windows versions, the TCP/IP headers are exactly 40 bytes, so MTU-40=MSS.
Third, TCP 1323 Options scale your unscaled RWIN value by 2^n, not 64KiB by 2^n. I.e. 1460*44=64240 is the most common non-fragmented unscaled RWIN value. 64240 then scales to 128480, 256960, etc. while the unscaled RWIN remains 64240 (still MSS multiple).

Of course the MSS multiple is only important when the RWIN is completely full, i.e. in large file transfers over high latency networks.

Dirk Munk
06-26-14, 04:11 PM
The point is that you can not set the unscaled RWIN, and that is what I wrote. The maximum size for the unscaled RWIN is 64KiB, and with RFC 1323 Opts set, Windows will set the unscaled RWIN to 64KiB, and that makes sense. Look at the first entry of this thread, RWIN is set at 64KiB, and I did not do that.

Philip
06-26-14, 06:09 PM
You are correct, for Windows 7.

For older OSes, we had the ability to tune the unscaled RWIN to a large value under 64KiB, multiple of MSS as well. This was helpful with nodes that did not support Tcp1323 scaling.