Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Maximum segment size
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Transmission Control Protocol parameter}} The '''maximum segment size''' ('''MSS''') is a parameter of the ''Options'' field of the [[Transmission Control Protocol|TCP]] header that specifies the largest amount of data, specified in [[bytes]], that a computer or communications device can receive in a single [[Transmission Control Protocol#TCP segment structure|TCP segment]]. It does not count the [[Transmission Control Protocol#TCP segment structure|TCP header]] or the [[IP header]] (unlike, for example, the [[Maximum transmission unit|MTU]] for IP datagrams).{{Ref RFC|9293|rsection=3.7.1}} The [[IP datagram]] containing a TCP segment may be self-contained within a single packet, or it may be reconstructed from several [[IP fragmentation|fragmented]] pieces; either way, the MSS limit applies to the total amount of data contained in the final, reconstructed TCP segment. To avoid fragmentation in the [[Internet layer|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 and TCP header sizes. Though there is no minimum required MSS defined in [[Request for Comments|IETF RFCs]], there is a minimum MTU, and so a default MSS is calculated by subtracting the minimum IP and TCP header sizes from the MTU. For example, [[IPv4]] hosts typically default to an MSS of 536 octets (= 576 β 20 β 20) and [[IPv6]] hosts generally are able to handle an MSS of 1220 octets (= 1280 β 40 β 20).{{Ref RFC|9293|rsection=3.7.1}} Small MSS values will reduce or eliminate IP fragmentation but will result in higher [[Protocol overhead|overhead]].<ref>[http://www.tcpipguide.com/free/t_TCPMaximumSegmentSizeMSSandRelationshiptoIPDatagra.htm The TCP/IP Guide], TCP Maximum Segment Size (MSS) and Relationship to IP Datagram Size</ref> Each direction of data flow can use a different MSS. For most computer users, the MSS option is established by the [[operating system]]. TCP options size (Variable 0β320 bits, in units of 32 bits) must be deducted from MSS size if TCP options are enabled. For example, TCP Time Stamps are enabled by default on Linux platforms. ==Default value== The default TCP Maximum Segment Size for IPv4 is 536. For IPv6 it is 1220.{{Ref RFC|9293|rsection=3.7.1}} 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 (TCP)|SYN]] packet during the [[TCP handshake]]. The value cannot be changed after the connection is established. ==Inter-Layer Communication== <!-- This is the description taken from the obsolete RFC879, which describes only IPv4. This should be rewritten from RFC 9293 sec. 3.7.1. --> In order to notify MSS to the other end, an inter-layer communication is done as follows:{{Ref RFC|879|rsection=11}} * The Network Driver (ND) or interface should know the [[Maximum transmission unit|Maximum Transmission Unit (MTU)]] of the directly attached network. * The IP should ask the Network Driver for the Maximum Transmission Unit. * The TCP should ask the IP for the Maximum Datagram Data Size (MDDS). This is the MTU minus the IP header length (MDDS = MTU β IPHdrLen). * When opening a connection, TCP can send an MSS option with the value equal to: MDDS β TCPHdrLen. In other words, the MSS value to send is: MSS = MTU β TCPHdrLen β IPHdrLen While sending TCP segments to the other end, an inter-layer communication is done as follows:{{Ref RFC|879|rsection=11}} * TCP should determine the Maximum Segment Data Size (MSDS) from either the default or the received value of the MSS option. * TCP should determine if source fragmentation is possible (by asking the IP) and desirable. ** If so, TCP may hand to IP, segments (including the TCP header) up to MSDS + TCPHdrLen. ** If not, TCP may hand to IP, segments (including the TCP header) up to the lesser of (MSDS + TCPHdrLen) and MDDS. * IP checks the length of data passed to it by TCP. If the length is less than or equal MDDS, IP attaches the IP header and hands it to the ND. Otherwise, the IP must do source fragmentation. ==MSS and MTU== MSS is sometimes conflated with [[Maximum transmission unit|MTU/PMTU]], which is a characteristic of the underlying [[data link layer|link layer]], while MSS applies specifically to TCP and hence the [[transport layer]]. The two are similar in that they limit the maximum size of the payload carried by their respective [[protocol data unit]] (frame for MTU, TCP segment for MSS), and related since MSS cannot exceed the MTU for its underlying link (taking into account the overhead of any headers added by the layers below TCP). However, the difference, in addition to applying to different layers, is that MSS can have a different value in either direction and also that frames exceeding the MTU may cause packets (which encapsulate segments) to be fragmented by the [[network layer]], while segments exceeding the MSS are simply discarded. ==Further reading== * {{cite book|last=Comer|first=Douglas E.|title=Internetworking with TCP/IP|volume=1|edition=5/E|publisher=Prentice Hall|location=Upper Saddle River, NJ, USA|year=2006}} * {{cite book|last=Kozierok|first=Charles M.|title=The TCP/IP Guide|edition=3.0|date=2005-09-20|accessdate=2011-09-08|url=http://www.tcpipguide.com/free/t_TCPMaximumSegmentSizeMSSandRelationshiptoIPDatagra-2.htm}} ==See also== *[[Path MTU Discovery]] ==References== {{reflist}} {{-}} {{Ethernet}} {{DEFAULTSORT:Maximum Segment Size}} [[Category:Packets (information technology)]] [[Category:Transmission Control Protocol]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:-
(
edit
)
Template:Cite book
(
edit
)
Template:Clear
(
edit
)
Template:Ethernet
(
edit
)
Template:Ref RFC
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)