TCP - factors affecting segment size

There are various factors that affect the size of a TCP segment. These include:

  • TCP Maximum Segment Size - The MSS is negotiated at the beginning of a TCP communication, during the three-way handshake. The MSS is determined based on the maximum detected size of the underlying IPv4 or IPv6 packet and ethernet frame sizes of the lower layers.
  • Window size - Typically, the window size is larger than the segment size. Many segments can be sent within a typical TCP window. However, there is only one situation in which the window size affects the segment size: when the window size is set to something smaller than the MSS. In this case, it can limit the size of the segments that are sent, even if the MSS allows for larger segments.