idnits 2.17.1 draft-ietf-beep-tcpmapping-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 224: '... SHOULD NOT shrink the window, i.e.,...' Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 10, 2000) is 8592 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-11) exists of draft-ietf-beep-framework-04 ** Obsolete normative reference: RFC 793 (ref. '2') (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2234 (ref. '3') (Obsoleted by RFC 4234) Summary: 7 errors (**), 0 flaws (~~), 3 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M.T. Rose 3 Internet-Draft Invisible Worlds, Inc. 4 Expires: April 10, 2001 October 10, 2000 6 Mapping the BEEP Framework onto TCP 7 draft-ietf-beep-tcpmapping-04 9 Status of this Memo 11 This document is an Internet-Draft and is in full conformance with 12 all provisions of Section 10 of RFC2026. 14 Internet-Drafts are working documents of the Internet Engineering 15 Task Force (IETF), its areas, and its working groups. Note that 16 other groups may also distribute working documents as 17 Internet-Drafts. 19 Internet-Drafts are draft documents valid for a maximum of six 20 months and may be updated, replaced, or obsoleted by other documents 21 at any time. It is inappropriate to use Internet-Drafts as reference 22 material or to cite them other than as "work in progress." 24 The list of current Internet-Drafts can be accessed at 25 http://www.ietf.org/ietf/1id-abstracts.txt. 27 The list of Internet-Draft Shadow Directories can be accessed at 28 http://www.ietf.org/shadow.html. 30 This Internet-Draft will expire on April 10, 2001. 32 Copyright Notice 34 Copyright (C) The Internet Society (2000). All Rights Reserved. 36 Abstract 38 This memo describes how a BEEP session is mapped onto a single TCP 39 connection. 41 Table of Contents 43 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 44 2. Session Management . . . . . . . . . . . . . . . . . . . . . 4 45 3. Message Exchange . . . . . . . . . . . . . . . . . . . . . . 5 46 3.1 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 6 47 3.1.1 Channel Creation . . . . . . . . . . . . . . . . . . . . . . 6 48 3.1.2 Sending Messages . . . . . . . . . . . . . . . . . . . . . . 7 49 3.1.3 Processing SEQ Frames . . . . . . . . . . . . . . . . . . . 8 50 3.1.4 Use of Flow Control . . . . . . . . . . . . . . . . . . . . 9 51 References . . . . . . . . . . . . . . . . . . . . . . . . . 10 52 Author's Address . . . . . . . . . . . . . . . . . . . . . . 10 53 A. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 54 Full Copyright Statement . . . . . . . . . . . . . . . . . . 12 56 1. Introduction 58 This memo describes how a BEEP[1] session is mapped onto a single 59 TCP[2] connection. Refer to Section 2.5 of [1] for an explanation of 60 the mapping requirements. 62 2. Session Management 64 The mapping of BEEP session management onto the TCP service is 65 straight-forward. 67 A BEEP session is established when a TCP connection is established 68 between two BEEP peers: 70 o the BEEP peer that issues a passive OPEN call is termed the 71 listener; and, 73 o the BEEP peer that issues an active OPEN call is termed the 74 initiator. 76 A BEEP session is released when either peer issues the CLOSE call, 77 and the TCP connection is subsequently closed. 79 A BEEP session is terminated when either peer issues the ABORT call, 80 and the TCP connection is subsequently aborted. 82 3. Message Exchange 84 The mapping of BEEP exchanges onto the TCP service is less 85 straight-forward. 87 Messages are reliably sent and received using the SEND and RECEIVE 88 calls. (This also provides ordered delivery of messages on the same 89 channel.) 91 Although TCP imposes flow control on a per-connection basis, if 92 multiple channels are simultaneously in use on a BEEP session, BEEP 93 must provide a mechanism to avoid starvation and deadlock. To 94 achieve this, BEEP re-introduces a mechanism used by the TCP: 95 window-based flow control -- each channel has a sliding window that 96 indicates the number of payload octets that a peer may transmit 97 before receiving further permission. 99 3.1 Flow Control 101 Recall from Section 2.2.1.2 of [1] that every payload octet sent in 102 each direction on a channel has an associated sequence number. 103 Numbering of payload octets within a data frame is such that the 104 first payload octet is the lowest numbered, and the following 105 payload octets are numbered consecutively. 107 The actual sequence number space is finite, though very large, 108 ranging from 0..4294967295 (2**32 - 1). Since the space is finite, 109 all arithmetic dealing with sequence numbers is performed modulo 110 2**32. This unsigned arithmetic preserves the relationship of 111 sequence numbers as they cycle from 2**32 - 1 to 0 again. 113 3.1.1 Channel Creation 115 When a channel is created, the sequence number associated with the 116 first payload octet of the first data frame is 0, and the initial 117 window size for that channel is 4096 octets. After channel creation, 118 a BEEP peer may update the window size by sending a SEQ frame 119 (Section 3.1.3). 121 If a BEEP peer is asked to create a channel and it is unable to 122 allocate at least 4096 octets for that channel, it must decline 123 creation of the channel, as specified in Section 2.3.1.2 of [1]. 124 Similarly, during establishment of the BEEP session, if the BEEP 125 peer acting in the listening role is unable to allocate at least 126 4096 octets for channel 0, then it must return a negative reply, as 127 specified in Section 2.4 of [1], instead of a greeting. 129 3.1.2 Sending Messages 131 Before a message is sent, the sending BEEP peer must ensure that the 132 size of the payload is within the window advertised by the receiving 133 BEEP peer. If not, it has three choices: 135 o if the window would allow for at least one payload octet to be 136 sent, the BEEP peer may segment the message and start by sending 137 a smaller data frame (up to the size of the remaining window); 139 o the BEEP peer may delay sending the message until the window 140 becomes larger; or, 142 o the BEEP peer may signal to its application that it is unable to 143 send the message, allowing the application to try again at a 144 later time (or perhaps signaling its application when a larger 145 window is available). 147 The choice is implementation-dependent, although it is recommended 148 that the application using BEEP be given a mechanism for influencing 149 the decision. 151 3.1.3 Processing SEQ Frames 153 As an application accepts responsibility for incoming data frames, 154 its BEEP peer should send SEQ frames to advertise a new window. 156 The ABNF[3] for a SEQ frame is: 158 seq = "SEQ" SP channel SP ackno SP window CR LF 160 ackno = seqno 162 window = size 164 ; channel, seqno, and size are defined in Section 2.2.1 of [1]. 166 The SEQ frame has three parameters: 168 o a channel number; 170 o an acknowledgement number, that indicates the value of the next 171 sequence number that the sender is expecting to receive on this 172 channel; and, 174 o a window size, that indicates the number of payload octets 175 beginning with the one indicated by the acknowledgement number 176 that the sender is expecting to receive on this channel. 178 A single space character (decimal code 32, " ") separates each 179 component. The SEQ frame is terminated with a CRLF pair. 181 When a SEQ frame is received, if any of the channel number, 182 acknowledgement number, or window size cannot be determined or is 183 invalid, then the BEEP session is terminated without generating a 184 response, and it is recommended that a diagnostic entry be logged. 186 3.1.4 Use of Flow Control 188 The key to successful use of flow control within BEEP is to balance 189 performance and fairness: 191 o large messages should be segmented into multiple frames (e.g., 192 the ideal BEEP segment size should be no larger than TCP's 193 negotiated maximum segment size minus some small constant); 195 o frames for different channels with traffic ready to send should 196 be sent in a round-robin fashion; and, 198 o each time a message is received, a SEQ frame should be sent 199 whenever the window size is at least one half of the available 200 buffer space (if the transport service presents multiple messages 201 to a BEEP peer simultaneously, then a single consolidating SEQ 202 frame may be sent). 204 In order to avoid pathological interactions with the transport 205 service, it is important that a BEEP peer advertise windows based on 206 available buffer space, to allow data to be read from the transport 207 service as soon as available. Further, SEQ frames for a channel 208 should have higher priority than messages for that channel. 210 Implementations may wish to provide queue management facilities to 211 the application using BEEP, e.g., channel priorities, (relative) 212 buffer allocations, and so on. In particular, implementations should 213 not allow a given channel to monopolize the underlying transport 214 window (e.g., slow readers should get small windows). 216 In addition, where possible, implementations should support 217 transport layer APIs that convey congestion information. 219 Finally, implementors should follow the guidelines given in the 220 relevant portions of RFC1122[4] that deal with flow control (and 221 bear in mind that issues such as retransmission, while they interact 222 with flow control in TCP, are not applicable to this memo). For 223 example, Section 4.2.2.16 of RFC1122[4] indicates that a "receiver 224 SHOULD NOT shrink the window, i.e., move the right window edge to 225 the left" and then discusses the impact of this rule on 226 unacknowledged data. In the context of mapping BEEP onto a single 227 TCP connection, only the portions concerning flow control should be 228 implemented. 230 References 232 [1] Rose, M.T., "The Blocks Extensible Exchange Protocol 233 Framework", draft-ietf-beep-framework-04 (work in progress), 234 October 2000. 236 [2] Postel, J., "Transmission Control Protocol", RFC 793, STD 7, 237 Sep 1981. 239 [3] Crocker, D. H. and P. Overell, "Augmented BNF for Syntax 240 Specifications: ABNF", RFC 2234, November 1997. 242 [4] Braden, R.T., "Requirements for Internet hosts - communication 243 layers", RFC 1122, STD 3, Oct 1989. 245 Author's Address 247 Marshall T. Rose 248 Invisible Worlds, Inc. 249 1179 North McDowell Boulevard 250 Petaluma, CA 94954-6559 251 US 253 Phone: +1 707 789 3700 254 EMail: mrose@invisible.net 255 URI: http://invisible.net/ 257 Appendix A. Acknowledgements 259 The author gratefully acknowledges the contributions of: Dave 260 Crocker, Steve Harris, Eliot Lear, Keith McCloghrie, Craig 261 Partridge, Vernon Schryver, and, Joe Touch. In particular, Dave 262 Crocker provided helpful suggestions on the nature of flow control 263 in the mapping. 265 Full Copyright Statement 267 Copyright (C) The Internet Society (2000). All Rights Reserved. 269 This document and translations of it may be copied and furnished to 270 others, and derivative works that comment on or otherwise explain it 271 or assist in its implementation may be prepared, copied, published 272 and distributed, in whole or in part, without restriction of any 273 kind, provided that the above copyright notice and this paragraph 274 are included on all such copies and derivative works. However, this 275 document itself may not be modified in any way, such as by removing 276 the copyright notice or references to the Internet Society or other 277 Internet organizations, except as needed for the purpose of 278 developing Internet standards in which case the procedures for 279 copyrights defined in the Internet Standards process must be 280 followed, or as required to translate it into languages other than 281 English. 283 The limited permissions granted above are perpetual and will not be 284 revoked by the Internet Society or its successors or assigns. 286 This document and the information contained herein is provided on an 287 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 288 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 289 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 290 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 291 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 293 Acknowledgement 295 Funding for the RFC editor function is currently provided by the 296 Internet Society.