Before being able to explain MTU and RWIN, it helps if we have a
basic understanding of how data is transmitted.
Networks use certain protocols
to send and receive data - TCP (Transmission
Control Protocol) is
one of the core protocols in the Internet suite as it provides a means
of reliably sending data between two connections. How its able
to guarantee a reliable connection is through its use of acknowledgements
(ACK) from the receiving system.
sends you data, this is broken up into small packets, the host will
send a packet of data which then requires an acknowledgement
from the receiving system. Once the sender has received an ACK,
it will continue to send the next packet of data.
If for any reason an ACK is not received, the host will wait for a
short period of time before trying to retransmit. This constant "chatter"
of stop-start between the 2 connections ensures that all packets are
received in the correct order.
Maximum Transmission Unit
The MTU is the maximum amount of data (packet size) that can be transmitted
in one go before it has to be cut up into smaller chunks. Each
network has a maximum limit of data size it can cope with before data
is fragmented into smaller packets. This figure may vary from network
TCP Receive Window
RWIN is the amount of received data that you can accept (buffer)
without having to send an acknowledgement to the remote host. With TCP it's
the stop start action whilst waiting for an ACK during the
sending/receiving of data that can slow things down. Now since
the default RWIN is often too small for higher speed broadband connections,
you can increase the size of your RWIN thereby allowing more data to
be transferred at once, in turn reducing the pauses and thus speeding
up your connection.
Maximum Segment Size
MSS is the maximum size of useful data that can traverse the network
before it has to be fragmented. Data Packets also have to include something
called headers which is a small amount of additional data that include
instructions such as where the data is being sent to. TCP and IP headers
increase the packet size by 40 bytes. Therefore MSS = MTU - 40
it helps think of these headers as being the brown paper or envelope
on which you write the address if you are sending a parcel by post.
Hopefully by this stage you will see where this is heading.. in other words
you may be thinking hey... I know I'll increase all by settings to
make them bigger. Unfortunately, its not quite so simple, as has already
been said each network on the internet may have a different MTU and
therefore if you increase things too much it will have an adverse effect
and slow things down.
Working out your maximum MTU
The best way of finding out
your optimum MTU is by pinging your ISP with packets of data to see
what size you can send without the data being fragmented.
The ping command (for windows users) you need to use is:
ping -f -l [packet size] [www.bbc.co.uk]
where [packet size] is the size of the packet.
For Mac OS X and Linux the required command is
$ ping -D -s 1472 www.bbc.co.uk
Start at say 1472, and work your
way down until you get a responsive ping from the highest number you
More information about the PING command
"Packet needs to be fragmented but DF not set" indicates that
the packet size is too large.
In the example above it shows that my highest responsive ping is 1402.
From this we need to add on 28 to get the
maximum MTU figure.
(28 being the header size for IP + ICMP)
Do not go above 1472. (1472 + 28 = 1500 MTU) since 1500 is the maximum MTU.
Working out your RWIN
You calculate your RWIN using the following formula:
RWIN = n * (MTU - 40)
where n is a whole number.
n can be 2, 4, 6, 8 or 16 etc (8 is the Win9x default)
Therefore if you choose an MTU of 1430
(1430 - 40 = 1390)
RWIN = 27800
20 * 1390 = 27800
1500 - Windows machines
8192 - Windows 95/98/98SE/NT
16384 - Windows ME/2k
Windows XP dynamically calculates the RWIN
|| How to tweak and
suggested settings || Tweaking History
|| MTU Problems||