| 
 | Please Whitelist This Site?I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)
 If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads. If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK. Thanks for your understanding! Sincerely, Charles KozierokAuthor and Publisher, The TCP/IP Guide
 | 
 
 
   
  
    | 
  
| NOTE: Using software to mass-download the site degrades the server and is prohibited. If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.
 |  |  | 
| 
 
 
 | 
 
 TCP Maximum Segment Size (MSS) and Relationship to IP Datagram Size
 (Page 2 of 3)
 Maximum Segment Size Selection The selection of the MSS is based 
on the need to balance various competing performance and implementation 
issues in the transmission of data on TCP/IP networks. The main TCP 
standard, RFC 793, doesn't discuss MSS very much, which opened the potential 
for confusion on how the parameter should be used. RFC 879 was published 
a couple of years after the TCP standard to clarify this parameter and 
the issues surrounding it. Some issues with MSS are fairly mundane; 
for example, certain devices are limited in the amount of space they 
have for buffers to hold TCP segments, and therefore may wish to limit 
segment size to a relatively small value. In general, though, the MSS 
must be chosen by balancing two competing performance issues: 
TCP Default Maximum Segment SizeOverhead Management: The TCP header takes 
up 20 bytes of data (or more if options are used); the IP header also 
uses 20 or more bytes. This means that between them a minimum of 40 
bytes are needed for headers, all of which is non-data overhead. 
If we set the MSS too low, this results in very inefficient use of bandwidth. 
For example, suppose we set it to 40; if we did, a maximum 
of 50% of each segment could actually be data; the rest would just be 
headers. Many segment datagrams would be even worse in terms of efficiency.
 
IP Fragmentation: TCP segments will be 
packaged into IP datagrams. As we saw in the section on 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 solution to these two competing 
issues was to establish a default MSS for TCP that was as large as possible 
while avoiding fragmentation for most transmitted segments. This was 
computed by starting with the minimum MTU for IP networks of 576. All 
networks are required to be able to handle an IP datagram of this size 
without fragmenting. From this number, we subtract 20 bytes for the 
TCP header and 20 for the IP header, leaving 536 bytes. This is the 
standard MSS for TCP. The selection of this value was a 
compromise of sorts. When this number is used, it means that most 
TCP segments will be sent unfragmented across an IP internetwork. However, 
if any TCP or IP options are used, this will cause the minimum MTU of 
576 to be exceeded and fragmentation to happen. Still, it makes more 
sense to allow some segments to be fragmented rather than use a much 
smaller MSS to ensure that none are ever fragmented. If we chose, say, 
an MSS of 400, we would probably never have fragmentation, but we'd 
lower the data/header ratio from 536:40 (93% data) to 400:40 (91% data) 
for all segments. |  Key Concept: TCP is designed to restrict the size of the segments it sends to a certain maximum limit, to cut down on the likelihood that segments will need to be fragmented for transmission at the IP level. The TCP maximum segment size (MSS) specifies the maximum number of bytes in the TCP segments Data field, regardless of any other factors that influence segment size. The default MSS for TCP is 536, which results from taking the minimum IP MTU of 576 and subtracting 20 bytes each for the IP and TCP headers.
 | 
 
 
 
 | 
 | If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support! |  
|  | 
 | 
 
 
 Home - 
Table Of Contents - Contact Us
 
 The TCP/IP Guide (http://www.TCPIPGuide.com)
 Version 3.0 - Version Date: September 20, 2005
 
 © Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
 Not responsible for any loss resulting from the use of this site.
 |