Network Working Group J. Postel
Request for Comments: 879 ISI
November 1983
The TCP Maximum Segment Size and Related Topics
1. Introduction
This memo discusses the TCP Maximum Segment Size and its relation to the IP Maximum Datagram Size. TCP is specified in reference [1]. IP is specified in references [2,3].
Postel [Page 1]
RFC 879 November 1983 TCP Maximum Segment Size 2. The IP Maximum Datagram SizeHosts are not required to reassemble infinitely large IP datagrams. The maximum size datagram that all hosts are required to accept or reassemble from fragments is 576 octets. The maximum size reassembly buffer every host must have is 576 octets. Hosts are allowed to accept larger datagrams and assemble fragments into larger datagrams, hosts may have buffers as large as they please.
3. The TCP Maximum Segment Size Option
TCP provides an option that may be used at the time a connection is established (only) to indicate the maximum size TCP segment that can be accepted on that connection. This Maximum Segment Size (MSS) announcement (often mistakenly called a negotiation) is sent from the data receiver to the data sender and says "I can accept TCP segments up to size X". The size (X) may be larger or smaller than the default. The MSS can be used completely independently in each direction of data flow. The result may be quite different maximum sizes in the two directions.
4. The Relationship of TCP Segments and IP Datagrams
TCP segment are transmitted as the data in IP datagrams. The correspondence between TCP segments and IP datagrams must be one to one. This is because TCP expects to find exactly one complete TCP segment in each block of data turned over to it by IP, and IP must turn over a block of data for each datagram received (or completely reassembled).
Postel [Page 2]
RFC 879 November 1983 TCP Maximum Segment Size 5. Layering and ModularityTCP is an end to end reliable data stream protocol with error control, flow control, etc. TCP remembers many things about the state of a connection.
6. IP Information Requirements
There is no general requirement that IP keep information on a per host basis.
Postel [Page 3]
RFC 879 November 1983
TCP Maximum Segment Size
Different Network
7. The Relationship between IP Datagram and TCP Segment Sizes
The relationship between the value of the maximum IP datagram size and the maximum TCP segment size is obscure. The problem is that both the IP header and the TCP header may vary in length. The TCP Maximum Segment Size option (MSS) is defined to specify the maximum number of data octets in a TCP segment exclusive of TCP (or IP) header.
Postel [Page 4]
RFC 879 November 1983
TCP Maximum Segment Size
where MSS is the value in the option, and MTU is the Maximum Transmission Unit (or the maximum packet size) allowed on the directly attached network.
Postel [Page 5]
RFC 879 November 1983 TCP Maximum Segment Size 8. Maximum Packet SizeEach network has some maximum packet size, or maximum transmission unit (MTU). Ultimately there is some limit imposed by the technology, but often the limit is an engineering choice or even an administrative choice. Different installations of the same network product do not have to use the same maximum packet size. Even within one installation not all host must use the same packet size (this way lies madness, though).
9. Source Fragmentation
A source host would not normally create datagram fragments. Under normal circumstances datagram fragments only arise when a gateway must send a datagram into a network with a smaller maximum packet size than the datagram. In this case the gateway must fragment the datagram (unless it is marked "don't fragment" in which case it is discarded, with the option of sending an ICMP message to the source reporting the problem).
Postel [Page 6]
RFC 879 November 1983
TCP Maximum Segment Size
For example, if the receiving TCP announced that it would accept segments up to 5000 octets (in cooperation with the receiving IP) then the sending TCP could give such a large segment to the sending IP provided the sending IP would send it in datagram fragments that fit in the packets of the directly attached network.
10. Gateway Fragmentation
Gateways must be prepared to do fragmentation. It is not an optional feature for a gateway.
Postel [Page 7]
RFC 879 November 1983
TCP Maximum Segment Size
A larger than default datagram can only arrive at a gateway because the source host knows that the destination host can handle such large datagrams (probably because the destination host announced it to the source host in an TCP MSS option). Thus, the gateway should pass on this large datagram in one piece or in the largest fragments that fit into the next network.
11. Inter-Layer Communication
The Network Driver (ND) or interface should know the Maximum Transmission Unit (MTU) of the directly attached network.
Postel [Page 8]
RFC 879 November 1983 TCP Maximum Segment Size 12. What is the Default MSS ?Another way of asking this question is "What transmitted value for MSS has exactly the same effect of not transmitting the option at all?".
Postel [Page 9]
RFC 879 November 1983 TCP Maximum Segment Size 13. The TruthThe rule relating the maximum IP datagram size and the maximum TCP segment size is:
14. The Consequences
When TCP is used in a situation when either the IP or TCP headers are not minimum and yet the maximum IP datagram that can be received remains 576 octets then the TCP Maximum Segment Size option must be used to reduce the limit on data octets allowed in a TCP segment.
Postel [Page 10]
RFC 879 November 1983 TCP Maximum Segment Size 15. References[1] Postel, J., ed., "Transmission Control Protocol - DARPA Internet