idnits 2.17.1 draft-ietf-tsvwg-sctp-ndata-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 4, 2016) is 2845 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) == Missing Reference: 'RFCXXXX' is mentioned on line 697, but not defined ** Obsolete normative reference: RFC 4960 (Obsoleted by RFC 9260) ** Obsolete normative reference: RFC 6096 (Obsoleted by RFC 9260) ** Obsolete normative reference: RFC 7053 (Obsoleted by RFC 9260) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group R. Stewart 3 Internet-Draft Netflix, Inc. 4 Intended status: Standards Track M. Tuexen 5 Expires: January 5, 2017 Muenster Univ. of Appl. Sciences 6 S. Loreto 7 Ericsson 8 R. Seggelmann 9 Metafinanz Informationssysteme GmbH 10 July 4, 2016 12 Stream Schedulers and User Message Interleaving for the Stream Control 13 Transmission Protocol 14 draft-ietf-tsvwg-sctp-ndata-06.txt 16 Abstract 18 The Stream Control Transmission Protocol (SCTP) is a message oriented 19 transport protocol supporting arbitrary large user messages. 20 However, the sender can not interleave different user messages which 21 causes head of line blocking at the sender side. To overcome this 22 limitation, this document adds a new data chunk to SCTP. 24 Whenever an SCTP sender is allowed to send a user data, it can 25 possibly choose from multiple outgoing SCTP streams. Multiple ways 26 for this selection, called stream schedulers, are defined. Some of 27 them don't require the support of user message interleaving, some do. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on January 5, 2017. 46 Copyright Notice 48 Copyright (c) 2016 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 1.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 3 65 1.2. Conventions . . . . . . . . . . . . . . . . . . . . . . . 5 66 2. User Message Interleaving . . . . . . . . . . . . . . . . . . 5 67 2.1. The I-DATA Chunk supporting User Message Interleaving . . 5 68 2.2. Procedures . . . . . . . . . . . . . . . . . . . . . . . 7 69 2.2.1. Negotiation . . . . . . . . . . . . . . . . . . . . . 7 70 2.2.2. Sender Side Considerations . . . . . . . . . . . . . 8 71 2.2.3. Receiver Side Considerations . . . . . . . . . . . . 8 72 2.3. Interaction with other SCTP Extensions . . . . . . . . . 8 73 2.3.1. SCTP Partial Reliability Extension . . . . . . . . . 9 74 2.3.2. SCTP Stream Reconfiguration Extension . . . . . . . . 10 75 3. Stream Schedulers . . . . . . . . . . . . . . . . . . . . . . 10 76 3.1. First Come First Serve (SCTP_SS_FCFS) . . . . . . . . . . 10 77 3.2. Round Robin Scheduler (SCTP_SS_RR) . . . . . . . . . . . 10 78 3.3. Round Robin Scheduler per Packet (SCTP_SS_RR_PKT) . . . . 10 79 3.4. Priority Based Scheduler (SCTP_SS_PRIO) . . . . . . . . . 11 80 3.5. Fair Bandwidth Scheduler (SCTP_SS_FB) . . . . . . . . . . 11 81 3.6. Weighted Fair Queueing Scheduler (SCTP_SS_WFQ) . . . . . 11 82 4. Socket API Considerations . . . . . . . . . . . . . . . . . . 11 83 4.1. Exposition of the Stream Sequence Number (SSN) . . . . . 11 84 4.2. SCTP_ASSOC_CHANGE Notification . . . . . . . . . . . . . 12 85 4.3. Socket Options . . . . . . . . . . . . . . . . . . . . . 12 86 4.3.1. Enable or Disable the Support of User Message 87 Interleaving (SCTP_INTERLEAVING_SUPPORTED) . . . . . 12 88 4.3.2. Get or Set the Stream Scheduler 89 (SCTP_STREAM_SCHEDULER) . . . . . . . . . . . . . . . 13 90 4.3.3. Get or Set the Stream Scheduler Parameter 91 (SCTP_STREAM_SCHEDULER_VALUE) . . . . . . . . . . . . 14 92 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 93 6. Security Considerations . . . . . . . . . . . . . . . . . . . 16 94 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 16 95 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 96 8.1. Normative References . . . . . . . . . . . . . . . . . . 16 97 8.2. Informative References . . . . . . . . . . . . . . . . . 17 98 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 100 1. Introduction 102 1.1. Overview 104 When SCTP [RFC4960] was initially designed it was mainly envisioned 105 for the transport of small signaling messages. Late in the design 106 stage it was decided to add support for fragmentation and reassembly 107 of larger messages with the thought that someday Session Initiation 108 Protocol (SIP) [RFC3261] style signaling messages may also need to 109 use SCTP and a single MTU sized message would be too small. 110 Unfortunately this design decision, though valid at the time, did not 111 account for other applications which might send very large messages 112 over SCTP. When such large messages are now sent over SCTP a form of 113 sender side head of line blocking becomes created within the 114 protocol. This head of line blocking is caused by the use of the 115 Transmission Sequence Number (TSN) for three different purposes: 117 1. As an identifier for DATA chunks to provide a reliable transfer. 119 2. As an identifier for the sequence of fragments to allow 120 reassembly. 122 3. As a sequence number allowing to have up to 2**16 - 1 Stream 123 Sequence Numbers (SSNs) outstanding. 125 The protocol requires all fragments of a user message to have 126 consecutive TSNs. Therefore it is impossible for the sender to 127 interleave different user messages. 129 This document also defines several stream schedulers for general SCTP 130 associations. If support for user message interleaving has been 131 negotiated, several more schedulers are available. 133 The following Figure 1 illustrates the behaviour of a round robin 134 stream scheduler using DATA chunks. Please note that the use of such 135 an scheduler implies late TSN assignment but it can be used with an 136 [RFC4960] compliant implementation not supporting user message 137 interleaving. 139 +---+---+---+ 140 | 0/0 |-+ 141 +---+---+---+ | 142 | +---+---+---+---+---+---+---+---+---+ 143 +---+---+---+ +->|1/2|1/1|2/0|2/0|2/0|1/0|0/0|0/0|0/0| 144 |1/2|1/1|1/0|--->|---|---|---|---|---|---|---|---|---| 145 +---+---+---+ +->| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 146 | +---+---+---+---+---+---+---+---+---+ 147 +---+---+---+ | 148 | 2/0 |-+ 149 +---+---+---+ 150 +-------+ 151 +-------+ |SID/SSN| 152 |SID/SSN| |-------| 153 +-------+ | TSN | 154 +-------+ 156 Figure 1: Round Robin Scheduler without User Message Interleaving 158 This document describes a new Data chunk called I-DATA. This chunk 159 incorporates all the flags and fields except the Stream Sequence 160 Number (SSN) and properties of the current SCTP Data chunk but also 161 adds two new fields in its chunk header, the Fragment Sequence Number 162 (FSN) and the Message Identifier (MID). Then the FSN is only used 163 for reassembling all fragments having the same MID and ordering 164 property. The TSN is used only for the reliable transfer in 165 combination with SACK chunks. 167 The MID is also used for ensuring ordered delivery, therefore 168 replacing the stream sequence number. Therefore, the head of line 169 blocking caused by the original design is avoided. 171 The following Figure 2 illustrates the behaviour of an interleaving 172 round robin stream scheduler using I-DATA chunks. 174 +---+---+---+ 175 | 0/0 |-+ 176 +---+---+---+ | 177 | +-----+-----+-----+-----+-----+-----+-----+-----+-----+ 178 +---+---+---+ +->|2/0/2|1/2/0|0/0/2|2/0/1|1/1/0|0/0/1|2/0/0|1/0/0|0/0/0| 179 |1/2|1/1|1/0|--->|-----|-----|-----|-----|-----|-----|-----|-----|-----| 180 +---+---+---+ +->| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 181 | +-----+-----+-----+-----+-----+-----+-----+-----+-----+ 182 +---+---+---+ | 183 | 2/0 |-+ 184 +---+---+---+ 185 +-----------+ 186 +-------+ |SID/MID/FSN| 187 |SID/MID| |-----------| 188 +-------+ | TSN | 189 +-----------+ 191 Figure 2: Round Robin Scheduler with User Message Interleaving 193 The support of the I-DATA chunk is negotiated during the association 194 setup using the Supported Extensions Parameter as defined in 195 [RFC5061]. If I-DATA support has been negotiated for an association 196 I-DATA chunks are used for all user-messages and no DATA chunks. It 197 should be noted, that an SCTP implementation needs to support the 198 coexistence of associations using DATA chunks and associations using 199 I-DATA chunks. 201 1.2. Conventions 203 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 204 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 205 document are to be interpreted as described in [RFC2119]. 207 2. User Message Interleaving 209 The interleaving of user messages is required for WebRTC Datachannels 210 as specified in [I-D.ietf-rtcweb-data-channel]. 212 2.1. The I-DATA Chunk supporting User Message Interleaving 214 The following Figure 3 shows the new I-DATA chunk allowing user 215 messages interleaving. 217 0 1 2 3 218 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 219 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 220 | Type = 64 | Res |I|U|B|E| Length | 221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 222 | TSN | 223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 224 | Stream Identifier | Reserved | 225 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 226 | Message Identifier | 227 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 228 | Payload Protocol Identifier / Fragment Sequence Number | 229 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 230 \ \ 231 / User Data / 232 \ \ 233 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 235 Figure 3: I-DATA chunk format 237 The only differences between the I-DATA chunk in Figure 3 and the 238 DATA chunk defined in [RFC4960] and [RFC7053] is the addition of the 239 new Message Identifier (MID) and Fragment Sequence Number (FSN) and 240 the removal of the Stream Sequence Number (SSN). The length of the 241 I-DATA chunk header is 20 bytes, which is 4 bytes more than the 242 length of the DATA chunk header defined in [RFC4960]. 244 The new fields are: 246 Reserved: 16 bits (unsigned integer) 247 This field is reserved. It MUST be set to 0 by the sender and 248 MUST be ignored by the receiver. 250 Message Identifier (MID): 32 bits (unsigned integer) 251 The MID is the same for all fragments of a user message, it is 252 used to determine which fragments (enumerated by the FSN) belong 253 to the same user message. For ordered user messages, the MID is 254 also used by the SCTP receiver to deliver the user messages in the 255 correct order to the upper layer (similar to the SSN of the DATA 256 chunk defined in [RFC4960]). The sender uses two counters for 257 each outgoing stream, one for ordered messages, one for unordered 258 messages. All counters are independent and initially 0. They are 259 incremented by 1 for each user message. Please note that the 260 serial number arithmetic defined in [RFC1982] using SERIAL_BITS = 261 32 applies. Therefore the sender MUST NOT have more than 2**31 - 262 1 ordered messages for each outgoing stream in flight and MUST NOT 263 have more than 2**31 - 1 unordered messages for each outgoing 264 stream in flight. Please note that the MID is in "network byte 265 order", a.k.a. Big Endian. 267 Payload Protocol Identifier (PPID) / Fragment Sequence Number (FSN): 268 32 bits (unsigned integer) 269 If the B bit is set, this field contains the PPID of the user 270 message. Note that in this case, this field is NOT touched by an 271 SCTP implementation; therefore, its byte order is not necessarily 272 in network byte order. The upper layer is responsible for any 273 byte order conversions to this field, similar to the PPID of DATA 274 chunks. In this case the FSN is implicitly considered to be 0. 275 If the B bit is not set, this field contains the FSN. The FSN is 276 used to enumerate all fragments of a single user message, starting 277 from 0 and incremented by 1. The last fragment of a message MUST 278 have the 'E' bit set. Note that the FSN MAY wrap completely 279 multiple times allowing arbitrary large user messages. For the 280 FSN the serial number arithmetic defined in [RFC1982] applies with 281 SERIAL_BITS = 32. Therefore a sender MUST NOT have more than 282 2**31 - 1 fragments of a single user message in flight. Please 283 note that the FSN is in "network byte order", a.k.a. Big Endian. 285 2.2. Procedures 287 This subsection describes how the support of the I-DATA chunk is 288 negotiated and how the I-DATA chunk is used by the sender and 289 receiver. 291 2.2.1. Negotiation 293 A sender MUST NOT send a I-DATA chunk unless both peers have 294 indicated its support of the I-DATA chunk type within the Supported 295 Extensions Parameter as defined in [RFC5061]. If I-DATA support has 296 been negotiated on an association, I-DATA chunks MUST be used for all 297 user messages and DATA-chunk MUST NOT be used. If I-DATA support has 298 not been negotiated on an association, DATA chunks MUST be used for 299 all user messages and I-DATA chunks MUST NOT be used. 301 A sender MUST NOT use the I-DATA chunk unless the user has requested 302 that use (e.g. via the socket API, see Section 4). This constraint 303 is made since usage of this chunk requires that the application be 304 willing to interleave messages upon reception within an association. 305 This is not the default choice within the socket API (see [RFC6458]) 306 thus the user MUST indicate support to the protocol of the reception 307 of completely interleaved messages. Note that for stacks that do not 308 implement [RFC6458] they may use other methods to indicate 309 interleaved message support and thus enable the usage of the I-DATA 310 chunk, the key is that the stack MUST know the application has 311 indicated its choice in wanting to use the extension. 313 2.2.2. Sender Side Considerations 315 Sender side usage of the I-DATA chunk is quite simple. Instead of 316 using the TSN for fragmentation purposes, the sender uses the new FSN 317 field to indicate which fragment number is being sent. The first 318 fragment MUST have the 'B' bit set. The last fragment MUST have the 319 'E' bit set. All other fragments MUST NOT have the 'B' or 'E' bit 320 set. All other properties of the existing SCTP DATA chunk also apply 321 to the I-DATA chunk, i.e. congestion control as well as receiver 322 window conditions MUST be observed as defined in [RFC4960]. 324 Note that the usage of this chunk implies the late assignment of the 325 actual TSN to any chunk being sent. Each I-DATA chunk uses a single 326 TSN. This way messages from other streams may be interleaved with 327 the fragmented message. Please note that this is the only form of 328 interleaving support. For example, it is not possible to interleave 329 multiple ordered or unordered user messages from the same stream. 331 The sender MUST NOT be fragmenting more than one user message in any 332 given stream at any time. At any time, a sender MAY fragment 333 multiple user message, each of them on different streams. 335 The sender MUST assign TSN's in a way that the receiver can make 336 progress. One way to achieve this is to assign the later fragments 337 of a user message a higher TSN and send out the TSNs in sequence. 339 2.2.3. Receiver Side Considerations 341 Upon reception of an SCTP packet containing a I-DATA chunk if the 342 message needs to be reassembled, then the receiver MUST use the FSN 343 for reassembly of the message and not the TSN. The receiver MUST NOT 344 make any assumption about the TSN assignments of the sender. Note 345 that a non-fragmented message is indicated by the fact that both the 346 'E' and 'B' bits are set. An ordered or unordered fragmented message 347 is thus identified by not having both bits set. 349 2.3. Interaction with other SCTP Extensions 351 The usage of the I-DATA chunk might interfere with other SCTP 352 extensions. Future SCTP extensions MUST describe if and how they 353 interfere with the usage of I-DATA chunks. For the SCTP extensions 354 already defined when this document was published, the details are 355 given in the following subsections. 357 2.3.1. SCTP Partial Reliability Extension 359 When the SCTP extension defined in [RFC3758] is used in combination 360 with the user message interleaving extension, the new I-FORWARD-TSN 361 chunk MUST be used instead of the FORWARD-TSN chunk. The difference 362 between the FORWARD-TSN and the I-FORWARD-TSN chunk is that the 363 16-bit Stream Sequence Number (SSN) has been replaced by the 32-bit 364 Message Identifier (MID). To keep the memory aligned, a 16-bit 365 reserved field has also been added. 367 0 1 2 3 368 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 369 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 370 | Type = 194 | Flags = 0x00 | Length = Variable | 371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 372 | New Cumulative TSN | 373 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 374 | Stream Identifier 1 | Reserved | 375 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 376 | Message Identifier 1 | 377 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 378 \ \ 379 / / 380 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 381 | Stream Identifier N | Reserved | 382 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 383 | Message Identifier N | 384 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 386 Figure 4: I-FORWARD-TSN chunk format 388 Reserved: 16 bits (unsigned integer) 389 This field is reserved. It MUST be set to 0 by the sender and 390 MUST be ignored by the receiver. 392 Message Identifier (MID): 32 bits (unsigned integer) 393 This ordered user messages, this field corresponds to the SSN 394 field in the FORWARD-TSN chunk. It is just a 32-bit number 395 instead of a 16-bit number. In case of abandoned unordered 396 messages, the handling corresponds to the handling for ordered 397 messages, since when using I-DATA chunks, they can also be 398 identified by the MID. 400 The FORWARD-TSN chunk MUST be used in combination with the DATA chunk 401 and MUST NOT be used in combination with the I-DATA chunk. The I- 402 FORWARD-TSN chunk MUST be used in combination with the I-DATA chunk 403 and MUST NOT be used in combination with the DATA chunk. 405 Support for the I-FORWARD-TSN chunk is negotiated during the SCTP 406 association setup via the Supported Extensions Parameter as defined 407 in [RFC5061]. Only if both end points support the I-DATA chunk and 408 the I-FORWARD-TSN chunk, the partial reliability extension can be 409 used in combination with user message interleaving. 411 2.3.2. SCTP Stream Reconfiguration Extension 413 When an association resets the SSN using the SCTP extension defined 414 in [RFC6525], the two counters (one for the ordered messages, one for 415 the unordered messages) used for the MID MUST be reset to 0 416 correspondingly. 418 Since most schedulers, especially all schedulers when supporting user 419 message interleaving, require late TSN assignment, it should be noted 420 that the implementation of [RFC6525] needs to handle this. 422 3. Stream Schedulers 424 This section defines several stream schedulers. The streams 425 schedulers may behave differently depending on whether user message 426 interleaving has been negotiated for the association or not. 428 3.1. First Come First Serve (SCTP_SS_FCFS) 430 The simple first-come, first-serve scheduler of user messages is 431 used. It just passes through the messages in the order in which they 432 have been delivered by the application. No modification of the order 433 is done at all. The usage of user message interleaving does not 434 affect the sending of the chunks, except that I-DATA chunks are used 435 instead of DATA chunks. 437 3.2. Round Robin Scheduler (SCTP_SS_RR) 439 When not using user message interleaving, this scheduler provides a 440 fair scheduling based on the number of user messages by cycling 441 around non-empty stream queues. When using user message 442 interleaving, this scheduler provides a fair scheduling based on the 443 number of I-DATA chunks by cycling around non-empty stream queues. 445 3.3. Round Robin Scheduler per Packet (SCTP_SS_RR_PKT) 447 This is a round-robin scheduler but bundles only DATA or I-DATA 448 chunks referring to the same stream in a packet. This minimizes 449 head-of-line blocking when a packet is lost because only a single 450 stream is affected. 452 3.4. Priority Based Scheduler (SCTP_SS_PRIO) 454 Scheduling of user messages with strict priorities is used. The 455 priority is configurable per outgoing SCTP stream. Streams having a 456 higher priority will be scheduled first and when multiple streams 457 have the same priority, the scheduling between them is implementation 458 specific. When using user message interleaving, the sending of lower 459 priority user messages will not block the sending of higher priority 460 user messages. 462 3.5. Fair Bandwidth Scheduler (SCTP_SS_FB) 464 A fair bandwidth distribution between the streams is used. This 465 scheduler considers the lengths of the messages of each stream and 466 schedules them in a certain way to maintain an equal bandwidth for 467 all streams. The details are implementation specific. Using user 468 message interleaving allows for a better realization of the fair 469 bandwidth usage. 471 3.6. Weighted Fair Queueing Scheduler (SCTP_SS_WFQ) 473 A weighted fair queueing scheduler between the streams is used. The 474 weight is configurable per outgoing SCTP stream. This scheduler 475 considers the lengths of the messages of each stream and schedules 476 them in a certain way to use the bandwidth according to the given 477 weights. The details are implementation specific. Using user 478 message interleaving allows for a better realization of the bandwidth 479 usage according to the given weights. 481 This scheduler in combination with user message interleaving is used 482 for WebRTC Datachannels as specified in 483 [I-D.ietf-rtcweb-data-channel]. 485 4. Socket API Considerations 487 This section describes how the socket API defined in [RFC6458] is 488 extended to allow applications to use the extension described in this 489 document. 491 Please note that this section is informational only. 493 4.1. Exposition of the Stream Sequence Number (SSN) 495 The socket API defined in [RFC6458] defines several structures in 496 which the SSN of a received user message is exposed to the 497 application. The list of these structures includes: 499 struct sctp_sndrcvinfo 500 Specified in Section 5.3.2 of [RFC6458] and being deprecated. 502 struct sctp_extrcvinfo 503 Specified in Section 5.3.3 of [RFC6458] and being deprecated. 505 struct sctp_rcvinfo 506 Specified in Section 5.3.5 of [RFC6458]. 508 If user message interleaving is used, the lower order 16 bits of the 509 MID are used as the SSN when filling out these structures. 511 4.2. SCTP_ASSOC_CHANGE Notification 513 When an SCTP_ASSOC_CHANGE notification is delivered indicating a 514 sac_state of SCTP_COMM_UP or SCTP_RESTART for an SCTP association 515 where both peers support the I-DATA chunk, 516 SCTP_ASSOC_SUPPORTS_INTERLEAVING should be listed in the sac_info 517 field. 519 4.3. Socket Options 521 +-----------------------------+-------------------------+-----+-----+ 522 | option name | data type | get | set | 523 +-----------------------------+-------------------------+-----+-----+ 524 | SCTP_INTERLEAVING_SUPPORTED | struct sctp_assoc_value | X | X | 525 | SCTP_STREAM_SCHEDULER | struct sctp_assoc_value | X | X | 526 | SCTP_STREAM_SCHEDULER_VALUE | struct | X | X | 527 | | sctp_stream_value | | | 528 +-----------------------------+-------------------------+-----+-----+ 530 4.3.1. Enable or Disable the Support of User Message Interleaving 531 (SCTP_INTERLEAVING_SUPPORTED) 533 This socket option allows the enabling or disabling of the 534 negotiation of user message interleaving support for future 535 associations. For existing associations it allows to query whether 536 user message interleaving support was negotiated or not on a 537 particular association. 539 User message interleaving is disabled per default. 541 This socket option uses IPPROTO_SCTP as its level and 542 SCTP_INTERLEAVING_SUPPORTED as its name. It can be used with 543 getsockopt() and setsockopt(). The socket option value uses the 544 following structure defined in [RFC6458]: 546 struct sctp_assoc_value { 547 sctp_assoc_t assoc_id; 548 uint32_t assoc_value; 549 }; 551 assoc_id: This parameter is ignored for one-to-one style sockets. 552 For one-to-many style sockets, this parameter indicates upon which 553 association the user is performing an action. The special 554 sctp_assoc_t SCTP_FUTURE_ASSOC can also be used, it is an error to 555 use SCTP_{CURRENT|ALL}_ASSOC in assoc_id. 557 assoc_value: A non-zero value encodes the enabling of user message 558 interleaving whereas a value of 0 encodes the disabling of user 559 message interleaving. 561 sctp_opt_info() needs to be extended to support 562 SCTP_INTERLEAVING_SUPPORTED. 564 An application using user message interleaving should also set the 565 fragment interleave level to 2 by using the SCTP_FRAGMENT_INTERLEAVE 566 socket option specified in Section 8.1.20 of [RFC6458]. This allows 567 the interleaving of user messages from different streams. Please 568 note that it does not allow the interleaving of ordered and unordered 569 user messages on the same stream. Failure to set this option can 570 possibly lead to application deadlock. Some implementations might 571 therefore put some restrictions on setting combinations of these 572 values. 574 4.3.2. Get or Set the Stream Scheduler (SCTP_STREAM_SCHEDULER) 576 A stream scheduler can be selected with the SCTP_STREAM_SCHEDULER 577 option for setsockopt(). The struct sctp_assoc_value is used to 578 specify the association for which the scheduler should be changed and 579 the value of the desired algorithm. 581 The definition of struct sctp_assoc_value is the same as in 582 [RFC6458]: 584 struct sctp_assoc_value { 585 sctp_assoc_t assoc_id; 586 uint32_t assoc_value; 587 }; 589 assoc_id: Holds the identifier for the association of which the 590 scheduler should be changed. The special 591 SCTP_{FUTURE|CURRENT|ALL}_ASSOC can also be used. This parameter 592 is ignored for one-to-one style sockets. 594 assoc_value: This specifies which scheduler is used. The following 595 constants can be used: 597 SCTP_SS_DEFAULT: The default scheduler used by the SCTP 598 implementation. Typical values are SCTP_SS_FCFS or SCTP_SS_RR. 600 SCTP_SS_FCFS: Use the scheduler specified in Section 3.1. 602 SCTP_SS_RR: Use the scheduler specified in Section 3.2. 604 SCTP_SS_RR_PKT: Use the scheduler specified in Section 3.3. 606 SCTP_SS_PRIO: Use the scheduler specified in Section 3.4. The 607 priority can be assigned with the sctp_stream_value struct. 608 The higher the assigned value, the lower the priority, that is 609 the default value 0 is the highest priority and therefore the 610 default scheduling will be used if no priorities have been 611 assigned. 613 SCTP_SS_FB: Use the scheduler specified in Section 3.5. 615 SCTP_SS_WFQ: Use the scheduler specified in Section 3.6. The 616 weight can be assigned with the sctp_stream_value struct. 618 4.3.3. Get or Set the Stream Scheduler Parameter 619 (SCTP_STREAM_SCHEDULER_VALUE) 621 Some schedulers require additional information to be set for 622 individual streams as shown in the following table: 624 +-----------------+-----------------+ 625 | name | per stream info | 626 +-----------------+-----------------+ 627 | SCTP_SS_DEFAULT | n/a | 628 | SCTP_SS_FCFS | no | 629 | SCTP_SS_RR | no | 630 | SCTP_SS_RR_PKT | no | 631 | SCTP_SS_PRIO | yes | 632 | SCTP_SS_FB | no | 633 | SCTP_SS_WFQ | yes | 634 +-----------------+-----------------+ 636 This is achieved with the SCTP_STREAM_SCHEDULER_VALUE option and the 637 corresponding struct sctp_stream_value. The definition of struct 638 sctp_stream_value is as follows: 640 struct sctp_stream_value { 641 sctp_assoc_t assoc_id; 642 uint16_t stream_id; 643 uint16_t stream_value; 644 }; 646 assoc_id: Holds the identifier for the association of which the 647 scheduler should be changed. The special 648 SCTP_{FUTURE|CURRENT|ALL}_ASSOC can also be used. This parameter 649 is ignored for one-to-one style sockets. 651 stream_id: Holds the stream id for the stream for which additional 652 information has to be provided. 654 stream_value: The meaning of this field depends on the scheduler 655 specified. It is ignored when the scheduler does not need 656 additional information. 658 5. IANA Considerations 660 [NOTE to RFC-Editor: 662 "RFCXXXX" is to be replaced by the RFC number you assign this 663 document. 665 ] 667 [NOTE to RFC-Editor: 669 The suggested values for the chunk type and the chunk flags are 670 tentative and to be confirmed by IANA. 672 ] 674 This document (RFCXXXX) is the reference for all registrations 675 described in this section. 677 A new chunk type has to be assigned by IANA. IANA should assign this 678 value from the pool of chunks with the upper two bits set to '01'. 679 This requires an additional line in the "Chunk Types" registry for 680 SCTP: 682 +----------+-------------------------+-----------+ 683 | ID Value | Chunk Type | Reference | 684 +----------+-------------------------+-----------+ 685 | 64 | New DATA chunk (I-DATA) | [RFCXXXX] | 686 +----------+-------------------------+-----------+ 688 The registration table as defined in [RFC6096] for the chunk flags of 689 this chunk type is initially given by the following table: 691 +------------------+-----------------+-----------+ 692 | Chunk Flag Value | Chunk Flag Name | Reference | 693 +------------------+-----------------+-----------+ 694 | 0x01 | E bit | [RFCXXXX] | 695 | 0x02 | B bit | [RFCXXXX] | 696 | 0x04 | U bit | [RFCXXXX] | 697 | 0x08 | I bit | [RFCXXXX] | 698 | 0x10 | Unassigned | | 699 | 0x20 | Unassigned | | 700 | 0x40 | Unassigned | | 701 | 0x80 | Unassigned | | 702 +------------------+-----------------+-----------+ 704 6. Security Considerations 706 This document does not add any additional security considerations in 707 addition to the ones given in [RFC4960] and [RFC6458]. 709 7. Acknowledgments 711 The authors wish to thank Christer Holmberg, Marcelo Ricardo Leitner, 712 Karen E. Egede Nielsen, Irene Ruengeler, Felix Weinrank, and Lixia 713 Zhang for her invaluable comments. 715 This work has received funding from the European Union's Horizon 2020 716 research and innovation programme under grant agreement No. 644334 717 (NEAT). The views expressed are solely those of the author(s). 719 8. References 721 8.1. Normative References 723 [RFC1982] Elz, R. and R. Bush, "Serial Number Arithmetic", RFC 1982, 724 DOI 10.17487/RFC1982, August 1996, 725 . 727 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 728 Requirement Levels", BCP 14, RFC 2119, 729 DOI 10.17487/RFC2119, March 1997, 730 . 732 [RFC3758] Stewart, R., Ramalho, M., Xie, Q., Tuexen, M., and P. 733 Conrad, "Stream Control Transmission Protocol (SCTP) 734 Partial Reliability Extension", RFC 3758, 735 DOI 10.17487/RFC3758, May 2004, 736 . 738 [RFC4960] Stewart, R., Ed., "Stream Control Transmission Protocol", 739 RFC 4960, DOI 10.17487/RFC4960, September 2007, 740 . 742 [RFC5061] Stewart, R., Xie, Q., Tuexen, M., Maruyama, S., and M. 743 Kozuka, "Stream Control Transmission Protocol (SCTP) 744 Dynamic Address Reconfiguration", RFC 5061, 745 DOI 10.17487/RFC5061, September 2007, 746 . 748 [RFC6096] Tuexen, M. and R. Stewart, "Stream Control Transmission 749 Protocol (SCTP) Chunk Flags Registration", RFC 6096, 750 DOI 10.17487/RFC6096, January 2011, 751 . 753 [RFC6525] Stewart, R., Tuexen, M., and P. Lei, "Stream Control 754 Transmission Protocol (SCTP) Stream Reconfiguration", 755 RFC 6525, DOI 10.17487/RFC6525, February 2012, 756 . 758 [RFC7053] Tuexen, M., Ruengeler, I., and R. Stewart, "SACK- 759 IMMEDIATELY Extension for the Stream Control Transmission 760 Protocol", RFC 7053, DOI 10.17487/RFC7053, November 2013, 761 . 763 8.2. Informative References 765 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 766 A., Peterson, J., Sparks, R., Handley, M., and E. 767 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 768 DOI 10.17487/RFC3261, June 2002, 769 . 771 [RFC6458] Stewart, R., Tuexen, M., Poon, K., Lei, P., and V. 772 Yasevich, "Sockets API Extensions for the Stream Control 773 Transmission Protocol (SCTP)", RFC 6458, 774 DOI 10.17487/RFC6458, December 2011, 775 . 777 [I-D.ietf-rtcweb-data-channel] 778 Jesup, R., Loreto, S., and M. Tuexen, "WebRTC Data 779 Channels", draft-ietf-rtcweb-data-channel-13 (work in 780 progress), January 2015. 782 Authors' Addresses 784 Randall R. Stewart 785 Netflix, Inc. 786 Chapin, SC 29036 787 United States 789 Email: randall@lakerest.net 791 Michael Tuexen 792 Muenster University of Applied Sciences 793 Stegerwaldstrasse 39 794 48565 Steinfurt 795 Germany 797 Email: tuexen@fh-muenster.de 799 Salvatore Loreto 800 Ericsson 801 Hirsalantie 11 802 Jorvas 02420 803 Finland 805 Email: Salvatore.Loreto@ericsson.com 807 Robin Seggelmann 808 Metafinanz Informationssysteme GmbH 809 Leopoldstrasse 146 810 80804 Muenchen 811 Germany 813 Email: rfc@robin-seggelmann.com