Network Working Group M.T. Rose Internet-Draft Invisible Worlds, Inc. Expires: December 28, 2000 June 29, 2000 Mapping the BXXP Framework onto TCP draft-mrose-bxxp-tcpmapping-00 Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026 except that the right to produce derivative works is not granted. (If this document becomes part of an IETF working group activity, then it will be brought into full compliance with Section 10 of RFC2026.) Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on December 28, 2000. Copyright Notice Copyright (C) The Internet Society (2000). All Rights Reserved. Abstract This memo describes how a BXXP session is mapped onto a single TCP connection. Rose Expires December 28, 2000 [Page 1] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Session Management . . . . . . . . . . . . . . . . . . . . . 4 3. Data Exchange . . . . . . . . . . . . . . . . . . . . . . . 5 3.1 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.1 Channel Creation . . . . . . . . . . . . . . . . . . . . . . 6 3.1.2 Sending REQ or RSP Messages . . . . . . . . . . . . . . . . 7 3.1.3 Processing SEQ Messages . . . . . . . . . . . . . . . . . . 8 3.1.4 Use of Flow Control . . . . . . . . . . . . . . . . . . . . 9 References . . . . . . . . . . . . . . . . . . . . . . . . . 10 Author's Address . . . . . . . . . . . . . . . . . . . . . . 10 A. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 Full Copyright Statement . . . . . . . . . . . . . . . . . . 12 Rose Expires December 28, 2000 [Page 2] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 1. Introduction This memo describes how a BXXP[1] session is mapped onto a single TCP[2] connection. Refer to Section 2.5 of [1] for an explanation of the mapping requirements. Rose Expires December 28, 2000 [Page 3] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 2. Session Management The mapping of BXXP session management onto the TCP service is straight-forward. A BXXP session is established when a TCP connection is established between two BXXP peers: o the BXXP peer that issues a passive OPEN call is termed the listener; and, o the BXXP peer that issues an active OPEN call is termed the initiator. A BXXP session is released when either peer issues the CLOSE call, and the TCP connection is subsequently closed. A BXXP session is terminated with either peer issues the ABORT call, and the TCP connection is subsequently aborted. Rose Expires December 28, 2000 [Page 4] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 3. Data Exchange The mapping of BXXP data exchange onto the TCP service is less straight-forward. Messages are reliably sent and received using the SEND and RECEIVE calls. (This also provides ordered delivery of messages on the same channel.) Although TCP imposes flow control on a per-connection basis, if multiple channels are simultaneously in use on a BXXP session, BXXP must provide a mechanism to avoid starvation and deadlock. To achieve this, BXXP re-introduces mechanisms used by the TCP: sequence numbers and window-based flow control -- each channel has a sliding window that indicates the number of payload octets that a peer may transmit before receiving further permission. Rose Expires December 28, 2000 [Page 5] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 3.1 Flow Control Recall from Section 2.2.1.2 of [1] that every payload octet sent in each direction on a channel has an associated sequence number. Numbering of payload octets within a frame is such that the first payload octet is the lowest numbered, and the following payload octets are numbered consecutively. The actual sequence number space is finite, though very large, ranging from 0..4294967295 (2**32 - 1). Since the space is finite, all arithmetic dealing with sequence numbers is performed modulo 2**32. This unsigned arithmetic preserves the relationship of sequence numbers as they cycle from 2**32 - 1 to 0 again. 3.1.1 Channel Creation When a channel is created, the sequence number associated with the first payload octet of the first frame is 0, and the initial window size for that channel is 4096 octets. After channel creation, a BXXP peer may update the window size by sending a "SEQ" message (Section 3.1.3). If a BXXP peer is requested to create a channel and it is unable to allocate at least 4096 octets for that channel, it must decline creation of the channel, as specified in Section 2.3.1.3 of [1]. Similarly, during establishment of the BXXP session, if the BXXP peer acting in the listening role is unable to allocate at least 4096 octets for channel 0, then it must return a negative response, as specified in Section 2.4 of [1]. instead of a greeting. Rose Expires December 28, 2000 [Page 6] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 3.1.2 Sending REQ or RSP Messages Before a message is sent, the sending BXXP peer must ensure that the size of the payload is within the window advertised by the receiving BXXP peer. If not, it has three choices: o if the window would allow for at least one payload octet to be sent, the BXXP peer may segment the message and start by sending a smaller frame (up to the size of the remaining window); o the BXXP peer may delay sending the message until the window becomes larger; or, o the BXXP peer may signal to its application that it is unable to send the message, allowing the application to try again at a later time (or perhaps signaling its application when a larger window is available.) The choice is implementation-dependent, although it is recommended that the application using BXXP be given a mechanism for influencing the decision. Rose Expires December 28, 2000 [Page 7] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 3.1.3 Processing SEQ Messages As an application accepts responsibility for incoming frames, its BXXP peer should send "SEQ" messages to advertise a new window. The ABNF for a "SEQ" message is: seq = "SEQ" SP channel SP ackno SP window CR LF ackno = seqno window = size ; channel, seqno, and size are defined in Section 2.2.1 of [1]. The "SEQ" message has three parameters: o a channel number; o an acknowledgement number, that indicates the value of the next sequence number that the sender is expecting to receive on this channel; and, o a window size, that indicates the number of payload octets beginning with the one indicated by the acknowledgement number that the sender is expecting to receive on this channel. A single space character (decimal code 32, " ") separates each component. The "SEQ" message is terminated with a CRLF pair. When a "SEQ" message is received, if any of the channel number, acknowledgement number, or window size cannot be determined or is invalid, then the BXXP session is terminated without generating a response, and it is recommended that a diagnostic entry be logged. Rose Expires December 28, 2000 [Page 8] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 3.1.4 Use of Flow Control The key to successful use of flow control within BXXP is to balance performance and fairness: o large messages should be segmented into multiple frames (e.g., the BXXP segment size should be no larger than TCP's negotiated maximum segment size minus some small constant); o frames for different channels with traffic ready to send should be sent in a round-robin fashion; and, o a "SEQ" message should be sent each time a "REQ" or "RSP" message is received (if the transport service presents multiple messages to a BXXP peer simultaneously, then a single consolidating "SEQ" message may be sent). In order to avoid pathological interactions with the transport service, it is important that a BXXP peer advertise windows based on available buffer space, to allow data to be read from the transport service as soon as available. Further, "SEQ" messages for a channel should have higher priority than "REQ" or "RSP messages for that channel. Finally, implementations may wish to provide queue management facilities to the application using BXXP, e.g., channel priorities. In particular, implementations should not allow a given channel to monopolize the underlying transport window (e.g., slow readers should get small windows). Rose Expires December 28, 2000 [Page 9] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 References [1] Rose, M.T., "The Blocks eXtensible eXchange Protocol Framework", draft-mrose-bxxp-framework-00 (work in progress), June 2000. [2] Postel, J., "Transmission Control Protocol", RFC 793, STD 7, Sep 1981. Author's Address Marshall T. Rose Invisible Worlds, Inc. 1179 North McDowell Boulevard Petaluma, CA 94954-6559 US Phone: +1 707 789 3700 EMail: mrose@invisible.net URI: http://invisible.net/ Rose Expires December 28, 2000 [Page 10] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 Appendix A. Acknowledgements Dave Crocker provided helpful suggestions on the nature of flow control in the mapping. Rose Expires December 28, 2000 [Page 11] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 Full Copyright Statement Copyright (C) The Internet Society (2000). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Invisible Worlds expressly disclaims any and all warranties regarding this contribution including any warranty that (a) this contribution does not violate the rights of others, (b) the owners, if any, of other rights in this contribution have been informed of the rights and permissions granted to IETF herein, and (c) any required authorizations from such owners have been obtained. This document and the information contained herein is provided on an "AS IS" basis and INVISIBLE WORLDS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL INVISIBLE WORLDS BE LIABLE TO ANY OTHER PARTY INCLUDING THE IETF AND ITS MEMBERS FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. Rose Expires December 28, 2000 [Page 12] Internet-Draft Mapping the BXXP Framework onto TCP June 2000 Acknowledgement Funding for the RFC editor function is currently provided by the Internet Society. Rose Expires December 28, 2000 [Page 13]