| · How
large should the TCP Receive Window be?
Receive Window should
be larger than bandwidth delay product (also known
as pipe capacity).
For example, for 170ms delay on a
768Kbps link, RWIN = 768000 bits/sec * 0.170 sec =
130560 bits = 16320 bytes.
Note that if either available bandwidth
or the delay is doubled, RWIN would double as well.
On LAN links the delay is very small. Therefore, a
small RWIN would be sufficient. However, effect of
insufficient RWIN size become particularly noticeable
on WAN links. Due to relatively small default RWIN
size (8KB) Windows 95, 98, NT 3.51 and NT 4.0 throughput
would suffer in above 768Kbps connection during file
transfer via FTP. Windows 2000 uses a more realistic
16KB default for RWIN. However, that too would need
to be increased depending on pipe capacity.
Well, that looks rather simple but
latency (delay) is actually not constant. It varies
from connection to connection and even during the
lifetime of one connection as some IP packets may
follow different routes and the heavy load on a router
in the path may cause extra latency.
Latency consists of two parts; Propagation
delay and transmission delay. Propagation delay becomes
significant for links established over satellites
and transmission latency becomes significant when
the packets must be forwarded over many routers. In
addition routers usually introduce more latency for
larger packets than smaller packets. Generally, heavy
traffic in the pipe also increases transmission delays.
To determine delay accurately we actually
need to measure downstream and upstream delays separately
because we receive large data packets on downstream
and generate much smaller ACK packets on upstream.
This measurement can be most effectively done on the
sender side. However, we can make an intelligent guess
on the receive side by using the PING tool to determine
the round trip time for big (maximum data packet sized)
packets.
Windows 95/98, Windows NT 3.51/4.0
and Windows 2000 comes with a command line tool called
"ping.exe". Open a command (DOS) window and enter
the following line:
ping -f -n 10 -l 1472 host_or_IP
Use (MTU - 28) as the parameter for
-l option (e.g. for ethernet use 1500-28 = 1472).
See Microsoft KB article Q159211 on using PING tool
to determine MTU (see More Information Section). Even
though the article is targeted to Windows NT, this
portion of the article is general enough to apply
all Windows OS and the concept is applicable to other
OS easily. In short, this parameter should be the
largest value that will NOT generate "Packet needs
to be fragmented but DF set." message.
Large packet delay measured using
ping tool is the worst case delay, so it sets the
upper bound for RWIN. Most certainly normal delay
will be smaller as ACK packets used in return path
will be much smaller and typically delayed less. We
may make a rough guess of typical delay by averaging
ping times of large (as above) and small (ACK sized)
packets. For ACK sized packets use 12 as -l parameter
as in:
ping -f -n 10 -l 12 host_or_IP
Example: A 608/128Kbps DSL link with
200ms for maximum sized and 100ms for small packet
delays:
RWIN(max) = 608000 * 0.200 = 121600
bits = 15200 bytes.
RWIN(typical) = 608000 * 0.150 = 91200 bits = 11400
bytes.
Then edit the registry file maching
your OS using a text editor such as Notepad and do
the following customizations:
Windows 95: Find the following line
and substitute RWIN for xxxxxxxx as 8 digit hexadecimal
number. You may use Windows Calculator (in scientific
mode) to convert decimal number to hexadecimal number.
Remember to prepend 0's to make value 8 digits long.
"DefaultRcvWindow"=dword:xxxxxxxx
Windows 98: Find the following line
and substitute RWIN for nnnn as a decimal number.
"DefaultRcvWindow"="nnnn"
Windows NT/Windows 2000: Find the
following line and substitute RWIN for xxxxxxxx as
8 digit hexadecimal number. You may use Windows Calculator
(in scientific mode) to convert decimal number to
hexadecimal number. Remember to prepend 0's to make
value 8 digits long.
"TcpWindowSize"=dword:xxxxxxxx
Back
to Top
|