📄 rfc879.txt
字号:
installations. Gateways must be prepared to accept datagrams as large as can be sent in the maximum packets of the directly attached networks. Gateway implementations should be easily configured for installation in different circumstances. A footnote: The MTUs of some popular networks (note that the actual limit in some installations may be set lower by administrative policy): ARPANET, MILNET = 1007 Ethernet (10Mb) = 1500 Proteon PRONET = 20469. 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). It might be desirable for the source host to send datagram fragmentsPostel [Page 6]RFC 879 November 1983TCP Maximum Segment Size if the maximum segment size (default or negotiated) allowed by the data receiver were larger than the maximum packet size allowed by the directly attached network. However, such datagram fragments must not combine to a size larger than allowed by the destination host. 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. There are some conditions where source host fragmentation would be necessary. If the host is attached to a network with a small packet size (for example 256 octets), and it supports an application defined to send fixed sized messages larger than that packet size (for example TFTP [5]). If the host receives ICMP Echo messages with data it is required to send an ICMP Echo-Reply message with the same data. If the amount of data in the Echo were larger than the packet size of the directly attached network the following steps might be required: (1) receive the fragments, (2) reassemble the datagram, (3) interpret the Echo, (4) create an Echo-Reply, (5) fragment it, and (6) send the fragments.10. Gateway Fragmentation Gateways must be prepared to do fragmentation. It is not an optional feature for a gateway. Gateways have no information about the size of datagrams destination hosts are prepared to accept. It would be inappropriate for gateways to attempt to keep such information. Gateways must be prepared to accept the largest datagrams that are allowed on each of the directly attached networks, even if it is larger than 576 octets. Gateways must be prepared to fragment datagrams to fit into the packets of the next network, even if it smaller than 576 octets. If a source host thought to take advantage of the local network's ability to carry larger datagrams but doesn't have the slightest idea if the destination host can accept larger than default datagrams and expects the gateway to fragment the datagram into default sizePostel [Page 7]RFC 879 November 1983TCP Maximum Segment Size fragments, then the source host is misguided. If indeed, the destination host can't accept larger than default datagrams, it probably can't reassemble them either. If the gateway either passes on the large datagram whole or fragments into default size fragments the destination will not accept it. Thus, this mode of behavior by source hosts must be outlawed. 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. An interesting footnote is that even though the gateways may know about know the 576 rule, it is irrelevant to them.11. Inter-Layer Communication The Network Driver (ND) or interface should know the 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 MDDS - TCPHdrLen. 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 attached the IP header and hands it to the ND. Otherwise the IP must do source fragmentation.Postel [Page 8]RFC 879 November 1983TCP 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?". In terms of the previous section: The default assumption is that the Maximum Transmission Unit is 576 octets. MTU = 576 The Maximum Datagram Data Size (MDDS) is the MTU minus the IP header length. MDDS = MTU - IPHdrLen = 576 - 20 = 556 When opening a connection TCP can send an MSS option with the value equal MDDS - TCPHdrLen. MSS = MDDS - TCPHdrLen = 556 - 20 = 536 TCP should determine the Maximum Segment Data Size (MSDS) from either the default or the received value of the MSS option. Default MSS = 536, then MSDS = 536 TCP should determine if source fragmentation is possible and desirable. If so TCP may hand to IP segments (including the TCP header) up to MSDS + TCPHdrLen (536 + 20 = 556). If not TCP may hand to IP segments (including the TCP header) up to the lesser of (MSDS + TCPHdrLen (536 + 20 = 556)) and MDDS (556).Postel [Page 9]RFC 879 November 1983TCP Maximum Segment Size 13. The Truth The rule relating the maximum IP datagram size and the maximum TCP segment size is: TCP Maximum Segment Size = IP Maximum Datagram Size - 40 The rule must match the default case. If the TCP Maximum Segment Size option is not transmitted then the data sender is allowed to send IP datagrams of maximum size (576) with a minimum IP header (20) and a minimum TCP header (20) and thereby be able to stuff 536 octets of data into each TCP segment. The definition of the MSS option can be stated: The maximum number of data octets that may be received by the sender of this TCP option in TCP segments with no TCP header options transmitted in IP datagrams with no IP header options.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. For example, if the IP Security option (11 octets) were in use and the IP maximum datagram size remained at 576 octets, then the TCP should send the MSS with a value of 525 (536-11).Postel [Page 10]RFC 879 November 1983TCP Maximum Segment Size 15. References [1] Postel, J., ed., "Transmission Control Protocol - DARPA Internet Program Protocol Specification", RFC 793, USC/Information Sciences Institute, September 1981. [2] Postel, J., ed., "Internet Protocol - DARPA Internet Program Protocol Specification", RFC 791, USC/Information Sciences Institute, September 1981. [3] Postel, J., "Internet Control Message Protocol - DARPA Internet Program Protocol Specification", RFC 792, USC/Information Sciences Institute, September 1981. [4] Plummer, D., "An Ethernet Address Resolution Protocol or Converting Network Protocol Addresses to 48-bit Ethernet Addresses for Transmission on Ethernet Hardware", RFC 826, MIT/LCS, November 1982. [5] Sollins, K., "The TFTP Protocol (Revision 2)", RFC 783, MIT/LCS, June 1981.Postel [Page 11]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -