When tcp_window_scaling is set, what is the relationship among MTU, MSS and Window size

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 6
  • Red Hat Enterprise Linux (RHEL) 5
  • Red Hat Enterprise Linux (RHEL) 4

Issue

  • When tcp_window_scaling is set, what is the relationship among MTU, MSS and Window size?

Resolution

In a connection between a client and a server, the client tells the server the number of bytes it is willing to receive at one time from the server; this is the client's receive window, which becomes the server's send window.

Likewise, the server tells the client how many bytes of data it is willing to take from the client at one time; this is the server's receive window and the client's send window.

The simplest way of considering the window size is that it indicates the size of the device's receive buffer for the particular connection.

That is, window size represents how much data a device can handle from its peer at one time before it is passed to the application process.

TCP segments are the messages that carry data between TCP devices.

A primary determinant of how much data to send in a segment is the current status of the sliding window mechanism on the part of the receiver.

When Device A receives a TCP segment from Device B, it examines value of the Window field to know the limit on how much data Device B is allowing Device A to send in its next segment.

In addition to the dictates of the current window size, each TCP device also has associated with it a ceiling; on TCP size—a segment size that will never be exceeded regardless of how large the current window is. This is called the maximum segment size (MSS).

TCP segments will be packaged into IP datagrams. IP datagrams have their own size limit issues: the matter of the maximum transmission unit (MTU) of an underlying network.

If a TCP segment is too large, it will lead to an IP datagram is too large to be sent without fragmentation.

Fragmentation reduces efficiency and increases the chances of part of a TCP segment being lost, resulting in the entire segment needing to be retransmitted.

The TCP maximum segment size (MSS) specifies the maximum number of bytes in the TCP segment’s Data field, regardless of any other factors that influence segment size.

The default MSS for TCP is 512, which results from taking the minimum IP MTU of 552 and subtracting 20 bytes each for the IP and TCP headers.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

4 Comments

Thank you for writing this obviously great information regarding TCP window size, and how it relates with MSS, MTU, TCP Size Ceiling and it's other factors.

I do have a few questions on this information. We are interested in it because we have RHEL servers that are separated by a very large distance. We are looking to adjust the Window Size and are also interested in tuning these servers to be able to 'talk' and deal with each others' data.

First set of questions...
In the block of text in this article it says:
Quoted from above

A primary determinant of how much data to send in a 
segment is the current status of the sliding window 
mechanism on the part of the receiver. When Device A 
receives a TCP segment from Device B, it examines 
value of the Window field to know the limit on how 
much data Device B is allowing Device A to send in 
its next segment.

The statments with 'Device A' and 'Device B' seem potentially unclear.
Points above Quoted and broken down

1) When Device A receives a TCP segment from 
   Device B..."
2) ...it (probably Device A?) examines value of the 
   Window field (seems to be Device B)...
3) ...to know the limit on how much data 
   Device B is allowing Device A to send in it's next segment...
  • So the example starts off with Device A receiving a TCP segment from Device B.
  • It seems clear (so far) the example states 'Device A examines the Window field to know the limit...'
  • The unclear part is what follows on how much data Device B (should this be Device A?) is allowing Device A (should this be Device B?) to send in it's next segment. From the example in the text in the original article above, (as of Aug 9 2013), it seems Device A is receiving TCP segments from Device B.

First round question question summary...
- Does this example in the article really mean:
"When Device A receives a TCP segment from Device B Device A examines the value of the Window field on how much data Device A is allowing Device B to send in its next segment?"
- In the example above, it seems that Device A is receiving TCP segements from Device B.
-- We suspect this TCP Window Size should probably be set between both systems (they only talk to each other).

Thanks for any assistance
Regards,
RJ

Thanks for the detailed feedback, Remmele! We'll review the article and clarify these issues.

Thanks David!

You're welcome, Remmele! Thanks again for the feedback.