The differences between IP
MTU, TCP windows size and MSS are sometimes not clear enough but most of the
times the correct chosen values influence the throughput (here more details ) of
the link. Again, these values are vendor, hardware and operating system
dependent.
The IP MTU is considered to
be the maximum IP packet size which can be transmitted over the interface
without the need of IP fragmentation.
The TCP window size is
consider being how many TCP segments can be transmitted without waiting for a
TCP acknowledgment, or I say it to be a burst of unacknowledged TCP segments or
a burst of MSS.
The MSS is the Maximum
Segment Size of one TCP segment; it is actually the maximum amount of Data
which can be sent in 1 TCP segment, not including the Ethernet, IP and TCP
headers.
If you want to read more
details about MTU, you can find Almighty-MTU
As you have noticed (I hope)
in all my previous diagram I have put in all Ethernet frame Data field IP and
TCP header leaving the actual Data (which is the MSS) in another column, now
you can see below how a IEEE 802.3 frame with 3 MPLS Headers looks like (in
data filed encapsulating a TCP/P frame):
Theoretically we have the
following relationship between the MTU and MSS:
ETHERNET MTU > MPLS MTU > IP MTU > MSS
Again, theoretically the MSS
can be calculated with the following formula, defined in the RFC 879
MSS = MTU – IP Header (+ Options if present) – TCP Header (+
Options if present)
IP Header = 20 / 60 bytes without / with Options
TCP Header = 20 / 60 bytes without / with Options
1. Windows default MSS – 1460 bytes
The default MSS for Windows
OS is 1460 byes (considering in both IP and TCP Headers are not present any
Options), and the default TCP Windows size is 12 x default MSS = 17520 bytes.
The MSS value can be adjusted modifying the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Find Tcpip\Parameters TcpWindowSize
2. Linux default MSS – 1460 bytes
The default MSS for Linux OS
(check your kernel version it could be different) is 1460 bytes (considering in
both IP and TCP Headers are not present any Options), and the default TCP
Windows size is 10 x default MSS = 14600 bytes.
The MSS value 0 (zero) shown in the netstat –nr command indicates that the
kernel will ignore this value and will calculate the MSS= MTU-40 when the TCP
connection is established.
The route mss can be changed
using the following command (the changed value is not persistent at server
reboot):
ip route add x.x.x.x/24 dev eth0 advmss [max-segment-size-bytes]
This
command only affects the packets received, not the packets transmitted, for
Linux OS there are 2 MSS values: transmitted and received. If there is no
received MSS value, by default the minimum MSS value (536 bytes) is considered.
3. Cisco default MSS – 1460 bytes
The default MSS for Cisco is
1460 bytes for the TCP connection which are passing through the device and 536
bytes for the TCP connection started or terminated on the device.
To change the MSS value for
the TCP SYN packets which are passing through the Cisco device, the following
command can be used:
ip tcp adjust-mss [max-segment-size-bytes]
To change the MSS value for
the TCP SYN originating or terminating on Cisco device, the following
command can be used:
ip tcp mss [max-segment-size-bytes]
To change the TCP windows
size of the TCP sessions originating or terminating on Cisco device, the
following command can be used, the default is 2144 bytes:
ip tcp window-size [bytes]
4. Juniper default MSS – 1460byte for routers and 1350 bytes for
firewalls
For Juniper router, the default MSS is 1460 bytes for the TCP
connection which are passing through the device and 536 bytes for the TCP
connection started or terminated on the device.
For Juniper firewalls, for the
TCP connection started or terminated on the device the default MSS is 1350
bytes.
It can be configured as fallow:
user@host# set system internet-options tcp-mss [max-segment-size-bytes]
5. Huawei default MSS – 1460byte
For Huawei router, the default
MSS is 1460 bytes for the TCP connection which are passing through the device
and 536 bytes for the TCP connection started or terminated on the device.
The
minimum TCP MSS is by default 216 bytes. The default window size is 8KB.
tcp min-mss
[mss-value-bytes]
tcp window [window-size-byte]
The MSS can be changed for VT
interface, VE sub-interface or Eth-Trunk sub-interface using the following
command, the default being 0:
tcp adjust-mss [mss-value-bytes]
Conclusion: The MSS can be configured sometimes,
but the defaults again are vendor, hardware and operating system dependent,
that’s why, before changing them, please consult your vendor for more details.
Also the TCP congestion avoidance mechanism is vendor and software dependent.
By Mihaela Paraschivu
No comments: