Maximum Segment Size (MSS)

alpharithms fallback 1

The maximum segment size (MSS) is a measure used in TCP protocol to define the largest allowable packet size to be sent across the network. Independent MSS measures can be used on either side of data transmission and, in some cases, may represent significantly different values.

MSS is a measure of data in the transmitted segment and not the information contained in either the TCP or Internet Protocol (IP) header.

Per RFC879‘s specs; the default MSS to be used in TCP transmissions is calculated (in octets) by the following formula:

TCP mss size
RFC879 Specification for TCP MSS size relative to IP MSS

This specification was defined before IPV6 and, as one might expect, has been adapted by RFC2460 to accommodate the longer denotation used by the more modern protocol by using the following formula:

TCP MSS default size IPv6
RFC2460 Specification for TCP MSS size relative to IP MSS

The MSS value is used during the transmission of data and not during initial connection negotiation, such as the TCP 3-Way Handshake. As noted by RFC 879:

The MSS value counts only data octets, thus it does not count the TCP SYN and FIN control bits even though SYN and FIN do consume TCP sequence numbers

The MSS is a dynamic variable that is rapidly increased during the Slow Start state of TCP’s congestion control algorithm. This is essentially the process by which a TCP application determines available network bandwidth.

Zαck West
Full-Stack Software Engineer with 10+ years of experience. Expertise in developing distributed systems, implementing object-oriented models with a focus on semantic clarity, driving development with TDD, enhancing interfaces through thoughtful visual design, and developing deep learning agents.