I made a mistake in my original post. The Android phone advertises its Window Scaling factor to be WS=256 not the actual window size. Essentially, the window scaling simply extends the 16-bit TCP Window size. Since the size of the Window field in the TCP header is 16 bits then the max value of the window is limited to 65535. The scaling factor is used to increase the Window size to values above 65535.
So the hard limit of the Window size is the Max window size ( max value of 16 bit=65535) multiplied by the scaling factor.
The Window size is also dependent on the delay between the client and the server. Let's assume both the client and the server advertise the maximum window size of 65,535 bytes ( max value of a 16-bit). But if the link between the two is 20 Mega bits per second and the delay is 40 millisecond, then, the amount of data that can be in flight is (20,000,000*delay)/8 = 100k Bytes. So, the window is 100,000 bytes but the max value of the 16 bit window field is 65535, then, in this case the scaling factor can be used to increase the window size to 100 KB.
It should be noted the window size can be dynamically adjusted by modifying the value of the window field in the TCP header but the scaling factor remains constant.
1 of 1 people found this helpful
By default WICED uses 7 Kb window size as specified WICED_DEFAULT_TCP_WINDOW_SIZE in 43xxx_Wi-Fi/include/wiced_defaults.h.
Based on your host (assuming STM32F412), you can change the WS by using GLOBAL_DEFINES += WICED_TCP_WINDOW_SIZE=131072 in your application makefile.