Maximum segment size

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The maximum segment size (MSS) is a parameter of the TCP protocol that specifies the largest amount of data, specified in octets, that a computer or communications device can receive in a single TCP segment. It does not count the TCP header or the IP header.[1] The IP datagram containing a TCP segment may be self-contained within a single packet, or it may be reconstructed from several fragmented pieces; either way, the MSS limit applies to the total amount of data contained in the final, reconstructed TCP segment.

The default TCP Maximum Segment Size is 536.[2] Where a host wishes to set the maximum segment size to a value other than the default, the maximum segment size is specified as a TCP option, initially in the TCP SYN packet during the TCP handshake. Because the maximum segment size parameter is controlled by a TCP option, a host can change the value in any later segment.

Each direction of data flow can use a different MSS.

To avoid fragmentation in the IP layer, a host must specify the maximum segment size as equal to the largest IP datagram that the host can handle minus the IP header size and TCP header sizes.[3] Therefore IPv4 hosts are required to be able to handle an MSS of 536 octets (= 576[4] - 20 - 20) and IPv6 hosts are required to be able to handle an MSS of 1220 octets (= 1280[5] - 40 - 20).

Low MSS values will reduce or eliminate IP fragmentation, but will result in higher overhead.[6]

For most computer users, the MSS option is established by the operating system.

Further reading[edit]

  • Comer, Douglas E. (2006). Internetworking with TCP/IP. Vol. 1 (5/E ed.). Upper Saddle River, NJ, USA: Prentice Hall. 
  • Kozierok, Charles M. (2005-09-20). The TCP/IP Guide (3.0 ed.). Retrieved 2011-09-08. 

See also[edit]

References[edit]

  1. ^ RFC 879, page 2, Section 3, "The MSS counts only data octets in the segment, it does not count the TCP header or the IP header."
  2. ^ RFC 879, page 1, Section 1, "The default TCP Maximum Segment Size is 536."
  3. ^ RFC 2460, page 28, Section 8.3
  4. ^ RFC 879, page 1, Section 1
  5. ^ RFC 2460, page 24, Section 5
  6. ^ The TCP/IP Guide, TCP Maximum Segment Size (MSS) and Relationship to IP Datagram Size