Maximum segment size
From Wikipedia, the free encyclopedia
| This article may require cleanup to meet Wikipedia's quality standards. Please improve this article if you can. (November 2006) |
The maximum segment size (MSS) is the largest amount of data, specified in bytes, that a computer or communications device can handle in a single, unfragmented piece. For optimum communications, the number of bytes in the data segment and the headers must not add up to more than the number of bytes in the maximum transmission unit (MTU).
The MSS is an important consideration in Internet connections. TCP and IPv4 headers are 20 bytes long each, whereas an IPv6 header is 40 bytes long, so the MSS is equal to MTU minus 40 when using IPv4, and MTU minus 60 when using IPv6 (typical MTU for IPv4 is 1500 bytes).
As data is routed over the Internet, it must pass through multiple gateway routers. Ideally, each TCP segment can pass through every router without being fragmented. If the data segment size is too large for any of the routers through which the data passes, the oversized segments are fragmented. This slows down the connection speed as seen by the computer user. In some cases the slowdown is dramatic. The likelihood of such fragmentation can be minimized by keeping the MSS as small as reasonably possible. For most computer users, the MSS is set automatically by the operating system.
Thus if the IP datagrams carrying the segments are as large as possible, we use the optimum segment size to avoid fragmentation. Although this may be difficult to achieve, it can be beneficial for the system to run smoothly without delayed performances or slow connection. Thus, in order to achieve this goal, three considerations must be made:
- Make sure the implemented TCP has a mechanism for this.
- Check the dynamic route changes of the routers to make sure that the datagrams does not dynamically change into a size that needs to be fragmented.
- Observe the lower-level protocol headers.
The selection of the MSS is based on the need to balance competing performances and implementation issues in the transmission of data being passed around on the TCP/IP. For example, let us take the definition of overhead management to consideration. Since the TCP header takes up 20 bytes, the IP header must also use 20 bytes or more, requiring a minimum of 40 bytes to be placed for the headers. A low MSS setting would lead to an inefficient use of network bandwidth, since a larger percentage of each segment would consist of TCP and IP header information.
Another example is IP fragmentation when the TCP is packaged into IP packets. If the TCP segment is too large, it will lead the IP packet to be too large, and then cause fragmentation. Since fragmentation reduces efficiency and increases the chance of data loss, such an event can potentially lead to the need to retransmit the entire segment.
[edit] See also
[edit] Further Reading
- RFC 879
- Comer, Douglas E. (2006). Internetworking with TCP/IP, 5E, Upper Saddle River, NJ, USA: Prentice Hall.
- Kozierok, Charles M. (2005-09-20). The TCP/IP Guide, 3E. Retrieved on 2007-11-28.

