idnits 2.17.1 draft-ietf-tsvwg-rfc4960-bis-04.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 seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 26, 2019) is 1735 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. 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: 'ASSOCIATE' is mentioned on line 2384, but not defined == Missing Reference: 'SHUTDOWN' is mentioned on line 2415, but not defined == Missing Reference: 'ABORT' is mentioned on line 2378, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU.V42.1994' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 4960 (Obsoleted by RFC 9260) -- Obsolete informational reference (is this intentional?): RFC 7053 (Obsoleted by RFC 9260) -- Obsolete informational reference (is this intentional?): RFC 8540 (Obsoleted by RFC 9260) Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 6 comments (--). 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 Obsoletes: 4960 (if approved) M. Tuexen 5 Intended status: Standards Track Muenster Univ. of Appl. Sciences 6 Expires: January 27, 2020 K. Nielsen 7 Kamstrup A/S 8 July 26, 2019 10 Stream Control Transmission Protocol 11 draft-ietf-tsvwg-rfc4960-bis-04 13 Abstract 15 This document obsoletes RFC 4960, if approved. It describes the 16 Stream Control Transmission Protocol (SCTP). SCTP is designed to 17 transport Public Switched Telephone Network (PSTN) signaling messages 18 over IP networks, but is capable of broader applications. 20 SCTP is a reliable transport protocol operating on top of a 21 connectionless packet network such as IP. It offers the following 22 services to its users: 24 o acknowledged error-free non-duplicated transfer of user data, 26 o data fragmentation to conform to discovered path MTU size, 28 o sequenced delivery of user messages within multiple streams, with 29 an option for order-of-arrival delivery of individual user 30 messages, 32 o optional bundling of multiple user messages into a single SCTP 33 packet, and 35 o network-level fault tolerance through supporting of multi-homing 36 at either or both ends of an association. 38 The design of SCTP includes appropriate congestion avoidance behavior 39 and resistance to flooding and masquerade attacks. 41 Status of This Memo 43 This Internet-Draft is submitted in full conformance with the 44 provisions of BCP 78 and BCP 79. 46 Internet-Drafts are working documents of the Internet Engineering 47 Task Force (IETF). Note that other groups may also distribute 48 working documents as Internet-Drafts. The list of current Internet- 49 Drafts is at https://datatracker.ietf.org/drafts/current/. 51 Internet-Drafts are draft documents valid for a maximum of six months 52 and may be updated, replaced, or obsoleted by other documents at any 53 time. It is inappropriate to use Internet-Drafts as reference 54 material or to cite them other than as "work in progress." 56 This Internet-Draft will expire on January 27, 2020. 58 Copyright Notice 60 Copyright (c) 2019 IETF Trust and the persons identified as the 61 document authors. All rights reserved. 63 This document is subject to BCP 78 and the IETF Trust's Legal 64 Provisions Relating to IETF Documents 65 (https://trustee.ietf.org/license-info) in effect on the date of 66 publication of this document. Please review these documents 67 carefully, as they describe your rights and restrictions with respect 68 to this document. Code Components extracted from this document must 69 include Simplified BSD License text as described in Section 4.e of 70 the Trust Legal Provisions and are provided without warranty as 71 described in the Simplified BSD License. 73 This document may contain material from IETF Documents or IETF 74 Contributions published or made publicly available before November 75 10, 2008. The person(s) controlling the copyright in some of this 76 material may not have granted the IETF Trust the right to allow 77 modifications of such material outside the IETF Standards Process. 78 Without obtaining an adequate license from the person(s) controlling 79 the copyright in such materials, this document may not be modified 80 outside the IETF Standards Process, and derivative works of it may 81 not be created outside the IETF Standards Process, except to format 82 it for publication as an RFC or to translate it into languages other 83 than English. 85 Table of Contents 87 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 88 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 6 89 1.2. Architectural View of SCTP . . . . . . . . . . . . . . . 6 90 1.3. Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 7 91 1.4. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 11 92 1.5. Functional View of SCTP . . . . . . . . . . . . . . . . . 11 93 1.5.1. Association Startup and Takedown . . . . . . . . . . 12 94 1.5.2. Sequenced Delivery within Streams . . . . . . . . . . 13 95 1.5.3. User Data Fragmentation . . . . . . . . . . . . . . . 13 96 1.5.4. Acknowledgement and Congestion Avoidance . . . . . . 13 97 1.5.5. Chunk Bundling . . . . . . . . . . . . . . . . . . . 14 98 1.5.6. Packet Validation . . . . . . . . . . . . . . . . . . 14 99 1.5.7. Path Management . . . . . . . . . . . . . . . . . . . 14 100 1.6. Serial Number Arithmetic . . . . . . . . . . . . . . . . 15 101 1.7. Changes from RFC 4960 . . . . . . . . . . . . . . . . . . 16 102 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 16 103 3. SCTP Packet Format . . . . . . . . . . . . . . . . . . . . . 16 104 3.1. SCTP Common Header Field Descriptions . . . . . . . . . . 17 105 3.2. Chunk Field Descriptions . . . . . . . . . . . . . . . . 18 106 3.2.1. Optional/Variable-Length Parameter Format . . . . . . 20 107 3.2.2. Reporting of Unrecognized Parameters . . . . . . . . 22 108 3.3. SCTP Chunk Definitions . . . . . . . . . . . . . . . . . 22 109 3.3.1. Payload Data (DATA) (0) . . . . . . . . . . . . . . . 22 110 3.3.2. Initiation (INIT) (1) . . . . . . . . . . . . . . . . 25 111 3.3.2.1. Optional/Variable-Length Parameters in INIT . . . 28 112 3.3.3. Initiation Acknowledgement (INIT ACK) (2) . . . . . . 31 113 3.3.3.1. Optional or Variable-Length Parameters . . . . . 34 114 3.3.4. Selective Acknowledgement (SACK) (3) . . . . . . . . 35 115 3.3.5. Heartbeat Request (HEARTBEAT) (4) . . . . . . . . . . 39 116 3.3.6. Heartbeat Acknowledgement (HEARTBEAT ACK) (5) . . . . 40 117 3.3.7. Abort Association (ABORT) (6) . . . . . . . . . . . . 41 118 3.3.8. Shutdown Association (SHUTDOWN) (7) . . . . . . . . . 42 119 3.3.9. Shutdown Acknowledgement (SHUTDOWN ACK) (8) . . . . . 42 120 3.3.10. Operation Error (ERROR) (9) . . . . . . . . . . . . . 43 121 3.3.10.1. Invalid Stream Identifier (1) . . . . . . . . . 44 122 3.3.10.2. Missing Mandatory Parameter (2) . . . . . . . . 45 123 3.3.10.3. Stale Cookie Error (3) . . . . . . . . . . . . . 45 124 3.3.10.4. Out of Resource (4) . . . . . . . . . . . . . . 46 125 3.3.10.5. Unresolvable Address (5) . . . . . . . . . . . . 46 126 3.3.10.6. Unrecognized Chunk Type (6) . . . . . . . . . . 46 127 3.3.10.7. Invalid Mandatory Parameter (7) . . . . . . . . 47 128 3.3.10.8. Unrecognized Parameters (8) . . . . . . . . . . 47 129 3.3.10.9. No User Data (9) . . . . . . . . . . . . . . . . 48 130 3.3.10.10. Cookie Received While Shutting Down (10) . . . . 48 131 3.3.10.11. Restart of an Association with New Addresses 132 (11) . . . . . . . . . . . . . . . . . . . . . . 49 133 3.3.10.12. User-Initiated Abort (12) . . . . . . . . . . . 49 134 3.3.10.13. Protocol Violation (13) . . . . . . . . . . . . 49 135 3.3.11. Cookie Echo (COOKIE ECHO) (10) . . . . . . . . . . . 50 136 3.3.12. Cookie Acknowledgement (COOKIE ACK) (11) . . . . . . 51 137 3.3.13. Shutdown Complete (SHUTDOWN COMPLETE) (14) . . . . . 51 138 4. SCTP Association State Diagram . . . . . . . . . . . . . . . 52 139 5. Association Initialization . . . . . . . . . . . . . . . . . 55 140 5.1. Normal Establishment of an Association . . . . . . . . . 55 141 5.1.1. Handle Stream Parameters . . . . . . . . . . . . . . 57 142 5.1.2. Handle Address Parameters . . . . . . . . . . . . . . 58 143 5.1.3. Generating State Cookie . . . . . . . . . . . . . . . 59 144 5.1.4. State Cookie Processing . . . . . . . . . . . . . . . 60 145 5.1.5. State Cookie Authentication . . . . . . . . . . . . . 60 146 5.1.6. An Example of Normal Association Establishment . . . 61 147 5.2. Handle Duplicate or Unexpected INIT, INIT ACK, COOKIE 148 ECHO, and COOKIE ACK . . . . . . . . . . . . . . . . . . 63 149 5.2.1. INIT Received in COOKIE-WAIT or COOKIE-ECHOED State 150 (Item B) . . . . . . . . . . . . . . . . . . . . . . 63 151 5.2.2. Unexpected INIT in States Other than CLOSED, COOKIE- 152 ECHOED, COOKIE-WAIT, and SHUTDOWN-ACK-SENT . . . . . 64 153 5.2.3. Unexpected INIT ACK . . . . . . . . . . . . . . . . . 65 154 5.2.4. Handle a COOKIE ECHO when a TCB Exists . . . . . . . 65 155 5.2.4.1. An Example of a Association Restart . . . . . . . 67 156 5.2.5. Handle Duplicate COOKIE ACK . . . . . . . . . . . . . 69 157 5.2.6. Handle Stale COOKIE Error . . . . . . . . . . . . . . 69 158 5.3. Other Initialization Issues . . . . . . . . . . . . . . . 69 159 5.3.1. Selection of Tag Value . . . . . . . . . . . . . . . 69 160 5.4. Path Verification . . . . . . . . . . . . . . . . . . . . 70 161 6. User Data Transfer . . . . . . . . . . . . . . . . . . . . . 71 162 6.1. Transmission of DATA Chunks . . . . . . . . . . . . . . . 73 163 6.2. Acknowledgement on Reception of DATA Chunks . . . . . . . 76 164 6.2.1. Processing a Received SACK . . . . . . . . . . . . . 79 165 6.3. Management of Retransmission Timer . . . . . . . . . . . 81 166 6.3.1. RTO Calculation . . . . . . . . . . . . . . . . . . . 81 167 6.3.2. Retransmission Timer Rules . . . . . . . . . . . . . 82 168 6.3.3. Handle T3-rtx Expiration . . . . . . . . . . . . . . 83 169 6.4. Multi-Homed SCTP Endpoints . . . . . . . . . . . . . . . 84 170 6.4.1. Failover from an Inactive Destination Address . . . . 86 171 6.5. Stream Identifier and Stream Sequence Number . . . . . . 86 172 6.6. Ordered and Unordered Delivery . . . . . . . . . . . . . 86 173 6.7. Report Gaps in Received DATA TSNs . . . . . . . . . . . . 87 174 6.8. CRC32c Checksum Calculation . . . . . . . . . . . . . . . 88 175 6.9. Fragmentation and Reassembly . . . . . . . . . . . . . . 89 176 6.10. Bundling . . . . . . . . . . . . . . . . . . . . . . . . 90 177 7. Congestion Control . . . . . . . . . . . . . . . . . . . . . 91 178 7.1. SCTP Differences from TCP Congestion Control . . . . . . 92 179 7.2. SCTP Slow-Start and Congestion Avoidance . . . . . . . . 93 180 7.2.1. Slow-Start . . . . . . . . . . . . . . . . . . . . . 94 181 7.2.2. Congestion Avoidance . . . . . . . . . . . . . . . . 95 182 7.2.3. Congestion Control . . . . . . . . . . . . . . . . . 96 183 7.2.4. Fast Retransmit on Gap Reports . . . . . . . . . . . 96 184 7.2.5. Making Changes to Differentiated Services Code Points 97 185 7.3. Path MTU Discovery . . . . . . . . . . . . . . . . . . . 98 186 8. Fault Management . . . . . . . . . . . . . . . . . . . . . . 98 187 8.1. Endpoint Failure Detection . . . . . . . . . . . . . . . 98 188 8.2. Path Failure Detection . . . . . . . . . . . . . . . . . 99 189 8.3. Path Heartbeat . . . . . . . . . . . . . . . . . . . . . 100 190 8.4. Handle "Out of the Blue" Packets . . . . . . . . . . . . 102 191 8.5. Verification Tag . . . . . . . . . . . . . . . . . . . . 103 192 8.5.1. Exceptions in Verification Tag Rules . . . . . . . . 103 193 9. Termination of Association . . . . . . . . . . . . . . . . . 104 194 9.1. Abort of an Association . . . . . . . . . . . . . . . . . 105 195 9.2. Shutdown of an Association . . . . . . . . . . . . . . . 105 196 10. Interface with Upper Layer . . . . . . . . . . . . . . . . . 108 197 10.1. ULP-to-SCTP . . . . . . . . . . . . . . . . . . . . . . 108 198 10.2. SCTP-to-ULP . . . . . . . . . . . . . . . . . . . . . . 117 199 11. Security Considerations . . . . . . . . . . . . . . . . . . . 119 200 11.1. Security Objectives . . . . . . . . . . . . . . . . . . 119 201 11.2. SCTP Responses to Potential Threats . . . . . . . . . . 119 202 11.2.1. Countering Insider Attacks . . . . . . . . . . . . . 120 203 11.2.2. Protecting against Data Corruption in the Network . 120 204 11.2.3. Protecting Confidentiality . . . . . . . . . . . . . 120 205 11.2.4. Protecting against Blind Denial-of-Service Attacks . 121 206 11.2.4.1. Flooding . . . . . . . . . . . . . . . . . . . . 121 207 11.2.4.2. Blind Masquerade . . . . . . . . . . . . . . . . 122 208 11.2.4.3. Improper Monopolization of Services . . . . . . 123 209 11.3. SCTP Interactions with Firewalls . . . . . . . . . . . . 123 210 11.4. Protection of Non-SCTP-Capable Hosts . . . . . . . . . . 123 211 12. Network Management Considerations . . . . . . . . . . . . . . 124 212 13. Recommended Transmission Control Block (TCB) Parameters . . . 124 213 13.1. Parameters Necessary for the SCTP Instance . . . . . . . 124 214 13.2. Parameters Necessary per Association (i.e., the TCB) . . 125 215 13.3. Per Transport Address Data . . . . . . . . . . . . . . . 126 216 13.4. General Parameters Needed . . . . . . . . . . . . . . . 127 217 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 127 218 14.1. IETF-Defined Chunk Extension . . . . . . . . . . . . . . 127 219 14.2. IETF Chunk Flags Registration . . . . . . . . . . . . . 128 220 14.3. IETF-Defined Chunk Parameter Extension . . . . . . . . . 128 221 14.4. IETF-Defined Additional Error Causes . . . . . . . . . . 128 222 14.5. Payload Protocol Identifiers . . . . . . . . . . . . . . 129 223 14.6. Port Numbers Registry . . . . . . . . . . . . . . . . . 129 224 15. Suggested SCTP Protocol Parameter Values . . . . . . . . . . 131 225 16. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 131 226 17. References . . . . . . . . . . . . . . . . . . . . . . . . . 132 227 17.1. Normative References . . . . . . . . . . . . . . . . . . 132 228 17.2. Informative References . . . . . . . . . . . . . . . . . 134 229 Appendix A. Explicit Congestion Notification . . . . . . . . . . 136 230 Appendix B. CRC32c Checksum Calculation . . . . . . . . . . . . 137 231 Appendix C. ICMP Handling . . . . . . . . . . . . . . . . . . . 144 232 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 146 234 1. Introduction 236 This section explains the reasoning behind the development of the 237 Stream Control Transmission Protocol (SCTP), the services it offers, 238 and the basic concepts needed to understand the detailed description 239 of the protocol. 241 This document obsoletes [RFC4960], if approved. 243 1.1. Motivation 245 TCP [RFC0793] has performed immense service as the primary means of 246 reliable data transfer in IP networks. However, an increasing number 247 of recent applications have found TCP too limiting, and have 248 incorporated their own reliable data transfer protocol on top of UDP 249 [RFC0768]. The limitations that users have wished to bypass include 250 the following: 252 o TCP provides both reliable data transfer and strict order-of- 253 transmission delivery of data. Some applications need reliable 254 transfer without sequence maintenance, while others would be 255 satisfied with partial ordering of the data. In both of these 256 cases, the head-of-line blocking offered by TCP causes unnecessary 257 delay. 259 o The stream-oriented nature of TCP is often an inconvenience. 260 Applications add their own record marking to delineate their 261 messages, and make explicit use of the push facility to ensure 262 that a complete message is transferred in a reasonable time. 264 o The limited scope of TCP sockets complicates the task of providing 265 highly-available data transfer capability using multi-homed hosts. 267 o TCP is relatively vulnerable to denial-of-service attacks, such as 268 SYN attacks. 270 Transport of PSTN signaling across the IP network is an application 271 for which all of these limitations of TCP are relevant. While this 272 application directly motivated the development of SCTP, other 273 applications might find SCTP a good match to their requirements. 275 1.2. Architectural View of SCTP 277 SCTP is viewed as a layer between the SCTP user application ("SCTP 278 user" for short) and a connectionless packet network service such as 279 IP. The remainder of this document assumes SCTP runs on top of IP. 280 The basic service offered by SCTP is the reliable transfer of user 281 messages between peer SCTP users. It performs this service within 282 the context of an association between two SCTP endpoints. Section 10 283 of this document sketches the API that exists at the boundary between 284 the SCTP and the SCTP user layers. 286 SCTP is connection-oriented in nature, but the SCTP association is a 287 broader concept than the TCP connection. SCTP provides the means for 288 each SCTP endpoint (Section 1.3) to provide the other endpoint 289 (during association startup) with a list of transport addresses 290 (i.e., multiple IP addresses in combination with an SCTP port) 291 through which that endpoint can be reached and from which it will 292 originate SCTP packets. The association spans transfers over all of 293 the possible source/destination combinations that can be generated 294 from each endpoint's lists. 296 _____________ _____________ 297 | SCTP User | | SCTP User | 298 | Application | | Application | 299 |-------------| |-------------| 300 | SCTP | | SCTP | 301 | Transport | | Transport | 302 | Service | | Service | 303 |-------------| |-------------| 304 | |One or more ---- One or more| | 305 | IP Network |IP address \/ IP address| IP Network | 306 | Service |appearances /\ appearances| Service | 307 |_____________| ---- |_____________| 309 SCTP Node A |<-------- Network transport ------->| SCTP Node B 311 Figure 1: An SCTP Association 313 1.3. Key Terms 315 Some of the language used to describe SCTP has been introduced in the 316 previous sections. This section provides a consolidated list of the 317 key terms and their definitions. 319 Active destination transport address: A transport address on a peer 320 endpoint that a transmitting endpoint considers available for 321 receiving user messages. 323 Bundling: An optional multiplexing operation, whereby more than one 324 user message might be carried in the same SCTP packet. Each user 325 message occupies its own DATA chunk. 327 Chunk: A unit of information within an SCTP packet, consisting of a 328 chunk header and chunk-specific content. 330 Congestion window (cwnd): An SCTP variable that limits outstanding 331 data, in number of bytes, that a sender can send to a particular 332 destination transport address before receiving an acknowledgement. 334 Cumulative TSN Ack Point: The Transmission Sequence Number (TSN) of 335 the last DATA chunk acknowledged via the Cumulative TSN Ack field 336 of a SACK. 338 Flightsize: The amount of bytes of outstanding data to a particular 339 destination transport address at any given time. 341 Idle destination address: An address that has not had user messages 342 sent to it within some length of time, normally the HEARTBEAT 343 interval or greater. 345 Inactive destination transport address: An address that is 346 considered inactive due to errors and unavailable to transport 347 user messages. 349 Message = user message: Data submitted to SCTP by the Upper Layer 350 Protocol (ULP). 352 Message Authentication Code (MAC): An integrity check mechanism 353 based on cryptographic hash functions using a secret key. 354 Typically, message authentication codes are used between two 355 parties that share a secret key in order to validate information 356 transmitted between these parties. In SCTP, it is used by an 357 endpoint to validate the State Cookie information that is returned 358 from the peer in the COOKIE ECHO chunk. The term "MAC" has 359 different meanings in different contexts. SCTP uses this term 360 with the same meaning as in [RFC2104]. 362 Network Byte Order: Most significant byte first, a.k.a., big endian. 364 Ordered Message: A user message that is delivered in order with 365 respect to all previous user messages sent within the stream on 366 which the message was sent. 368 Outstanding data (or "data outstanding" or "data in flight"): The 369 total amount of the DATA chunks associated with outstanding TSNs. 370 A retransmitted DATA chunk is counted once in outstanding data. A 371 DATA chunk that is classified as lost but that has not yet been 372 retransmitted is not in outstanding data. 374 Outstanding TSN (at an SCTP endpoint): A TSN (and the associated 375 DATA chunk) that has been sent by the endpoint but for which it 376 has not yet received an acknowledgement. 378 Path: The route taken by the SCTP packets sent by one SCTP endpoint 379 to a specific destination transport address of its peer SCTP 380 endpoint. Sending to different destination transport addresses 381 does not necessarily guarantee getting separate paths. 383 Primary Path: The primary path is the destination and source address 384 that will be put into a packet outbound to the peer endpoint by 385 default. The definition includes the source address since an 386 implementation MAY wish to specify both destination and source 387 address to better control the return path taken by reply chunks 388 and on which interface the packet is transmitted when the data 389 sender is multi-homed. 391 Receiver Window (rwnd): An SCTP variable a data sender uses to store 392 the most recently calculated receiver window of its peer, in 393 number of bytes. This gives the sender an indication of the space 394 available in the receiver's inbound buffer. 396 SCTP association: A protocol relationship between SCTP endpoints, 397 composed of the two SCTP endpoints and protocol state information 398 including Verification Tags and the currently active set of 399 Transmission Sequence Numbers (TSNs), etc. An association can be 400 uniquely identified by the transport addresses used by the 401 endpoints in the association. Two SCTP endpoints MUST NOT have 402 more than one SCTP association between them at any given time. 404 SCTP endpoint: The logical sender/receiver of SCTP packets. On a 405 multi-homed host, an SCTP endpoint is represented to its peers as 406 a combination of a set of eligible destination transport addresses 407 to which SCTP packets can be sent and a set of eligible source 408 transport addresses from which SCTP packets can be received. All 409 transport addresses used by an SCTP endpoint MUST use the same 410 port number, but can use multiple IP addresses. A transport 411 address used by an SCTP endpoint MUST NOT be used by another SCTP 412 endpoint. In other words, a transport address is unique to an 413 SCTP endpoint. 415 SCTP packet (or packet): The unit of data delivery across the 416 interface between SCTP and the connectionless packet network 417 (e.g., IP). An SCTP packet includes the common SCTP header, 418 possible SCTP control chunks, and user data encapsulated within 419 SCTP DATA chunks. 421 SCTP user application (SCTP user): The logical higher-layer 422 application entity which uses the services of SCTP, also called 423 the Upper-Layer Protocol (ULP). 425 Slow-Start Threshold (ssthresh): An SCTP variable. This is the 426 threshold that the endpoint will use to determine whether to 427 perform slow start or congestion avoidance on a particular 428 destination transport address. Ssthresh is in number of bytes. 430 Stream: A unidirectional logical channel established from one to 431 another associated SCTP endpoint, within which all user messages 432 are delivered in sequence except for those submitted to the 433 unordered delivery service. 435 Note: The relationship between stream numbers in opposite 436 directions is strictly a matter of how the applications use them. 437 It is the responsibility of the SCTP user to create and manage 438 these correlations if they are so desired. 440 Stream Sequence Number: A 16-bit sequence number used internally by 441 SCTP to ensure sequenced delivery of the user messages within a 442 given stream. One Stream Sequence Number is attached to each user 443 message. 445 Tie-Tags: Two 32-bit random numbers that together make a 64-bit 446 nonce. These tags are used within a State Cookie and TCB so that 447 a newly restarting association can be linked to the original 448 association within the endpoint that did not restart and yet not 449 reveal the true Verification Tags of an existing association. 451 Transmission Control Block (TCB): An internal data structure created 452 by an SCTP endpoint for each of its existing SCTP associations to 453 other SCTP endpoints. TCB contains all the status and operational 454 information for the endpoint to maintain and manage the 455 corresponding association. 457 Transmission Sequence Number (TSN): A 32-bit sequence number used 458 internally by SCTP. One TSN is attached to each chunk containing 459 user data to permit the receiving SCTP endpoint to acknowledge its 460 receipt and detect duplicate deliveries. 462 Transport address: A transport address is traditionally defined by a 463 network-layer address, a transport-layer protocol, and a 464 transport-layer port number. In the case of SCTP running over IP, 465 a transport address is defined by the combination of an IP address 466 and an SCTP port number (where SCTP is the transport protocol). 468 Unacknowledged TSN (at an SCTP endpoint): A TSN (and the associated 469 DATA chunk) that has been received by the endpoint but for which 470 an acknowledgement has not yet been sent. Or in the opposite 471 case, for a packet that has been sent but no acknowledgement has 472 been received. 474 Unordered Message: Unordered messages are "unordered" with respect 475 to any other message; this includes both other unordered messages 476 as well as other ordered messages. An unordered message might be 477 delivered prior to or later than ordered messages sent on the same 478 stream. 480 User message: The unit of data delivery across the interface between 481 SCTP and its user. 483 Verification Tag: A 32-bit unsigned integer that is randomly 484 generated. The Verification Tag provides a key that allows a 485 receiver to verify that the SCTP packet belongs to the current 486 association and is not an old or stale packet from a previous 487 association. 489 1.4. Abbreviations 491 MAC Message Authentication Code [RFC2104] 492 RTO Retransmission Timeout 493 RTT Round-Trip Time 494 RTTVAR Round-Trip Time Variation 495 SCTP Stream Control Transmission Protocol 496 SRTT Smoothed RTT 497 TCB Transmission Control Block 498 TLV Type-Length-Value coding format 499 TSN Transmission Sequence Number 500 ULP Upper-Layer Protocol 502 1.5. Functional View of SCTP 504 The SCTP transport service can be decomposed into a number of 505 functions. These are depicted in Figure 2 and explained in the 506 remainder of this section. 508 SCTP User Application 510 ----------------------------------------------------- 511 _____________ ____________________ 512 | | | Sequenced Delivery | 513 | Association | | within Streams | 514 | | |____________________| 515 | Startup | 516 | | ____________________________ 517 | and | | User Data Fragmentation | 518 | | |____________________________| 519 | Takedown | 520 | | ____________________________ 521 | | | Acknowledgement | 522 | | | and | 523 | | | Congestion Avoidance | 524 | | |____________________________| 525 | | 526 | | ____________________________ 527 | | | Chunk Bundling | 528 | | |____________________________| 529 | | 530 | | ________________________________ 531 | | | Packet Validation | 532 | | |________________________________| 533 | | 534 | | ________________________________ 535 | | | Path Management | 536 |_____________| |________________________________| 538 Figure 2: Functional View of the SCTP Transport Service 540 1.5.1. Association Startup and Takedown 542 An association is initiated by a request from the SCTP user (see the 543 description of the ASSOCIATE (or SEND) primitive in Section 10). 545 A cookie mechanism, similar to one described by Karn and Simpson in 546 [RFC2522], is employed during the initialization to provide 547 protection against synchronization attacks. The cookie mechanism 548 uses a four-way handshake, the last two legs of which are allowed to 549 carry user data for fast setup. The startup sequence is described in 550 Section 5 of this document. 552 SCTP provides for graceful close (i.e., shutdown) of an active 553 association on request from the SCTP user. See the description of 554 the SHUTDOWN primitive in Section 10. SCTP also allows ungraceful 555 close (i.e., abort), either on request from the user (ABORT 556 primitive) or as a result of an error condition detected within the 557 SCTP layer. Section 9 describes both the graceful and the ungraceful 558 close procedures. 560 SCTP does not support a half-open state (like TCP) wherein one side 561 continues sending data while the other end is closed. When either 562 endpoint performs a shutdown, the association on each peer will stop 563 accepting new data from its user and only deliver data in queue at 564 the time of the graceful close (see Section 9). 566 1.5.2. Sequenced Delivery within Streams 568 The term "stream" is used in SCTP to refer to a sequence of user 569 messages that are to be delivered to the upper-layer protocol in 570 order with respect to other messages within the same stream. This is 571 in contrast to its usage in TCP, where it refers to a sequence of 572 bytes (in this document, a byte is assumed to be 8 bits). 574 The SCTP user can specify at association startup time the number of 575 streams to be supported by the association. This number is 576 negotiated with the remote end (see Section 5.1.1). User messages 577 are associated with stream numbers (SEND, RECEIVE primitives, 578 Section 10). Internally, SCTP assigns a Stream Sequence Number to 579 each message passed to it by the SCTP user. On the receiving side, 580 SCTP ensures that messages are delivered to the SCTP user in sequence 581 within a given stream. However, while one stream might be blocked 582 waiting for the next in-sequence user message, delivery from other 583 streams might proceed. 585 SCTP provides a mechanism for bypassing the sequenced delivery 586 service. User messages sent using this mechanism are delivered to 587 the SCTP user as soon as they are received. 589 1.5.3. User Data Fragmentation 591 When needed, SCTP fragments user messages to ensure that the SCTP 592 packet passed to the lower layer conforms to the path MTU. On 593 receipt, fragments are reassembled into complete messages before 594 being passed to the SCTP user. 596 1.5.4. Acknowledgement and Congestion Avoidance 598 SCTP assigns a Transmission Sequence Number (TSN) to each user data 599 fragment or unfragmented message. The TSN is independent of any 600 Stream Sequence Number assigned at the stream level. The receiving 601 end acknowledges all TSNs received, even if there are gaps in the 602 sequence. In this way, reliable delivery is kept functionally 603 separate from sequenced stream delivery. 605 The acknowledgement and congestion avoidance function is responsible 606 for packet retransmission when timely acknowledgement has not been 607 received. Packet retransmission is conditioned by congestion 608 avoidance procedures similar to those used for TCP. See Section 6 609 and Section 7 for a detailed description of the protocol procedures 610 associated with this function. 612 1.5.5. Chunk Bundling 614 As described in Section 3, the SCTP packet as delivered to the lower 615 layer consists of a common header followed by one or more chunks. 616 Each chunk might contain either user data or SCTP control 617 information. The SCTP user has the option to request bundling of 618 more than one user message into a single SCTP packet. The chunk 619 bundling function of SCTP is responsible for assembly of the complete 620 SCTP packet and its disassembly at the receiving end. 622 During times of congestion, an SCTP implementation MAY still perform 623 bundling even if the user has requested that SCTP not bundle. The 624 user's disabling of bundling only affects SCTP implementations that 625 might delay a small period of time before transmission (to attempt to 626 encourage bundling). When the user layer disables bundling, this 627 small delay is prohibited but not bundling that is performed during 628 congestion or retransmission. 630 1.5.6. Packet Validation 632 A mandatory Verification Tag field and a 32-bit checksum field (see 633 Appendix B for a description of the CRC32c checksum) are included in 634 the SCTP common header. The Verification Tag value is chosen by each 635 end of the association during association startup. Packets received 636 without the expected Verification Tag value are discarded, as a 637 protection against blind masquerade attacks and against stale SCTP 638 packets from a previous association. The CRC32c checksum can be set 639 by the sender of each SCTP packet to provide additional protection 640 against data corruption in the network. The receiver of an SCTP 641 packet with an invalid CRC32c checksum silently discards the packet. 643 1.5.7. Path Management 645 The sending SCTP user is able to manipulate the set of transport 646 addresses used as destinations for SCTP packets through the 647 primitives described in Section 10. The SCTP path management 648 function chooses the destination transport address for each outgoing 649 SCTP packet based on the SCTP user's instructions and the currently 650 perceived reachability status of the eligible destination set. The 651 path management function monitors reachability through heartbeats 652 when other packet traffic is inadequate to provide this information 653 and advises the SCTP user when reachability of any far-end transport 654 address changes. The path management function is also responsible 655 for reporting the eligible set of local transport addresses to the 656 far end during association startup, and for reporting the transport 657 addresses returned from the far end to the SCTP user. 659 At association startup, a primary path is defined for each SCTP 660 endpoint, and is used for normal sending of SCTP packets. 662 On the receiving end, the path management is responsible for 663 verifying the existence of a valid SCTP association to which the 664 inbound SCTP packet belongs before passing it for further processing. 666 Note: Path Management and Packet Validation are done at the same 667 time, so although described separately above, in reality they cannot 668 be performed as separate items. 670 1.6. Serial Number Arithmetic 672 It is essential to remember that the actual Transmission Sequence 673 Number space is finite, though very large. This space ranges from 0 674 to 2**32 - 1. Since the space is finite, all arithmetic dealing with 675 Transmission Sequence Numbers MUST be performed modulo 2**32. This 676 unsigned arithmetic preserves the relationship of sequence numbers as 677 they cycle from 2**32 - 1 to 0 again. There are some subtleties to 678 computer modulo arithmetic, so great care has to be taken in 679 programming the comparison of such values. When referring to TSNs, 680 the symbol "=<" means "less than or equal"(modulo 2**32). 682 Comparisons and arithmetic on TSNs in this document SHOULD use Serial 683 Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 32. 685 An endpoint SHOULD NOT transmit a DATA chunk with a TSN that is more 686 than 2**31 - 1 above the beginning TSN of its current send window. 687 Doing so will cause problems in comparing TSNs. 689 Transmission Sequence Numbers wrap around when they reach 2**32 - 1. 690 That is, the next TSN a DATA chunk MUST use after transmitting TSN = 691 2**32 - 1 is TSN = 0. 693 Any arithmetic done on Stream Sequence Numbers SHOULD use Serial 694 Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 16. 695 All other arithmetic and comparisons in this document use normal 696 arithmetic. 698 1.7. Changes from RFC 4960 700 SCTP was originally defined in [RFC4960], which this document 701 obsoletes, if approved. Readers interested in the details of the 702 various changes that this document incorporates are asked to consult 703 [RFC8540]. 705 2. Conventions 707 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 708 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 709 "OPTIONAL" in this document are to be interpreted as described in BCP 710 14 [RFC2119] [RFC8174] when, and only when, they appear in all 711 capitals, as shown here. 713 3. SCTP Packet Format 715 An SCTP packet is composed of a common header and chunks. A chunk 716 contains either control information or user data. 718 The SCTP packet format is shown below: 720 0 1 2 3 721 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 722 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 723 | Common Header | 724 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 725 | Chunk #1 | 726 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 727 | ... | 728 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 729 | Chunk #n | 730 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 732 Multiple chunks can be bundled into one SCTP packet up to the MTU 733 size, except for the INIT, INIT ACK, and SHUTDOWN COMPLETE chunks. 734 These chunks MUST NOT be bundled with any other chunk in a packet. 735 See Section 6.10 for more details on chunk bundling. 737 If a user data message doesn't fit into one SCTP packet it can be 738 fragmented into multiple chunks using the procedure defined in 739 Section 6.9. 741 All integer fields in an SCTP packet MUST be transmitted in network 742 byte order, unless otherwise stated. 744 3.1. SCTP Common Header Field Descriptions 746 SCTP Common Header Format 748 0 1 2 3 749 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 750 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 751 | Source Port Number | Destination Port Number | 752 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 753 | Verification Tag | 754 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 755 | Checksum | 756 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 758 Source Port Number: 16 bits (unsigned integer) 760 This is the SCTP sender's port number. It can be used by the 761 receiver in combination with the source IP address, the SCTP 762 destination port, and possibly the destination IP address to 763 identify the association to which this packet belongs. The port 764 number 0 MUST NOT be used. 766 Destination Port Number: 16 bits (unsigned integer) 768 This is the SCTP port number to which this packet is destined. 769 The receiving host will use this port number to de-multiplex the 770 SCTP packet to the correct receiving endpoint/application. The 771 port number 0 MUST NOT be used. 773 Verification Tag: 32 bits (unsigned integer) 775 The receiver of this packet uses the Verification Tag to validate 776 the sender of this SCTP packet. On transmit, the value of this 777 Verification Tag MUST be set to the value of the Initiate Tag 778 received from the peer endpoint during the association 779 initialization, with the following exceptions: 781 * A packet containing an INIT chunk MUST have a zero Verification 782 Tag. 784 * A packet containing a SHUTDOWN COMPLETE chunk with the T bit 785 set MUST have the Verification Tag copied from the packet with 786 the SHUTDOWN ACK chunk. 788 * A packet containing an ABORT chunk MAY have the verification 789 tag copied from the packet that caused the ABORT to be sent. 790 For details see Section 8.4 and Section 8.5. 792 Checksum: 32 bits (unsigned integer) 794 This field contains the checksum of this SCTP packet. Its 795 calculation is discussed in Section 6.8. SCTP uses the CRC32c 796 algorithm as described in Appendix B for calculating the checksum. 798 3.2. Chunk Field Descriptions 800 The figure below illustrates the field format for the chunks to be 801 transmitted in the SCTP packet. Each chunk is formatted with a Chunk 802 Type field, a chunk-specific Flag field, a Chunk Length field, and a 803 Value field. 805 0 1 2 3 806 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 807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 808 | Chunk Type | Chunk Flags | Chunk Length | 809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 810 \ \ 811 / Chunk Value / 812 \ \ 813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 815 Chunk Type: 8 bits (unsigned integer) 817 This field identifies the type of information contained in the 818 Chunk Value field. It takes a value from 0 to 254. The value of 819 255 is reserved for future use as an extension field. 821 The values of Chunk Types are defined as follows: 823 ID Value Chunk Type 824 ----- ---------- 825 0 - Payload Data (DATA) 826 1 - Initiation (INIT) 827 2 - Initiation Acknowledgement (INIT ACK) 828 3 - Selective Acknowledgement (SACK) 829 4 - Heartbeat Request (HEARTBEAT) 830 5 - Heartbeat Acknowledgement (HEARTBEAT ACK) 831 6 - Abort (ABORT) 832 7 - Shutdown (SHUTDOWN) 833 8 - Shutdown Acknowledgement (SHUTDOWN ACK) 834 9 - Operation Error (ERROR) 835 10 - State Cookie (COOKIE ECHO) 836 11 - Cookie Acknowledgement (COOKIE ACK) 837 12 - Reserved for Explicit Congestion Notification Echo 838 (ECNE) 839 13 - Reserved for Congestion Window Reduced (CWR) 840 14 - Shutdown Complete (SHUTDOWN COMPLETE) 841 15 to 62 - available 842 63 - reserved for IETF-defined Chunk Extensions 843 64 to 126 - available 844 127 - reserved for IETF-defined Chunk Extensions 845 128 to 190 - available 846 191 - reserved for IETF-defined Chunk Extensions 847 192 to 254 - available 848 255 - reserved for IETF-defined Chunk Extensions 850 Chunk Types are encoded such that the highest-order 2 bits specify 851 the action that is taken if the processing endpoint does not 852 recognize the Chunk Type. 854 00 - Stop processing this SCTP packet; discard the unrecognized 855 chunk and all further chunks. 857 01 - Stop processing this SCTP packet, discard the unrecognized 858 chunk and all further chunks, and report the unrecognized 859 chunk in an 'Unrecognized Chunk Type'. 861 10 - Skip this chunk and continue processing. 863 11 - Skip this chunk and continue processing, but report in an 864 ERROR chunk using the 'Unrecognized Chunk Type' cause of 865 error. 867 Note: The ECNE and CWR chunk types are reserved for future use of 868 Explicit Congestion Notification (ECN); see Appendix A. 870 Chunk Flags: 8 bits 872 The usage of these bits depends on the Chunk type as given by the 873 Chunk Type field. Unless otherwise specified, they are set to 0 874 on transmit and are ignored on receipt. 876 Chunk Length: 16 bits (unsigned integer) 878 This value represents the size of the chunk in bytes, including 879 the Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields. 880 Therefore, if the Chunk Value field is zero-length, the Length 881 field will be set to 4. The Chunk Length field does not count any 882 chunk padding. 884 Chunks (including Type, Length, and Value fields) are padded out 885 by the sender with all zero bytes to be a multiple of 4 bytes 886 long. This padding MUST NOT be more than 3 bytes in total. The 887 Chunk Length value does not include terminating padding of the 888 chunk. However, it does include padding of any variable-length 889 parameter except the last parameter in the chunk. The receiver 890 MUST ignore the padding. 892 Note: A robust implementation is expected to accept the chunk 893 whether or not the final padding has been included in the Chunk 894 Length. 896 Chunk Value: variable length 898 The Chunk Value field contains the actual information to be 899 transferred in the chunk. The usage and format of this field is 900 dependent on the Chunk Type. 902 The total length of a chunk (including Type, Length, and Value 903 fields) MUST be a multiple of 4 bytes. If the length of the chunk is 904 not a multiple of 4 bytes, the sender MUST pad the chunk with all 905 zero bytes, and this padding is not included in the Chunk Length 906 field. The sender MUST NOT pad with more than 3 bytes. The receiver 907 MUST ignore the padding bytes. 909 SCTP-defined chunks are described in detail in Section 3.3. The 910 guidelines for IETF-defined chunk extensions can be found in 911 Section 14.1 of this document. 913 3.2.1. Optional/Variable-Length Parameter Format 915 Chunk values of SCTP control chunks consist of a chunk-type-specific 916 header of required fields, followed by zero or more parameters. The 917 optional and variable-length parameters contained in a chunk are 918 defined in a Type-Length-Value format as shown below. 920 0 1 2 3 921 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 922 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 923 | Parameter Type | Parameter Length | 924 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 925 \ \ 926 / Parameter Value / 927 \ \ 928 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 930 Chunk Parameter Type: 16 bits (unsigned integer) 932 The Type field is a 16-bit identifier of the type of parameter. 933 It takes a value of 0 to 65534. 935 The value of 65535 is reserved for IETF-defined extensions. 936 Values other than those defined in specific SCTP chunk 937 descriptions are reserved for use by IETF. 939 Chunk Parameter Length: 16 bits (unsigned integer) 941 The Parameter Length field contains the size of the parameter in 942 bytes, including the Parameter Type, Parameter Length, and 943 Parameter Value fields. Thus, a parameter with a zero-length 944 Parameter Value field would have a Length field of 4. The 945 Parameter Length does not include any padding bytes. 947 Chunk Parameter Value: variable length 949 The Parameter Value field contains the actual information to be 950 transferred in the parameter. 952 The total length of a parameter (including Type, Parameter Length, 953 and Value fields) MUST be a multiple of 4 bytes. If the length of 954 the parameter is not a multiple of 4 bytes, the sender pads the 955 parameter at the end (i.e., after the Parameter Value field) with all 956 zero bytes. The length of the padding is not included in the 957 Parameter Length field. A sender MUST NOT pad with more than 3 958 bytes. The receiver MUST ignore the padding bytes. 960 The Parameter Types are encoded such that the highest-order 2 bits 961 specify the action that is taken if the processing endpoint does not 962 recognize the Parameter Type. 964 00 - Stop processing this parameter; do not process any further 965 parameters within this chunk. 967 01 - Stop processing this parameter, do not process any further 968 parameters within this chunk, and report the unrecognized 969 parameter in an 'Unrecognized Parameter', as described in 970 Section 3.2.2. 972 10 - Skip this parameter and continue processing. 974 11 - Skip this parameter and continue processing but report the 975 unrecognized parameter in an 'Unrecognized Parameter', as 976 described in Section 3.2.2. 978 Please note that in all four cases, an INIT ACK or COOKIE ECHO chunk 979 is sent. In the 00 or 01 case, the processing of the parameters 980 after the unknown parameter is canceled, but no processing already 981 done is rolled back. 983 The actual SCTP parameters are defined in the specific SCTP chunk 984 sections. The rules for IETF-defined parameter extensions are 985 defined in Section 14.3. Note that a parameter type MUST be unique 986 across all chunks. For example, the parameter type '5' is used to 987 represent an IPv4 address (see Section 3.3.2.1). The value '5' then 988 is reserved across all chunks to represent an IPv4 address and MUST 989 NOT be reused with a different meaning in any other chunk. 991 3.2.2. Reporting of Unrecognized Parameters 993 If the receiver of an INIT chunk detects unrecognized parameters and 994 has to report them according to Section 3.2.1, it MUST put the 995 'Unrecognized Parameter' parameter(s) in the INIT ACK chunk sent in 996 response to the INIT chunk. Note that if the receiver of the INIT 997 chunk is NOT going to establish an association (e.g., due to lack of 998 resources), an 'Unrecognized Parameter' would NOT be included with 999 any ABORT being sent to the sender of the INIT. 1001 If the receiver of an INIT ACK chunk detects unrecognized parameters 1002 and has to report them according to Section 3.2.1, it SHOULD bundle 1003 the ERROR chunk containing the 'Unrecognized Parameters' error cause 1004 with the COOKIE ECHO chunk sent in response to the INIT ACK chunk. 1005 If the receiver of the INIT ACK cannot bundle the COOKIE ECHO chunk 1006 with the ERROR chunk, the ERROR chunk MAY be sent separately but not 1007 before the COOKIE ACK has been received. 1009 Note: Any time a COOKIE ECHO is sent in a packet, it MUST be the 1010 first chunk. 1012 3.3. SCTP Chunk Definitions 1014 This section defines the format of the different SCTP chunk types. 1016 3.3.1. Payload Data (DATA) (0) 1018 The following format MUST be used for the DATA chunk: 1020 0 1 2 3 1021 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 1022 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1023 | Type = 0 | Res |I|U|B|E| Length | 1024 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1025 | TSN | 1026 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1027 | Stream Identifier S | Stream Sequence Number n | 1028 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1029 | Payload Protocol Identifier | 1030 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1031 \ \ 1032 / User Data (seq n of Stream S) / 1033 \ \ 1034 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1036 Res: 4 bits 1038 Should be set to all '0's and ignored by the receiver. 1040 I bit: 1 bit 1042 The (I)mmediate bit MAY be set by the sender whenever the sender 1043 of a DATA chunk can benefit from the corresponding SACK chunk 1044 being sent back without delay. See Section 4 of [RFC7053] for a 1045 discussion of the benefits. 1047 U bit: 1 bit 1049 The (U)nordered bit, if set to '1', indicates that this is an 1050 unordered DATA chunk, and there is no Stream Sequence Number 1051 assigned to this DATA chunk. Therefore, the receiver MUST ignore 1052 the Stream Sequence Number field. 1054 After reassembly (if necessary), unordered DATA chunks MUST be 1055 dispatched to the upper layer by the receiver without any attempt 1056 to reorder. 1058 If an unordered user message is fragmented, each fragment of the 1059 message MUST have its U bit set to '1'. 1061 B bit: 1 bit 1063 The (B)eginning fragment bit, if set, indicates the first fragment 1064 of a user message. 1066 E bit: 1 bit 1067 The (E)nding fragment bit, if set, indicates the last fragment of 1068 a user message. 1070 An unfragmented user message MUST have both the B and E bits set to 1071 '1'. Setting both B and E bits to '0' indicates a middle fragment of 1072 a multi-fragment user message, as summarized in the following table: 1074 +---+---+-------------------------------------------+ 1075 | B | E | Description | 1076 +---+---+-------------------------------------------+ 1077 | 1 | 0 | First piece of a fragmented user message | 1078 +---+---+-------------------------------------------+ 1079 | 0 | 0 | Middle piece of a fragmented user message | 1080 +---+---+-------------------------------------------+ 1081 | 0 | 1 | Last piece of a fragmented user message | 1082 +---+---+-------------------------------------------+ 1083 | 1 | 1 | Unfragmented message | 1084 +---+---+-------------------------------------------+ 1086 Table 1: Fragment Description Flags 1088 When a user message is fragmented into multiple chunks, the TSNs are 1089 used by the receiver to reassemble the message. This means that the 1090 TSNs for each fragment of a fragmented user message MUST be strictly 1091 sequential. 1093 Length: 16 bits (unsigned integer) 1095 This field indicates the length of the DATA chunk in bytes from 1096 the beginning of the type field to the end of the User Data field 1097 excluding any padding. A DATA chunk with one byte of user data 1098 will have Length set to 17 (indicating 17 bytes). 1100 A DATA chunk with a User Data field of length L will have the 1101 Length field set to (16 + L) (indicating 16+L bytes) where L MUST 1102 be greater than 0. 1104 TSN: 32 bits (unsigned integer) 1106 This value represents the TSN for this DATA chunk. The valid 1107 range of TSN is from 0 to 4294967295 (2**32 - 1). TSN wraps back 1108 to 0 after reaching 4294967295. 1110 Stream Identifier S: 16 bits (unsigned integer) 1112 Identifies the stream to which the following user data belongs. 1114 Stream Sequence Number n: 16 bits (unsigned integer) 1115 This value represents the Stream Sequence Number of the following 1116 user data within the stream S. Valid range is 0 to 65535. 1118 When a user message is fragmented by SCTP for transport, the same 1119 Stream Sequence Number MUST be carried in each of the fragments of 1120 the message. 1122 Payload Protocol Identifier: 32 bits (unsigned integer) 1124 This value represents an application (or upper layer) specified 1125 protocol identifier. This value is passed to SCTP by its upper 1126 layer and sent to its peer. This identifier is not used by SCTP 1127 but can be used by certain network entities, as well as by the 1128 peer application, to identify the type of information being 1129 carried in this DATA chunk. This field MUST be sent even in 1130 fragmented DATA chunks (to make sure it is available for agents in 1131 the middle of the network). Note that this field is NOT touched 1132 by an SCTP implementation; therefore, its byte order is NOT 1133 necessarily big endian. The upper layer is responsible for any 1134 byte order conversions to this field. 1136 The value 0 indicates that no application identifier is specified 1137 by the upper layer for this payload data. 1139 User Data: variable length 1141 This is the payload user data. The implementation MUST pad the 1142 end of the data to a 4-byte boundary with all-zero bytes. Any 1143 padding MUST NOT be included in the Length field. A sender MUST 1144 never add more than 3 bytes of padding. 1146 3.3.2. Initiation (INIT) (1) 1148 This chunk is used to initiate an SCTP association between two 1149 endpoints. The format of the INIT chunk is shown below: 1151 0 1 2 3 1152 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 1153 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1154 | Type = 1 | Chunk Flags | Chunk Length | 1155 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1156 | Initiate Tag | 1157 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1158 | Advertised Receiver Window Credit (a_rwnd) | 1159 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1160 | Number of Outbound Streams | Number of Inbound Streams | 1161 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1162 | Initial TSN | 1163 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1164 \ \ 1165 / Optional/Variable-Length Parameters / 1166 \ \ 1167 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1169 The INIT chunk contains the following parameters. Unless otherwise 1170 noted, each parameter MUST only be included once in the INIT chunk. 1172 Fixed Parameters Status 1173 ---------------------------------------------- 1174 Initiate Tag Mandatory 1175 Advertised Receiver Window Credit Mandatory 1176 Number of Outbound Streams Mandatory 1177 Number of Inbound Streams Mandatory 1178 Initial TSN Mandatory 1180 Variable Parameters Status Type Value 1181 ------------------------------------------------------------- 1182 IPv4 Address (Note 1) Optional 5 1183 IPv6 Address (Note 1) Optional 6 1184 Cookie Preservative Optional 9 1185 Reserved for ECN Capable (Note 2) Optional 32768 (0x8000) 1186 Host Name Address (Note 3) Optional 11 1187 Supported Address Types (Note 4) Optional 12 1189 Note 1: The INIT chunks can contain multiple addresses that can be 1190 IPv4 and/or IPv6 in any combination. 1192 Note 2: The ECN Capable field is reserved for future use of Explicit 1193 Congestion Notification. 1195 Note 3: An INIT chunk MUST NOT contain the Host Name Address 1196 parameter. The receiver of an INIT chunk containing a Host Name 1197 Address parameter MUST send an ABORT and MAY include an "Unresolvable 1198 Address" error cause. 1200 Note 4: This parameter, when present, specifies all the address types 1201 the sending endpoint can support. The absence of this parameter 1202 indicates that the sending endpoint can support any address type. 1204 IMPLEMENTATION NOTE: If an INIT chunk is received with known 1205 parameters that are not optional parameters of the INIT chunk, then 1206 the receiver SHOULD process the INIT chunk and send back an INIT ACK. 1207 The receiver of the INIT chunk MAY bundle an ERROR chunk with the 1208 COOKIE ACK chunk later. However, restrictive implementations MAY 1209 send back an ABORT chunk in response to the INIT chunk. 1211 The Chunk Flags field in INIT is reserved, and all bits in it SHOULD 1212 be set to 0 by the sender and ignored by the receiver. The sequence 1213 of parameters within an INIT can be processed in any order. 1215 Initiate Tag: 32 bits (unsigned integer) 1217 The receiver of the INIT (the responding end) records the value of 1218 the Initiate Tag parameter. This value MUST be placed into the 1219 Verification Tag field of every SCTP packet that the receiver of 1220 the INIT transmits within this association. 1222 The Initiate Tag is allowed to have any value except 0. See 1223 Section 5.3.1 for more on the selection of the tag value. 1225 If the value of the Initiate Tag in a received INIT chunk is found 1226 to be 0, the receiver MUST treat it as an error and close the 1227 association by transmitting an ABORT. 1229 Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned 1230 integer) 1232 This value represents the dedicated buffer space, in number of 1233 bytes, the sender of the INIT has reserved in association with 1234 this window. During the life of the association, this buffer 1235 space SHOULD NOT be lessened (i.e., dedicated buffers taken away 1236 from this association); however, an endpoint MAY change the value 1237 of a_rwnd it sends in SACK chunks. 1239 Number of Outbound Streams (OS): 16 bits (unsigned integer) 1241 Defines the number of outbound streams the sender of this INIT 1242 chunk wishes to create in this association. The value of 0 MUST 1243 NOT be used. 1245 Note: A receiver of an INIT with the OS value set to 0 SHOULD 1246 abort the association. 1248 Number of Inbound Streams (MIS): 16 bits (unsigned integer) 1250 Defines the maximum number of streams the sender of this INIT 1251 chunk allows the peer end to create in this association. The 1252 value 0 MUST NOT be used. 1254 Note: There is no negotiation of the actual number of streams but 1255 instead the two endpoints will use the min(requested, offered). 1256 See Section 5.1.1 for details. 1258 Note: A receiver of an INIT with the MIS value of 0 SHOULD abort 1259 the association. 1261 Initial TSN (I-TSN): 32 bits (unsigned integer) 1263 Defines the initial TSN that the sender will use. The valid range 1264 is from 0 to 4294967295. This field MAY be set to the value of 1265 the Initiate Tag field. 1267 3.3.2.1. Optional/Variable-Length Parameters in INIT 1269 The following parameters follow the Type-Length-Value format as 1270 defined in Section 3.2.1. Any Type-Length-Value fields MUST come 1271 after the fixed-length fields defined in the previous section. 1273 IPv4 Address Parameter (5) 1275 0 1 2 3 1276 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 1277 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1278 | Type = 5 | Length = 8 | 1279 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1280 | IPv4 Address | 1281 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1283 IPv4 Address: 32 bits (unsigned integer) 1285 Contains an IPv4 address of the sending endpoint. It is binary 1286 encoded. 1288 IPv6 Address Parameter (6) 1289 0 1 2 3 1290 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 1291 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1292 | Type = 6 | Length = 20 | 1293 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1294 | | 1295 | IPv6 Address | 1296 | | 1297 | | 1298 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1300 IPv6 Address: 128 bits (unsigned integer) 1302 Contains an IPv6 [RFC8200] address of the sending endpoint. It is 1303 binary encoded. 1305 Note: A sender MUST NOT use an IPv4-mapped IPv6 address [RFC4291], 1306 but SHOULD instead use an IPv4 Address parameter for an IPv4 1307 address. 1309 Combined with the Source Port Number in the SCTP common header, the 1310 value passed in an IPv4 or IPv6 Address parameter indicates a 1311 transport address the sender of the INIT will support for the 1312 association being initiated. That is, during the life time of this 1313 association, this IP address can appear in the source address field 1314 of an IP datagram sent from the sender of the INIT, and can be used 1315 as a destination address of an IP datagram sent from the receiver of 1316 the INIT. 1318 More than one IP Address parameter can be included in an INIT chunk 1319 when the INIT sender is multi-homed. Moreover, a multi-homed 1320 endpoint might have access to different types of network; thus, more 1321 than one address type can be present in one INIT chunk, i.e., IPv4 1322 and IPv6 addresses are allowed in the same INIT chunk. 1324 If the INIT contains at least one IP Address parameter, then the 1325 source address of the IP datagram containing the INIT chunk and any 1326 additional address(es) provided within the INIT can be used as 1327 destinations by the endpoint receiving the INIT. If the INIT does 1328 not contain any IP Address parameters, the endpoint receiving the 1329 INIT MUST use the source address associated with the received IP 1330 datagram as its sole destination address for the association. 1332 Note that not using any IP Address parameters in the INIT and INIT 1333 ACK is an alternative to make an association more likely to work 1334 across a NAT box. 1336 Cookie Preservative (9) 1337 The sender of the INIT SHOULD use this parameter to suggest to the 1338 receiver of the INIT for a longer life-span of the State Cookie. 1340 0 1 2 3 1341 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 1342 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1343 | Type = 9 | Length = 8 | 1344 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1345 | Suggested Cookie Life-Span Increment (msec.) | 1346 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1348 Suggested Cookie Life-Span Increment: 32 bits (unsigned integer) 1350 This parameter indicates to the receiver how much increment in 1351 milliseconds the sender wishes the receiver to add to its default 1352 cookie life-span. 1354 This optional parameter MAY be added to the INIT chunk by the 1355 sender when it reattempts establishing an association with a peer 1356 to which its previous attempt of establishing the association 1357 failed due to a stale cookie operation error. The receiver MAY 1358 choose to ignore the suggested cookie life-span increase for its 1359 own security reasons. 1361 Host Name Address (11) 1363 The sender of an INIT chunk MUST NOT include this parameter. The 1364 usage of the Host Name Address parameter is deprecated. 1366 0 1 2 3 1367 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 1368 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1369 | Type = 11 | Length | 1370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1371 / Host Name / 1372 \ \ 1373 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1375 Host Name: variable length 1377 This field contains a host name in "host name syntax" per RFC 1123 1378 Section 2.1 [RFC1123]. The method for resolving the host name is 1379 out of scope of SCTP. 1381 Note: At least one null terminator is included in the Host Name 1382 string and MUST be included in the length. 1384 Supported Address Types (12) 1385 The sender of INIT uses this parameter to list all the address types 1386 it can support. 1388 0 1 2 3 1389 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 1390 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1391 | Type = 12 | Length | 1392 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1393 | Address Type #1 | Address Type #2 | 1394 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1395 | ...... | 1396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+ 1398 Address Type: 16 bits (unsigned integer) 1400 This is filled with the type value of the corresponding address 1401 TLV (e.g., IPv4 = 5, IPv6 = 6). The value indicating the Host 1402 Name Address parameter (Host name = 11) MUST NOT be used. 1404 3.3.3. Initiation Acknowledgement (INIT ACK) (2) 1406 The INIT ACK chunk is used to acknowledge the initiation of an SCTP 1407 association. 1409 The parameter part of INIT ACK is formatted similarly to the INIT 1410 chunk. It uses two extra variable parameters: The State Cookie and 1411 the Unrecognized Parameter: 1413 The format of the INIT ACK chunk is shown below: 1415 0 1 2 3 1416 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 1417 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1418 | Type = 2 | Chunk Flags | Chunk Length | 1419 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1420 | Initiate Tag | 1421 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1422 | Advertised Receiver Window Credit | 1423 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1424 | Number of Outbound Streams | Number of Inbound Streams | 1425 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1426 | Initial TSN | 1427 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1428 \ \ 1429 / Optional/Variable-Length Parameters / 1430 \ \ 1431 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1433 Initiate Tag: 32 bits (unsigned integer) 1435 The receiver of the INIT ACK records the value of the Initiate Tag 1436 parameter. This value MUST be placed into the Verification Tag 1437 field of every SCTP packet that the INIT ACK receiver transmits 1438 within this association. 1440 The Initiate Tag MUST NOT take the value 0. See Section 5.3.1 for 1441 more on the selection of the Initiate Tag value. 1443 If the value of the Initiate Tag in a received INIT ACK chunk is 1444 found to be 0, the receiver MUST destroy the association 1445 discarding its TCB. The receiver MAY send an ABORT for debugging 1446 purpose. 1448 Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned 1449 integer) 1451 This value represents the dedicated buffer space, in number of 1452 bytes, the sender of the INIT ACK has reserved in association with 1453 this window. During the life of the association, this buffer 1454 space SHOULD NOT be lessened (i.e., dedicated buffers taken away 1455 from this association). 1457 Number of Outbound Streams (OS): 16 bits (unsigned integer) 1459 Defines the number of outbound streams the sender of this INIT ACK 1460 chunk wishes to create in this association. The value of 0 MUST 1461 NOT be used, and the value MUST NOT be greater than the MIS value 1462 sent in the INIT chunk. 1464 Note: A receiver of an INIT ACK with the OS value set to 0 SHOULD 1465 destroy the association discarding its TCB. 1467 Number of Inbound Streams (MIS): 16 bits (unsigned integer) 1469 Defines the maximum number of streams the sender of this INIT ACK 1470 chunk allows the peer end to create in this association. The 1471 value 0 MUST NOT be used. 1473 Note: There is no negotiation of the actual number of streams but 1474 instead the two endpoints will use the min(requested, offered). 1475 See Section 5.1.1 for details. 1477 Note: A receiver of an INIT ACK with the MIS value set to 0 SHOULD 1478 destroy the association discarding its TCB. 1480 Initial TSN (I-TSN): 32 bits (unsigned integer) 1481 Defines the initial TSN that the INIT ACK sender will use. The 1482 valid range is from 0 to 4294967295. This field MAY be set to the 1483 value of the Initiate Tag field. 1485 Fixed Parameters Status 1486 ---------------------------------------------- 1487 Initiate Tag Mandatory 1488 Advertised Receiver Window Credit Mandatory 1489 Number of Outbound Streams Mandatory 1490 Number of Inbound Streams Mandatory 1491 Initial TSN Mandatory 1493 Variable Parameters Status Type Value 1494 ------------------------------------------------------------- 1495 State Cookie Mandatory 7 1496 IPv4 Address (Note 1) Optional 5 1497 IPv6 Address (Note 1) Optional 6 1498 Unrecognized Parameter Optional 8 1499 Reserved for ECN Capable (Note 2) Optional 32768 (0x8000) 1500 Host Name Address (Note 3) Optional 11 1502 Note 1: The INIT ACK chunks can contain any number of IP address 1503 parameters that can be IPv4 and/or IPv6 in any combination. 1505 Note 2: The ECN Capable field is reserved for future use of Explicit 1506 Congestion Notification. 1508 Note 3: An INIT ACK chunk MUST NOT contain the Host Name Address 1509 parameter. The receiver of INIT ACK chunks containing a Host Name 1510 Address parameter MUST send an ABORT and MAY include an "Unresolvable 1511 Address" error cause. 1513 IMPLEMENTATION NOTE: An implementation MUST be prepared to receive an 1514 INIT ACK that is quite large (more than 1500 bytes) due to the 1515 variable size of the State Cookie AND the variable address list. For 1516 example if a responder to the INIT has 1000 IPv4 addresses it wishes 1517 to send, it would need at least 8,000 bytes to encode this in the 1518 INIT ACK. 1520 IMPLEMENTATION NOTE: If an INIT ACK chunk is received with known 1521 parameters that are not optional parameters of the INIT ACK chunk, 1522 then the receiver SHOULD process the INIT ACK chunk and send back a 1523 COOKIE ECHO. The receiver of the INIT ACK chunk MAY bundle an ERROR 1524 chunk with the COOKIE ECHO chunk. However, restrictive 1525 implementations MAY send back an ABORT chunk in response to the INIT 1526 ACK chunk. 1528 In combination with the Source Port carried in the SCTP common 1529 header, each IP Address parameter in the INIT ACK indicates to the 1530 receiver of the INIT ACK a valid transport address supported by the 1531 sender of the INIT ACK for the life time of the association being 1532 initiated. 1534 If the INIT ACK contains at least one IP Address parameter, then the 1535 source address of the IP datagram containing the INIT ACK and any 1536 additional address(es) provided within the INIT ACK MAY be used as 1537 destinations by the receiver of the INIT ACK. If the INIT ACK does 1538 not contain any IP Address parameters, the receiver of the INIT ACK 1539 MUST use the source address associated with the received IP datagram 1540 as its sole destination address for the association. 1542 The State Cookie and Unrecognized Parameters use the Type-Length- 1543 Value format as defined in Section 3.2.1 and are described below. 1544 The other fields are defined the same as their counterparts in the 1545 INIT chunk. 1547 3.3.3.1. Optional or Variable-Length Parameters 1549 State Cookie 1551 Parameter Type Value: 7 1553 Parameter Length: Variable size, depending on size of Cookie. 1555 Parameter Value: 1557 This parameter value MUST contain all the necessary state and 1558 parameter information required for the sender of this INIT ACK to 1559 create the association, along with a Message Authentication Code 1560 (MAC). See Section 5.1.3 for details on State Cookie definition. 1562 Unrecognized Parameter: 1564 Parameter Type Value: 8 1566 Parameter Length: Variable size. 1568 Parameter Value: 1570 This parameter is returned to the originator of the INIT chunk 1571 when the INIT contains an unrecognized parameter that has a value 1572 that indicates it SHOULD be reported to the sender. This 1573 parameter value field will contain unrecognized parameters copied 1574 from the INIT chunk complete with Parameter Type, Length, and 1575 Value fields. 1577 3.3.4. Selective Acknowledgement (SACK) (3) 1579 This chunk is sent to the peer endpoint to acknowledge received DATA 1580 chunks and to inform the peer endpoint of gaps in the received 1581 subsequences of DATA chunks as represented by their TSNs. 1583 The SACK MUST contain the Cumulative TSN Ack, Advertised Receiver 1584 Window Credit (a_rwnd), Number of Gap Ack Blocks, and Number of 1585 Duplicate TSNs fields. 1587 By definition, the value of the Cumulative TSN Ack parameter is the 1588 last TSN received before a break in the sequence of received TSNs 1589 occurs; the next TSN value following this one has not yet been 1590 received at the endpoint sending the SACK. This parameter therefore 1591 acknowledges receipt of all TSNs less than or equal to its value. 1593 The handling of a_rwnd by the receiver of the SACK is discussed in 1594 detail in Section 6.2.1. 1596 The SACK also contains zero or more Gap Ack Blocks. Each Gap Ack 1597 Block acknowledges a subsequence of TSNs received following a break 1598 in the sequence of received TSNs. The Gap Ack Blocks SHOULD be 1599 isolated. This means that the TSN just before each Gap Ack Block and 1600 the TSN just after each Gap Ack Block have not been received. By 1601 definition, all TSNs acknowledged by Gap Ack Blocks are greater than 1602 the value of the Cumulative TSN Ack. 1604 0 1 2 3 1605 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 1606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1607 | Type = 3 |Chunk Flags | Chunk Length | 1608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1609 | Cumulative TSN Ack | 1610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1611 | Advertised Receiver Window Credit (a_rwnd) | 1612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1613 | Number of Gap Ack Blocks = N | Number of Duplicate TSNs = X | 1614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1615 | Gap Ack Block #1 Start | Gap Ack Block #1 End | 1616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1617 / / 1618 \ ... \ 1619 / / 1620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1621 | Gap Ack Block #N Start | Gap Ack Block #N End | 1622 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1623 | Duplicate TSN 1 | 1624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1625 / / 1626 \ ... \ 1627 / / 1628 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1629 | Duplicate TSN X | 1630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1632 Chunk Flags: 8 bits 1634 Set to all '0's on transmit and ignored on receipt. 1636 Cumulative TSN Ack: 32 bits (unsigned integer) 1638 This parameter contains the TSN of the last DATA chunk received in 1639 sequence before a gap. In the case where no DATA chunk has been 1640 received, this value is set to the peer's Initial TSN minus one. 1642 Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned 1643 integer) 1645 This field indicates the updated receive buffer space in bytes of 1646 the sender of this SACK; see Section 6.2.1 for details. 1648 Number of Gap Ack Blocks: 16 bits (unsigned integer) 1650 Indicates the number of Gap Ack Blocks included in this SACK. 1652 Number of Duplicate TSNs: 16 bit 1654 This field contains the number of duplicate TSNs the endpoint has 1655 received. Each duplicate TSN is listed following the Gap Ack 1656 Block list. 1658 Gap Ack Blocks: 1660 These fields contain the Gap Ack Blocks. They are repeated for 1661 each Gap Ack Block up to the number of Gap Ack Blocks defined in 1662 the Number of Gap Ack Blocks field. All DATA chunks with TSNs 1663 greater than or equal to (Cumulative TSN Ack + Gap Ack Block 1664 Start) and less than or equal to (Cumulative TSN Ack + Gap Ack 1665 Block End) of each Gap Ack Block are assumed to have been received 1666 correctly. Gap Ack Blocks SHOULD be isolated. This means that 1667 the DATA chunks with TSNs equal to (Cumulative TSN Ack + Gap Ack 1668 Block Start - 1) and (Cumulative TSN Ack + Gap Ack Block End + 1) 1669 have not been received. 1671 Gap Ack Block Start: 16 bits (unsigned integer) 1673 Indicates the Start offset TSN for this Gap Ack Block. To 1674 calculate the actual TSN number the Cumulative TSN Ack is added to 1675 this offset number. This calculated TSN identifies the first TSN 1676 in this Gap Ack Block that has been received. 1678 Gap Ack Block End: 16 bits (unsigned integer) 1680 Indicates the End offset TSN for this Gap Ack Block. To calculate 1681 the actual TSN number, the Cumulative TSN Ack is added to this 1682 offset number. This calculated TSN identifies the TSN of the last 1683 DATA chunk received in this Gap Ack Block. 1685 For example, assume that the receiver has the following DATA 1686 chunks newly arrived at the time when it decides to send a 1687 Selective ACK, 1688 ---------- 1689 | TSN=17 | 1690 ---------- 1691 | | <- still missing 1692 ---------- 1693 | TSN=15 | 1694 ---------- 1695 | TSN=14 | 1696 ---------- 1697 | | <- still missing 1698 ---------- 1699 | TSN=12 | 1700 ---------- 1701 | TSN=11 | 1702 ---------- 1703 | TSN=10 | 1704 ---------- 1706 then the parameter part of the SACK MUST be constructed as follows 1707 (assuming the new a_rwnd is set to 4660 by the sender): 1709 +--------------------------------+ 1710 | Cumulative TSN Ack = 12 | 1711 +--------------------------------+ 1712 | a_rwnd = 4660 | 1713 +----------------+---------------+ 1714 | num of block=2 | num of dup=0 | 1715 +----------------+---------------+ 1716 |block #1 strt=2 |block #1 end=3 | 1717 +----------------+---------------+ 1718 |block #2 strt=5 |block #2 end=5 | 1719 +----------------+---------------+ 1721 Duplicate TSN: 32 bits (unsigned integer) 1723 Indicates the number of times a TSN was received in duplicate 1724 since the last SACK was sent. Every time a receiver gets a 1725 duplicate TSN (before sending the SACK), it adds it to the list of 1726 duplicates. The duplicate count is reinitialized to zero after 1727 sending each SACK. 1729 For example, if a receiver were to get the TSN 19 three times it 1730 would list 19 twice in the outbound SACK. After sending the SACK, if 1731 it received yet one more TSN 19 it would list 19 as a duplicate once 1732 in the next outgoing SACK. 1734 3.3.5. Heartbeat Request (HEARTBEAT) (4) 1736 An endpoint SHOULD send this chunk to its peer endpoint to probe the 1737 reachability of a particular destination transport address defined in 1738 the present association. 1740 The parameter field contains the Heartbeat Information, which is a 1741 variable-length opaque data structure understood only by the sender. 1743 0 1 2 3 1744 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 1745 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1746 | Type = 4 | Chunk Flags | Heartbeat Length | 1747 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1748 \ \ 1749 / Heartbeat Information TLV (Variable-Length) / 1750 \ \ 1751 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1753 Chunk Flags: 8 bits 1755 Set to 0 on transmit and ignored on receipt. 1757 Heartbeat Length: 16 bits (unsigned integer) 1759 Set to the size of the chunk in bytes, including the chunk header 1760 and the Heartbeat Information field. 1762 Heartbeat Information: variable length 1764 Defined as a variable-length parameter using the format described 1765 in Section 3.2.1, i.e.: 1767 Variable Parameters Status Type Value 1768 ------------------------------------------------------------- 1769 Heartbeat Info Mandatory 1 1771 0 1 2 3 1772 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 1773 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1774 | Heartbeat Info Type=1 | HB Info Length | 1775 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1776 / Sender-Specific Heartbeat Info / 1777 \ \ 1778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1780 The Sender-Specific Heartbeat Info field SHOULD include 1781 information about the sender's current time when this HEARTBEAT 1782 chunk is sent and the destination transport address to which this 1783 HEARTBEAT is sent (see Section 8.3). This information is simply 1784 reflected back by the receiver in the HEARTBEAT ACK message (see 1785 Section 3.3.6). Note also that the HEARTBEAT message is both for 1786 reachability checking and for path verification (see Section 5.4). 1787 When a HEARTBEAT chunk is being used for path verification 1788 purposes, it MUST hold a 64-bit random nonce. 1790 3.3.6. Heartbeat Acknowledgement (HEARTBEAT ACK) (5) 1792 An endpoint MUST send this chunk to its peer endpoint as a response 1793 to a HEARTBEAT chunk (see Section 8.3). A HEARTBEAT ACK is always 1794 sent to the source IP address of the IP datagram containing the 1795 HEARTBEAT chunk to which this ack is responding. 1797 The parameter field contains a variable-length opaque data structure. 1799 0 1 2 3 1800 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 1801 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1802 | Type = 5 | Chunk Flags | Heartbeat Ack Length | 1803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1804 \ \ 1805 / Heartbeat Information TLV (Variable-Length) / 1806 \ \ 1807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1809 Chunk Flags: 8 bits 1811 Set to 0 on transmit and ignored on receipt. 1813 Heartbeat Ack Length: 16 bits (unsigned integer) 1815 Set to the size of the chunk in bytes, including the chunk header 1816 and the Heartbeat Information field. 1818 Heartbeat Information: variable length 1820 This field MUST contain the Heartbeat Information parameter of the 1821 Heartbeat Request to which this Heartbeat Acknowledgement is 1822 responding. 1824 Variable Parameters Status Type Value 1825 ------------------------------------------------------------- 1826 Heartbeat Info Mandatory 1 1828 3.3.7. Abort Association (ABORT) (6) 1830 The ABORT chunk is sent to the peer of an association to close the 1831 association. The ABORT chunk MAY contain Cause Parameters to inform 1832 the receiver about the reason of the abort. DATA chunks MUST NOT be 1833 bundled with ABORT. Control chunks (except for INIT, INIT ACK, and 1834 SHUTDOWN COMPLETE) MAY be bundled with an ABORT, but they MUST be 1835 placed before the ABORT in the SCTP packet or they will be ignored by 1836 the receiver. 1838 If an endpoint receives an ABORT with a format error or no TCB is 1839 found, it MUST silently discard it. Moreover, under any 1840 circumstances, an endpoint that receives an ABORT MUST NOT respond to 1841 that ABORT by sending an ABORT of its own. 1843 0 1 2 3 1844 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 1845 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1846 | Type = 6 |Reserved |T| Length | 1847 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1848 \ \ 1849 / zero or more Error Causes / 1850 \ \ 1851 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1853 Chunk Flags: 8 bits 1855 Reserved: 7 bits 1857 Set to 0 on transmit and ignored on receipt. 1859 T bit: 1 bit 1861 The T bit is set to 0 if the sender filled in the Verification 1862 Tag expected by the peer. If the Verification Tag is 1863 reflected, the T bit MUST be set to 1. Reflecting means that 1864 the sent Verification Tag is the same as the received one. 1866 Length: 16 bits (unsigned integer) 1868 Set to the size of the chunk in bytes, including the chunk header 1869 and all the Error Cause fields present. 1871 See Section 3.3.10 for Error Cause definitions. 1873 Note: Special rules apply to this chunk for verification; please see 1874 Section 8.5.1 for details. 1876 3.3.8. Shutdown Association (SHUTDOWN) (7) 1878 An endpoint in an association MUST use this chunk to initiate a 1879 graceful close of the association with its peer. This chunk has the 1880 following format. 1882 0 1 2 3 1883 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 1884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1885 | Type = 7 | Chunk Flags | Length = 8 | 1886 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1887 | Cumulative TSN Ack | 1888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1890 Chunk Flags: 8 bits 1892 Set to 0 on transmit and ignored on receipt. 1894 Length: 16 bits (unsigned integer) 1896 Indicates the length of the parameter. Set to 8. 1898 Cumulative TSN Ack: 32 bits (unsigned integer) 1900 This parameter contains the TSN of the last chunk received in 1901 sequence before any gaps. 1903 Note: Since the SHUTDOWN message does not contain Gap Ack Blocks, 1904 it cannot be used to acknowledge TSNs received out of order. In a 1905 SACK, lack of Gap Ack Blocks that were previously included 1906 indicates that the data receiver reneged on the associated DATA 1907 chunks. Since SHUTDOWN does not contain Gap Ack Blocks, the 1908 receiver of the SHUTDOWN MUST NOT interpret the lack of a Gap Ack 1909 Block as a renege. (See Section 6.2 for information on reneging.) 1911 3.3.9. Shutdown Acknowledgement (SHUTDOWN ACK) (8) 1913 This chunk MUST be used to acknowledge the receipt of the SHUTDOWN 1914 chunk at the completion of the shutdown process; see Section 9.2 for 1915 details. 1917 The SHUTDOWN ACK chunk has no parameters. 1919 0 1 2 3 1920 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 1921 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1922 | Type = 8 |Chunk Flags | Length = 4 | 1923 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1925 Chunk Flags: 8 bits 1927 Set to 0 on transmit and ignored on receipt. 1929 3.3.10. Operation Error (ERROR) (9) 1931 An endpoint sends this chunk to its peer endpoint to notify it of 1932 certain error conditions. It contains one or more error causes. An 1933 Operation Error is not considered fatal in and of itself, but MAY be 1934 used with an ABORT chunk to report a fatal condition. It has the 1935 following parameters: 1937 0 1 2 3 1938 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 1939 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1940 | Type = 9 | Chunk Flags | Length | 1941 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1942 \ \ 1943 / one or more Error Causes / 1944 \ \ 1945 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1947 Chunk Flags: 8 bits 1949 Set to 0 on transmit and ignored on receipt. 1951 Length: 16 bits (unsigned integer) 1953 Set to the size of the chunk in bytes, including the chunk header 1954 and all the Error Cause fields present. 1956 Error causes are defined as variable-length parameters using the 1957 format described in Section 3.2.1, that is: 1959 0 1 2 3 1960 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 1961 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1962 | Cause Code | Cause Length | 1963 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1964 / Cause-Specific Information / 1965 \ \ 1966 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1968 Cause Code: 16 bits (unsigned integer) 1970 Defines the type of error conditions being reported. 1972 Cause Code 1973 Value Cause Code 1974 --------- ---------------- 1975 1 Invalid Stream Identifier 1976 2 Missing Mandatory Parameter 1977 3 Stale Cookie Error 1978 4 Out of Resource 1979 5 Unresolvable Address 1980 6 Unrecognized Chunk Type 1981 7 Invalid Mandatory Parameter 1982 8 Unrecognized Parameters 1983 9 No User Data 1984 10 Cookie Received While Shutting Down 1985 11 Restart of an Association with New Addresses 1986 12 User Initiated Abort 1987 13 Protocol Violation 1988 Cause Length: 16 bits (unsigned integer) 1990 Set to the size of the parameter in bytes, including the Cause 1991 Code, Cause Length, and Cause-Specific Information fields. 1992 Cause-Specific Information: variable length 1994 This field carries the details of the error condition. 1996 Section 3.3.10.1 - Section 3.3.10.13 define error causes for SCTP. 1997 Guidelines for the IETF to define new error cause values are 1998 discussed in Section 14.4. 2000 3.3.10.1. Invalid Stream Identifier (1) 2002 Cause of error 2003 --------------- 2005 Invalid Stream Identifier: Indicates endpoint received a DATA chunk 2006 sent to a nonexistent stream. 2008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2009 | Cause Code=1 | Cause Length=8 | 2010 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2011 | Stream Identifier | (Reserved) | 2012 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2014 Stream Identifier: 16 bits (unsigned integer) 2016 Contains the Stream Identifier of the DATA chunk received in 2017 error. 2019 Reserved: 16 bits 2020 This field is reserved. It is set to all 0's on transmit and 2021 ignored on receipt. 2023 3.3.10.2. Missing Mandatory Parameter (2) 2025 Cause of error 2026 --------------- 2028 Missing Mandatory Parameter: Indicates that one or more mandatory TLV 2029 parameters are missing in a received INIT or INIT ACK. 2031 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2032 | Cause Code=2 | Cause Length=8+N*2 | 2033 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2034 | Number of missing params=N | 2035 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2036 | Missing Param Type #1 | Missing Param Type #2 | 2037 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2038 | Missing Param Type #N-1 | Missing Param Type #N | 2039 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2041 Number of Missing params: 32 bits (unsigned integer) 2043 This field contains the number of parameters contained in the 2044 Cause-Specific Information field. 2046 Missing Param Type: 16 bits (unsigned integer) 2048 Each field will contain the missing mandatory parameter number. 2050 3.3.10.3. Stale Cookie Error (3) 2052 Cause of error 2053 -------------- 2055 Stale Cookie Error: Indicates the receipt of a valid State Cookie 2056 that has expired. 2058 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2059 | Cause Code=3 | Cause Length=8 | 2060 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2061 | Measure of Staleness (usec.) | 2062 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2064 Measure of Staleness: 32 bits (unsigned integer) 2066 This field contains the difference, in microseconds, between the 2067 current time and the time the State Cookie expired. 2069 The sender of this error cause MAY choose to report how long past 2070 expiration the State Cookie is by including a non-zero value in 2071 the Measure of Staleness field. If the sender does not wish to 2072 provide this information, it SHOULD set the Measure of Staleness 2073 field to the value of zero. 2075 3.3.10.4. Out of Resource (4) 2077 Cause of error 2078 --------------- 2080 Out of Resource: Indicates that the sender is out of resource. This 2081 is usually sent in combination with or within an ABORT. 2083 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2084 | Cause Code=4 | Cause Length=4 | 2085 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2087 3.3.10.5. Unresolvable Address (5) 2089 Cause of error 2090 --------------- 2092 Unresolvable Address: Indicates that the sender is not able to 2093 resolve the specified address parameter (e.g., type of address is not 2094 supported by the sender). This is usually sent in combination with 2095 or within an ABORT. 2097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2098 | Cause Code=5 | Cause Length | 2099 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2100 / Unresolvable Address / 2101 \ \ 2102 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2104 Unresolvable Address: variable length 2106 The Unresolvable Address field contains the complete Type, Length, 2107 and Value of the address parameter (or Host Name parameter) that 2108 contains the unresolvable address or host name. 2110 3.3.10.6. Unrecognized Chunk Type (6) 2112 Cause of error 2113 --------------- 2114 Unrecognized Chunk Type: This error cause is returned to the 2115 originator of the chunk if the receiver does not understand the chunk 2116 and the upper bits of the 'Chunk Type' are set to 01 or 11. 2118 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2119 | Cause Code=6 | Cause Length | 2120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2121 / Unrecognized Chunk / 2122 \ \ 2123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2125 Unrecognized Chunk: variable length 2127 The Unrecognized Chunk field contains the unrecognized chunk from 2128 the SCTP packet complete with Chunk Type, Chunk Flags, and Chunk 2129 Length. 2131 3.3.10.7. Invalid Mandatory Parameter (7) 2133 Cause of error 2134 --------------- 2136 Invalid Mandatory Parameter: This error cause is returned to the 2137 originator of an INIT or INIT ACK chunk when one of the mandatory 2138 parameters is set to an invalid value. 2140 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2141 | Cause Code=7 | Cause Length=4 | 2142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2144 3.3.10.8. Unrecognized Parameters (8) 2146 Cause of error 2147 --------------- 2149 Unrecognized Parameters: This error cause is returned to the 2150 originator of the INIT ACK chunk if the receiver does not recognize 2151 one or more Optional TLV parameters in the INIT ACK chunk. 2153 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2154 | Cause Code=8 | Cause Length | 2155 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2156 / Unrecognized Parameters / 2157 \ \ 2158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2160 Unrecognized Parameters: variable length 2161 The Unrecognized Parameters field contains the unrecognized 2162 parameters copied from the INIT ACK chunk complete with TLV. This 2163 error cause is normally contained in an ERROR chunk bundled with 2164 the COOKIE ECHO chunk when responding to the INIT ACK, when the 2165 sender of the COOKIE ECHO chunk wishes to report unrecognized 2166 parameters. 2168 3.3.10.9. No User Data (9) 2170 Cause of error 2171 --------------- 2173 No User Data: This error cause is returned to the originator of a 2174 DATA chunk if a received DATA chunk has no user data. 2176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2177 | Cause Code=9 | Cause Length=8 | 2178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2179 / TSN value / 2180 \ \ 2181 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2183 TSN value: 32 bits (unsigned integer) 2185 The TSN value field contains the TSN of the DATA chunk received 2186 with no user data field. 2188 This cause code is normally returned in an ABORT chunk (see 2189 Section 6.2). 2191 3.3.10.10. Cookie Received While Shutting Down (10) 2193 Cause of error 2194 --------------- 2196 Cookie Received While Shutting Down: A COOKIE ECHO was received while 2197 the endpoint was in the SHUTDOWN-ACK-SENT state. This error is 2198 usually returned in an ERROR chunk bundled with the retransmitted 2199 SHUTDOWN ACK. 2201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2202 | Cause Code=10 | Cause Length=4 | 2203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2205 3.3.10.11. Restart of an Association with New Addresses (11) 2207 Cause of error 2208 -------------- 2210 Restart of an association with new addresses: An INIT was received on 2211 an existing association. But the INIT added addresses to the 2212 association that were previously NOT part of the association. The 2213 new addresses are listed in the error code. This ERROR is normally 2214 sent as part of an ABORT refusing the INIT (see Section 5.2). 2216 0 1 2 3 2217 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 2218 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2219 | Cause Code=11 | Cause Length=Variable | 2220 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2221 / New Address TLVs / 2222 \ \ 2223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2225 Note: Each New Address TLV is an exact copy of the TLV that was found 2226 in the INIT chunk that was new, including the Parameter Type and the 2227 Parameter Length. 2229 3.3.10.12. User-Initiated Abort (12) 2231 Cause of error 2232 -------------- 2234 This error cause MAY be included in ABORT chunks that are sent 2235 because of an upper-layer request. The upper layer can specify an 2236 Upper Layer Abort Reason that is transported by SCTP transparently 2237 and MAY be delivered to the upper-layer protocol at the peer. 2239 0 1 2 3 2240 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 2241 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2242 | Cause Code=12 | Cause Length=Variable | 2243 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2244 / Upper Layer Abort Reason / 2245 \ \ 2246 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2248 3.3.10.13. Protocol Violation (13) 2250 Cause of error 2251 -------------- 2252 This error cause MAY be included in ABORT chunks that are sent 2253 because an SCTP endpoint detects a protocol violation of the peer 2254 that is not covered by the error causes described in Section 3.3.10.1 2255 to Section 3.3.10.12. An implementation MAY provide additional 2256 information specifying what kind of protocol violation has been 2257 detected. 2259 0 1 2 3 2260 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 2261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2262 | Cause Code=13 | Cause Length=Variable | 2263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2264 / Additional Information / 2265 \ \ 2266 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2268 3.3.11. Cookie Echo (COOKIE ECHO) (10) 2270 This chunk is used only during the initialization of an association. 2271 It is sent by the initiator of an association to its peer to complete 2272 the initialization process. This chunk MUST precede any DATA chunk 2273 sent within the association, but MAY be bundled with one or more DATA 2274 chunks in the same packet. 2276 0 1 2 3 2277 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 2278 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2279 | Type = 10 |Chunk Flags | Length | 2280 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2281 / Cookie / 2282 \ \ 2283 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2285 Chunk Flags: 8 bits 2287 Set to 0 on transmit and ignored on receipt. 2289 Length: 16 bits (unsigned integer) 2291 Set to the size of the chunk in bytes, including the 4 bytes of 2292 the chunk header and the size of the cookie. 2294 Cookie: variable size 2296 This field MUST contain the exact cookie received in the State 2297 Cookie parameter from the previous INIT ACK. 2299 An implementation SHOULD make the cookie as small as possible to 2300 ensure interoperability. 2302 Note: A Cookie Echo does NOT contain a State Cookie parameter; 2303 instead, the data within the State Cookie's Parameter Value 2304 becomes the data within the Cookie Echo's Chunk Value. This 2305 allows an implementation to change only the first 2 bytes of the 2306 State Cookie parameter to become a COOKIE ECHO chunk. 2308 3.3.12. Cookie Acknowledgement (COOKIE ACK) (11) 2310 This chunk is used only during the initialization of an association. 2311 It is used to acknowledge the receipt of a COOKIE ECHO chunk. This 2312 chunk MUST precede any DATA or SACK chunk sent within the 2313 association, but MAY be bundled with one or more DATA chunks or SACK 2314 chunk's in the same SCTP packet. 2316 0 1 2 3 2317 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 2318 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2319 | Type = 11 |Chunk Flags | Length = 4 | 2320 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2322 Chunk Flags: 8 bits 2324 Set to 0 on transmit and ignored on receipt. 2326 3.3.13. Shutdown Complete (SHUTDOWN COMPLETE) (14) 2328 This chunk MUST be used to acknowledge the receipt of the SHUTDOWN 2329 ACK chunk at the completion of the shutdown process; see Section 9.2 2330 for details. 2332 The SHUTDOWN COMPLETE chunk has no parameters. 2334 0 1 2 3 2335 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 2336 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2337 | Type = 14 |Reserved |T| Length = 4 | 2338 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2340 Chunk Flags: 8 bits 2342 Reserved: 7 bits 2344 Set to 0 on transmit and ignored on receipt. 2346 T bit: 1 bit 2347 The T bit is set to 0 if the sender filled in the Verification 2348 Tag expected by the peer. If the Verification Tag is 2349 reflected, the T bit MUST be set to 1. Reflecting means that 2350 the sent Verification Tag is the same as the received one. 2352 Note: Special rules apply to this chunk for verification, please see 2353 Section 8.5.1 for details. 2355 4. SCTP Association State Diagram 2357 During the life time of an SCTP association, the SCTP endpoint's 2358 association progresses from one state to another in response to 2359 various events. The events that might potentially advance an 2360 association's state include: 2362 o SCTP user primitive calls, e.g., [ASSOCIATE], [SHUTDOWN], [ABORT], 2363 o Reception of INIT, COOKIE ECHO, ABORT, SHUTDOWN, etc., control 2364 chunks, or 2365 o Some timeout events. 2367 The state diagram in the figures below illustrates state changes, 2368 together with the causing events and resulting actions. Note that 2369 some of the error conditions are not shown in the state diagram. 2370 Full descriptions of all special cases are found in the text. 2372 Note: Chunk names are given in all capital letters, while parameter 2373 names have the first letter capitalized, e.g., COOKIE ECHO chunk type 2374 vs. State Cookie parameter. If more than one event/message can occur 2375 that causes a state transition, it is labeled (A), (B), etc. 2377 ----- -------- (from any state) 2378 / \ / rcv ABORT [ABORT] 2379 rcv INIT | | | ---------- or ---------- 2380 --------------- | v v delete TCB snd ABORT 2381 generate Cookie \ +---------+ delete TCB 2382 snd INIT ACK ---| CLOSED | 2383 +---------+ 2384 / \ [ASSOCIATE] 2385 / \ --------------- 2386 | | create TCB 2387 | | snd INIT 2388 | | strt init timer 2389 rcv valid | | 2390 COOKIE ECHO | v 2391 (1) ---------------- | +------------+ 2392 create TCB | | COOKIE-WAIT| (2) 2393 snd COOKIE ACK | +------------+ 2394 | | 2395 | | rcv INIT ACK 2396 | | ----------------- 2397 | | snd COOKIE ECHO 2398 | | stop init timer 2399 | | strt cookie timer 2400 | v 2401 | +--------------+ 2402 | | COOKIE-ECHOED| (3) 2403 | +--------------+ 2404 | | 2405 | | rcv COOKIE ACK 2406 | | ----------------- 2407 | | stop cookie timer 2408 v v 2409 +---------------+ 2410 | ESTABLISHED | 2411 +---------------+ 2412 | 2413 | 2414 /----+------------\ 2415 [SHUTDOWN] / \ 2416 -------------------| | 2417 check outstanding | | 2418 DATA chunks | | 2419 v | 2420 +---------+ | 2421 |SHUTDOWN-| | rcv SHUTDOWN 2422 |PENDING | |------------------ 2423 +---------+ | check outstanding 2424 | | DATA chunks 2425 No more outstanding | | 2426 ---------------------| | 2427 snd SHUTDOWN | | 2428 strt shutdown timer | | 2429 v v 2430 +---------+ +-----------+ 2431 (4) |SHUTDOWN-| | SHUTDOWN- | (5,6) 2432 |SENT | | RECEIVED | 2433 +---------+ +-----------+ 2434 | \ | 2435 (A) rcv SHUTDOWN ACK | \ | 2436 ----------------------| \ | 2437 stop shutdown timer | \rcv:SHUTDOWN | 2438 send SHUTDOWN COMPLETE| \ (B) | 2439 delete TCB | \ | 2440 | \ | No more outstanding 2441 | \ |----------------- 2442 | \ | send SHUTDOWN ACK 2443 (B)rcv SHUTDOWN | \ | strt shutdown timer 2444 ----------------------| \ | 2445 send SHUTDOWN ACK | \ | 2446 start shutdown timer | \ | 2447 move to SHUTDOWN- | \ | 2448 ACK-SENT | | | 2449 | v | 2450 | +-----------+ 2451 | | SHUTDOWN- | (7) 2452 | | ACK-SENT | 2453 | +----------+- 2454 | | (C)rcv SHUTDOWN COMPLETE 2455 | |----------------- 2456 | | stop shutdown timer 2457 | | delete TCB 2458 | | 2459 | | (D)rcv SHUTDOWN ACK 2460 | |-------------- 2461 | | stop shutdown timer 2462 | | send SHUTDOWN COMPLETE 2463 | | delete TCB 2464 | | 2465 \ +---------+ / 2466 \-->| CLOSED |<--/ 2467 +---------+ 2469 Figure 3: State Transition Diagram of SCTP 2471 Notes: 2473 1) If the State Cookie in the received COOKIE ECHO is invalid (i.e., 2474 failed to pass the integrity check), the receiver MUST silently 2475 discard the packet. Or, if the received State Cookie is expired 2476 (see Section 5.1.5), the receiver MUST send back an ERROR chunk. 2477 In either case, the receiver stays in the CLOSED state. 2478 2) If the T1-init timer expires, the endpoint MUST retransmit INIT 2479 and restart the T1-init timer without changing state. This MUST 2480 be repeated up to 'Max.Init.Retransmits' times. After that, the 2481 endpoint MUST abort the initialization process and report the 2482 error to the SCTP user. 2483 3) If the T1-cookie timer expires, the endpoint MUST retransmit 2484 COOKIE ECHO and restart the T1-cookie timer without changing 2485 state. This MUST be repeated up to 'Max.Init.Retransmits' times. 2486 After that, the endpoint MUST abort the initialization process 2487 and report the error to the SCTP user. 2489 4) In the SHUTDOWN-SENT state, the endpoint MUST acknowledge any 2490 received DATA chunks without delay. 2491 5) In the SHUTDOWN-RECEIVED state, the endpoint MUST NOT accept any 2492 new send requests from its SCTP user. 2493 6) In the SHUTDOWN-RECEIVED state, the endpoint MUST transmit or 2494 retransmit data and leave this state when all data in queue is 2495 transmitted. 2496 7) In the SHUTDOWN-ACK-SENT state, the endpoint MUST NOT accept any 2497 new send requests from its SCTP user. 2499 The CLOSED state is used to indicate that an association is not 2500 created (i.e., doesn't exist). 2502 5. Association Initialization 2504 Before the first data transmission can take place from one SCTP 2505 endpoint ("A") to another SCTP endpoint ("Z"), the two endpoints MUST 2506 complete an initialization process in order to set up an SCTP 2507 association between them. 2509 The SCTP user at an endpoint can use the ASSOCIATE primitive to 2510 initialize an SCTP association to another SCTP endpoint. 2512 IMPLEMENTATION NOTE: From an SCTP user's point of view, an 2513 association might be implicitly opened, without an ASSOCIATE 2514 primitive (see Section 10.1 B) being invoked, by the initiating 2515 endpoint's sending of the first user data to the destination 2516 endpoint. The initiating SCTP will assume default values for all 2517 mandatory and optional parameters for the INIT/INIT ACK. 2519 Once the association is established, unidirectional streams are open 2520 for data transfer on both ends (see Section 5.1.1). 2522 5.1. Normal Establishment of an Association 2524 The initialization process consists of the following steps (assuming 2525 that SCTP endpoint "A" tries to set up an association with SCTP 2526 endpoint "Z" and "Z" accepts the new association): 2528 A) "A" first sends an INIT chunk to "Z". In the INIT, "A" MUST 2529 provide its Verification Tag (Tag_A) in the Initiate Tag field. 2530 Tag_A SHOULD be a random number in the range of 1 to 4294967295 2531 (see Section 5.3.1 for Tag value selection). After sending the 2532 INIT, "A" starts the T1-init timer and enters the COOKIE-WAIT 2533 state. 2535 B) "Z" responds immediately with an INIT ACK chunk. The destination 2536 IP address of the INIT ACK MUST be set to the source IP address 2537 of the INIT to which this INIT ACK is responding. In the 2538 response, besides filling in other parameters, "Z" MUST set the 2539 Verification Tag field to Tag_A, and also provide its own 2540 Verification Tag (Tag_Z) in the Initiate Tag field. 2542 Moreover, "Z" MUST generate and send along with the INIT ACK a 2543 State Cookie. See Section 5.1.3 for State Cookie generation. 2545 Note: After sending out INIT ACK with the State Cookie parameter, 2546 "Z" MUST NOT allocate any resources or keep any states for the 2547 new association. Otherwise, "Z" will be vulnerable to resource 2548 attacks. 2550 C) Upon reception of the INIT ACK from "Z", "A" stops the T1-init 2551 timer and leave the COOKIE-WAIT state. "A" then sends the State 2552 Cookie received in the INIT ACK chunk in a COOKIE ECHO chunk, 2553 starts the T1-cookie timer, and enters the COOKIE-ECHOED state. 2555 Note: The COOKIE ECHO chunk MAY be bundled with any pending 2556 outbound DATA chunks, but it MUST be the first chunk in the 2557 packet and until the COOKIE ACK is returned the sender MUST NOT 2558 send any other packets to the peer. 2560 D) Upon reception of the COOKIE ECHO chunk, endpoint "Z" will reply 2561 with a COOKIE ACK chunk after building a TCB and moving to the 2562 ESTABLISHED state. A COOKIE ACK chunk MAY be bundled with any 2563 pending DATA chunks (and/or SACK chunks), but the COOKIE ACK 2564 chunk MUST be the first chunk in the packet. 2566 IMPLEMENTATION NOTE: An implementation can choose to send the 2567 Communication Up notification to the SCTP user upon reception of 2568 a valid COOKIE ECHO chunk. 2570 E) Upon reception of the COOKIE ACK, endpoint "A" will move from the 2571 COOKIE-ECHOED state to the ESTABLISHED state, stopping the 2572 T1-cookie timer. It can also notify its ULP about the successful 2573 establishment of the association with a Communication Up 2574 notification (see Section 10). 2576 An INIT or INIT ACK chunk MUST NOT be bundled with any other chunk. 2577 They MUST be the only chunks present in the SCTP packets that carry 2578 them. 2580 An endpoint MUST send the INIT ACK to the IP address from which it 2581 received the INIT. 2583 Note: T1-init timer and T1-cookie timer SHOULD follow the same rules 2584 given in Section 6.3. 2586 If an endpoint receives an INIT, INIT ACK, or COOKIE ECHO chunk but 2587 decides not to establish the new association due to missing mandatory 2588 parameters in the received INIT or INIT ACK, invalid parameter 2589 values, or lack of local resources, it SHOULD respond with an ABORT 2590 chunk. It SHOULD also specify the cause of abort, such as the type 2591 of the missing mandatory parameters, etc., by including the error 2592 cause parameters with the ABORT chunk. The Verification Tag field in 2593 the common header of the outbound SCTP packet containing the ABORT 2594 chunk MUST be set to the Initiate Tag value of the peer. 2596 Note that a COOKIE ECHO chunk that does NOT pass the integrity check 2597 is NOT considered an 'invalid parameter' and requires special 2598 handling; see Section 5.1.5. 2600 After the reception of the first DATA chunk in an association the 2601 endpoint MUST immediately respond with a SACK to acknowledge the DATA 2602 chunk. Subsequent acknowledgements SHOULD be done as described in 2603 Section 6.2. 2605 When the TCB is created, each endpoint MUST set its internal 2606 Cumulative TSN Ack Point to the value of its transmitted Initial TSN 2607 minus one. 2609 IMPLEMENTATION NOTE: The IP addresses and SCTP port are generally 2610 used as the key to find the TCB within an SCTP instance. 2612 5.1.1. Handle Stream Parameters 2614 In the INIT and INIT ACK chunks, the sender of the chunk MUST 2615 indicate the number of outbound streams (OSs) it wishes to have in 2616 the association, as well as the maximum inbound streams (MISs) it 2617 will accept from the other endpoint. 2619 After receiving the stream configuration information from the other 2620 side, each endpoint MUST perform the following check: If the peer's 2621 MIS is less than the endpoint's OS, meaning that the peer is 2622 incapable of supporting all the outbound streams the endpoint wants 2623 to configure, the endpoint MUST use MIS outbound streams and MAY 2624 report any shortage to the upper layer. The upper layer can then 2625 choose to abort the association if the resource shortage is 2626 unacceptable. 2628 After the association is initialized, the valid outbound stream 2629 identifier range for either endpoint MUST be 0 to min(local OS, 2630 remote MIS)-1. 2632 5.1.2. Handle Address Parameters 2634 During the association initialization, an endpoint uses the following 2635 rules to discover and collect the destination transport address(es) 2636 of its peer. 2638 A) If there are no address parameters present in the received INIT 2639 or INIT ACK chunk, the endpoint MUST take the source IP address 2640 from which the chunk arrives and record it, in combination with 2641 the SCTP source port number, as the only destination transport 2642 address for this peer. 2644 B) If there is a Host Name Address parameter present in the received 2645 INIT or INIT ACK chunk, the endpoint MUST immediately send an 2646 ABORT and MAY include an "Unresolvable Address" error cause to 2647 its peer. The ABORT SHOULD be sent to the source IP address from 2648 which the last peer packet was received. 2650 C) If there are only IPv4/IPv6 addresses present in the received 2651 INIT or INIT ACK chunk, the receiver MUST derive and record all 2652 the transport addresses from the received chunk AND the source IP 2653 address that sent the INIT or INIT ACK. The transport addresses 2654 are derived by the combination of SCTP source port (from the 2655 common header) and the IP Address parameter(s) carried in the 2656 INIT or INIT ACK chunk and the source IP address of the IP 2657 datagram. The receiver SHOULD use only these transport addresses 2658 as destination transport addresses when sending subsequent 2659 packets to its peer. 2661 D) An INIT or INIT ACK chunk MUST be treated as belonging to an 2662 already established association (or one in the process of being 2663 established) if the use of any of the valid address parameters 2664 contained within the chunk would identify an existing TCB. 2666 IMPLEMENTATION NOTE: In some cases (e.g., when the implementation 2667 doesn't control the source IP address that is used for transmitting), 2668 an endpoint might need to include in its INIT or INIT ACK all 2669 possible IP addresses from which packets to the peer could be 2670 transmitted. 2672 After all transport addresses are derived from the INIT or INIT ACK 2673 chunk using the above rules, the endpoint selects one of the 2674 transport addresses as the initial primary path. 2676 Note: The INIT ACK MUST be sent to the source address of the INIT. 2678 The sender of INIT chunks MAY include a 'Supported Address Types' 2679 parameter in the INIT to indicate what types of addresses are 2680 acceptable. 2682 IMPLEMENTATION NOTE: In the case that the receiver of an INIT ACK 2683 fails to resolve the address parameter due to an unsupported type, it 2684 can abort the initiation process and then attempt a reinitiation by 2685 using a 'Supported Address Types' parameter in the new INIT to 2686 indicate what types of address it prefers. 2688 IMPLEMENTATION NOTE: If an SCTP endpoint that only supports either 2689 IPv4 or IPv6 receives IPv4 and IPv6 addresses in an INIT or INIT ACK 2690 chunk from its peer, it MUST use all the addresses belonging to the 2691 supported address family. The other addresses MAY be ignored. The 2692 endpoint SHOULD NOT respond with any kind of error indication. 2694 IMPLEMENTATION NOTE: If an SCTP endpoint lists in the 'Supported 2695 Address Types' parameter either IPv4 or IPv6, but uses the other 2696 family for sending the packet containing the INIT chunk, or if it 2697 also lists addresses of the other family in the INIT chunk, then the 2698 address family that is not listed in the 'Supported Address Types' 2699 parameter SHOULD also be considered as supported by the receiver of 2700 the INIT chunk. The receiver of the INIT chunk SHOULD NOT respond 2701 with any kind of error indication. 2703 5.1.3. Generating State Cookie 2705 When sending an INIT ACK as a response to an INIT chunk, the sender 2706 of INIT ACK creates a State Cookie and sends it in the State Cookie 2707 parameter of the INIT ACK. Inside this State Cookie, the sender can 2708 include a MAC (see [RFC2104] for an example), a timestamp on when the 2709 State Cookie is created, and the lifespan of the State Cookie, along 2710 with all the information necessary for it to establish the 2711 association. 2713 The following steps SHOULD be taken to generate the State Cookie: 2715 1) Create an association TCB using information from both the 2716 received INIT and the outgoing INIT ACK chunk, 2717 2) In the TCB, set the creation time to the current time of day, and 2718 the lifespan to the protocol parameter 'Valid.Cookie.Life' (see 2719 Section 15), 2720 3) From the TCB, identify and collect the minimal subset of 2721 information needed to re-create the TCB, and generate a MAC using 2722 this subset of information and a secret key (see [RFC2104] for an 2723 example of generating a MAC), and 2724 4) Generate the State Cookie by combining this subset of information 2725 and the resultant MAC. 2727 After sending the INIT ACK with the State Cookie parameter, the 2728 sender SHOULD delete the TCB and any other local resource related to 2729 the new association, so as to prevent resource attacks. 2731 The hashing method used to generate the MAC is strictly a private 2732 matter for the receiver of the INIT chunk. The use of a MAC is 2733 mandatory to prevent denial-of-service attacks. The secret key 2734 SHOULD be random ([RFC4086] provides some information on randomness 2735 guidelines); it SHOULD be changed reasonably frequently, and the 2736 timestamp in the State Cookie MAY be used to determine which key is 2737 used to verify the MAC. 2739 An implementation SHOULD make the cookie as small as possible to 2740 ensure interoperability. 2742 5.1.4. State Cookie Processing 2744 When an endpoint (in the COOKIE-WAIT state) receives an INIT ACK 2745 chunk with a State Cookie parameter, it MUST immediately send a 2746 COOKIE ECHO chunk to its peer with the received State Cookie. The 2747 sender MAY also add any pending DATA chunks to the packet after the 2748 COOKIE ECHO chunk. 2750 The endpoint MUST also start the T1-cookie timer after sending out 2751 the COOKIE ECHO chunk. If the timer expires, the endpoint MUST 2752 retransmit the COOKIE ECHO chunk and restart the T1-cookie timer. 2753 This is repeated until either a COOKIE ACK is received or 2754 'Max.Init.Retransmits' (see Section 15) is reached causing the peer 2755 endpoint to be marked unreachable (and thus the association enters 2756 the CLOSED state). 2758 5.1.5. State Cookie Authentication 2760 When an endpoint receives a COOKIE ECHO chunk from another endpoint 2761 with which it has no association, it takes the following actions: 2763 1) Compute a MAC using the TCB data carried in the State Cookie and 2764 the secret key (note the timestamp in the State Cookie MAY be 2765 used to determine which secret key to use). [RFC2104] can be 2766 used as a guideline for generating the MAC, 2767 2) Authenticate the State Cookie as one that it previously generated 2768 by comparing the computed MAC against the one carried in the 2769 State Cookie. If this comparison fails, the SCTP packet, 2770 including the COOKIE ECHO and any DATA chunks, SHOULD be silently 2771 discarded, 2772 3) Compare the port numbers and the Verification Tag contained 2773 within the COOKIE ECHO chunk to the actual port numbers and the 2774 Verification Tag within the SCTP common header of the received 2775 packet. If these values do not match, the packet MUST be 2776 silently discarded. 2777 4) Compare the creation timestamp in the State Cookie to the current 2778 local time. If the elapsed time is longer than the lifespan 2779 carried in the State Cookie, then the packet, including the 2780 COOKIE ECHO and any attached DATA chunks, SHOULD be discarded, 2781 and the endpoint MUST transmit an ERROR chunk with a "Stale 2782 Cookie" error cause to the peer endpoint. 2783 5) If the State Cookie is valid, create an association to the sender 2784 of the COOKIE ECHO chunk with the information in the TCB data 2785 carried in the COOKIE ECHO and enter the ESTABLISHED state. 2786 6) Send a COOKIE ACK chunk to the peer acknowledging receipt of the 2787 COOKIE ECHO. The COOKIE ACK MAY be bundled with an outbound DATA 2788 chunk or SACK chunk; however, the COOKIE ACK MUST be the first 2789 chunk in the SCTP packet. 2790 7) Immediately acknowledge any DATA chunk bundled with the COOKIE 2791 ECHO with a SACK (subsequent DATA chunk acknowledgement SHOULD 2792 follow the rules defined in Section 6.2). As mentioned in step 2793 6, if the SACK is bundled with the COOKIE ACK, the COOKIE ACK 2794 MUST appear first in the SCTP packet. 2796 If a COOKIE ECHO is received from an endpoint with which the receiver 2797 of the COOKIE ECHO has an existing association, the procedures in 2798 Section 5.2 SHOULD be followed. 2800 5.1.6. An Example of Normal Association Establishment 2802 In the following example, "A" initiates the association and then 2803 sends a user message to "Z", then "Z" sends two user messages to "A" 2804 later (assuming no bundling or fragmentation occurs): 2806 Endpoint A Endpoint Z 2807 {app sets association with Z} 2808 (build TCB) 2809 INIT [I-Tag=Tag_A 2810 & other info] ------\ 2811 (Start T1-init timer) \ 2812 (Enter COOKIE-WAIT state) \---> (compose temp TCB and Cookie_Z) 2813 /-- INIT ACK [Veri Tag=Tag_A, 2814 / I-Tag=Tag_Z, 2815 (Cancel T1-init timer) <------/ Cookie_Z, & other info] 2816 (destroy temp TCB) 2817 COOKIE ECHO [Cookie_Z] ------\ 2818 (Start T1-cookie timer) \ 2819 (Enter COOKIE-ECHOED state) \---> (build TCB, enter ESTABLISHED 2820 state) 2821 /---- COOKIE ACK 2822 / 2823 (Cancel T1-cookie timer, <---/ 2824 enter ESTABLISHED state) 2825 {app sends 1st user data; strm 0} 2826 DATA [TSN=initial TSN_A 2827 Strm=0,Seq=0 & user data]--\ 2828 (Start T3-rtx timer) \ 2829 \-> 2830 /----- SACK [TSN Ack=init 2831 / TSN_A,Block=0] 2832 (Cancel T3-rtx timer) <------/ 2833 ... 2834 {app sends 2 messages;strm 0} 2835 /---- DATA 2836 / [TSN=init TSN_Z 2837 <--/ Strm=0,Seq=0 & user data 1] 2838 SACK [TSN Ack=init TSN_Z, /---- DATA 2839 Block=0] --------\ / [TSN=init TSN_Z +1, 2840 \/ Strm=0,Seq=1 & user data 2] 2841 <------/\ 2842 \ 2843 \------> 2845 Figure 4: INITIATION Example 2847 If the T1-init timer expires at "A" after the INIT or COOKIE ECHO 2848 chunks are sent, the same INIT or COOKIE ECHO chunk with the same 2849 Initiate Tag (i.e., Tag_A) or State Cookie is retransmitted and the 2850 timer restarted. This is repeated Max.Init.Retransmits times before 2851 "A" considers "Z" unreachable and reports the failure to its upper 2852 layer (and thus the association enters the CLOSED state). 2854 When retransmitting the INIT, the endpoint MUST follow the rules 2855 defined in Section 6.3 to determine the proper timer value. 2857 5.2. Handle Duplicate or Unexpected INIT, INIT ACK, COOKIE ECHO, and 2858 COOKIE ACK 2860 During the life time of an association (in one of the possible 2861 states), an endpoint can receive from its peer endpoint one of the 2862 setup chunks (INIT, INIT ACK, COOKIE ECHO, and COOKIE ACK). The 2863 receiver treats such a setup chunk as a duplicate and process it as 2864 described in this section. 2866 Note: An endpoint will not receive the chunk unless the chunk was 2867 sent to an SCTP transport address and is from an SCTP transport 2868 address associated with this endpoint. Therefore, the endpoint 2869 processes such a chunk as part of its current association. 2871 The following scenarios can cause duplicated or unexpected chunks: 2873 A) The peer has crashed without being detected, restarted itself, 2874 and sent out a new INIT chunk trying to restore the association, 2876 B) Both sides are trying to initialize the association at about the 2877 same time, 2879 C) The chunk is from a stale packet that was used to establish the 2880 present association or a past association that is no longer in 2881 existence, 2883 D) The chunk is a false packet generated by an attacker, or 2885 E) The peer never received the COOKIE ACK and is retransmitting its 2886 COOKIE ECHO. 2888 The rules in the following sections are applied in order to identify 2889 and correctly handle these cases. 2891 5.2.1. INIT Received in COOKIE-WAIT or COOKIE-ECHOED State (Item B) 2893 This usually indicates an initialization collision, i.e., each 2894 endpoint is attempting, at about the same time, to establish an 2895 association with the other endpoint. 2897 Upon receipt of an INIT in the COOKIE-WAIT state, an endpoint MUST 2898 respond with an INIT ACK using the same parameters it sent in its 2899 original INIT chunk (including its Initiate Tag, unchanged). When 2900 responding, the following rules MUST be applied: 2902 1) The INIT ACK MUST only be sent to an address passed by the upper 2903 layer in the request to initialize the association. 2905 2) The INIT ACK MUST only be sent to an address reported in the 2906 incoming INIT. 2908 3) The INIT ACK SHOULD be sent to the source address of the received 2909 INIT. 2911 Upon receipt of an INIT in the COOKIE-ECHOED state, an endpoint MUST 2912 respond with an INIT ACK using the same parameters it sent in its 2913 original INIT chunk (including its Initiate Tag, unchanged), provided 2914 that no NEW address has been added to the forming association. If 2915 the INIT message indicates that a new address has been added to the 2916 association, then the entire INIT MUST be discarded, and SHOULD NOT 2917 do any changes to the existing association. An ABORT SHOULD be sent 2918 in response that MAY include the error 'Restart of an association 2919 with new addresses'. The error SHOULD list the addresses that were 2920 added to the restarting association. 2922 When responding in either state (COOKIE-WAIT or COOKIE-ECHOED) with 2923 an INIT ACK, the original parameters are combined with those from the 2924 newly received INIT chunk. The endpoint MUST also generate a State 2925 Cookie with the INIT ACK. The endpoint uses the parameters sent in 2926 its INIT to calculate the State Cookie. 2928 After that, the endpoint MUST NOT change its state, the T1-init timer 2929 MUST be left running, and the corresponding TCB MUST NOT be 2930 destroyed. The normal procedures for handling State Cookies when a 2931 TCB exists will resolve the duplicate INITs to a single association. 2933 For an endpoint that is in the COOKIE-ECHOED state, it MUST populate 2934 its Tie-Tags within both the association TCB and inside the State 2935 Cookie (see Section 5.2.2 for a description of the Tie-Tags). 2937 5.2.2. Unexpected INIT in States Other than CLOSED, COOKIE-ECHOED, 2938 COOKIE-WAIT, and SHUTDOWN-ACK-SENT 2940 Unless otherwise stated, upon receipt of an unexpected INIT for this 2941 association, the endpoint MUST generate an INIT ACK with a State 2942 Cookie. Before responding, the endpoint MUST check to see if the 2943 unexpected INIT adds new addresses to the association. If new 2944 addresses are added to the association, the endpoint MUST respond 2945 with an ABORT, copying the 'Initiate Tag' of the unexpected INIT into 2946 the 'Verification Tag' of the outbound packet carrying the ABORT. In 2947 the ABORT response, the cause of error MAY be set to 'restart of an 2948 association with new addresses'. The error SHOULD list the addresses 2949 that were added to the restarting association. If no new addresses 2950 are added, when responding to the INIT in the outbound INIT ACK, the 2951 endpoint MUST copy its current Tie-Tags to a reserved place within 2952 the State Cookie and the association's TCB. We refer to these 2953 locations inside the cookie as the Peer's-Tie-Tag and the Local-Tie- 2954 Tag. We will refer to the copy within an association's TCB as the 2955 Local Tag and Peer's Tag. The outbound SCTP packet containing this 2956 INIT ACK MUST carry a Verification Tag value equal to the Initiate 2957 Tag found in the unexpected INIT. And the INIT ACK MUST contain a 2958 new Initiate Tag (randomly generated; see Section 5.3.1). Other 2959 parameters for the endpoint SHOULD be copied from the existing 2960 parameters of the association (e.g., number of outbound streams) into 2961 the INIT ACK and cookie. 2963 After sending out the INIT ACK or ABORT, the endpoint MUST take no 2964 further actions; i.e., the existing association, including its 2965 current state, and the corresponding TCB MUST NOT be changed. 2967 Note: Only when a TCB exists and the association is not in a COOKIE- 2968 WAIT or SHUTDOWN-ACK-SENT state are the Tie-Tags populated with a 2969 value other than 0. For a normal association INIT (i.e., the 2970 endpoint is in the CLOSED state), the Tie-Tags MUST be set to 0 2971 (indicating that no previous TCB existed). 2973 5.2.3. Unexpected INIT ACK 2975 If an INIT ACK is received by an endpoint in any state other than the 2976 COOKIE-WAIT state, the endpoint SHOULD discard the INIT ACK chunk. 2977 An unexpected INIT ACK usually indicates the processing of an old or 2978 duplicated INIT chunk. 2980 5.2.4. Handle a COOKIE ECHO when a TCB Exists 2982 When a COOKIE ECHO chunk is received by an endpoint in any state for 2983 an existing association (i.e., not in the CLOSED state) the following 2984 rules are applied: 2986 1) Compute a MAC as described in step 1 of Section 5.1.5, 2988 2) Authenticate the State Cookie as described in step 2 of 2989 Section 5.1.5 (this is case C or D above). 2991 3) Compare the timestamp in the State Cookie to the current time. 2992 If the State Cookie is older than the lifespan carried in the 2993 State Cookie and the Verification Tags contained in the State 2994 Cookie do not match the current association's Verification Tags, 2995 the packet, including the COOKIE ECHO and any DATA chunks, SHOULD 2996 be discarded. The endpoint also MUST transmit an ERROR chunk 2997 with a "Stale Cookie" error cause to the peer endpoint (this is 2998 case C or D in Section 5.2). 3000 If both Verification Tags in the State Cookie match the 3001 Verification Tags of the current association, consider the State 3002 Cookie valid (this is case E in Section 5.2) even if the lifespan 3003 is exceeded. 3005 4) If the State Cookie proves to be valid, unpack the TCB into a 3006 temporary TCB. 3008 5) Refer to Table 2 to determine the correct action to be taken. 3010 +-----------+------------+---------------+----------------+--------+ 3011 | Local Tag | Peer's Tag | Local-Tie-Tag | Peer's-Tie-Tag | Action | 3012 +-----------+------------+---------------+----------------+--------+ 3013 | X | X | M | M | (A) | 3014 +-----------+------------+---------------+----------------+--------+ 3015 | M | X | A | A | (B) | 3016 +-----------+------------+---------------+----------------+--------+ 3017 | M | 0 | A | A | (B) | 3018 +-----------+------------+---------------+----------------+--------+ 3019 | X | M | 0 | 0 | (C) | 3020 +-----------+------------+---------------+----------------+--------+ 3021 | M | M | A | A | (D) | 3022 +-----------+------------+---------------+----------------+--------+ 3024 Table 2: Handling of a COOKIE ECHO when a TCB Exists 3026 Legend: 3028 X - Tag does not match the existing TCB. 3029 M - Tag matches the existing TCB. 3030 0 - No Tie-Tag in cookie (unknown). 3031 A - All cases, i.e., M, X, or 0. 3033 Note: For any case not shown in Table 2, the cookie SHOULD be 3034 silently discarded. 3036 Action 3038 A) In this case, the peer might have restarted. When the endpoint 3039 recognizes this potential 'restart', the existing session is 3040 treated the same as if it received an ABORT followed by a new 3041 COOKIE ECHO with the following exceptions: 3043 * Any SCTP DATA chunks MAY be retained (this is an 3044 implementation-specific option). 3046 * A notification of RESTART SHOULD be sent to the ULP instead of 3047 a "COMMUNICATION LOST" notification. 3049 All the congestion control parameters (e.g., cwnd, ssthresh) 3050 related to this peer MUST be reset to their initial values (see 3051 Section 6.2.1). 3053 After this, the endpoint enters the ESTABLISHED state. 3055 If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes 3056 that the peer has restarted (Action A), it MUST NOT set up a new 3057 association but instead resend the SHUTDOWN ACK and send an ERROR 3058 chunk with a "Cookie Received While Shutting Down" error cause to 3059 its peer. 3061 B) In this case, both sides might be attempting to start an 3062 association at about the same time, but the peer endpoint started 3063 its INIT after responding to the local endpoint's INIT. Thus, it 3064 might have picked a new Verification Tag, not being aware of the 3065 previous tag it had sent this endpoint. The endpoint SHOULD stay 3066 in or enter the ESTABLISHED state, but it MUST update its peer's 3067 Verification Tag from the State Cookie, stop any init or cookie 3068 timers that might be running, and send a COOKIE ACK. 3070 C) In this case, the local endpoint's cookie has arrived late. 3071 Before it arrived, the local endpoint sent an INIT and received 3072 an INIT ACK and finally sent a COOKIE ECHO with the peer's same 3073 tag but a new tag of its own. The cookie SHOULD be silently 3074 discarded. The endpoint SHOULD NOT change states and SHOULD 3075 leave any timers running. 3077 D) When both local and remote tags match, the endpoint SHOULD enter 3078 the ESTABLISHED state, if it is in the COOKIE-ECHOED state. It 3079 SHOULD stop any cookie timer that is running and send a COOKIE 3080 ACK. 3082 Note: The "peer's Verification Tag" is the tag received in the 3083 Initiate Tag field of the INIT or INIT ACK chunk. 3085 5.2.4.1. An Example of a Association Restart 3087 In the following example, "A" initiates the association after a 3088 restart has occurred. Endpoint "Z" had no knowledge of the restart 3089 until the exchange (i.e., Heartbeats had not yet detected the failure 3090 of "A") (assuming no bundling or fragmentation occurs): 3092 Endpoint A Endpoint Z 3093 <-------------- Association is established----------------------> 3094 Tag=Tag_A Tag=Tag_Z 3095 <---------------------------------------------------------------> 3096 {A crashes and restarts} 3097 {app sets up a association with Z} 3098 (build TCB) 3099 INIT [I-Tag=Tag_A' 3100 & other info] --------\ 3101 (Start T1-init timer) \ 3102 (Enter COOKIE-WAIT state) \---> (find an existing TCB 3103 compose temp TCB and Cookie_Z 3104 with Tie-Tags to previous 3105 association) 3106 /--- INIT ACK [Veri Tag=Tag_A', 3107 / I-Tag=Tag_Z', 3108 (Cancel T1-init timer) <------/ Cookie_Z[TieTags= 3109 Tag_A,Tag_Z 3110 & other info] 3111 (destroy temp TCB,leave original 3112 in place) 3113 COOKIE ECHO [Veri=Tag_Z', 3114 Cookie_Z 3115 Tie=Tag_A, 3116 Tag_Z]----------\ 3117 (Start T1-init timer) \ 3118 (Enter COOKIE-ECHOED state) \---> (Find existing association, 3119 Tie-Tags match old tags, 3120 Tags do not match, i.e., 3121 case X X M M above, 3122 Announce Restart to ULP 3123 and reset association). 3124 /---- COOKIE ACK 3125 (Cancel T1-init timer, <------/ 3126 Enter ESTABLISHED state) 3127 {app sends 1st user data; strm 0} 3128 DATA [TSN=initial TSN_A 3129 Strm=0,Seq=0 & user data]--\ 3130 (Start T3-rtx timer) \ 3131 \-> 3132 /--- SACK [TSN Ack=init TSN_A,Block=0] 3133 (Cancel T3-rtx timer) <------/ 3135 Figure 5: A Restart Example 3137 5.2.5. Handle Duplicate COOKIE ACK 3139 At any state other than COOKIE-ECHOED, an endpoint SHOULD silently 3140 discard a received COOKIE ACK chunk. 3142 5.2.6. Handle Stale COOKIE Error 3144 Receipt of an ERROR chunk with a "Stale Cookie" error cause indicates 3145 one of a number of possible events: 3147 A) The association failed to completely setup before the State 3148 Cookie issued by the sender was processed. 3150 B) An old State Cookie was processed after setup completed. 3152 C) An old State Cookie is received from someone that the receiver is 3153 not interested in having an association with and the ABORT chunk 3154 was lost. 3156 When processing an ERROR chunk with a "Stale Cookie" error cause an 3157 endpoint SHOULD first examine if an association is in the process of 3158 being set up, i.e., the association is in the COOKIE-ECHOED state. 3159 In all cases, if the association is not in the COOKIE-ECHOED state, 3160 the ERROR chunk SHOULD be silently discarded. 3162 If the association is in the COOKIE-ECHOED state, the endpoint MAY 3163 elect one of the following three alternatives. 3165 1) Send a new INIT chunk to the endpoint to generate a new State 3166 Cookie and reattempt the setup procedure. 3167 2) Discard the TCB and report to the upper layer the inability to 3168 set up the association. 3169 3) Send a new INIT chunk to the endpoint, adding a Cookie 3170 Preservative parameter requesting an extension to the life time 3171 of the State Cookie. When calculating the time extension, an 3172 implementation SHOULD use the RTT information measured based on 3173 the previous COOKIE ECHO / ERROR exchange, and SHOULD add no more 3174 than 1 second beyond the measured RTT, due to long State Cookie 3175 life times making the endpoint more subject to a replay attack. 3177 5.3. Other Initialization Issues 3179 5.3.1. Selection of Tag Value 3181 Initiate Tag values SHOULD be selected from the range of 1 to 2**32 - 3182 1. It is very important that the Initiate Tag value be randomized to 3183 help protect against "man in the middle" and "sequence number" 3184 attacks. The methods described in [RFC4086] can be used for the 3185 Initiate Tag randomization. Careful selection of Initiate Tags is 3186 also necessary to prevent old duplicate packets from previous 3187 associations being mistakenly processed as belonging to the current 3188 association. 3190 Moreover, the Verification Tag value used by either endpoint in a 3191 given association MUST NOT change during the life time of an 3192 association. A new Verification Tag value MUST be used each time the 3193 endpoint tears down and then reestablishes an association to the same 3194 peer. 3196 5.4. Path Verification 3198 During association establishment, the two peers exchange a list of 3199 addresses. In the predominant case, these lists accurately represent 3200 the addresses owned by each peer. However, it is possible that a 3201 misbehaving peer might supply addresses that it does not own. To 3202 prevent this, the following rules are applied to all addresses of the 3203 new association: 3205 1) Any addresses passed to the sender of the INIT by its upper layer 3206 in the request to initialize an association are automatically 3207 considered to be CONFIRMED. 3209 2) For the receiver of the COOKIE ECHO, the only CONFIRMED address 3210 is the address to which the INIT ACK was sent. 3212 3) All other addresses not covered by rules 1 and 2 are considered 3213 UNCONFIRMED and are subject to probing for verification. 3215 To probe an address for verification, an endpoint will send 3216 HEARTBEATs including a 64-bit random nonce and a path indicator (to 3217 identify the address that the HEARTBEAT is sent to) within the 3218 HEARTBEAT parameter. 3220 Upon receipt of the HEARTBEAT ACK, a verification is made that the 3221 nonce included in the HEARTBEAT parameter is the one sent to the 3222 address indicated inside the HEARTBEAT parameter. When this match 3223 occurs, the address that the original HEARTBEAT was sent to is now 3224 considered CONFIRMED and available for normal data transfer. 3226 These probing procedures are started when an association moves to the 3227 ESTABLISHED state and are ended when all paths are confirmed. 3229 In each RTO, a probe MAY be sent on an active UNCONFIRMED path in an 3230 attempt to move it to the CONFIRMED state. If during this probing 3231 the path becomes inactive, this rate is lowered to the normal 3232 HEARTBEAT rate. At the expiration of the RTO timer, the error 3233 counter of any path that was probed but not CONFIRMED is incremented 3234 by one and subjected to path failure detection, as defined in 3235 Section 8.2. When probing UNCONFIRMED addresses, however, the 3236 association overall error count is NOT incremented. 3238 The number of HEARTBEATS sent at each RTO SHOULD be limited by the 3239 HB.Max.Burst parameter. It is an implementation decision as to how 3240 to distribute HEARTBEATS to the peer's addresses for path 3241 verification. 3243 Whenever a path is confirmed, an indication MAY be given to the upper 3244 layer. 3246 An endpoint MUST NOT send any chunks to an UNCONFIRMED address, with 3247 the following exceptions: 3249 o A HEARTBEAT including a nonce MAY be sent to an UNCONFIRMED 3250 address. 3252 o A HEARTBEAT ACK MAY be sent to an UNCONFIRMED address. 3254 o A COOKIE ACK MAY be sent to an UNCONFIRMED address, but it MUST be 3255 bundled with a HEARTBEAT including a nonce. An implementation 3256 that does NOT support bundling MUST NOT send a COOKIE ACK to an 3257 UNCONFIRMED address. 3259 o A COOKIE ECHO MAY be sent to an UNCONFIRMED address, but it MUST 3260 be bundled with a HEARTBEAT including a nonce, and the packet MUST 3261 NOT exceed the path MTU. If the implementation does NOT support 3262 bundling or if the bundled COOKIE ECHO plus HEARTBEAT (including 3263 nonce) would exceed the path MTU, then the implementation MUST NOT 3264 send a COOKIE ECHO to an UNCONFIRMED address. 3266 6. User Data Transfer 3268 Data transmission MUST only happen in the ESTABLISHED, SHUTDOWN- 3269 PENDING, and SHUTDOWN-RECEIVED states. The only exception to this is 3270 that DATA chunks are allowed to be bundled with an outbound COOKIE 3271 ECHO chunk when in the COOKIE-WAIT state. 3273 DATA chunks MUST only be received according to the rules below in 3274 ESTABLISHED, SHUTDOWN-PENDING, and SHUTDOWN-SENT. A DATA chunk 3275 received in CLOSED is out of the blue and SHOULD be handled per 3276 Section 8.4. A DATA chunk received in any other state SHOULD be 3277 discarded. 3279 A SACK MUST be processed in ESTABLISHED, SHUTDOWN-PENDING, and 3280 SHUTDOWN-RECEIVED. An incoming SACK MAY be processed in COOKIE- 3281 ECHOED. A SACK in the CLOSED state is out of the blue and SHOULD be 3282 processed according to the rules in Section 8.4. A SACK chunk 3283 received in any other state SHOULD be discarded. 3285 An SCTP receiver MUST be able to receive a minimum of 1500 bytes in 3286 one SCTP packet. This means that an SCTP endpoint MUST NOT indicate 3287 less than 1500 bytes in its initial a_rwnd sent in the INIT or INIT 3288 ACK. 3290 For transmission efficiency, SCTP defines mechanisms for bundling of 3291 small user messages and fragmentation of large user messages. The 3292 following diagram depicts the flow of user messages through SCTP. 3294 In this section, the term "data sender" refers to the endpoint that 3295 transmits a DATA chunk and the term "data receiver" refers to the 3296 endpoint that receives a DATA chunk. A data receiver will transmit 3297 SACK chunks. 3299 +--------------------------+ 3300 | User Messages | 3301 +--------------------------+ 3302 SCTP user ^ | 3303 ==================|==|======================================= 3304 | v (1) 3305 +------------------+ +--------------------+ 3306 | SCTP DATA Chunks | |SCTP Control Chunks | 3307 +------------------+ +--------------------+ 3308 ^ | ^ | 3309 | v (2) | v (2) 3310 +--------------------------+ 3311 | SCTP packets | 3312 +--------------------------+ 3313 SCTP ^ | 3314 ===========================|==|=========================== 3315 | v 3316 Connectionless Packet Transfer Service (e.g., IP) 3318 Figure 6: Illustration of User Data Transfer 3320 Notes: 3322 1) When converting user messages into DATA chunks, an endpoint will 3323 fragment user messages larger than the current association path 3324 MTU into multiple DATA chunks. The data receiver will normally 3325 reassemble the fragmented message from DATA chunks before 3326 delivery to the user (see Section 6.9 for details). 3328 2) Multiple DATA and control chunks MAY be bundled by the sender 3329 into a single SCTP packet for transmission, as long as the final 3330 size of the packet does not exceed the current path MTU. The 3331 receiver will unbundle the packet back into the original chunks. 3332 Control chunks MUST come before DATA chunks in the packet. 3334 The fragmentation and bundling mechanisms, as detailed in Section 6.9 3335 and Section 6.10, are OPTIONAL to implement by the data sender, but 3336 they MUST be implemented by the data receiver, i.e., an endpoint MUST 3337 properly receive and process bundled or fragmented data. 3339 6.1. Transmission of DATA Chunks 3341 This document is specified as if there is a single retransmission 3342 timer per destination transport address, but implementations MAY have 3343 a retransmission timer for each DATA chunk. 3345 The following general rules MUST be applied by the data sender for 3346 transmission and/or retransmission of outbound DATA chunks: 3348 A) At any given time, the data sender MUST NOT transmit new data to 3349 any destination transport address if its peer's rwnd indicates 3350 that the peer has no buffer space (i.e., rwnd is smaller than the 3351 size of the next DATA chunk; see Section 6.2.1). 3353 When the receiver has no buffer space, this probe is called a 3354 zero window probe. Note that a zero window probe SHOULD only be 3355 sent when all outstanding DATA chunks have been cumulatively 3356 acknowledged and no DATA chunks are in flight. Zero window 3357 probing MUST be supported. 3359 If the sender continues to receive SACKs from the peer while 3360 doing zero window probing, the unacknowledged window probes 3361 SHOULD NOT increment the error counter for the association or any 3362 destination transport address. This is because the receiver 3363 could keep its window closed for an indefinite time. Section 6.2 3364 describes the receiver behavior when it advertises a zero window. 3365 The sender SHOULD send the first zero window probe after 1 RTO 3366 when it detects that the receiver has closed its window and 3367 SHOULD increase the probe interval exponentially afterwards. 3368 Also note that the cwnd SHOULD be adjusted according to 3369 Section 7.2.1. Zero window probing does not affect the 3370 calculation of cwnd. 3372 The sender MUST also have an algorithm for sending new DATA 3373 chunks to avoid silly window syndrome (SWS) as described in 3374 [RFC1122]. The algorithm can be similar to the one described in 3375 Section 4.2.3.4 of [RFC1122]. 3377 However, regardless of the value of rwnd (including if it is 0), 3378 the data sender can always have one DATA chunk in flight to the 3379 receiver if allowed by cwnd (see rule B below). This rule allows 3380 the sender to probe for a change in rwnd that the sender missed 3381 due to the SACK having been lost in transit from the data 3382 receiver to the data sender. 3384 B) At any given time, the sender MUST NOT transmit new data to a 3385 given transport address if it has cwnd + (PMTU - 1) or more bytes 3386 of data outstanding to that transport address. If data is 3387 available, the sender SHOULD exceed cwnd by up to (PMTU - 1) 3388 bytes on a new data transmission if the flightsize does not 3389 currently reach cwnd. The breach of cwnd MUST constitute one 3390 packet only. 3392 C) When the time comes for the sender to transmit, before sending 3393 new DATA chunks, the sender MUST first transmit any DATA chunks 3394 that are marked for retransmission (limited by the current cwnd). 3396 D) When the time comes for the sender to transmit new DATA chunks, 3397 the protocol parameter Max.Burst SHOULD be used to limit the 3398 number of packets sent. The limit MAY be applied by adjusting 3399 cwnd temporarily, as follows: 3401 if ((flightsize + Max.Burst * MTU) < cwnd) 3402 cwnd = flightsize + Max.Burst * MTU; 3404 Or, it MAY be applied by strictly limiting the number of packets 3405 emitted by the output routine. When calculating the number of 3406 packets to transmit, and particularly when using the formula 3407 above, cwnd SHOULD NOT be changed permanently. 3409 E) Then, the sender can send out as many new DATA chunks as rule A 3410 and rule B allow. 3412 Multiple DATA chunks committed for transmission MAY be bundled in a 3413 single packet. Furthermore, DATA chunks being retransmitted MAY be 3414 bundled with new DATA chunks, as long as the resulting packet size 3415 does not exceed the path MTU. A ULP can request that no bundling is 3416 performed, but this only turns off any delays that an SCTP 3417 implementation might be using to increase bundling efficiency. It 3418 does not in itself stop all bundling from occurring (i.e., in case of 3419 congestion or retransmission). 3421 Before an endpoint transmits a DATA chunk, if any received DATA 3422 chunks have not been acknowledged (e.g., due to delayed ack), the 3423 sender SHOULD create a SACK and bundle it with the outbound DATA 3424 chunk, as long as the size of the final SCTP packet does not exceed 3425 the current MTU. See Section 6.2. 3427 IMPLEMENTATION NOTE: When the window is full (i.e., transmission is 3428 disallowed by rule A and/or rule B), the sender MAY still accept send 3429 requests from its upper layer, but MUST transmit no more DATA chunks 3430 until some or all of the outstanding DATA chunks are acknowledged and 3431 transmission is allowed by rule A and rule B again. 3433 Whenever a transmission or retransmission is made to any address, if 3434 the T3-rtx timer of that address is not currently running, the sender 3435 MUST start that timer. If the timer for that address is already 3436 running, the sender MUST restart the timer if the earliest (i.e., 3437 lowest TSN) outstanding DATA chunk sent to that address is being 3438 retransmitted. Otherwise, the data sender MUST NOT restart the 3439 timer. 3441 When starting or restarting the T3-rtx timer, the timer value SHOULD 3442 be adjusted according to the timer rules defined in Section 6.3.2 and 3443 Section 6.3.3. 3445 Note: The data sender SHOULD NOT use a TSN that is more than 2**31 - 3446 1 above the beginning TSN of the current send window. 3448 Note: For each stream, the data sender SHOULD NOT have more than 3449 2**16 - 1 ordered user messages in the current send window. 3451 Whenever the sender of a DATA chunk can benefit from the 3452 corresponding SACK chunk being sent back without delay, the sender 3453 MAY set the I bit in the DATA chunk header. Please note that why the 3454 sender has set the I bit is irrelevant to the receiver. 3456 Reasons for setting the I bit include, but are not limited to, the 3457 following (see Section 4 of [RFC7053] for a discussion of the 3458 benefits): 3460 o The application requests that the I bit of the last DATA chunk of 3461 a user message be set when providing the user message to the SCTP 3462 implementation (see Section 10.1). 3463 o The sender is in the SHUTDOWN-PENDING state. 3464 o The sending of a DATA chunk fills the congestion or receiver 3465 window. 3467 / 3469 6.2. Acknowledgement on Reception of DATA Chunks 3471 The SCTP endpoint MUST always acknowledge the reception of each valid 3472 DATA chunk when the DATA chunk received is inside its receive window. 3474 When the receiver's advertised window is 0, the receiver MUST drop 3475 any new incoming DATA chunk with a TSN larger than the largest TSN 3476 received so far. If the new incoming DATA chunk holds a TSN value 3477 less than the largest TSN received so far, then the receiver SHOULD 3478 drop the largest TSN held for reordering and accept the new incoming 3479 DATA chunk. In either case, if such a DATA chunk is dropped, the 3480 receiver MUST immediately send back a SACK with the current receive 3481 window showing only DATA chunks received and accepted so far. The 3482 dropped DATA chunk(s) MUST NOT be included in the SACK, as they were 3483 not accepted. The receiver MUST also have an algorithm for 3484 advertising its receive window to avoid receiver silly window 3485 syndrome (SWS), as described in [RFC1122]. The algorithm can be 3486 similar to the one described in Section 4.2.3.3 of [RFC1122]. 3488 The guidelines on delayed acknowledgement algorithm specified in 3489 Section 4.2 of [RFC5681] SHOULD be followed. Specifically, an 3490 acknowledgement SHOULD be generated for at least every second packet 3491 (not every second DATA chunk) received, and SHOULD be generated 3492 within 200 ms of the arrival of any unacknowledged DATA chunk. In 3493 some situations, it might be beneficial for an SCTP transmitter to be 3494 more conservative than the algorithms detailed in this document 3495 allow. However, an SCTP transmitter MUST NOT be more aggressive than 3496 the following algorithms allow. 3498 An SCTP receiver MUST NOT generate more than one SACK for every 3499 incoming packet, other than to update the offered window as the 3500 receiving application consumes new data. When the window opens up, 3501 an SCTP receiver SHOULD send additional SACK chunks to update the 3502 window even if no new data is received. The receiver MUST avoid 3503 sending a large number of window updates -- in particular, large 3504 bursts of them. One way to achieve this is to send a window update 3505 only if the window can be increased by at least a quarter of the 3506 receive buffer size of the association. 3508 IMPLEMENTATION NOTE: The maximum delay for generating an 3509 acknowledgement MAY be configured by the SCTP administrator, either 3510 statically or dynamically, in order to meet the specific timing 3511 requirement of the protocol being carried. 3513 An implementation MUST NOT allow the maximum delay (protocol 3514 parameter 'SACK.Delay') to be configured to be more than 500 ms. In 3515 other words, an implementation MAY lower the value of SACK.Delay 3516 below 500 ms but MUST NOT raise it above 500 ms. 3518 Acknowledgements MUST be sent in SACK chunks unless shutdown was 3519 requested by the ULP, in which case an endpoint MAY send an 3520 acknowledgement in the SHUTDOWN chunk. A SACK chunk can acknowledge 3521 the reception of multiple DATA chunks. See Section 3.3.4 for SACK 3522 chunk format. In particular, the SCTP endpoint MUST fill in the 3523 Cumulative TSN Ack field to indicate the latest sequential TSN (of a 3524 valid DATA chunk) it has received. Any received DATA chunks with TSN 3525 greater than the value in the Cumulative TSN Ack field are reported 3526 in the Gap Ack Block fields. The SCTP endpoint MUST report as many 3527 Gap Ack Blocks as can fit in a single SACK chunk limited by the 3528 current path MTU. 3530 Note: The SHUTDOWN chunk does not contain Gap Ack Block fields. 3531 Therefore, the endpoint SHOULD use a SACK instead of the SHUTDOWN 3532 chunk to acknowledge DATA chunks received out of order. 3534 Upon receipt of an SCTP packet containing a DATA chunk with the I bit 3535 set, the receiver SHOULD NOT delay the sending of the corresponding 3536 SACK chunk, i.e., the receiver SHOULD immediately respond with the 3537 corresponding SACK chunk. 3539 When a packet arrives with duplicate DATA chunk(s) and with no new 3540 DATA chunk(s), the endpoint MUST immediately send a SACK with no 3541 delay. If a packet arrives with duplicate DATA chunk(s) bundled with 3542 new DATA chunks, the endpoint MAY immediately send a SACK. Normally, 3543 receipt of duplicate DATA chunks will occur when the original SACK 3544 chunk was lost and the peer's RTO has expired. The duplicate TSN 3545 number(s) SHOULD be reported in the SACK as duplicate. 3547 When an endpoint receives a SACK, it MAY use the duplicate TSN 3548 information to determine if SACK loss is occurring. Further use of 3549 this data is for future study. 3551 The data receiver is responsible for maintaining its receive buffers. 3552 The data receiver SHOULD notify the data sender in a timely manner of 3553 changes in its ability to receive data. How an implementation 3554 manages its receive buffers is dependent on many factors (e.g., 3555 operating system, memory management system, amount of memory, etc.). 3556 However, the data sender strategy defined in Section 6.2.1 is based 3557 on the assumption of receiver operation similar to the following: 3559 A) At initialization of the association, the endpoint tells the peer 3560 how much receive buffer space it has allocated to the association 3561 in the INIT or INIT ACK. The endpoint sets a_rwnd to this value. 3563 B) As DATA chunks are received and buffered, decrement a_rwnd by the 3564 number of bytes received and buffered. This is, in effect, 3565 closing rwnd at the data sender and restricting the amount of 3566 data it can transmit. 3568 C) As DATA chunks are delivered to the ULP and released from the 3569 receive buffers, increment a_rwnd by the number of bytes 3570 delivered to the upper layer. This is, in effect, opening up 3571 rwnd on the data sender and allowing it to send more data. The 3572 data receiver SHOULD NOT increment a_rwnd unless it has released 3573 bytes from its receive buffer. For example, if the receiver is 3574 holding fragmented DATA chunks in a reassembly queue, it SHOULD 3575 NOT increment a_rwnd. 3577 D) When sending a SACK, the data receiver SHOULD place the current 3578 value of a_rwnd into the a_rwnd field. The data receiver SHOULD 3579 take into account that the data sender will not retransmit DATA 3580 chunks that are acked via the Cumulative TSN Ack (i.e., will drop 3581 from its retransmit queue). 3583 Under certain circumstances, the data receiver MAY drop DATA chunks 3584 that it has received but hasn't released from its receive buffers 3585 (i.e., delivered to the ULP). These DATA chunks might have been 3586 acked in Gap Ack Blocks. For example, the data receiver might be 3587 holding data in its receive buffers while reassembling a fragmented 3588 user message from its peer when it runs out of receive buffer space. 3589 It MAY drop these DATA chunks even though it has acknowledged them in 3590 Gap Ack Blocks. If a data receiver drops DATA chunks, it MUST NOT 3591 include them in Gap Ack Blocks in subsequent SACKs until they are 3592 received again via retransmission. In addition, the endpoint SHOULD 3593 take into account the dropped data when calculating its a_rwnd. 3595 An endpoint SHOULD NOT revoke a SACK and discard data. Only in 3596 extreme circumstances might an endpoint use this procedure (such as 3597 out of buffer space). The data receiver SHOULD take into account 3598 that dropping data that has been acked in Gap Ack Blocks can result 3599 in suboptimal retransmission strategies in the data sender and thus 3600 in suboptimal performance. 3602 The following example illustrates the use of delayed 3603 acknowledgements: 3605 Endpoint A Endpoint Z 3607 {App sends 3 messages; strm 0} 3608 DATA [TSN=7,Strm=0,Seq=3] ------------> (ack delayed) 3609 (Start T3-rtx timer) 3611 DATA [TSN=8,Strm=0,Seq=4] ------------> (send ack) 3612 /------- SACK [TSN Ack=8,block=0] 3613 (cancel T3-rtx timer) <-----/ 3615 DATA [TSN=9,Strm=0,Seq=5] ------------> (ack delayed) 3616 (Start T3-rtx timer) 3617 ... 3618 {App sends 1 message; strm 1} 3619 (bundle SACK with DATA) 3620 /----- SACK [TSN Ack=9,block=0] \ 3621 / DATA [TSN=6,Strm=1,Seq=2] 3622 (cancel T3-rtx timer) <------/ (Start T3-rtx timer) 3624 (ack delayed) 3625 (send ack) 3626 SACK [TSN Ack=6,block=0] -------------> (cancel T3-rtx timer) 3628 Figure 7: Delayed Acknowledgement Example 3630 If an endpoint receives a DATA chunk with no user data (i.e., the 3631 Length field is set to 16), it MUST send an ABORT with error cause 3632 set to "No User Data". 3634 An endpoint SHOULD NOT send a DATA chunk with no user data part. 3636 6.2.1. Processing a Received SACK 3638 Each SACK an endpoint receives contains an a_rwnd value. This value 3639 represents the amount of buffer space the data receiver, at the time 3640 of transmitting the SACK, has left of its total receive buffer space 3641 (as specified in the INIT/INIT ACK). Using a_rwnd, Cumulative TSN 3642 Ack, and Gap Ack Blocks, the data sender can develop a representation 3643 of the peer's receive buffer space. 3645 One of the problems the data sender takes into account when 3646 processing a SACK is that a SACK can be received out of order. That 3647 is, a SACK sent by the data receiver can pass an earlier SACK and be 3648 received first by the data sender. If a SACK is received out of 3649 order, the data sender can develop an incorrect view of the peer's 3650 receive buffer space. 3652 Since there is no explicit identifier that can be used to detect out- 3653 of-order SACKs, the data sender uses heuristics to determine if a 3654 SACK is new. 3656 An endpoint SHOULD use the following rules to calculate the rwnd, 3657 using the a_rwnd value, the Cumulative TSN Ack, and Gap Ack Blocks in 3658 a received SACK. 3660 A) At the establishment of the association, the endpoint initializes 3661 the rwnd to the Advertised Receiver Window Credit (a_rwnd) the 3662 peer specified in the INIT or INIT ACK. 3664 B) Any time a DATA chunk is transmitted (or retransmitted) to a 3665 peer, the endpoint subtracts the data size of the chunk from the 3666 rwnd of that peer. 3668 C) Any time a DATA chunk is marked for retransmission, either via 3669 T3-rtx timer expiration (Section 6.3.3) or via Fast Retransmit 3670 (Section 7.2.4), add the data size of those chunks to the rwnd. 3672 Note: If the implementation is maintaining a timer on each DATA 3673 chunk, then only DATA chunks whose timer expired would be marked 3674 for retransmission. 3676 D) Any time a SACK arrives, the endpoint performs the following: 3678 i) If Cumulative TSN Ack is less than the Cumulative TSN Ack 3679 Point, then drop the SACK. Since Cumulative TSN Ack is 3680 monotonically increasing, a SACK whose Cumulative TSN Ack 3681 is less than the Cumulative TSN Ack Point indicates an out- 3682 of-order SACK. 3684 ii) Set rwnd equal to the newly received a_rwnd minus the 3685 number of bytes still outstanding after processing the 3686 Cumulative TSN Ack and the Gap Ack Blocks. 3688 iii) If the SACK is missing a TSN that was previously 3689 acknowledged via a Gap Ack Block (e.g., the data receiver 3690 reneged on the data), then consider the corresponding DATA 3691 that might be possibly missing: Count one miss indication 3692 towards Fast Retransmit as described in Section 7.2.4, and 3693 if no retransmit timer is running for the destination 3694 address to which the DATA chunk was originally transmitted, 3695 then T3-rtx is started for that destination address. 3697 iv) If the Cumulative TSN Ack matches or exceeds the Fast 3698 Recovery exitpoint (Section 7.2.4), Fast Recovery is 3699 exited. 3701 6.3. Management of Retransmission Timer 3703 An SCTP endpoint uses a retransmission timer T3-rtx to ensure data 3704 delivery in the absence of any feedback from its peer. The duration 3705 of this timer is referred to as RTO (retransmission timeout). 3707 When an endpoint's peer is multi-homed, the endpoint will calculate a 3708 separate RTO for each different destination transport address of its 3709 peer endpoint. 3711 The computation and management of RTO in SCTP follow closely how TCP 3712 manages its retransmission timer. To compute the current RTO, an 3713 endpoint maintains two state variables per destination transport 3714 address: SRTT (smoothed round-trip time) and RTTVAR (round-trip time 3715 variation). 3717 6.3.1. RTO Calculation 3719 The rules governing the computation of SRTT, RTTVAR, and RTO are as 3720 follows: 3722 C1) Until an RTT measurement has been made for a packet sent to the 3723 given destination transport address, set RTO to the protocol 3724 parameter 'RTO.Initial'. 3725 C2) When the first RTT measurement R is made, set 3727 SRTT <- R, 3729 RTTVAR <- R/2, and 3731 RTO <- SRTT + 4 * RTTVAR. 3732 C3) When a new RTT measurement R' is made, set 3734 RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| 3736 and 3738 SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R' 3740 Note: The value of SRTT used in the update to RTTVAR is its 3741 value before updating SRTT itself using the second assignment. 3743 After the computation, update RTO <- SRTT + 4 * RTTVAR. 3744 C4) When data is in flight and when allowed by rule C5 below, a new 3745 RTT measurement MUST be made each round trip. Furthermore, new 3746 RTT measurements SHOULD be made no more than once per round trip 3747 for a given destination transport address. There are two 3748 reasons for this recommendation: First, it appears that 3749 measuring more frequently often does not in practice yield any 3750 significant benefit [ALLMAN99]; second, if measurements are made 3751 more often, then the values of RTO.Alpha and RTO.Beta in rule C3 3752 above SHOULD be adjusted so that SRTT and RTTVAR still adjust to 3753 changes at roughly the same rate (in terms of how many round 3754 trips it takes them to reflect new values) as they would if 3755 making only one measurement per round-trip and using RTO.Alpha 3756 and RTO.Beta as given in rule C3. However, the exact nature of 3757 these adjustments remains a research issue. 3759 C5) Karn's algorithm: RTT measurements MUST NOT be made using 3760 packets that were retransmitted (and thus for which it is 3761 ambiguous whether the reply was for the first instance of the 3762 chunk or for a later instance) 3764 IMPLEMENTATION NOTE: RTT measurements SHOULD only be made using 3765 a chunk with TSN r if no chunk with TSN less than or equal to r 3766 is retransmitted since r is first sent. 3768 C6) Whenever RTO is computed, if it is less than RTO.Min seconds 3769 then it is rounded up to RTO.Min seconds. The reason for this 3770 rule is that RTOs that do not have a high minimum value are 3771 susceptible to unnecessary timeouts [ALLMAN99]. 3773 C7) A maximum value MAY be placed on RTO provided it is at least 3774 RTO.max seconds. 3776 There is no requirement for the clock granularity G used for 3777 computing RTT measurements and the different state variables, other 3778 than: 3780 G1) Whenever RTTVAR is computed, if RTTVAR = 0, then adjust RTTVAR 3781 <- G. 3783 Experience [ALLMAN99] has shown that finer clock granularities (<= 3784 100 msec) perform somewhat better than more coarse granularities. 3786 6.3.2. Retransmission Timer Rules 3788 The rules for managing the retransmission timer are as follows: 3790 R1) Every time a DATA chunk is sent to any address (including a 3791 retransmission), if the T3-rtx timer of that address is not 3792 running, start it running so that it will expire after the RTO 3793 of that address. The RTO used here is that obtained after any 3794 doubling due to previous T3-rtx timer expirations on the 3795 corresponding destination address as discussed in rule E2 below. 3797 R2) Whenever all outstanding data sent to an address have been 3798 acknowledged, turn off the T3-rtx timer of that address. 3799 R3) Whenever a SACK is received that acknowledges the DATA chunk 3800 with the earliest outstanding TSN for that address, restart the 3801 T3-rtx timer for that address with its current RTO (if there is 3802 still outstanding data on that address). 3803 R4) Whenever a SACK is received missing a TSN that was previously 3804 acknowledged via a Gap Ack Block, start the T3-rtx for the 3805 destination address to which the DATA chunk was originally 3806 transmitted if it is not already running. 3808 The following example shows the use of various timer rules (assuming 3809 that the receiver uses delayed acks). 3811 Endpoint A Endpoint Z 3812 {App begins to send} 3813 Data [TSN=7,Strm=0,Seq=3] ------------> (ack delayed) 3814 (Start T3-rtx timer) 3815 {App sends 1 message; strm 1} 3816 (bundle ack with data) 3817 DATA [TSN=8,Strm=0,Seq=4] ----\ /-- SACK [TSN Ack=7,Block=0] 3818 \ / DATA [TSN=6,Strm=1,Seq=2] 3819 \ / (Start T3-rtx timer) 3820 \ 3821 / \ 3822 (Restart T3-rtx timer) <------/ \--> (ack delayed) 3823 (ack delayed) 3824 {send ack} 3825 SACK [TSN Ack=6,Block=0] --------------> (Cancel T3-rtx timer) 3826 .. 3827 (send ack) 3828 (Cancel T3-rtx timer) <-------------- SACK [TSN Ack=8,Block=0] 3830 Figure 8: Timer Rule Examples 3832 6.3.3. Handle T3-rtx Expiration 3834 Whenever the retransmission timer T3-rtx expires for a destination 3835 address, do the following: 3837 E1) For the destination address for which the timer expires, adjust 3838 its ssthresh with rules defined in Section 7.2.3 and set the 3839 cwnd <- MTU. 3840 E2) For the destination address for which the timer expires, set RTO 3841 <- RTO * 2 ("back off the timer"). The maximum value discussed 3842 in rule C7 above (RTO.max) MAY be used to provide an upper bound 3843 to this doubling operation. 3844 E3) Determine how many of the earliest (i.e., lowest TSN) 3845 outstanding DATA chunks for the address for which the T3-rtx has 3846 expired will fit into a single packet, subject to the MTU 3847 constraint for the path corresponding to the destination 3848 transport address to which the retransmission is being sent 3849 (this might be different from the address for which the timer 3850 expires; see Section 6.4). Call this value K. Bundle and 3851 retransmit those K DATA chunks in a single packet to the 3852 destination endpoint. 3853 E4) Start the retransmission timer T3-rtx on the destination address 3854 to which the retransmission is sent, if rule R1 above indicates 3855 to do so. The RTO to be used for starting T3-rtx SHOULD be the 3856 one for the destination address to which the retransmission is 3857 sent, which, when the receiver is multi-homed, might be 3858 different from the destination address for which the timer 3859 expired (see Section 6.4 below). 3861 After retransmitting, once a new RTT measurement is obtained (which 3862 can happen only when new data has been sent and acknowledged, per 3863 rule C5, or for a measurement made from a HEARTBEAT; see 3864 Section 8.3), the computation in rule C3 is performed, including the 3865 computation of RTO, which might result in "collapsing" RTO back down 3866 after it has been subject to doubling (rule E2). 3868 Note: Any DATA chunks that were sent to the address for which the 3869 T3-rtx timer expired but did not fit in one MTU (rule E3 above) 3870 SHOULD be marked for retransmission and sent as soon as cwnd allows 3871 (normally, when a SACK arrives). 3873 The final rule for managing the retransmission timer concerns 3874 failover (see Section 6.4.1): 3876 F1) Whenever an endpoint switches from the current destination 3877 transport address to a different one, the current retransmission 3878 timers are left running. As soon as the endpoint transmits a 3879 packet containing DATA chunk(s) to the new transport address, 3880 start the timer on that transport address, using the RTO value 3881 of the destination address to which the data is being sent, if 3882 rule R1 indicates to do so. 3884 6.4. Multi-Homed SCTP Endpoints 3886 An SCTP endpoint is considered multi-homed if there are more than one 3887 transport address that can be used as a destination address to reach 3888 that endpoint. 3890 Moreover, the ULP of an endpoint selects one of the multiple 3891 destination addresses of a multi-homed peer endpoint as the primary 3892 path (see Section 5.1.2 and Section 10.1 for details). 3894 By default, an endpoint SHOULD always transmit to the primary path, 3895 unless the SCTP user explicitly specifies the destination transport 3896 address (and possibly source transport address) to use. 3898 An endpoint SHOULD transmit reply chunks (e.g., INIT ACK, COOKIE ACK, 3899 HEARTBEAT ACK) in response to control chunks to the same destination 3900 transport address from which it received the control chunk to which 3901 it is replying. 3903 The selection of the destination transport address for packets 3904 containing SACK chunks is implementation dependent. However, an 3905 endpoint SHOULD NOT vary the destination transport address of a SACK 3906 when it receives DATA chunks coming from the same source address. 3908 When acknowledging multiple DATA chunks received in packets from 3909 different source addresses in a single SACK, the SACK chunk MAY be 3910 transmitted to one of the destination transport addresses from which 3911 the DATA or control chunks being acknowledged were received. 3913 When a receiver of a duplicate DATA chunk sends a SACK to a multi- 3914 homed endpoint, it MAY be beneficial to vary the destination address 3915 and not use the source address of the DATA chunk. The reason is that 3916 receiving a duplicate from a multi-homed endpoint might indicate that 3917 the return path (as specified in the source address of the DATA 3918 chunk) for the SACK is broken. 3920 Furthermore, when its peer is multi-homed, an endpoint SHOULD try to 3921 retransmit a chunk that timed out to an active destination transport 3922 address that is different from the last destination address to which 3923 the DATA chunk was sent. 3925 When its peer is multi-homed, an endpoint SHOULD send fast 3926 retransmissions to the same destination transport address to which 3927 the original data was sent. If the primary path has been changed and 3928 the original data was sent to the old primary path before the Fast 3929 Retransmit, the implementation MAY send it to the new primary path. 3931 Retransmissions do not affect the total outstanding data count. 3932 However, if the DATA chunk is retransmitted onto a different 3933 destination address, both the outstanding data counts on the new 3934 destination address and the old destination address to which the data 3935 chunk was last sent is adjusted accordingly. 3937 6.4.1. Failover from an Inactive Destination Address 3939 Some of the transport addresses of a multi-homed SCTP endpoint might 3940 become inactive due to either the occurrence of certain error 3941 conditions (see Section 8.2) or adjustments from the SCTP user. 3943 When there is outbound data to send and the primary path becomes 3944 inactive (e.g., due to failures), or where the SCTP user explicitly 3945 requests to send data to an inactive destination transport address, 3946 before reporting an error to its ULP, the SCTP endpoint SHOULD try to 3947 send the data to an alternate active destination transport address if 3948 one exists. 3950 When retransmitting data that timed out, if the endpoint is multi- 3951 homed, it needs to consider each source-destination address pair in 3952 its retransmission selection policy. When retransmitting timed-out 3953 data, the endpoint SHOULD attempt to pick the most divergent source- 3954 destination pair from the original source-destination pair to which 3955 the packet was transmitted. 3957 Note: Rules for picking the most divergent source-destination pair 3958 are an implementation decision and are not specified within this 3959 document. 3961 6.5. Stream Identifier and Stream Sequence Number 3963 Every DATA chunk MUST carry a valid stream identifier. If an 3964 endpoint receives a DATA chunk with an invalid stream identifier, it 3965 SHOULD acknowledge the reception of the DATA chunk following the 3966 normal procedure, immediately send an ERROR chunk with cause set to 3967 "Invalid Stream Identifier" (see Section 3.3.10), and discard the 3968 DATA chunk. The endpoint MAY bundle the ERROR chunk and the SACK 3969 chunk in the same packet. 3971 The Stream Sequence Number in all the streams MUST start from 0 when 3972 the association is established. Also, when the Stream Sequence 3973 Number reaches the value 65535 the next Stream Sequence Number MUST 3974 be set to 0. 3976 6.6. Ordered and Unordered Delivery 3978 Within a stream, an endpoint MUST deliver DATA chunks received with 3979 the U flag set to 0 to the upper layer according to the order of 3980 their Stream Sequence Number. If DATA chunks arrive out of order of 3981 their Stream Sequence Number, the endpoint MUST hold the received 3982 DATA chunks from delivery to the ULP until they are reordered. 3984 However, an SCTP endpoint can indicate that no ordered delivery is 3985 required for a particular DATA chunk transmitted within the stream by 3986 setting the U flag of the DATA chunk to 1. 3988 When an endpoint receives a DATA chunk with the U flag set to 1, it 3989 bypasses the ordering mechanism and immediately deliver the data to 3990 the upper layer (after reassembly if the user data is fragmented by 3991 the data sender). 3993 This provides an effective way of transmitting "out-of-band" data in 3994 a given stream. Also, a stream can be used as an "unordered" stream 3995 by simply setting the U flag to 1 in all DATA chunks sent through 3996 that stream. 3998 IMPLEMENTATION NOTE: When sending an unordered DATA chunk, an 3999 implementation MAY choose to place the DATA chunk in an outbound 4000 packet that is at the head of the outbound transmission queue if 4001 possible. 4003 The 'Stream Sequence Number' field in a DATA chunk with U flag set to 4004 1 has no significance. The sender can fill it with arbitrary value, 4005 but the receiver MUST ignore the field. 4007 Note: When transmitting ordered and unordered data, an endpoint does 4008 not increment its Stream Sequence Number when transmitting a DATA 4009 chunk with U flag set to 1. 4011 6.7. Report Gaps in Received DATA TSNs 4013 Upon the reception of a new DATA chunk, an endpoint examines the 4014 continuity of the TSNs received. If the endpoint detects a gap in 4015 the received DATA chunk sequence, it SHOULD send a SACK with Gap Ack 4016 Blocks immediately. The data receiver continues sending a SACK after 4017 receipt of each SCTP packet that doesn't fill the gap. 4019 Based on the Gap Ack Block from the received SACK, the endpoint can 4020 calculate the missing DATA chunks and make decisions on whether to 4021 retransmit them (see Section 6.2.1 for details). 4023 Multiple gaps can be reported in one single SACK (see Section 3.3.4). 4025 When its peer is multi-homed, the SCTP endpoint SHOULD always try to 4026 send the SACK to the same destination address from which the last 4027 DATA chunk was received. 4029 Upon the reception of a SACK, the endpoint MUST remove all DATA 4030 chunks that have been acknowledged by the SACK's Cumulative TSN Ack 4031 from its transmit queue. The endpoint MUST also treat all the DATA 4032 chunks with TSNs not included in the Gap Ack Blocks reported by the 4033 SACK as "missing". The number of "missing" reports for each 4034 outstanding DATA chunk MUST be recorded by the data sender in order 4035 to make retransmission decisions. See Section 7.2.4 for details. 4037 The following example shows the use of SACK to report a gap. 4039 Endpoint A Endpoint Z 4040 {App sends 3 messages; strm 0} 4041 DATA [TSN=6,Strm=0,Seq=2] ---------------> (ack delayed) 4042 (Start T3-rtx timer) 4044 DATA [TSN=7,Strm=0,Seq=3] --------> X (lost) 4046 DATA [TSN=8,Strm=0,Seq=4] ---------------> (gap detected, 4047 immediately send ack) 4048 /----- SACK [TSN Ack=6,Block=1, 4049 / Start=2,End=2] 4050 <-----/ 4051 (remove 6 from out-queue, 4052 and mark 7 as "1" missing report) 4054 Figure 9: Reporting a Gap using SACK 4056 The maximum number of Gap Ack Blocks that can be reported within a 4057 single SACK chunk is limited by the current path MTU. When a single 4058 SACK cannot cover all the Gap Ack Blocks needed to be reported due to 4059 the MTU limitation, the endpoint MUST send only one SACK, reporting 4060 the Gap Ack Blocks from the lowest to highest TSNs, within the size 4061 limit set by the MTU, and leave the remaining highest TSN numbers 4062 unacknowledged. 4064 6.8. CRC32c Checksum Calculation 4066 When sending an SCTP packet, the endpoint MUST strengthen the data 4067 integrity of the transmission by including the CRC32c checksum value 4068 calculated on the packet, as described below. 4070 After the packet is constructed (containing the SCTP common header 4071 and one or more control or DATA chunks), the transmitter MUST 4073 1) fill in the proper Verification Tag in the SCTP common header and 4074 initialize the checksum field to '0's, 4075 2) calculate the CRC32c checksum of the whole packet, including the 4076 SCTP common header and all the chunks (refer to Appendix B for 4077 details of the CRC32c algorithm); and 4079 3) put the resultant value into the checksum field in the common 4080 header, and leave the rest of the bits unchanged. 4082 When an SCTP packet is received, the receiver MUST first check the 4083 CRC32c checksum as follows: 4085 1) Store the received CRC32c checksum value aside. 4086 2) Replace the 32 bits of the checksum field in the received SCTP 4087 packet with all '0's and calculate a CRC32c checksum value of the 4088 whole received packet. 4089 3) Verify that the calculated CRC32c checksum is the same as the 4090 received CRC32c checksum. If it is not, the receiver MUST treat 4091 the packet as an invalid SCTP packet. 4093 The default procedure for handling invalid SCTP packets is to 4094 silently discard them. 4096 Any hardware implementation SHOULD be done in a way that is 4097 verifiable by the software. 4099 6.9. Fragmentation and Reassembly 4101 An endpoint MAY support fragmentation when sending DATA chunks, but 4102 it MUST support reassembly when receiving DATA chunks. If an 4103 endpoint supports fragmentation, it MUST fragment a user message if 4104 the size of the user message to be sent causes the outbound SCTP 4105 packet size to exceed the current MTU. If an implementation does not 4106 support fragmentation of outbound user messages, the endpoint MUST 4107 return an error to its upper layer and not attempt to send the user 4108 message. 4110 Note: If an implementation that supports fragmentation makes 4111 available to its upper layer a mechanism to turn off fragmentation, 4112 it might do so. However, in so doing, it MUST react just like an 4113 implementation that does NOT support fragmentation, i.e., it MUST 4114 reject sends that exceed the current Path MTU (P-MTU). 4116 IMPLEMENTATION NOTE: In this error case, the Send primitive discussed 4117 in Section 10.1 would need to return an error to the upper layer. 4119 If its peer is multi-homed, the endpoint SHOULD choose a size no 4120 larger than the association Path MTU. The association Path MTU is 4121 the smallest Path MTU of all destination addresses. 4123 Note: Once a message is fragmented, it cannot be re-fragmented. 4124 Instead, if the PMTU has been reduced, then IP fragmentation MUST be 4125 used. Please see Section 7.3 for details of PMTU discovery. 4127 When determining when to fragment, the SCTP implementation MUST take 4128 into account the SCTP packet header as well as the DATA chunk 4129 header(s). The implementation MUST also take into account the space 4130 required for a SACK chunk if bundling a SACK chunk with the DATA 4131 chunk. 4133 Fragmentation takes the following steps: 4135 1) The data sender MUST break the user message into a series of DATA 4136 chunks such that each chunk plus SCTP overhead fits into an IP 4137 datagram smaller than or equal to the association Path MTU. 4139 2) The transmitter MUST then assign, in sequence, a separate TSN to 4140 each of the DATA chunks in the series. The transmitter assigns 4141 the same SSN to each of the DATA chunks. If the user indicates 4142 that the user message is to be delivered using unordered 4143 delivery, then the U flag of each DATA chunk of the user message 4144 MUST be set to 1. 4146 3) The transmitter MUST also set the B/E bits of the first DATA 4147 chunk in the series to '10', the B/E bits of the last DATA chunk 4148 in the series to '01', and the B/E bits of all other DATA chunks 4149 in the series to '00'. 4151 An endpoint MUST recognize fragmented DATA chunks by examining the B/ 4152 E bits in each of the received DATA chunks, and queue the fragmented 4153 DATA chunks for reassembly. Once the user message is reassembled, 4154 SCTP passes the reassembled user message to the specific stream for 4155 possible reordering and final dispatching. 4157 Note: If the data receiver runs out of buffer space while still 4158 waiting for more fragments to complete the reassembly of the message, 4159 it SHOULD dispatch part of its inbound message through a partial 4160 delivery API (see Section 10), freeing some of its receive buffer 4161 space so that the rest of the message can be received. 4163 6.10. Bundling 4165 An endpoint bundles chunks by simply including multiple chunks in one 4166 outbound SCTP packet. The total size of the resultant IP datagram, 4167 including the SCTP packet and IP headers, MUST be less that or equal 4168 to the current Path MTU. 4170 If its peer endpoint is multi-homed, the sending endpoint SHOULD 4171 choose a size no larger than the latest MTU of the current primary 4172 path. 4174 When bundling control chunks with DATA chunks, an endpoint MUST place 4175 control chunks first in the outbound SCTP packet. The transmitter 4176 MUST transmit DATA chunks within an SCTP packet in increasing order 4177 of TSN. 4179 Note: Since control chunks are placed first in a packet and since 4180 DATA chunks are transmitted before SHUTDOWN or SHUTDOWN ACK chunks, 4181 DATA chunks cannot be bundled with SHUTDOWN or SHUTDOWN ACK chunks. 4183 Partial chunks MUST NOT be placed in an SCTP packet. A partial chunk 4184 is a chunk that is not completely contained in the SCTP packet; i.e., 4185 the SCTP packet is too short to contain all the bytes of the chunk as 4186 indicated by the chunk length. 4188 An endpoint MUST process received chunks in their order in the 4189 packet. The receiver uses the Chunk Length field to determine the 4190 end of a chunk and beginning of the next chunk taking account of the 4191 fact that all chunks end on a 4-byte boundary. If the receiver 4192 detects a partial chunk, it MUST drop the chunk. 4194 An endpoint MUST NOT bundle INIT, INIT ACK, or SHUTDOWN COMPLETE with 4195 any other chunks. 4197 7. Congestion Control 4199 Congestion control is one of the basic functions in SCTP. For some 4200 applications, it might be likely that adequate resources will be 4201 allocated to SCTP traffic to ensure prompt delivery of time-critical 4202 data -- thus, it would appear to be unlikely, during normal 4203 operations, that transmissions encounter severe congestion 4204 conditions. However, SCTP operates under adverse operational 4205 conditions, which can develop upon partial network failures or 4206 unexpected traffic surges. In such situations, SCTP follows correct 4207 congestion control steps to recover from congestion quickly in order 4208 to get data delivered as soon as possible. In the absence of network 4209 congestion, these preventive congestion control algorithms are 4210 expected to show no impact on the protocol performance. 4212 IMPLEMENTATION NOTE: As far as its specific performance requirements 4213 are met, an implementation is always allowed to adopt a more 4214 conservative congestion control algorithm than the one defined below. 4216 The congestion control algorithms used by SCTP are based on 4217 [RFC5681]. This section describes how the algorithms defined in 4218 [RFC5681] are adapted for use in SCTP. We first list differences in 4219 protocol designs between TCP and SCTP, and then describe SCTP's 4220 congestion control scheme. The description will use the same 4221 terminology as in TCP congestion control whenever appropriate. 4223 SCTP congestion control is always applied to the entire association, 4224 and not to individual streams. 4226 7.1. SCTP Differences from TCP Congestion Control 4228 Gap Ack Blocks in the SCTP SACK carry the same semantic meaning as 4229 the TCP SACK. TCP considers the information carried in the SACK as 4230 advisory information only. SCTP considers the information carried in 4231 the Gap Ack Blocks in the SACK chunk as advisory. In SCTP, any DATA 4232 chunk that has been acknowledged by SACK, including DATA that arrived 4233 at the receiving end out of order, is not considered fully delivered 4234 until the Cumulative TSN Ack Point passes the TSN of the DATA chunk 4235 (i.e., the DATA chunk has been acknowledged by the Cumulative TSN Ack 4236 field in the SACK). Consequently, the value of cwnd controls the 4237 amount of outstanding data, rather than (as in the case of non-SACK 4238 TCP) the upper bound between the highest acknowledged sequence number 4239 and the latest DATA chunk that can be sent within the congestion 4240 window. SCTP SACK leads to different implementations of Fast 4241 Retransmit and Fast Recovery than non-SACK TCP. As an example, see 4242 [FALL96]. 4244 The biggest difference between SCTP and TCP, however, is multi- 4245 homing. SCTP is designed to establish robust communication 4246 associations between two endpoints each of which might be reachable 4247 by more than one transport address. Potentially different addresses 4248 might lead to different data paths between the two endpoints; thus, 4249 ideally one needs a separate set of congestion control parameters for 4250 each of the paths. The treatment here of congestion control for 4251 multi-homed receivers is new with SCTP and might require refinement 4252 in the future. The current algorithms make the following 4253 assumptions: 4255 o The sender usually uses the same destination address until being 4256 instructed by the upper layer to do otherwise; however, SCTP MAY 4257 change to an alternate destination in the event an address is 4258 marked inactive (see Section 8.2). Also, SCTP MAY retransmit to a 4259 different transport address than the original transmission. 4261 o The sender keeps a separate congestion control parameter set for 4262 each of the destination addresses it can send to (not each source- 4263 destination pair but for each destination). The parameters SHOULD 4264 decay if the address is not used for a long enough time period. 4266 o For each of the destination addresses, an endpoint does slow start 4267 upon the first transmission to that address. 4269 Note: TCP guarantees in-sequence delivery of data to its upper-layer 4270 protocol within a single TCP session. This means that when TCP 4271 notices a gap in the received sequence number, it waits until the gap 4272 is filled before delivering the data that was received with sequence 4273 numbers higher than that of the missing data. On the other hand, 4274 SCTP can deliver data to its upper-layer protocol even if there is a 4275 gap in TSN if the Stream Sequence Numbers are in sequence for a 4276 particular stream (i.e., the missing DATA chunks are for a different 4277 stream) or if unordered delivery is indicated. Although this does 4278 not affect cwnd, it might affect rwnd calculation. 4280 7.2. SCTP Slow-Start and Congestion Avoidance 4282 The slow-start and congestion avoidance algorithms MUST be used by an 4283 endpoint to control the amount of data being injected into the 4284 network. The congestion control in SCTP is employed in regard to the 4285 association, not to an individual stream. In some situations, it 4286 might be beneficial for an SCTP sender to be more conservative than 4287 the algorithms allow; however, an SCTP sender MUST NOT be more 4288 aggressive than the following algorithms allow. 4290 Like TCP, an SCTP endpoint uses the following three control variables 4291 to regulate its transmission rate. 4293 o Receiver advertised window size (rwnd, in bytes), which is set by 4294 the receiver based on its available buffer space for incoming 4295 packets. 4296 Note: This variable is kept on the entire association. 4297 o Congestion control window (cwnd, in bytes), which is adjusted by 4298 the sender based on observed network conditions. 4299 Note: This variable is maintained on a per-destination-address 4300 basis. 4301 o Slow-start threshold (ssthresh, in bytes), which is used by the 4302 sender to distinguish slow-start and congestion avoidance phases. 4303 Note: This variable is maintained on a per-destination-address 4304 basis. 4306 SCTP also requires one additional control variable, 4307 partial_bytes_acked, which is used during congestion avoidance phase 4308 to facilitate cwnd adjustment. 4310 Unlike TCP, an SCTP sender MUST keep a set of these control variables 4311 cwnd, ssthresh, and partial_bytes_acked for EACH destination address 4312 of its peer (when its peer is multi-homed). Only one rwnd is kept 4313 for the whole association (no matter if the peer is multi-homed or 4314 has a single address). 4316 7.2.1. Slow-Start 4318 Beginning data transmission into a network with unknown conditions or 4319 after a sufficiently long idle period requires SCTP to probe the 4320 network to determine the available capacity. The slow-start 4321 algorithm is used for this purpose at the beginning of a transfer, or 4322 after repairing loss detected by the retransmission timer. 4324 o The initial cwnd before data transmission MUST be set to 4325 min(4*MTU, max (2*MTU, 4380 bytes)). 4326 o The initial cwnd after a retransmission timeout MUST be no more 4327 than 1*MTU, and only one packet is allowed to be in flight until 4328 successful acknowledgement. 4329 o The initial value of ssthresh SHOULD be arbitrarily high (e.g., 4330 the size of the largest possible advertised window). 4331 o Whenever cwnd is greater than zero, the endpoint is allowed to 4332 have cwnd bytes of data outstanding on that transport address. A 4333 limited overbooking as described in Section 6.1 B) SHOULD be 4334 supported. 4335 o When cwnd is less than or equal to ssthresh, an SCTP endpoint MUST 4336 use the slow-start algorithm to increase cwnd only if the current 4337 congestion window is being fully utilized, an incoming SACK 4338 advances the Cumulative TSN Ack Point, and the data sender is not 4339 in Fast Recovery. Only when these three conditions are met can 4340 the cwnd be increased; otherwise, the cwnd MUST NOT be increased. 4341 If these conditions are met, then cwnd MUST be increased by, at 4342 most, the lesser of 1) the total size of the previously 4343 outstanding DATA chunk(s) acknowledged, and 2) the destination's 4344 path MTU. This upper bound protects against the ACK-Splitting 4345 attack outlined in [SAVAGE99]. 4347 In instances where its peer endpoint is multi-homed, if an endpoint 4348 receives a SACK that advances its Cumulative TSN Ack Point, then it 4349 SHOULD update its cwnd (or cwnds) apportioned to the destination 4350 addresses to which it transmitted the acknowledged data. However, if 4351 the received SACK does not advance the Cumulative TSN Ack Point, the 4352 endpoint MUST NOT adjust the cwnd of any of the destination 4353 addresses. 4355 Because an endpoint's cwnd is not tied to its Cumulative TSN Ack 4356 Point, as duplicate SACKs come in, even though they might not advance 4357 the Cumulative TSN Ack Point an endpoint can still use them to clock 4358 out new data. That is, the data newly acknowledged by the SACK 4359 diminishes the amount of data now in flight to less than cwnd, and so 4360 the current, unchanged value of cwnd now allows new data to be sent. 4361 On the other hand, the increase of cwnd MUST be tied to the 4362 Cumulative TSN Ack Point advancement as specified above. Otherwise, 4363 the duplicate SACKs will not only clock out new data, but also will 4364 adversely clock out more new data than what has just left the 4365 network, during a time of possible congestion. 4367 o While the endpoint does not transmit data on a given transport 4368 address, the cwnd of the transport address SHOULD be adjusted to 4369 max(cwnd/2, 4*MTU) once per RTO. Before the first cwnd 4370 adjustment, the ssthresh of the transport address SHOULD be set to 4371 the cwnd. 4373 7.2.2. Congestion Avoidance 4375 When cwnd is greater than ssthresh, cwnd SHOULD be incremented by 4376 1*MTU per RTT if the sender has cwnd or more bytes of data 4377 outstanding for the corresponding transport address. The basic 4378 guidelines for incrementing cwnd during congestion avoidance are as 4379 follows: 4381 o SCTP MAY increment cwnd by 1*MTU. 4383 o SCTP SHOULD increment cwnd by 1*MTU once per RTT when the sender 4384 has cwnd or more bytes of data outstanding for the corresponding 4385 transport address. 4387 o SCTP MUST NOT increment cwnd by more than 1*MTU per RTT. 4389 In practice, an implementation can achieve this goal in the following 4390 way: 4392 o partial_bytes_acked is initialized to 0. 4393 o Whenever cwnd is greater than ssthresh, upon each SACK arrival, 4394 increase partial_bytes_acked by the total number of bytes of all 4395 new chunks acknowledged in that SACK, including chunks 4396 acknowledged by the new Cumulative TSN Ack, by Gap Ack Blocks, and 4397 by the number of bytes of duplicated chunks reported in Duplicate 4398 TSNs. 4399 o (1) when partial_bytes_acked is greater than cwnd and (2) before 4400 the arrival of the SACK the sender had less than cwnd bytes of 4401 data outstanding (i.e., before the arrival of the SACK, flightsize 4402 was less than cwnd), reset partial_bytes_acked to cwnd. 4403 o (1) when partial_bytes_acked is equal to or greater than cwnd and 4404 (2) before the arrival of the SACK the sender had cwnd or more 4405 bytes of data outstanding (i.e., before the arrival of the SACK, 4406 flightsize was greater than or equal to cwnd), partial_bytes_acked 4407 is reset to (partial_bytes_acked - cwnd). Next, cwnd is increased 4408 by 1*MTU. 4409 o Same as in the slow start, when the sender does not transmit DATA 4410 on a given transport address, the cwnd of the transport address 4411 SHOULD be adjusted to max(cwnd / 2, 4*MTU) per RTO. 4413 o When all of the data transmitted by the sender has been 4414 acknowledged by the receiver, partial_bytes_acked is initialized 4415 to 0. 4417 7.2.3. Congestion Control 4419 Upon detection of packet losses from SACK (see Section 7.2.4), an 4420 endpoint SHOULD do the following: 4422 ssthresh = max(cwnd/2, 4*MTU) 4423 cwnd = ssthresh 4424 partial_bytes_acked = 0 4426 Basically, a packet loss causes cwnd to be cut in half. 4428 When the T3-rtx timer expires on an address, SCTP SHOULD perform slow 4429 start by: 4431 ssthresh = max(cwnd/2, 4*MTU) 4432 cwnd = 1*MTU 4433 partial_bytes_acked = 0 4435 and ensure that no more than one SCTP packet will be in flight for 4436 that address until the endpoint receives acknowledgement for 4437 successful delivery of data to that address. 4439 7.2.4. Fast Retransmit on Gap Reports 4441 In the absence of data loss, an endpoint performs delayed 4442 acknowledgement. However, whenever an endpoint notices a hole in the 4443 arriving TSN sequence, it SHOULD start sending a SACK back every time 4444 a packet arrives carrying data until the hole is filled. 4446 Whenever an endpoint receives a SACK that indicates that some TSNs 4447 are missing, it SHOULD wait for two further miss indications (via 4448 subsequent SACKs for a total of three missing reports) on the same 4449 TSNs before taking action with regard to Fast Retransmit. 4451 Miss indications SHOULD follow the HTNA (Highest TSN Newly 4452 Acknowledged) algorithm. For each incoming SACK, miss indications 4453 are incremented only for missing TSNs prior to the highest TSN newly 4454 acknowledged in the SACK. A newly acknowledged DATA chunk is one not 4455 previously acknowledged in a SACK. If an endpoint is in Fast 4456 Recovery and a SACK arrives that advances the Cumulative TSN Ack 4457 Point, the miss indications are incremented for all TSNs reported 4458 missing in the SACK. 4460 When the third consecutive miss indication is received for a TSN(s), 4461 the data sender does the following: 4463 1) Mark the DATA chunk(s) with three miss indications for 4464 retransmission. 4465 2) If not in Fast Recovery, adjust the ssthresh and cwnd of the 4466 destination address(es) to which the missing DATA chunks were 4467 last sent, according to the formula described in Section 7.2.3. 4468 3) If not in Fast Recovery, determine how many of the earliest 4469 (i.e., lowest TSN) DATA chunks marked for retransmission will fit 4470 into a single packet, subject to constraint of the PMTU of the 4471 destination transport address to which the packet is being sent. 4472 Call this value K. Retransmit those K DATA chunks in a single 4473 packet. When a Fast Retransmit is being performed, the sender 4474 SHOULD ignore the value of cwnd and SHOULD NOT delay 4475 retransmission for this single packet. 4476 4) Restart the T3-rtx timer only if the last SACK acknowledged the 4477 lowest outstanding TSN number sent to that address, or the 4478 endpoint is retransmitting the first outstanding DATA chunk sent 4479 to that address. 4480 5) Mark the DATA chunk(s) as being fast retransmitted and thus 4481 ineligible for a subsequent Fast Retransmit. Those TSNs marked 4482 for retransmission due to the Fast-Retransmit algorithm that did 4483 not fit in the sent datagram carrying K other TSNs are also 4484 marked as ineligible for a subsequent Fast Retransmit. However, 4485 as they are marked for retransmission they will be retransmitted 4486 later on as soon as cwnd allows. 4487 6) If not in Fast Recovery, enter Fast Recovery and mark the highest 4488 outstanding TSN as the Fast Recovery exit point. When a SACK 4489 acknowledges all TSNs up to and including this exit point, Fast 4490 Recovery is exited. While in Fast Recovery, the ssthresh and 4491 cwnd SHOULD NOT change for any destinations due to a subsequent 4492 Fast Recovery event (i.e., one SHOULD NOT reduce the cwnd further 4493 due to a subsequent Fast Retransmit). 4495 Note: Before the above adjustments, if the received SACK also 4496 acknowledges new DATA chunks and advances the Cumulative TSN Ack 4497 Point, the cwnd adjustment rules defined in Section 7.2.1 and 4498 Section 7.2.2 MUST be applied first. 4500 7.2.5. Making Changes to Differentiated Services Code Points 4502 SCTP implementations MAY allow an application to configure the 4503 Differentiated Services Code Point (DSCP) used for sending packets. 4504 If a DSCP change might result in outgoing packets being queued in 4505 different queues, the congestion control parameters for all affected 4506 destination addresses MUST be reset to their initial values. 4508 7.3. Path MTU Discovery 4510 [RFC4821], [RFC8201], and [RFC1191] specify "Packetization Layer Path 4511 MTU Discovery", whereby an endpoint maintains an estimate of the 4512 maximum transmission unit (MTU) along a given Internet path and 4513 refrains from sending packets along that path that exceed the MTU, 4514 other than occasional attempts to probe for a change in the Path MTU 4515 (PMTU). [RFC4821] is thorough in its discussion of the MTU discovery 4516 mechanism and strategies for determining the current end-to-end MTU 4517 setting as well as detecting changes in this value. 4519 An endpoint SHOULD apply these techniques, and SHOULD do so on a per- 4520 destination-address basis. 4522 There are two important SCTP-specific points regarding Path MTU 4523 discovery: 4525 1) SCTP associations can span multiple addresses. An endpoint MUST 4526 maintain separate MTU estimates for each destination address of 4527 its peer. 4529 2) The sender SHOULD track an association PMTU that will be the 4530 smallest PMTU discovered for all of the peer's destination 4531 addresses. When fragmenting messages into multiple parts this 4532 association PMTU SHOULD be used to calculate the size of each 4533 fragment. This will allow retransmissions to be seamlessly sent 4534 to an alternate address without encountering IP fragmentation. 4536 8. Fault Management 4538 8.1. Endpoint Failure Detection 4540 An endpoint SHOULD keep a counter on the total number of consecutive 4541 retransmissions to its peer (this includes data retransmissions to 4542 all the destination transport addresses of the peer if it is multi- 4543 homed), including the number of unacknowledged HEARTBEAT chunks 4544 observed on the path that is currently used for data transfer. 4545 Unacknowledged HEARTBEAT chunks observed on paths different from the 4546 path currently used for data transfer SHOULD NOT increment the 4547 association error counter, as this could lead to association closure 4548 even if the path that is currently used for data transfer is 4549 available (but idle). If the value of this counter exceeds the limit 4550 indicated in the protocol parameter 'Association.Max.Retrans', the 4551 endpoint SHOULD consider the peer endpoint unreachable and SHALL stop 4552 transmitting any more data to it (and thus the association enters the 4553 CLOSED state). In addition, the endpoint SHOULD report the failure 4554 to the upper layer and optionally report back all outstanding user 4555 data remaining in its outbound queue. The association is 4556 automatically closed when the peer endpoint becomes unreachable. 4558 The counter MUST be reset each time a DATA chunk sent to that peer 4559 endpoint is acknowledged (by the reception of a SACK). When a 4560 HEARTBEAT ACK is received from the peer endpoint, the counter SHOULD 4561 also be reset. The receiver of the HEARTBEAT ACK MAY choose not to 4562 clear the counter if there is outstanding data on the association. 4563 This allows for handling the possible difference in reachability 4564 based on DATA chunks and HEARTBEAT chunks. 4566 8.2. Path Failure Detection 4568 When its peer endpoint is multi-homed, an endpoint SHOULD keep an 4569 error counter for each of the destination transport addresses of the 4570 peer endpoint. 4572 Each time the T3-rtx timer expires on any address, or when a 4573 HEARTBEAT sent to an idle address is not acknowledged within an RTO, 4574 the error counter of that destination address will be incremented. 4575 When the value in the error counter exceeds the protocol parameter 4576 'Path.Max.Retrans' of that destination address, the endpoint SHOULD 4577 mark the destination transport address as inactive, and a 4578 notification SHOULD be sent to the upper layer. 4580 When an outstanding TSN is acknowledged or a HEARTBEAT sent to that 4581 address is acknowledged with a HEARTBEAT ACK, the endpoint SHOULD 4582 clear the error counter of the destination transport address to which 4583 the DATA chunk was last sent (or HEARTBEAT was sent) and SHOULD also 4584 report to the upper layer when an inactive destination address is 4585 marked as active. When the peer endpoint is multi-homed and the last 4586 chunk sent to it was a retransmission to an alternate address, there 4587 exists an ambiguity as to whether or not the acknowledgement could be 4588 credited to the address of the last chunk sent. However, this 4589 ambiguity does not seem to have significant consequences for SCTP 4590 behavior. If this ambiguity is undesirable, the transmitter MAY 4591 choose not to clear the error counter if the last chunk sent was a 4592 retransmission. 4594 Note: When configuring the SCTP endpoint, the user SHOULD avoid 4595 having the value of 'Association.Max.Retrans' larger than the 4596 summation of the 'Path.Max.Retrans' of all the destination addresses 4597 for the remote endpoint. Otherwise, all the destination addresses 4598 might become inactive while the endpoint still considers the peer 4599 endpoint reachable. When this condition occurs, how SCTP chooses to 4600 function is implementation specific. 4602 When the primary path is marked inactive (due to excessive 4603 retransmissions, for instance), the sender MAY automatically transmit 4604 new packets to an alternate destination address if one exists and is 4605 active. If more than one alternate address is active when the 4606 primary path is marked inactive, only ONE transport address SHOULD be 4607 chosen and used as the new destination transport address. 4609 8.3. Path Heartbeat 4611 By default, an SCTP endpoint SHOULD monitor the reachability of the 4612 idle destination transport address(es) of its peer by sending a 4613 HEARTBEAT chunk periodically to the destination transport 4614 address(es). HEARTBEAT sending MAY begin upon reaching the 4615 ESTABLISHED state and is discontinued after sending either SHUTDOWN 4616 or SHUTDOWN ACK. A receiver of a HEARTBEAT MUST respond to a 4617 HEARTBEAT with a HEARTBEAT ACK after entering the COOKIE-ECHOED state 4618 (INIT sender) or the ESTABLISHED state (INIT receiver), up until 4619 reaching the SHUTDOWN-SENT state (SHUTDOWN sender) or the SHUTDOWN- 4620 ACK-SENT state (SHUTDOWN receiver). 4622 A destination transport address is considered "idle" if no new chunk 4623 that can be used for updating path RTT (usually including first 4624 transmission DATA, INIT, COOKIE ECHO, HEARTBEAT, etc.) and no 4625 HEARTBEAT has been sent to it within the current heartbeat period of 4626 that address. This applies to both active and inactive destination 4627 addresses. 4629 The upper layer can optionally initiate the following functions: 4631 A) Disable heartbeat on a specific destination transport address of 4632 a given association, 4634 B) Change the HB.interval, 4636 C) Re-enable heartbeat on a specific destination transport address 4637 of a given association, and 4639 D) Request an on-demand HEARTBEAT on a specific destination 4640 transport address of a given association. 4642 The endpoint SHOULD increment the respective error counter of the 4643 destination transport address each time a HEARTBEAT is sent to that 4644 address and not acknowledged within one RTO. 4646 When the value of this counter exceeds the protocol parameter 4647 'Path.Max.Retrans', the endpoint SHOULD mark the corresponding 4648 destination address as inactive if it is not so marked and SHOULD 4649 also report to the upper layer the change in reachability of this 4650 destination address. After this, the endpoint SHOULD continue 4651 HEARTBEAT on this destination address but SHOULD stop increasing the 4652 counter. 4654 The sender of the HEARTBEAT chunk SHOULD include in the Heartbeat 4655 Information field of the chunk the current time when the packet is 4656 sent out and the destination address to which the packet is sent. 4658 IMPLEMENTATION NOTE: An alternative implementation of the heartbeat 4659 mechanism that can be used is to increment the error counter variable 4660 every time a HEARTBEAT is sent to a destination. Whenever a 4661 HEARTBEAT ACK arrives, the sender SHOULD clear the error counter of 4662 the destination that the HEARTBEAT was sent to. This in effect would 4663 clear the previously stroked error (and any other error counts as 4664 well). 4666 The receiver of the HEARTBEAT SHOULD immediately respond with a 4667 HEARTBEAT ACK that contains the Heartbeat Information TLV, together 4668 with any other received TLVs, copied unchanged from the received 4669 HEARTBEAT chunk. 4671 Upon the receipt of the HEARTBEAT ACK, the sender of the HEARTBEAT 4672 SHOULD clear the error counter of the destination transport address 4673 to which the HEARTBEAT was sent and mark the destination transport 4674 address as active if it is not so marked. The endpoint SHOULD report 4675 to the upper layer when an inactive destination address is marked as 4676 active due to the reception of the latest HEARTBEAT ACK. The 4677 receiver of the HEARTBEAT ACK SHOULD also clear the association 4678 overall error count (as defined in Section 8.1). 4680 The receiver of the HEARTBEAT ACK SHOULD also perform an RTT 4681 measurement for that destination transport address using the time 4682 value carried in the HEARTBEAT ACK chunk. 4684 On an idle destination address that is allowed to heartbeat, it is 4685 RECOMMENDED that a HEARTBEAT chunk is sent once per RTO of that 4686 destination address plus the protocol parameter 'HB.interval', with 4687 jittering of +/- 50% of the RTO value, and exponential backoff of the 4688 RTO if the previous HEARTBEAT is unanswered. 4690 A primitive is provided for the SCTP user to change the HB.interval 4691 and turn on or off the heartbeat on a given destination address. The 4692 heartbeat interval set by the SCTP user is added to the RTO of that 4693 destination (including any exponential backoff). Only one heartbeat 4694 SHOULD be sent each time the heartbeat timer expires (if multiple 4695 destinations are idle). It is an implementation decision on how to 4696 choose which of the candidate idle destinations to heartbeat to (if 4697 more than one destination is idle). 4699 Note: When tuning the heartbeat interval, there is a side effect that 4700 SHOULD be taken into account. When this value is increased, i.e., 4701 the HEARTBEAT takes longer, the detection of lost ABORT messages 4702 takes longer as well. If a peer endpoint ABORTs the association for 4703 any reason and the ABORT chunk is lost, the local endpoint will only 4704 discover the lost ABORT by sending a DATA chunk or HEARTBEAT chunk 4705 (thus causing the peer to send another ABORT). This is to be 4706 considered when tuning the HEARTBEAT timer. If the HEARTBEAT is 4707 disabled, only sending DATA to the association will discover a lost 4708 ABORT from the peer. 4710 8.4. Handle "Out of the Blue" Packets 4712 An SCTP packet is called an "out of the blue" (OOTB) packet if it is 4713 correctly formed (i.e., passed the receiver's CRC32c check; see 4714 Section 6.8), but the receiver is not able to identify the 4715 association to which this packet belongs. 4717 The receiver of an OOTB packet MUST do the following: 4719 1) If the OOTB packet is to or from a non-unicast address, a 4720 receiver SHOULD silently discard the packet. Otherwise, 4721 2) If the OOTB packet contains an ABORT chunk, the receiver MUST 4722 silently discard the OOTB packet and take no further action. 4723 Otherwise, 4724 3) If the packet contains an INIT chunk with a Verification Tag set 4725 to '0', process it as described in Section 5.1. If, for whatever 4726 reason, the INIT cannot be processed normally and an ABORT has to 4727 be sent in response, the Verification Tag of the packet 4728 containing the ABORT chunk MUST be the Initiate Tag of the 4729 received INIT chunk, and the T bit of the ABORT chunk has to be 4730 set to 0, indicating that the Verification Tag is NOT reflected. 4731 4) If the packet contains a COOKIE ECHO in the first chunk, process 4732 it as described in Section 5.1. Otherwise, 4733 5) If the packet contains a SHUTDOWN ACK chunk, the receiver SHOULD 4734 respond to the sender of the OOTB packet with a SHUTDOWN 4735 COMPLETE. When sending the SHUTDOWN COMPLETE, the receiver of 4736 the OOTB packet MUST fill in the Verification Tag field of the 4737 outbound packet with the Verification Tag received in the 4738 SHUTDOWN ACK and set the T bit in the Chunk Flags to indicate 4739 that the Verification Tag is reflected. Otherwise, 4740 6) If the packet contains a SHUTDOWN COMPLETE chunk, the receiver 4741 SHOULD silently discard the packet and take no further action. 4742 Otherwise, 4743 7) If the packet contains a "Stale Cookie" ERROR or a COOKIE ACK, 4744 the SCTP packet SHOULD be silently discarded. Otherwise, 4745 8) The receiver SHOULD respond to the sender of the OOTB packet with 4746 an ABORT. When sending the ABORT, the receiver of the OOTB 4747 packet MUST fill in the Verification Tag field of the outbound 4748 packet with the value found in the Verification Tag field of the 4749 OOTB packet and set the T bit in the Chunk Flags to indicate that 4750 the Verification Tag is reflected. After sending this ABORT, the 4751 receiver of the OOTB packet MUST discard the OOTB packet and MUST 4752 NOT take any further action. 4754 8.5. Verification Tag 4756 The Verification Tag rules defined in this section apply when sending 4757 or receiving SCTP packets that do not contain an INIT, SHUTDOWN 4758 COMPLETE, COOKIE ECHO (see Section 5.1), ABORT, or SHUTDOWN ACK 4759 chunk. The rules for sending and receiving SCTP packets containing 4760 one of these chunk types are discussed separately in Section 8.5.1. 4762 When sending an SCTP packet, the endpoint MUST fill in the 4763 Verification Tag field of the outbound packet with the tag value in 4764 the Initiate Tag parameter of the INIT or INIT ACK received from its 4765 peer. 4767 When receiving an SCTP packet, the endpoint MUST ensure that the 4768 value in the Verification Tag field of the received SCTP packet 4769 matches its own tag. If the received Verification Tag value does not 4770 match the receiver's own tag value, the receiver MUST silently 4771 discard the packet and MUST NOT process it any further except for 4772 those cases listed in Section 8.5.1 below. 4774 8.5.1. Exceptions in Verification Tag Rules 4776 A) Rules for packet carrying INIT: 4778 * The sender MUST set the Verification Tag of the packet to 0. 4780 * When an endpoint receives an SCTP packet with the Verification 4781 Tag set to 0, it SHOULD verify that the packet contains only an 4782 INIT chunk. Otherwise, the receiver MUST silently discard the 4783 packet. 4785 B) Rules for packet carrying ABORT: 4787 * The endpoint MUST always fill in the Verification Tag field of 4788 the outbound packet with the destination endpoint's tag value, 4789 if it is known. 4791 * If the ABORT is sent in response to an OOTB packet, the 4792 endpoint MUST follow the procedure described in Section 8.4. 4794 * The receiver of an ABORT MUST accept the packet if the 4795 Verification Tag field of the packet matches its own tag and 4796 the T bit is not set OR if it is set to its peer's tag and the 4797 T bit is set in the Chunk Flags. Otherwise, the receiver MUST 4798 silently discard the packet and take no further action. 4800 C) Rules for packet carrying SHUTDOWN COMPLETE: 4802 * When sending a SHUTDOWN COMPLETE, if the receiver of the 4803 SHUTDOWN ACK has a TCB, then the destination endpoint's tag 4804 MUST be used, and the T bit MUST NOT be set. Only where no TCB 4805 exists SHOULD the sender use the Verification Tag from the 4806 SHUTDOWN ACK, and MUST set the T bit. 4808 * The receiver of a SHUTDOWN COMPLETE accepts the packet if the 4809 Verification Tag field of the packet matches its own tag and 4810 the T bit is not set OR if it is set to its peer's tag and the 4811 T bit is set in the Chunk Flags. Otherwise, the receiver MUST 4812 silently discard the packet and take no further action. An 4813 endpoint MUST ignore the SHUTDOWN COMPLETE if it is not in the 4814 SHUTDOWN-ACK-SENT state. 4816 D) Rules for packet carrying a COOKIE ECHO: 4818 * When sending a COOKIE ECHO, the endpoint MUST use the value of 4819 the Initiate Tag received in the INIT ACK. 4821 * The receiver of a COOKIE ECHO follows the procedures in 4822 Section 5. 4824 E) Rules for packet carrying a SHUTDOWN ACK: 4826 * If the receiver is in COOKIE-ECHOED or COOKIE-WAIT state the 4827 procedures in Section 8.4 SHOULD be followed; in other words, 4828 it is treated as an Out Of The Blue packet. 4830 9. Termination of Association 4832 An endpoint SHOULD terminate its association when it exits from 4833 service. An association can be terminated by either abort or 4834 shutdown. An abort of an association is abortive by definition in 4835 that any data pending on either end of the association is discarded 4836 and not delivered to the peer. A shutdown of an association is 4837 considered a graceful close where all data in queue by either 4838 endpoint is delivered to the respective peers. However, in the case 4839 of a shutdown, SCTP does not support a half-open state (like TCP) 4840 wherein one side might continue sending data while the other end is 4841 closed. When either endpoint performs a shutdown, the association on 4842 each peer will stop accepting new data from its user and only deliver 4843 data in queue at the time of sending or receiving the SHUTDOWN chunk. 4845 9.1. Abort of an Association 4847 When an endpoint decides to abort an existing association, it MUST 4848 send an ABORT chunk to its peer endpoint. The sender MUST fill in 4849 the peer's Verification Tag in the outbound packet and MUST NOT 4850 bundle any DATA chunk with the ABORT. If the association is aborted 4851 on request of the upper layer, a User-Initiated Abort error cause 4852 (see Section 3.3.10.12) SHOULD be present in the ABORT chunk. 4854 An endpoint MUST NOT respond to any received packet that contains an 4855 ABORT chunk (also see Section 8.4). 4857 An endpoint receiving an ABORT MUST apply the special Verification 4858 Tag check rules described in Section 8.5.1. 4860 After checking the Verification Tag, the receiving endpoint MUST 4861 remove the association from its record and SHOULD report the 4862 termination to its upper layer. If a User-Initiated Abort error 4863 cause is present in the ABORT chunk, the Upper Layer Abort Reason 4864 SHOULD be made available to the upper layer. 4866 9.2. Shutdown of an Association 4868 Using the SHUTDOWN primitive (see Section 10.1), the upper layer of 4869 an endpoint in an association can gracefully close the association. 4870 This will allow all outstanding DATA chunks from the peer of the 4871 shutdown initiator to be delivered before the association terminates. 4873 Upon receipt of the SHUTDOWN primitive from its upper layer, the 4874 endpoint enters the SHUTDOWN-PENDING state and remains there until 4875 all outstanding data has been acknowledged by its peer. The endpoint 4876 accepts no new data from its upper layer, but retransmits data to the 4877 far end if necessary to fill gaps. 4879 Once all its outstanding data has been acknowledged, the endpoint 4880 sends a SHUTDOWN chunk to its peer including in the Cumulative TSN 4881 Ack field the last sequential TSN it has received from the peer. It 4882 SHOULD then start the T2-shutdown timer and enter the SHUTDOWN-SENT 4883 state. If the timer expires, the endpoint MUST resend the SHUTDOWN 4884 with the updated last sequential TSN received from its peer. 4886 The rules in Section 6.3 MUST be followed to determine the proper 4887 timer value for T2-shutdown. To indicate any gaps in TSN, the 4888 endpoint MAY also bundle a SACK with the SHUTDOWN chunk in the same 4889 SCTP packet. 4891 An endpoint SHOULD limit the number of retransmissions of the 4892 SHUTDOWN chunk to the protocol parameter 'Association.Max.Retrans'. 4893 If this threshold is exceeded, the endpoint SHOULD destroy the TCB 4894 and SHOULD report the peer endpoint unreachable to the upper layer 4895 (and thus the association enters the CLOSED state). The reception of 4896 any packet from its peer (i.e., as the peer sends all of its queued 4897 DATA chunks) SHOULD clear the endpoint's retransmission count and 4898 restart the T2-shutdown timer, giving its peer ample opportunity to 4899 transmit all of its queued DATA chunks that have not yet been sent. 4901 Upon reception of the SHUTDOWN, the peer endpoint does the following: 4903 o enter the SHUTDOWN-RECEIVED state, 4905 o stop accepting new data from its SCTP user, and 4907 o verify, by checking the Cumulative TSN Ack field of the chunk, 4908 that all its outstanding DATA chunks have been received by the 4909 SHUTDOWN sender. 4911 Once an endpoint has reached the SHUTDOWN-RECEIVED state, it MUST 4912 ignore ULP shutdown requests but MUST continue responding to SHUTDOWN 4913 chunks from its peer. 4915 If there are still outstanding DATA chunks left, the SHUTDOWN 4916 receiver MUST continue to follow normal data transmission procedures 4917 defined in Section 6, until all outstanding DATA chunks are 4918 acknowledged; however, the SHUTDOWN receiver MUST NOT accept new data 4919 from its SCTP user. 4921 While in the SHUTDOWN-SENT state, the SHUTDOWN sender MUST 4922 immediately respond to each received packet containing one or more 4923 DATA chunks with a SHUTDOWN chunk and restart the T2-shutdown timer. 4924 If a SHUTDOWN chunk by itself cannot acknowledge all of the received 4925 DATA chunks (i.e., there are TSNs that can be acknowledged that are 4926 larger than the cumulative TSN, and thus gaps exist in the TSN 4927 sequence), or if duplicate TSNs have been received, then a SACK chunk 4928 MUST also be sent. 4930 The sender of the SHUTDOWN MAY also start an overall guard timer 'T5- 4931 shutdown-guard' to bound the overall time for the shutdown sequence. 4932 At the expiration of this timer, the sender SHOULD abort the 4933 association by sending an ABORT chunk. If the 'T5-shutdown- guard' 4934 timer is used, it SHOULD be set to the RECOMMENDED value of 5 times 4935 'RTO.Max'. 4937 If the receiver of the SHUTDOWN has no more outstanding DATA chunks, 4938 the SHUTDOWN receiver MUST send a SHUTDOWN ACK and start a T2- 4939 shutdown timer of its own, entering the SHUTDOWN-ACK-SENT state. If 4940 the timer expires, the endpoint MUST resend the SHUTDOWN ACK. 4942 The sender of the SHUTDOWN ACK SHOULD limit the number of 4943 retransmissions of the SHUTDOWN ACK chunk to the protocol parameter 4944 'Association.Max.Retrans'. If this threshold is exceeded, the 4945 endpoint SHOULD destroy the TCB and SHOULD report the peer endpoint 4946 unreachable to the upper layer (and thus the association enters the 4947 CLOSED state). 4949 Upon the receipt of the SHUTDOWN ACK, the SHUTDOWN sender MUST stop 4950 the T2-shutdown timer, send a SHUTDOWN COMPLETE chunk to its peer, 4951 and remove all record of the association. 4953 Upon reception of the SHUTDOWN COMPLETE chunk, the endpoint will 4954 verify that it is in the SHUTDOWN-ACK-SENT state; if it is not, the 4955 chunk SHOULD be discarded. If the endpoint is in the SHUTDOWN-ACK- 4956 SENT state, the endpoint SHOULD stop the T2-shutdown timer and remove 4957 all knowledge of the association (and thus the association enters the 4958 CLOSED state). 4960 An endpoint SHOULD ensure that all its outstanding DATA chunks have 4961 been acknowledged before initiating the shutdown procedure. 4963 An endpoint SHOULD reject any new data request from its upper layer 4964 if it is in the SHUTDOWN-PENDING, SHUTDOWN-SENT, SHUTDOWN-RECEIVED, 4965 or SHUTDOWN-ACK-SENT state. 4967 If an endpoint is in the SHUTDOWN-ACK-SENT state and receives an INIT 4968 chunk (e.g., if the SHUTDOWN COMPLETE was lost) with source and 4969 destination transport addresses (either in the IP addresses or in the 4970 INIT chunk) that belong to this association, it SHOULD discard the 4971 INIT chunk and retransmit the SHUTDOWN ACK chunk. 4973 Note: Receipt of an INIT with the same source and destination IP 4974 addresses as used in transport addresses assigned to an endpoint but 4975 with a different port number indicates the initialization of a 4976 separate association. 4978 The sender of the INIT or COOKIE ECHO SHOULD respond to the receipt 4979 of a SHUTDOWN ACK with a stand-alone SHUTDOWN COMPLETE in an SCTP 4980 packet with the Verification Tag field of its common header set to 4981 the same tag that was received in the SHUTDOWN ACK packet. This is 4982 considered an Out of the Blue packet as defined in Section 8.4. The 4983 sender of the INIT lets T1-init continue running and remains in the 4984 COOKIE-WAIT or COOKIE-ECHOED state. Normal T1-init timer expiration 4985 will cause the INIT or COOKIE chunk to be retransmitted and thus 4986 start a new association. 4988 If a SHUTDOWN is received in the COOKIE-WAIT or COOKIE ECHOED state, 4989 the SHUTDOWN chunk SHOULD be silently discarded. 4991 If an endpoint is in the SHUTDOWN-SENT state and receives a SHUTDOWN 4992 chunk from its peer, the endpoint SHOULD respond immediately with a 4993 SHUTDOWN ACK to its peer, and move into the SHUTDOWN-ACK-SENT state 4994 restarting its T2-shutdown timer. 4996 If an endpoint is in the SHUTDOWN-ACK-SENT state and receives a 4997 SHUTDOWN ACK, it MUST stop the T2-shutdown timer, send a SHUTDOWN 4998 COMPLETE chunk to its peer, and remove all record of the association. 5000 10. Interface with Upper Layer 5002 The Upper Layer Protocols (ULPs) request services by passing 5003 primitives to SCTP and receive notifications from SCTP for various 5004 events. 5006 The primitives and notifications described in this section can be 5007 used as a guideline for implementing SCTP. The following functional 5008 description of ULP interface primitives is shown for illustrative 5009 purposes. Different SCTP implementations can have different ULP 5010 interfaces. However, all SCTPs aer expected to provide a certain 5011 minimum set of services to guarantee that all SCTP implementations 5012 can support the same protocol hierarchy. 5014 10.1. ULP-to-SCTP 5016 The following sections functionally characterize a ULP/SCTP 5017 interface. The notation used is similar to most procedure or 5018 function calls in high-level languages. 5020 The ULP primitives described below specify the basic functions that 5021 SCTP performs to support inter-process communication. Individual 5022 implementations define their own exact format, and provide 5023 combinations or subsets of the basic functions in single calls. 5025 A) Initialize 5027 Format: INITIALIZE ([local port],[local eligible address list]) 5028 -> local SCTP instance name 5030 This primitive allows SCTP to initialize its internal data 5031 structures and allocate necessary resources for setting up its 5032 operation environment. Once SCTP is initialized, ULP can 5033 communicate directly with other endpoints without re-invoking 5034 this primitive. 5035 SCTP will return a local SCTP instance name to the ULP. 5037 Mandatory attributes: 5039 * None. 5041 Optional attributes: 5042 The following types of attributes can be passed along with the 5043 primitive: 5045 * local port - SCTP port number, if ULP wants it to be 5046 specified. 5047 * local eligible address list - an address list that the local 5048 SCTP endpoint binds. By default, if an address list is not 5049 included, all IP addresses assigned to the host are used by 5050 the local endpoint. 5052 IMPLEMENTATION NOTE: If this optional attribute is supported by 5053 an implementation, it will be the responsibility of the 5054 implementation to enforce that the IP source address field of any 5055 SCTP packets sent out by this endpoint contains one of the IP 5056 addresses indicated in the local eligible address list. 5057 B) Associate 5059 Format: ASSOCIATE(local SCTP instance name, destination transport 5060 addr, outbound stream count) -> association id 5061 [,destination transport addr list] [,outbound stream 5062 count] 5064 This primitive allows the upper layer to initiate an association 5065 to a specific peer endpoint. 5066 The peer endpoint is specified by one of the transport addresses 5067 that defines the endpoint (see Section 1.3). If the local SCTP 5068 instance has not been initialized, the ASSOCIATE is considered an 5069 error. 5070 An association id, which is a local handle to the SCTP 5071 association, will be returned on successful establishment of the 5072 association. If SCTP is not able to open an SCTP association 5073 with the peer endpoint, an error is returned. 5074 Other association parameters can be returned, including the 5075 complete destination transport addresses of the peer as well as 5076 the outbound stream count of the local endpoint. One of the 5077 transport addresses from the returned destination addresses will 5078 be selected by the local endpoint as default primary path for 5079 sending SCTP packets to this peer. The returned "destination 5080 transport addr list" can be used by the ULP to change the default 5081 primary path or to force sending a packet to a specific transport 5082 address. 5083 IMPLEMENTATION NOTE: If ASSOCIATE primitive is implemented as a 5084 blocking function call, the ASSOCIATE primitive can return 5085 association parameters in addition to the association id upon 5086 successful establishment. If ASSOCIATE primitive is implemented 5087 as a non-blocking call, only the association id is returned and 5088 association parameters are passed using the COMMUNICATION UP 5089 notification. 5090 Mandatory attributes: 5092 * local SCTP instance name - obtained from the INITIALIZE 5093 operation. 5094 * destination transport addr - specified as one of the transport 5095 addresses of the peer endpoint with which the association is 5096 to be established. 5097 * outbound stream count - the number of outbound streams the ULP 5098 would like to open towards this peer endpoint. 5100 Optional attributes: 5102 * None. 5103 C) Shutdown 5105 Format: SHUTDOWN(association id) -> result 5107 Gracefully closes an association. Any locally queued user data 5108 will be delivered to the peer. The association will be 5109 terminated only after the peer acknowledges all the SCTP packets 5110 sent. A success code will be returned on successful termination 5111 of the association. If attempting to terminate the association 5112 results in a failure, an error code is returned. 5113 Mandatory attributes: 5115 * association id - local handle to the SCTP association. 5117 Optional attributes: 5119 * None. 5120 D) Abort 5122 Format: ABORT(association id [, Upper Layer Abort Reason]) -> 5123 result 5125 Ungracefully closes an association. Any locally queued user data 5126 will be discarded, and an ABORT chunk is sent to the peer. A 5127 success code will be returned on successful abort of the 5128 association. If attempting to abort the association results in a 5129 failure, an error code is returned. 5130 Mandatory attributes: 5132 * association id - local handle to the SCTP association. 5134 Optional attributes: 5136 * Upper Layer Abort Reason - reason of the abort to be passed to 5137 the peer. 5138 * None. 5139 E) Send 5141 Format: SEND(association id, buffer address, byte count 5142 [,context] [,stream id] [,life time] [,destination 5143 transport address] [,unordered flag] [,no-bundle flag] 5144 [,payload protocol-id] [,sack-immediately flag] ) -> 5145 result 5147 This is the main method to send user data via SCTP. 5148 Mandatory attributes: 5150 * association id - local handle to the SCTP association. 5151 * buffer address - the location where the user message to be 5152 transmitted is stored. 5153 * byte count - the size of the user data in number of bytes. 5155 Optional attributes: 5157 * context - an optional 32-bit integer that will be carried in 5158 the sending failure notification to the ULP if the 5159 transportation of this user message fails. 5160 * stream id - to indicate which stream to send the data on. If 5161 not specified, stream 0 will be used. 5162 * life time - specifies the life time of the user data. The 5163 user data will not be sent by SCTP after the life time 5164 expires. This parameter can be used to avoid efforts to 5165 transmit stale user messages. SCTP notifies the ULP if the 5166 data cannot be initiated to transport (i.e., sent to the 5167 destination via SCTP's send primitive) within the life time 5168 variable. However, the user data will be transmitted if SCTP 5169 has attempted to transmit a chunk before the life time 5170 expired. 5171 IMPLEMENTATION NOTE: In order to better support the data life 5172 time option, the transmitter can hold back the assigning of 5173 the TSN number to an outbound DATA chunk to the last moment. 5174 And, for implementation simplicity, once a TSN number has been 5175 assigned the sender considers the send of this DATA chunk as 5176 committed, overriding any life time option attached to the 5177 DATA chunk. 5178 * destination transport address - specified as one of the 5179 destination transport addresses of the peer endpoint to which 5180 this packet is sent. Whenever possible, SCTP uses this 5181 destination transport address for sending the packets, instead 5182 of the current primary path. 5183 * unordered flag - this flag, if present, indicates that the 5184 user would like the data delivered in an unordered fashion to 5185 the peer (i.e., the U flag is set to 1 on all DATA chunks 5186 carrying this message). 5187 * no-bundle flag - instructs SCTP not to bundle this user data 5188 with other outbound DATA chunks. When faced with network 5189 congestion, SCTP might still bundle the data, even when this 5190 flag is present. 5191 * payload protocol-id - a 32-bit unsigned integer that is to be 5192 passed to the peer indicating the type of payload protocol 5193 data being transmitted. This value is passed as opaque data 5194 by SCTP. 5195 * sack-immediately flag - set the I bit on the last DATA chunk 5196 used for the user message to be transmitted. 5197 F) Set Primary 5199 Format: SETPRIMARY(association id, destination transport address, 5200 [source transport address]) -> result 5202 Instructs the local SCTP to use the specified destination 5203 transport address as the primary path for sending packets. 5204 The result of attempting this operation is returned. If the 5205 specified destination transport address is not present in the 5206 "destination transport address list" returned earlier in an 5207 associate command or communication up notification, an error is 5208 returned. 5209 Mandatory attributes: 5211 * association id - local handle to the SCTP association. 5212 * destination transport address - specified as one of the 5213 transport addresses of the peer endpoint, which is used as the 5214 primary address for sending packets. This overrides the 5215 current primary address information maintained by the local 5216 SCTP endpoint. 5218 Optional attributes: 5220 * source transport address - optionally, some implementations 5221 can allow you to set the default source address placed in all 5222 outgoing IP datagrams. 5223 G) Receive 5225 Format: RECEIVE(association id, buffer address, buffer size 5226 [,stream id]) -> byte count [,transport address] [,stream 5227 id] [,stream sequence number] [,partial flag] [,payload 5228 protocol-id] 5230 This primitive reads the first user message in the SCTP in-queue 5231 into the buffer specified by ULP, if there is one available. The 5232 size of the message read, in bytes, will be returned. It might, 5233 depending on the specific implementation, also return other 5234 information such as the sender's address, the stream id on which 5235 it is received, whether there are more messages available for 5236 retrieval, etc. For ordered messages, their Stream Sequence 5237 Number might also be returned. 5238 Depending upon the implementation, if this primitive is invoked 5239 when no message is available the implementation returns an 5240 indication of this condition or blocks the invoking process until 5241 data does become available. 5242 Mandatory attributes: 5244 * association id - local handle to the SCTP association 5245 * buffer address - the memory location indicated by the ULP to 5246 store the received message. 5247 * buffer size - the maximum size of data to be received, in 5248 bytes. 5250 Optional attributes: 5252 * stream id - to indicate which stream to receive the data on. 5253 * stream sequence number - the Stream Sequence Number assigned 5254 by the sending SCTP peer. 5255 * partial flag - if this returned flag is set to 1, then this 5256 primitive contains a partial delivery of the whole message. 5257 When this flag is set, the stream id and stream sequence 5258 number accompanies this primitive. When this flag is set to 5259 0, it indicates that no more deliveries will be received for 5260 this stream sequence number. 5261 * payload protocol-id - a 32-bit unsigned integer that is 5262 received from the peer indicating the type of payload protocol 5263 of the received data. This value is passed as opaque data by 5264 SCTP. 5265 H) Status 5267 Format: STATUS(association id) -> status data 5269 This primitive returns a data block containing the following 5270 information: 5272 association connection state, 5273 destination transport address list, 5274 destination transport address reachability states, 5275 current receiver window size, 5276 current congestion window sizes, 5277 number of unacknowledged DATA chunks, 5278 number of DATA chunks pending receipt, 5279 primary path, 5280 most recent SRTT on primary path, 5281 RTO on primary path, 5282 SRTT and RTO on other destination addresses, etc. 5284 Mandatory attributes: 5286 * association id - local handle to the SCTP association. 5288 Optional attributes: 5290 * None. 5291 I) Change Heartbeat 5293 Format: CHANGE HEARTBEAT(association id, destination transport 5294 address, new state [,interval]) -> result 5296 Instructs the local endpoint to enable or disable heartbeat on 5297 the specified destination transport address. 5298 The result of attempting this operation is returned. 5299 Note: Even when enabled, heartbeat will not take place if the 5300 destination transport address is not idle. 5301 Mandatory attributes: 5303 * association id - local handle to the SCTP association. 5304 * destination transport address - specified as one of the 5305 transport addresses of the peer endpoint. 5306 * new state - the new state of heartbeat for this destination 5307 transport address (either enabled or disabled). 5309 Optional attributes: 5311 * interval - if present, indicates the frequency of the 5312 heartbeat if this is to enable heartbeat on a destination 5313 transport address. This value is added to the RTO of the 5314 destination transport address. This value, if present, 5315 affects all destinations. 5316 J) Request HeartBeat 5318 Format: REQUESTHEARTBEAT(association id, destination transport 5319 address) -> result 5321 Instructs the local endpoint to perform a HeartBeat on the 5322 specified destination transport address of the given association. 5323 The returned result indicates whether the transmission of the 5324 HEARTBEAT chunk to the destination address is successful. 5325 Mandatory attributes: 5327 * association id - local handle to the SCTP association. 5328 * destination transport address - the transport address of the 5329 association on which a heartbeat is issued. 5330 K) Get SRTT Report 5332 Format: GETSRTTREPORT(association id, destination transport 5333 address) -> srtt result 5335 Instructs the local SCTP to report the current SRTT measurement 5336 on the specified destination transport address of the given 5337 association. The returned result can be an integer containing 5338 the most recent SRTT in milliseconds. 5339 Mandatory attributes: 5341 * association id - local handle to the SCTP association. 5342 * destination transport address - the transport address of the 5343 association on which the SRTT measurement is to be reported. 5344 L) Set Failure Threshold 5346 Format: SETFAILURETHRESHOLD(association id, destination transport 5347 address, failure threshold) -> result 5349 This primitive allows the local SCTP to customize the 5350 reachability failure detection threshold 'Path.Max.Retrans' for 5351 the specified destination address. 5352 Mandatory attributes: 5354 * association id - local handle to the SCTP association. 5355 * destination transport address - the transport address of the 5356 association on which the failure detection threshold is to be 5357 set. 5358 * failure threshold - the new value of 'Path.Max.Retrans' for 5359 the destination address. 5360 M) Set Protocol Parameters 5362 Format: SETPROTOCOLPARAMETERS(association id, [destination 5363 transport address,] protocol parameter list) -> result 5365 This primitive allows the local SCTP to customize the protocol 5366 parameters. 5367 Mandatory attributes: 5369 * association id - local handle to the SCTP association. 5370 * protocol parameter list - the specific names and values of the 5371 protocol parameters (e.g., Association.Max.Retrans (see 5372 Section 15), or other parameters like the DSCP) that the SCTP 5373 user wishes to customize. 5375 Optional attributes: 5377 * destination transport address - some of the protocol 5378 parameters might be set on a per destination transport address 5379 basis. 5380 N) Receive Unsent Message 5382 Format: RECEIVE_UNSENT(data retrieval id, buffer address, buffer 5383 size [,stream id] [, stream sequence number] [,partial 5384 flag] [,payload protocol-id]) 5386 * data retrieval id - the identification passed to the ULP in 5387 the failure notification. 5388 * buffer address - the memory location indicated by the ULP to 5389 store the received message. 5390 * buffer size - the maximum size of data to be received, in 5391 bytes. 5393 Optional attributes: 5395 * stream id - this is a return value that is set to indicate 5396 which stream the data was sent to. 5397 * stream sequence number - this value is returned indicating the 5398 Stream Sequence Number that was associated with the message. 5399 * partial flag - if this returned flag is set to 1, then this 5400 message is a partial delivery of the whole message. When this 5401 flag is set, the stream id and stream sequence number 5402 accompanies this primitive. When this flag is set to 0, it 5403 indicates that no more deliveries will be received for this 5404 stream sequence number. 5405 * payload protocol-id - The 32 bit unsigned integer that was 5406 sent to be sent to the peer indicating the type of payload 5407 protocol of the received data. 5408 O) Receive Unacknowledged Message 5410 Format: RECEIVE_UNACKED(data retrieval id, buffer address, buffer 5411 size, [,stream id] [,stream sequence number] [,partial 5412 flag] [,payload protocol-id]) 5414 * data retrieval id - the identification passed to the ULP in 5415 the failure notification. 5416 * buffer address - the memory location indicated by the ULP to 5417 store the received message. 5418 * buffer size - the maximum size of data to be received, in 5419 bytes. 5421 Optional attributes: 5423 * stream id - this is a return value that is set to indicate 5424 which stream the data was sent to. 5425 * stream sequence number - this value is returned indicating the 5426 Stream Sequence Number that was associated with the message. 5427 * partial flag - if this returned flag is set to 1, then this 5428 message is a partial delivery of the whole message. When this 5429 flag is set, the stream id and stream sequence number 5430 accompanies this primitive. When this flag is set to 0, it 5431 indicates that no more deliveries will be received for this 5432 stream sequence number. 5433 * payload protocol-id - the 32-bit unsigned integer that was 5434 sent to the peer indicating the type of payload protocol of 5435 the received data. 5436 P) Destroy SCTP Instance 5438 Format: DESTROY(local SCTP instance name) 5440 * local SCTP instance name - this is the value that was passed 5441 to the application in the initialize primitive and it 5442 indicates which SCTP instance is to be destroyed. 5444 10.2. SCTP-to-ULP 5446 It is assumed that the operating system or application environment 5447 provides a means for the SCTP to asynchronously signal the ULP 5448 process. When SCTP does signal a ULP process, certain information is 5449 passed to the ULP. 5451 IMPLEMENTATION NOTE: In some cases, this might be done through a 5452 separate socket or error channel. 5454 A) DATA ARRIVE notification 5455 SCTP invokes this notification on the ULP when a user message is 5456 successfully received and ready for retrieval. 5457 The following might optionally be passed with the notification: 5459 * association id - local handle to the SCTP association. 5460 * stream id - to indicate which stream the data is received on. 5461 B) SEND FAILURE notification 5462 If a message cannot be delivered, SCTP invokes this notification 5463 on the ULP. 5464 The following might optionally be passed with the notification: 5466 * association id - local handle to the SCTP association. 5467 * data retrieval id - an identification used to retrieve unsent 5468 and unacknowledged data. 5469 * cause code - indicating the reason of the failure, e.g., size 5470 too large, message life time expiration, etc. 5472 * context - optional information associated with this message 5473 (see D in Section 10.1). 5474 C) NETWORK STATUS CHANGE notification 5475 When a destination transport address is marked inactive (e.g., 5476 when SCTP detects a failure) or marked active (e.g., when SCTP 5477 detects a recovery), SCTP invokes this notification on the ULP. 5478 The following is passed with the notification: 5480 * association id - local handle to the SCTP association. 5481 * destination transport address - this indicates the destination 5482 transport address of the peer endpoint affected by the change. 5483 * new-status - this indicates the new status. 5484 D) COMMUNICATION UP notification 5485 This notification is used when SCTP becomes ready to send or 5486 receive user messages, or when a lost communication to an 5487 endpoint is restored. 5488 IMPLEMENTATION NOTE: If the ASSOCIATE primitive is implemented as 5489 a blocking function call, the association parameters are returned 5490 as a result of the ASSOCIATE primitive itself. In that case, 5491 COMMUNICATION UP notification is optional at the association 5492 initiator's side. 5493 The following is passed with the notification: 5495 * association id - local handle to the SCTP association. 5496 * status - This indicates what type of event has occurred. 5497 * destination transport address list - the complete set of 5498 transport addresses of the peer. 5499 * outbound stream count - the maximum number of streams allowed 5500 to be used in this association by the ULP. 5501 * inbound stream count - the number of streams the peer endpoint 5502 has requested with this association (this might not be the 5503 same number as 'outbound stream count'). 5504 E) COMMUNICATION LOST notification 5505 When SCTP loses communication to an endpoint completely (e.g., 5506 via Heartbeats) or detects that the endpoint has performed an 5507 abort operation, it invokes this notification on the ULP. 5508 The following is passed with the notification: 5510 * association id - local handle to the SCTP association. 5511 * status - this indicates what type of event has occurred; the 5512 status might indicate that a failure OR a normal termination 5513 event occurred in response to a shutdown or abort request. 5515 The following might be passed with the notification: 5517 * data retrieval id - an identification used to retrieve unsent 5518 and unacknowledged data. 5519 * last-acked - the TSN last acked by that peer endpoint. 5521 * last-sent - the TSN last sent to that peer endpoint. 5522 * Upper Layer Abort Reason - the abort reason specified in case 5523 of a user-initiated abort. 5524 F) COMMUNICATION ERROR notification 5525 When SCTP receives an ERROR chunk from its peer and decides to 5526 notify its ULP, it can invoke this notification on the ULP. 5527 The following can be passed with the notification: 5529 * association id - local handle to the SCTP association. 5530 * error info - this indicates the type of error and optionally 5531 some additional information received through the ERROR chunk. 5532 G) RESTART notification 5533 When SCTP detects that the peer has restarted, it might send this 5534 notification to its ULP. 5535 The following can be passed with the notification: 5537 * association id - local handle to the SCTP association. 5538 H) SHUTDOWN COMPLETE notification 5539 When SCTP completes the shutdown procedures (Section 9.2), this 5540 notification is passed to the upper layer. 5541 The following can be passed with the notification: 5543 * association id - local handle to the SCTP association. 5545 11. Security Considerations 5547 11.1. Security Objectives 5549 As a common transport protocol designed to reliably carry time- 5550 sensitive user messages, such as billing or signaling messages for 5551 telephony services, between two networked endpoints, SCTP has the 5552 following security objectives. 5554 o availability of reliable and timely data transport services 5555 o integrity of the user-to-user information carried by SCTP 5557 11.2. SCTP Responses to Potential Threats 5559 SCTP could potentially be used in a wide variety of risk situations. 5560 It is important for operators of systems running SCTP to analyze 5561 their particular situations and decide on the appropriate counter- 5562 measures. 5564 Operators of systems running SCTP might consult [RFC2196] for 5565 guidance in securing their site. 5567 11.2.1. Countering Insider Attacks 5569 The principles of [RFC2196] might be applied to minimize the risk of 5570 theft of information or sabotage by insiders. Such procedures 5571 include publication of security policies, control of access at the 5572 physical, software, and network levels, and separation of services. 5574 11.2.2. Protecting against Data Corruption in the Network 5576 Where the risk of undetected errors in datagrams delivered by the 5577 lower-layer transport services is considered to be too great, 5578 additional integrity protection is required. If this additional 5579 protection were provided in the application layer, the SCTP header 5580 would remain vulnerable to deliberate integrity attacks. While the 5581 existing SCTP mechanisms for detection of packet replays are 5582 considered sufficient for normal operation, stronger protections are 5583 needed to protect SCTP when the operating environment contains 5584 significant risk of deliberate attacks from a sophisticated 5585 adversary. 5587 The SCTP Authentication extension SCTP-AUTH [RFC4895] MAY be used 5588 when the threat environment requires stronger integrity protections, 5589 but does not require confidentiality. 5591 11.2.3. Protecting Confidentiality 5593 In most cases, the risk of breach of confidentiality applies to the 5594 signaling data payload, not to the SCTP or lower-layer protocol 5595 overheads. If that is true, encryption of the SCTP user data only 5596 might be considered. As with the supplementary checksum service, 5597 user data encryption MAY be performed by the SCTP user application. 5598 Alternately, the user application MAY use an implementation-specific 5599 API to request that the IP Encapsulating Security Payload (ESP) 5600 [RFC4303] be used to provide confidentiality and integrity. 5602 Particularly for mobile users, the requirement for confidentiality 5603 might include the masking of IP addresses and ports. In this case, 5604 ESP SHOULD be used instead of application-level confidentiality. If 5605 ESP is used to protect confidentiality of SCTP traffic, an ESP 5606 cryptographic transform that includes cryptographic integrity 5607 protection MUST be used, because if there is a confidentiality threat 5608 there will also be a strong integrity threat. 5610 Whenever ESP is in use, application-level encryption is not generally 5611 required. 5613 Regardless of where confidentiality is provided, the Internet Key 5614 Exchange Protocol version 2 (IKEv2) [RFC7296] SHOULD be used for key 5615 management. 5617 Operators might consult [RFC4301] for more information on the 5618 security services available at and immediately above the Internet 5619 Protocol layer. 5621 11.2.4. Protecting against Blind Denial-of-Service Attacks 5623 A blind attack is one where the attacker is unable to intercept or 5624 otherwise see the content of data flows passing to and from the 5625 target SCTP node. Blind denial-of-service attacks can take the form 5626 of flooding, masquerade, or improper monopolization of services. 5628 11.2.4.1. Flooding 5630 The objective of flooding is to cause loss of service and incorrect 5631 behavior at target systems through resource exhaustion, interference 5632 with legitimate transactions, and exploitation of buffer-related 5633 software bugs. Flooding can be directed either at the SCTP node or 5634 at resources in the intervening IP Access Links or the Internet. 5635 Where the latter entities are the target, flooding will manifest 5636 itself as loss of network services, including potentially the breach 5637 of any firewalls in place. 5639 In general, protection against flooding begins at the equipment 5640 design level, where it includes measures such as: 5642 o avoiding commitment of limited resources before determining that 5643 the request for service is legitimate. 5645 o giving priority to completion of processing in progress over the 5646 acceptance of new work. 5648 o identification and removal of duplicate or stale queued requests 5649 for service. 5651 o not responding to unexpected packets sent to non-unicast 5652 addresses. 5654 Network equipment is expected to be capable of generating an alarm 5655 and log if a suspicious increase in traffic occurs. The log provides 5656 information such as the identity of the incoming link and source 5657 address(es) used, which will help the network or SCTP system operator 5658 to take protective measures. Procedures are expected to be in place 5659 for the operator to act on such alarms if a clear pattern of abuse 5660 emerges. 5662 The design of SCTP is resistant to flooding attacks, particularly in 5663 its use of a four-way startup handshake, its use of a cookie to defer 5664 commitment of resources at the responding SCTP node until the 5665 handshake is completed, and its use of a Verification Tag to prevent 5666 insertion of extraneous packets into the flow of an established 5667 association. 5669 The IP Authentication Header and Encapsulating Security Payload might 5670 be useful in reducing the risk of certain kinds of denial-of-service 5671 attacks. 5673 Support for the Host Name Address parameter has been removed from the 5674 protocol. Endpoints receiving INIT or INIT ACK chunks containing the 5675 Host Name Address parameter MUST send an ABORT chunk in response and 5676 MAY include an "Unresolvable Address" error cause. 5678 11.2.4.2. Blind Masquerade 5680 Masquerade can be used to deny service in several ways: 5682 o by tying up resources at the target SCTP node to which the 5683 impersonated node has limited access. For example, the target 5684 node can by policy permit a maximum of one SCTP association with 5685 the impersonated SCTP node. The masquerading attacker can attempt 5686 to establish an association purporting to come from the 5687 impersonated node so that the latter cannot do so when it requires 5688 it. 5690 o by deliberately allowing the impersonation to be detected, thereby 5691 provoking counter-measures that cause the impersonated node to be 5692 locked out of the target SCTP node. 5694 o by interfering with an established association by inserting 5695 extraneous content such as a SHUTDOWN request. 5697 SCTP reduces the risk of blind masquerade attacks through IP spoofing 5698 by use of the four-way startup handshake. Because the initial 5699 exchange is memory-less, no lockout mechanism is triggered by blind 5700 masquerade attacks. In addition, the INIT ACK containing the State 5701 Cookie is transmitted back to the IP address from which it received 5702 the INIT. Thus, the attacker would not receive the INIT ACK 5703 containing the State Cookie. SCTP protects against insertion of 5704 extraneous packets into the flow of an established association by use 5705 of the Verification Tag. 5707 Logging of received INIT requests and abnormalities such as 5708 unexpected INIT ACKs might be considered as a way to detect patterns 5709 of hostile activity. However, the potential usefulness of such 5710 logging has to be weighed against the increased SCTP startup 5711 processing it implies, rendering the SCTP node more vulnerable to 5712 flooding attacks. Logging is pointless without the establishment of 5713 operating procedures to review and analyze the logs on a routine 5714 basis. 5716 11.2.4.3. Improper Monopolization of Services 5718 Attacks under this heading are performed openly and legitimately by 5719 the attacker. They are directed against fellow users of the target 5720 SCTP node or of the shared resources between the attacker and the 5721 target node. Possible attacks include the opening of a large number 5722 of associations between the attacker's node and the target, or 5723 transfer of large volumes of information within a legitimately 5724 established association. 5726 Policy limits are expected to be placed on the number of associations 5727 per adjoining SCTP node. SCTP user applications are expected to be 5728 capable of detecting large volumes of illegitimate or "no-op" 5729 messages within a given association and either logging or terminating 5730 the association as a result, based on local policy. 5732 11.3. SCTP Interactions with Firewalls 5734 It is helpful for some firewalls if they can inspect just the first 5735 fragment of a fragmented SCTP packet and unambiguously determine 5736 whether it corresponds to an INIT chunk (for further information, 5737 please refer to [RFC1858]). Accordingly, we stress the requirements, 5738 as stated in Section 3.1, that (1) an INIT chunk MUST NOT be bundled 5739 with any other chunk in a packet and (2) a packet containing an INIT 5740 chunk MUST have a zero Verification Tag. The receiver of an INIT 5741 chunk MUST silently discard the INIT chunk and all further chunks if 5742 the INIT chunk is bundled with other chunks or the packet has a non- 5743 zero Verification Tag. 5745 11.4. Protection of Non-SCTP-Capable Hosts 5747 To provide a non-SCTP-capable host with the same level of protection 5748 against attacks as for SCTP-capable ones, all SCTP stacks MUST 5749 implement the ICMP handling described in Appendix C. 5751 When an SCTP stack receives a packet containing multiple control or 5752 DATA chunks and the processing of the packet requires the sending of 5753 multiple chunks in response, the sender of the response chunk(s) MUST 5754 NOT send more than one packet. If bundling is supported, multiple 5755 response chunks that fit into a single packet MAY be bundled together 5756 into one single response packet. If bundling is not supported, then 5757 the sender MUST NOT send more than one response chunk and MUST 5758 discard all other responses. Note that this rule does NOT apply to a 5759 SACK chunk, since a SACK chunk is, in itself, a response to DATA and 5760 a SACK does not require a response of more DATA. 5762 An SCTP implementation SHOULD abort the association if it receives a 5763 SACK acknowledging a TSN that has not been sent. 5765 An SCTP implementation that receives an INIT that would require a 5766 large packet in response, due to the inclusion of multiple ERROR 5767 parameters, MAY (at its discretion) elect to omit some or all of the 5768 ERROR parameters to reduce the size of the INIT ACK. Due to a 5769 combination of the size of the COOKIE parameter and the number of 5770 addresses a receiver of an INIT indicates to a peer, it is always 5771 possible that the INIT ACK will be larger than the original INIT. An 5772 SCTP implementation SHOULD attempt to make the INIT ACK as small as 5773 possible to reduce the possibility of byte amplification attacks. 5775 12. Network Management Considerations 5777 The MIB module for SCTP defined in [RFC3873] applies for the version 5778 of the protocol specified in this document. 5780 13. Recommended Transmission Control Block (TCB) Parameters 5782 This section details a set of parameters that are expected to be 5783 contained within the TCB for an implementation. This section is for 5784 illustrative purposes and is not considered to be requirements on an 5785 implementation or as an exhaustive list of all parameters inside an 5786 SCTP TCB. Each implementation might need its own additional 5787 parameters for optimization. 5789 13.1. Parameters Necessary for the SCTP Instance 5791 Associations: A list of current associations and mappings to the data 5792 consumers for each association. This might be in the 5793 form of a hash table or other implementation-dependent 5794 structure. The data consumers might be process 5795 identification information such as file descriptors, 5796 named pipe pointer, or table pointers dependent on how 5797 SCTP is implemented. 5798 Secret Key: A secret key used by this endpoint to compute the MAC. 5799 This SHOULD be a cryptographic quality random number 5800 with a sufficient length. Discussion in [RFC4086] can 5801 be helpful in selection of the key. 5802 Address List: The list of IP addresses that this instance has bound. 5803 This information is passed to one's peer(s) in INIT and 5804 INIT ACK chunks. 5806 SCTP Port: The local SCTP port number to which the endpoint is 5807 bound. 5809 13.2. Parameters Necessary per Association (i.e., the TCB) 5811 Peer Verification Tag: Tag value to be sent in every packet and is 5812 received in the INIT or INIT ACK chunk. 5813 My Verification Tag: Tag expected in every inbound packet and sent 5814 in the INIT or INIT ACK chunk. 5815 State: A state variable indicating what state the association 5816 is in, i.e., COOKIE-WAIT, COOKIE-ECHOED, ESTABLISHED, 5817 SHUTDOWN-PENDING, SHUTDOWN-SENT, SHUTDOWN-RECEIVED, 5818 SHUTDOWN-ACK-SENT. 5819 Note: No "CLOSED" state is illustrated since if a 5820 association is "CLOSED" its TCB SHOULD be removed. 5821 Peer Transport Address List: A list of SCTP transport addresses to 5822 which the peer is bound. This information is derived 5823 from the INIT or INIT ACK and is used to associate an 5824 inbound packet with a given association. Normally, 5825 this information is hashed or keyed for quick lookup 5826 and access of the TCB. 5827 Primary Path: This is the current primary destination transport 5828 address of the peer endpoint. It might also specify a 5829 source transport address on this endpoint. 5830 Overall Error Count: The overall association error count. 5831 Overall Error Threshold: The threshold for this association that if 5832 the Overall Error Count reaches will cause this 5833 association to be torn down. 5834 Peer Rwnd: Current calculated value of the peer's rwnd. 5835 Next TSN: The next TSN number to be assigned to a new DATA chunk. 5836 This is sent in the INIT or INIT ACK chunk to the peer 5837 and incremented each time a DATA chunk is assigned a 5838 TSN (normally just prior to transmit or during 5839 fragmentation). 5840 Last Rcvd TSN: This is the last TSN received in sequence. This 5841 value is set initially by taking the peer's initial 5842 TSN, received in the INIT or INIT ACK chunk, and 5843 subtracting one from it. 5844 Mapping Array: An array of bits or bytes indicating which out-of- 5845 order TSNs have been received (relative to the Last 5846 Rcvd TSN). If no gaps exist, i.e., no out-of- order 5847 packets have been received, this array will be set to 5848 all zero. This structure might be in the form of a 5849 circular buffer or bit array. 5850 Ack State: This flag indicates if the next received packet is to 5851 be responded to with a SACK. This is initialized to 0. 5852 When a packet is received it is incremented. If this 5853 value reaches 2 or more, a SACK is sent and the value 5854 is reset to 0. Note: This is used only when no DATA 5855 chunks are received out of order. When DATA chunks are 5856 out of order, SACKs are not delayed (see Section 6). 5857 Inbound Streams: An array of structures to track the inbound 5858 streams, normally including the next sequence number 5859 expected and possibly the stream number. 5860 Outbound Streams: An array of structures to track the outbound 5861 streams, normally including the next sequence number to 5862 be sent on the stream. 5863 Reasm Queue: A reassembly queue. 5864 Local Transport Address List: The list of local IP addresses bound 5865 in to this association. 5866 Association PMTU: The smallest PMTU discovered for all of the peer's 5867 transport addresses. 5869 13.3. Per Transport Address Data 5871 For each destination transport address in the peer's address list 5872 derived from the INIT or INIT ACK chunk, a number of data elements 5873 need to be maintained including: 5875 Error Count: The current error count for this destination. 5876 Error Threshold: Current error threshold for this destination, i.e., 5877 what value marks the destination down if error count 5878 reaches this value. 5879 cwnd: The current congestion window. 5880 ssthresh: The current ssthresh value. 5881 RTO: The current retransmission timeout value. 5882 SRTT: The current smoothed round-trip time. 5883 RTTVAR: The current RTT variation. 5884 partial bytes acked: The tracking method for increase of cwnd when 5885 in congestion avoidance mode (see Section 7.2.2). 5886 state: The current state of this destination, i.e., DOWN, UP, 5887 ALLOW-HB, NO-HEARTBEAT, etc. 5888 PMTU: The current known path MTU. 5889 Per Destination Timer: A timer used by each destination. 5890 RTO-Pending: A flag used to track if one of the DATA chunks sent to 5891 this address is currently being used to compute an RTT. 5892 If this flag is 0, the next DATA chunk sent to this 5893 destination is expected to be used to compute an RTT 5894 and this flag is expected to be set. Every time the 5895 RTT calculation completes (i.e., the DATA chunk is 5896 SACK'd), clear this flag. 5897 last-time: The time to which this destination was last sent. This 5898 can be to determine if a HEARTBEAT is needed. 5900 13.4. General Parameters Needed 5902 Out Queue: A queue of outbound DATA chunks. 5903 In Queue: A queue of inbound DATA chunks. 5905 14. IANA Considerations 5907 SCTP defines three registries that IANA maintains: 5909 o through definition of additional chunk types, 5910 o through definition of additional parameter types, or 5911 o through definition of additional cause codes within ERROR chunks. 5913 SCTP requires that the IANA Port Numbers registry be opened for SCTP 5914 port registrations, Section 14.6 describes how. An IESG-appointed 5915 Expert Reviewer supports IANA in evaluating SCTP port allocation 5916 requests. 5918 14.1. IETF-Defined Chunk Extension 5920 The assignment of new chunk type codes is done through an IETF Review 5921 action, as defined in [RFC8126]. Documentation for a new chunk MUST 5922 contain the following information: 5924 a) A long and short name for the new chunk type. 5926 b) A detailed description of the structure of the chunk, which MUST 5927 conform to the basic structure defined in Section 3.2. 5929 c) A detailed definition and description of intended use of each 5930 field within the chunk, including the chunk flags if any. 5931 Defined chunk flags will be used as initial entries in the chunk 5932 flags table for the new chunk type. 5934 d) A detailed procedural description of the use of the new chunk 5935 type within the operation of the protocol. 5937 The last chunk type (255) is reserved for future extension if 5938 necessary. 5940 For each new chunk type, IANA creates a registration table for the 5941 chunk flags of that type. The procedure for registering particular 5942 chunk flags is described in Section 14.2. 5944 14.2. IETF Chunk Flags Registration 5946 The assignment of new chunk flags is done through an RFC Required 5947 action, as defined in [RFC8126]. Documentation for the chunk flags 5948 MUST contain the following information: 5950 a) A name for the new chunk flag. 5952 b) A detailed procedural description of the use of the new chunk 5953 flag within the operation of the protocol. It MUST be considered 5954 that implementations not supporting the flag will send '0' on 5955 transmit and just ignore it on receipt. 5957 IANA selects a chunk flags value. This MUST be one of 0x01, 0x02, 5958 0x04, 0x08, 0x10, 0x20, 0x40, or 0x80, which MUST be unique within 5959 the chunk flag values for the specific chunk type. 5961 14.3. IETF-Defined Chunk Parameter Extension 5963 The assignment of new chunk parameter type codes is done through an 5964 IETF Review action as defined in [RFC8126]. Documentation of the 5965 chunk parameter MUST contain the following information: 5967 a) Name of the parameter type. 5969 b) Detailed description of the structure of the parameter field. 5970 This structure MUST conform to the general Type-Length-Value 5971 format described in Section 3.2.1. 5973 c) Detailed definition of each component of the parameter value. 5975 d) Detailed description of the intended use of this parameter type, 5976 and an indication of whether and under what circumstances 5977 multiple instances of this parameter type can be found within the 5978 same chunk. 5980 e) Each parameter type MUST be unique across all chunks. 5982 14.4. IETF-Defined Additional Error Causes 5984 Additional cause codes can be allocated in the range 11 to 65535 5985 through a Specification Required action as defined in [RFC8126]. 5986 Provided documentation MUST include the following information: 5988 a) Name of the error condition. 5990 b) Detailed description of the conditions under which an SCTP 5991 endpoint issues an ERROR (or ABORT) with this cause code. 5993 c) Expected action by the SCTP endpoint that receives an ERROR (or 5994 ABORT) chunk containing this cause code. 5996 d) Detailed description of the structure and content of data fields 5997 that accompany this cause code. 5999 The initial word (32 bits) of a cause code parameter MUST conform to 6000 the format shown in Section 3.3.10, i.e.: 6002 o first 2 bytes contain the cause code value 6003 o last 2 bytes contain the length of the cause parameter. 6005 14.5. Payload Protocol Identifiers 6007 Except for value 0, which is reserved by SCTP to indicate an 6008 unspecified payload protocol identifier in a DATA chunk, SCTP will 6009 not be responsible for standardizing or verifying any payload 6010 protocol identifiers; SCTP simply receives the identifier from the 6011 upper layer and carries it with the corresponding payload data. 6013 The upper layer, i.e., the SCTP user, SHOULD standardize any specific 6014 protocol identifier with IANA if it is so desired. The use of any 6015 specific payload protocol identifier is out of the scope of SCTP. 6017 14.6. Port Numbers Registry 6019 SCTP services can use contact port numbers to provide service to 6020 unknown callers, as in TCP and UDP. IANA is therefore requested to 6021 open the existing "Service Name and Transport Protocol Port Number 6022 Registry" for SCTP using the following rules, which we intend to mesh 6023 well with existing port-number registration procedures. An IESG- 6024 appointed expert reviewer supports IANA in evaluating SCTP port 6025 allocation requests, according to the procedure defined in [RFC8126]. 6026 The details of this process are defined in [RFC6335]. 6028 This document registers the following ports. (These registrations 6029 are to be considered models to follow for future allocation 6030 requests.) 6031 discard 9/sctp Discard # IETF TSVWG 6032 # Randall Stewart 6033 # [RFC4960] 6035 The discard service, which accepts SCTP connections on port 6036 9, discards all incoming application data and sends no data 6037 in response. Thus, SCTP's discard port is analogous to 6038 TCP's discard port, and might be used to check the health 6039 of an SCTP stack. 6041 ftp-data 20/sctp FTP # IETF TSVWG 6042 # Randall Stewart 6043 # [RFC4960] 6045 ftp 21/sctp FTP # IETF TSVWG 6046 # Randall Stewart 6047 # [RFC4960] 6049 File Transfer Protocol (FTP) data (20) and control ports 6050 (21). 6052 ssh 22/sctp SSH # IETF TSVWG 6053 # Randall Stewart 6054 # [RFC4960] 6056 The Secure Shell (SSH) remote login service, which allows 6057 secure shell logins to a host. 6059 http 80/sctp HTTP # IETF TSVWG 6060 # Randall Stewart 6061 # [RFC4960] 6063 World Wide Web HTTP over SCTP. 6065 bgp 179/sctp BGP # IETF TSVWG 6066 # Randall Stewart 6067 # [RFC4960] 6069 Border Gateway Protocol over SCTP. 6071 https 443/sctp HTTPS # IETF TSVWG 6072 # Randall Stewart 6073 # [RFC4960] 6075 World Wide Web HTTP over TLS/SSL over SCTP. 6077 15. Suggested SCTP Protocol Parameter Values 6079 The following protocol parameters are RECOMMENDED: 6081 RTO.Initial: 1 second 6082 RTO.Min: 1 second 6083 RTO.Max: 60 seconds 6084 Max.Burst: 4 6085 RTO.Alpha: 1/8 6086 RTO.Beta: 1/4 6087 Valid.Cookie.Life: 60 seconds 6088 Association.Max.Retrans: 10 attempts 6089 Path.Max.Retrans: 5 attempts (per destination address) 6090 Max.Init.Retransmits: 8 attempts 6091 HB.interval: 30 seconds 6092 HB.Max.Burst: 1 6093 SACK.Delay: 200 milliseconds 6095 IMPLEMENTATION NOTE: The SCTP implementation can allow ULP to 6096 customize some of these protocol parameters (see Section 10). 6098 Note: RTO.Min SHOULD be set as described above in this section. 6100 16. Acknowledgements 6102 An undertaking represented by this updated document is not a small 6103 feat and represents the summation of the initial authors of RFC 2960: 6104 Q. Xie, K. Morneault, C. Sharp, H. Schwarzbauer, T. Taylor, 6105 I. Rytina, M. Kalla, L. Zhang, and V. Paxson. 6107 Add to that, the comments from everyone who contributed to the 6108 original RFC: 6110 Mark Allman, R.J. Atkinson, Richard Band, Scott Bradner, Steve 6111 Bellovin, Peter Butler, Ram Dantu, R. Ezhirpavai, Mike Fisk, Sally 6112 Floyd, Atsushi Fukumoto, Matt Holdrege, Henry Houh, Christian 6113 Huitema, Gary Lehecka, Jonathan Lee, David Lehmann, John Loughney, 6114 Daniel Luan, Barry Nagelberg, Thomas Narten, Erik Nordmark, Lyndon 6115 Ong, Shyamal Prasad, Kelvin Porter, Heinz Prantner, Jarno Rajahalme, 6116 Raymond E. Reeves, Renee Revis, Ivan Arias Rodriguez, A. Sankar, Greg 6117 Sidebottom, Brian Wyld, La Monte Yarroll, and many others for their 6118 invaluable comments. 6120 Then, add the authors of the SCTP implementor's guide, I. Arias- 6121 Rodriguez, K. Poon, A. Caro, and M. Tuexen. 6123 Then add to these the efforts of all the subsequent seven SCTP 6124 interoperability tests and those who commented on RFC 4460 as shown 6125 in its acknowledgements: 6127 Barry Zuckerman, La Monte Yarroll, Qiaobing Xie, Wang Xiaopeng, 6128 Jonathan Wood, Jeff Waskow, Mike Turner, John Townsend, Sabina 6129 Torrente, Cliff Thomas, Yuji Suzuki, Manoj Solanki, Sverre Slotte, 6130 Keyur Shah, Jan Rovins, Ben Robinson, Renee Revis, Ian Periam, RC 6131 Monee, Sanjay Rao, Sujith Radhakrishnan, Heinz Prantner, Biren Patel, 6132 Nathalie Mouellic, Mitch Miers, Bernward Meyknecht, Stan McClellan, 6133 Oliver Mayor, Tomas Orti Martin, Sandeep Mahajan, David Lehmann, 6134 Jonathan Lee, Philippe Langlois, Karl Knutson, Joe Keller, Gareth 6135 Keily, Andreas Jungmaier, Janardhan Iyengar, Mutsuya Irie, John 6136 Hebert, Kausar Hassan, Fred Hasle, Dan Harrison, Jon Grim, Laurent 6137 Glaude, Steven Furniss, Atsushi Fukumoto, Ken Fujita, Steve Dimig, 6138 Thomas Curran, Serkan Cil, Melissa Campbell, Peter Butler, Rob 6139 Brennan, Harsh Bhondwe, Brian Bidulock, Caitlin Bestler, Jon Berger, 6140 Robby Benedyk, Stephen Baucke, Sandeep Balani, and Ronnie Sellar. 6142 A special thanks to Mark Allman, who should actually be a co-author 6143 for his work on the max-burst, but managed to wiggle out due to a 6144 technicality. Also, we would like to acknowledge Lyndon Ong and Phil 6145 Conrad for their valuable input and many contributions. 6147 And finally, you have this document, and those who have commented 6148 upon that including Alfred Hoenes and Ronnie Sellars. 6150 My thanks cannot be adequately expressed to all of you who have 6151 participated in the coding, testing, and updating process of this 6152 document. All I can say is, Thank You! 6154 Randall Stewart - Editor 6156 17. References 6158 17.1. Normative References 6160 [ITU.V42.1994] 6161 International Telecommunications Union, "Error-correcting 6162 Procedures for DCEs Using Asynchronous-to-Synchronous 6163 Conversion", ITU-T Recommendation V.42, 1994. 6165 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 6166 DOI 10.17487/RFC0768, August 1980, 6167 . 6169 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 6170 RFC 793, DOI 10.17487/RFC0793, September 1981, 6171 . 6173 [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - 6174 Communication Layers", STD 3, RFC 1122, 6175 DOI 10.17487/RFC1122, October 1989, 6176 . 6178 [RFC1123] Braden, R., Ed., "Requirements for Internet Hosts - 6179 Application and Support", STD 3, RFC 1123, 6180 DOI 10.17487/RFC1123, October 1989, 6181 . 6183 [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, 6184 DOI 10.17487/RFC1191, November 1990, 6185 . 6187 [RFC1982] Elz, R. and R. Bush, "Serial Number Arithmetic", RFC 1982, 6188 DOI 10.17487/RFC1982, August 1996, 6189 . 6191 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6192 Requirement Levels", BCP 14, RFC 2119, 6193 DOI 10.17487/RFC2119, March 1997, 6194 . 6196 [RFC3873] Pastor, J. and M. Belinchon, "Stream Control Transmission 6197 Protocol (SCTP) Management Information Base (MIB)", 6198 RFC 3873, DOI 10.17487/RFC3873, September 2004, 6199 . 6201 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6202 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 6203 2006, . 6205 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6206 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 6207 December 2005, . 6209 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 6210 RFC 4303, DOI 10.17487/RFC4303, December 2005, 6211 . 6213 [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU 6214 Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, 6215 . 6217 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 6218 Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, 6219 . 6221 [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 6222 Cheshire, "Internet Assigned Numbers Authority (IANA) 6223 Procedures for the Management of the Service Name and 6224 Transport Protocol Port Number Registry", BCP 165, 6225 RFC 6335, DOI 10.17487/RFC6335, August 2011, 6226 . 6228 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 6229 Kivinen, "Internet Key Exchange Protocol Version 2 6230 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 6231 2014, . 6233 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 6234 Writing an IANA Considerations Section in RFCs", BCP 26, 6235 RFC 8126, DOI 10.17487/RFC8126, June 2017, 6236 . 6238 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 6239 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 6240 May 2017, . 6242 [RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6 6243 (IPv6) Specification", STD 86, RFC 8200, 6244 DOI 10.17487/RFC8200, July 2017, 6245 . 6247 [RFC8201] McCann, J., Deering, S., Mogul, J., and R. Hinden, Ed., 6248 "Path MTU Discovery for IP version 6", STD 87, RFC 8201, 6249 DOI 10.17487/RFC8201, July 2017, 6250 . 6252 17.2. Informative References 6254 [ALLMAN99] 6255 Allman, M. and V. Paxson, "On Estimating End-to-End 6256 Network Path Properties", SIGCOM 99, 1999. 6258 [FALL96] Fall, K. and S. Floyd, "Simulation-based Comparisons of 6259 Tahoe, Reno, and SACK TCP", SIGCOM 99, V. 26, N. 3, 6260 pp 5-21, July 1996. 6262 [RFC1858] Ziemba, G., Reed, D., and P. Traina, "Security 6263 Considerations for IP Fragment Filtering", RFC 1858, 6264 DOI 10.17487/RFC1858, October 1995, 6265 . 6267 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 6268 Hashing for Message Authentication", RFC 2104, 6269 DOI 10.17487/RFC2104, February 1997, 6270 . 6272 [RFC2196] Fraser, B., "Site Security Handbook", FYI 8, RFC 2196, 6273 DOI 10.17487/RFC2196, September 1997, 6274 . 6276 [RFC2522] Karn, P. and W. Simpson, "Photuris: Session-Key Management 6277 Protocol", RFC 2522, DOI 10.17487/RFC2522, March 1999, 6278 . 6280 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 6281 of Explicit Congestion Notification (ECN) to IP", 6282 RFC 3168, DOI 10.17487/RFC3168, September 2001, 6283 . 6285 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 6286 "Randomness Requirements for Security", BCP 106, RFC 4086, 6287 DOI 10.17487/RFC4086, June 2005, 6288 . 6290 [RFC4895] Tuexen, M., Stewart, R., Lei, P., and E. Rescorla, 6291 "Authenticated Chunks for the Stream Control Transmission 6292 Protocol (SCTP)", RFC 4895, DOI 10.17487/RFC4895, August 6293 2007, . 6295 [RFC4960] Stewart, R., Ed., "Stream Control Transmission Protocol", 6296 RFC 4960, DOI 10.17487/RFC4960, September 2007, 6297 . 6299 [RFC7053] Tuexen, M., Ruengeler, I., and R. Stewart, "SACK- 6300 IMMEDIATELY Extension for the Stream Control Transmission 6301 Protocol", RFC 7053, DOI 10.17487/RFC7053, November 2013, 6302 . 6304 [RFC8311] Black, D., "Relaxing Restrictions on Explicit Congestion 6305 Notification (ECN) Experimentation", RFC 8311, 6306 DOI 10.17487/RFC8311, January 2018, 6307 . 6309 [RFC8540] Stewart, R., Tuexen, M., and M. Proshin, "Stream Control 6310 Transmission Protocol: Errata and Issues in RFC 4960", 6311 RFC 8540, DOI 10.17487/RFC8540, February 2019, 6312 . 6314 [SAVAGE99] 6315 Savage, S., Cardwell, N., Wetherall, D., and T. Anderson, 6316 "TCP Congestion Control with a Misbehaving Receiver", ACM 6317 Computer Communications Review 29(5), October 1999. 6319 [WILLIAMS93] 6320 Williams, R., "A PAINLESS GUIDE TO CRC ERROR DETECTION 6321 ALGORITHMS", SIGCOM 99, August 1993, 6322 . 6325 Appendix A. Explicit Congestion Notification 6327 ECN as specified in [RFC3168] (updated by [RFC8311]) describes an 6328 extension to IP that details a method for becoming aware of 6329 congestion outside of datagram loss. This is a feature that an 6330 implementation MAY choose to add to SCTP. This appendix details the 6331 minor differences implementers will need to be aware of if they 6332 choose to implement this feature. In general, [RFC3168] (updated by 6333 [RFC8311]) SHOULD be followed, with the following exceptions. 6335 Negotiation: 6337 [RFC3168] (updated by [RFC8311]) details the negotiation of ECN 6338 during the SYN and SYN-ACK stages of a TCP connection. The sender of 6339 the SYN sets 2 bits in the TCP flags, and the sender of the SYN-ACK 6340 sets only 1 bit. The reasoning behind this is to ensure that both 6341 sides are truly ECN capable. For SCTP, this is not necessary. To 6342 indicate that an endpoint is ECN capable, an endpoint SHOULD add to 6343 the INIT and or INIT ACK chunk the TLV reserved for ECN. This TLV 6344 contains no parameters, and thus has the following format: 6346 0 1 2 3 6347 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 6348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6349 | Parameter Type = 32768 | Parameter Length = 4 | 6350 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6352 ECN-Echo: 6354 [RFC3168] (updated by [RFC8311]) details a specific bit for a 6355 receiver to send back in its TCP acknowledgements to notify the 6356 sender of the Congestion Experienced (CE) bit that the CE bit has 6357 arrived from the network. For SCTP, this same indication is made by 6358 including the ECNE chunk. This chunk contains one data element, 6359 i.e., the lowest TSN associated with the IP datagram marked with the 6360 CE bit, and looks as follows: 6362 0 1 2 3 6363 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 6364 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6365 | Chunk Type=12 | Flags=00000000| Chunk Length = 8 | 6366 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6367 | Lowest TSN Number | 6368 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6370 Note: The ECNE is considered a Control chunk. 6372 CWR: 6374 [RFC3168] (updated by [RFC8311]) details a specific bit for a sender 6375 to send in the header of its next outbound TCP segment to indicate to 6376 its peer that it has reduced its congestion window. This is termed 6377 the CWR bit. For SCTP, the same indication is made by including the 6378 CWR chunk. This chunk contains one data element, i.e., the TSN 6379 number that was sent in the ECNE chunk. This element represents the 6380 lowest TSN number in the datagram that was originally marked with the 6381 CE bit. 6383 0 1 2 3 6384 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 6385 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6386 | Chunk Type=13 | Flags=00000000| Chunk Length = 8 | 6387 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6388 | Lowest TSN Number | 6389 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6391 Note: The CWR is considered a Control chunk. 6393 Appendix B. CRC32c Checksum Calculation 6395 We define a 'reflected value' as one that is the opposite of the 6396 normal bit order of the machine. The 32-bit CRC (Cyclic Redundancy 6397 Check) is calculated as described for CRC32c and uses the polynomial 6398 code 0x11EDC6F41 (Castagnoli93) or 6399 x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+x^19+x^18+ 6400 x^14+x^13+x^11+x^10+x^9+x^8+x^6+x^0. The CRC is computed using a 6401 procedure similar to ETHERNET CRC [ITU.V42.1994], modified to reflect 6402 transport-level usage. 6404 CRC computation uses polynomial division. A message bit-string M is 6405 transformed to a polynomial, M(X), and the CRC is calculated from 6406 M(X) using polynomial arithmetic. 6408 When CRCs are used at the link layer, the polynomial is derived from 6409 on-the-wire bit ordering: the first bit 'on the wire' is the high- 6410 order coefficient. Since SCTP is a transport-level protocol, it 6411 cannot know the actual serial-media bit ordering. Moreover, 6412 different links in the path between SCTP endpoints can use different 6413 link-level bit orders. 6415 A convention therefore is established for mapping SCTP transport 6416 messages to polynomials for purposes of CRC computation. The bit- 6417 ordering for mapping SCTP messages to polynomials is that bytes are 6418 taken most-significant first, but within each byte, bits are taken 6419 least-significant first. The first byte of the message provides the 6420 eight highest coefficients. Within each byte, the least-significant 6421 SCTP bit gives the most-significant polynomial coefficient within 6422 that byte, and the most-significant SCTP bit is the least-significant 6423 polynomial coefficient in that byte. (This bit ordering is sometimes 6424 called 'mirrored' or 'reflected' [WILLIAMS93].) CRC polynomials are 6425 to be transformed back into SCTP transport-level byte values, using a 6426 consistent mapping. 6428 The SCTP transport-level CRC value can be calculated as follows: 6430 o CRC input data are assigned to a byte stream, numbered from 0 to 6431 N-1. 6433 o The transport-level byte stream is mapped to a polynomial value. 6434 An N-byte PDU with j bytes numbered 0 to N-1 is considered as 6435 coefficients of a polynomial M(x) of order 8N-1, with bit 0 of 6436 byte j being coefficient x^(8(N-j)-8), and bit 7 of byte j being 6437 coefficient x^(8(N-j)-1). 6439 o The CRC remainder register is initialized with all 1s and the CRC 6440 is computed with an algorithm that simultaneously multiplies by 6441 x^32 and divides by the CRC polynomial. 6443 o The polynomial is multiplied by x^32 and divided by G(x), the 6444 generator polynomial, producing a remainder R(x) of degree less 6445 than or equal to 31. 6447 o The coefficients of R(x) are considered a 32-bit sequence. 6449 o The bit sequence is complemented. The result is the CRC 6450 polynomial. 6452 o The CRC polynomial is mapped back into SCTP transport-level bytes. 6453 The coefficient of x^31 gives the value of bit 7 of SCTP byte 0, 6454 and the coefficient of x^24 gives the value of bit 0 of byte 0. 6455 The coefficient of x^7 gives bit 7 of byte 3, and the coefficient 6456 of x^0 gives bit 0 of byte 3. The resulting 4-byte transport- 6457 level sequence is the 32-bit SCTP checksum value. 6459 IMPLEMENTATION NOTE: Standards documents, textbooks, and vendor 6460 literature on CRCs often follow an alternative formulation, in which 6461 the register used to hold the remainder of the long-division 6462 algorithm is initialized to zero rather than all-1s, and instead the 6463 first 32 bits of the message are complemented. The long-division 6464 algorithm used in our formulation is specified such that the initial 6465 multiplication by 2^32 and the long-division are combined into one 6466 simultaneous operation. For such algorithms, and for messages longer 6467 than 64 bits, the two specifications are precisely equivalent. That 6468 equivalence is the intent of this document. 6470 Implementors of SCTP are warned that both specifications are to be 6471 found in the literature, sometimes with no restriction on the long- 6472 division algorithm. The choice of formulation in this document is to 6473 permit non-SCTP usage, where the same CRC algorithm can be used to 6474 protect messages shorter than 64 bits. 6476 There can be a computational advantage in validating the association 6477 against the Verification Tag, prior to performing a checksum, as 6478 invalid tags will result in the same action as a bad checksum in most 6479 cases. The exceptions for this technique would be INIT and some 6480 SHUTDOWN-COMPLETE exchanges, as well as a stale COOKIE ECHO. These 6481 special-case exchanges represent small packets and will minimize the 6482 effect of the checksum calculation. 6484 The following non-normative sample code is taken from an open-source 6485 CRC generator [WILLIAMS93], using the "mirroring" technique and 6486 yielding a lookup table for SCTP CRC32c with 256 entries, each 32 6487 bits wide. While neither especially slow nor especially fast, as 6488 software table-lookup CRCs go, it has the advantage of working on 6489 both big-endian and little-endian CPUs, using the same (host-order) 6490 lookup tables, and using only the predefined ntohl() and htonl() 6491 operations. The code is somewhat modified from [WILLIAMS93], to 6492 ensure portability between big-endian and little-endian 6493 architectures. (Note that if the byte endian-ness of the target 6494 architecture is known to be little-endian, the final bit-reversal and 6495 byte-reversal steps can be folded into a single operation.) 6497 6498 /****************************************************************/ 6499 /* Note: The definitions for Ross Williams's table generator */ 6500 /* would be TB_WIDTH=4, TB_POLY=0x1EDC6F41, TB_REVER=TRUE. */ 6501 /* For Mr. Williams's direct calculation code, use the settings */ 6502 /* cm_width=32, cm_poly=0x1EDC6F41, cm_init=0xFFFFFFFF, */ 6503 /* cm_refin=TRUE, cm_refot=TRUE, cm_xorot=0x00000000. */ 6504 /****************************************************************/ 6506 /* Example of the crc table file */ 6507 #ifndef __crc32cr_h__ 6508 #define __crc32cr_h__ 6510 #define CRC32C_POLY 0x1EDC6F41UL 6511 #define CRC32C(c,d) (c=(c>>8)^crc_c[(c^(d))&0xFF]) 6513 uint32_t crc_c[256] = { 6514 0x00000000UL, 0xF26B8303UL, 0xE13B70F7UL, 0x1350F3F4UL, 6515 0xC79A971FUL, 0x35F1141CUL, 0x26A1E7E8UL, 0xD4CA64EBUL, 6516 0x8AD958CFUL, 0x78B2DBCCUL, 0x6BE22838UL, 0x9989AB3BUL, 6517 0x4D43CFD0UL, 0xBF284CD3UL, 0xAC78BF27UL, 0x5E133C24UL, 6518 0x105EC76FUL, 0xE235446CUL, 0xF165B798UL, 0x030E349BUL, 6519 0xD7C45070UL, 0x25AFD373UL, 0x36FF2087UL, 0xC494A384UL, 6520 0x9A879FA0UL, 0x68EC1CA3UL, 0x7BBCEF57UL, 0x89D76C54UL, 6521 0x5D1D08BFUL, 0xAF768BBCUL, 0xBC267848UL, 0x4E4DFB4BUL, 6522 0x20BD8EDEUL, 0xD2D60DDDUL, 0xC186FE29UL, 0x33ED7D2AUL, 6523 0xE72719C1UL, 0x154C9AC2UL, 0x061C6936UL, 0xF477EA35UL, 6524 0xAA64D611UL, 0x580F5512UL, 0x4B5FA6E6UL, 0xB93425E5UL, 6525 0x6DFE410EUL, 0x9F95C20DUL, 0x8CC531F9UL, 0x7EAEB2FAUL, 6526 0x30E349B1UL, 0xC288CAB2UL, 0xD1D83946UL, 0x23B3BA45UL, 6527 0xF779DEAEUL, 0x05125DADUL, 0x1642AE59UL, 0xE4292D5AUL, 6528 0xBA3A117EUL, 0x4851927DUL, 0x5B016189UL, 0xA96AE28AUL, 6529 0x7DA08661UL, 0x8FCB0562UL, 0x9C9BF696UL, 0x6EF07595UL, 6530 0x417B1DBCUL, 0xB3109EBFUL, 0xA0406D4BUL, 0x522BEE48UL, 6531 0x86E18AA3UL, 0x748A09A0UL, 0x67DAFA54UL, 0x95B17957UL, 6532 0xCBA24573UL, 0x39C9C670UL, 0x2A993584UL, 0xD8F2B687UL, 6533 0x0C38D26CUL, 0xFE53516FUL, 0xED03A29BUL, 0x1F682198UL, 6534 0x5125DAD3UL, 0xA34E59D0UL, 0xB01EAA24UL, 0x42752927UL, 6535 0x96BF4DCCUL, 0x64D4CECFUL, 0x77843D3BUL, 0x85EFBE38UL, 6536 0xDBFC821CUL, 0x2997011FUL, 0x3AC7F2EBUL, 0xC8AC71E8UL, 6537 0x1C661503UL, 0xEE0D9600UL, 0xFD5D65F4UL, 0x0F36E6F7UL, 6538 0x61C69362UL, 0x93AD1061UL, 0x80FDE395UL, 0x72966096UL, 6539 0xA65C047DUL, 0x5437877EUL, 0x4767748AUL, 0xB50CF789UL, 6540 0xEB1FCBADUL, 0x197448AEUL, 0x0A24BB5AUL, 0xF84F3859UL, 6541 0x2C855CB2UL, 0xDEEEDFB1UL, 0xCDBE2C45UL, 0x3FD5AF46UL, 6542 0x7198540DUL, 0x83F3D70EUL, 0x90A324FAUL, 0x62C8A7F9UL, 6543 0xB602C312UL, 0x44694011UL, 0x5739B3E5UL, 0xA55230E6UL, 6544 0xFB410CC2UL, 0x092A8FC1UL, 0x1A7A7C35UL, 0xE811FF36UL, 6545 0x3CDB9BDDUL, 0xCEB018DEUL, 0xDDE0EB2AUL, 0x2F8B6829UL, 6546 0x82F63B78UL, 0x709DB87BUL, 0x63CD4B8FUL, 0x91A6C88CUL, 6547 0x456CAC67UL, 0xB7072F64UL, 0xA457DC90UL, 0x563C5F93UL, 6548 0x082F63B7UL, 0xFA44E0B4UL, 0xE9141340UL, 0x1B7F9043UL, 6549 0xCFB5F4A8UL, 0x3DDE77ABUL, 0x2E8E845FUL, 0xDCE5075CUL, 6550 0x92A8FC17UL, 0x60C37F14UL, 0x73938CE0UL, 0x81F80FE3UL, 6551 0x55326B08UL, 0xA759E80BUL, 0xB4091BFFUL, 0x466298FCUL, 6552 0x1871A4D8UL, 0xEA1A27DBUL, 0xF94AD42FUL, 0x0B21572CUL, 6553 0xDFEB33C7UL, 0x2D80B0C4UL, 0x3ED04330UL, 0xCCBBC033UL, 6554 0xA24BB5A6UL, 0x502036A5UL, 0x4370C551UL, 0xB11B4652UL, 6555 0x65D122B9UL, 0x97BAA1BAUL, 0x84EA524EUL, 0x7681D14DUL, 6556 0x2892ED69UL, 0xDAF96E6AUL, 0xC9A99D9EUL, 0x3BC21E9DUL, 6557 0xEF087A76UL, 0x1D63F975UL, 0x0E330A81UL, 0xFC588982UL, 6558 0xB21572C9UL, 0x407EF1CAUL, 0x532E023EUL, 0xA145813DUL, 6559 0x758FE5D6UL, 0x87E466D5UL, 0x94B49521UL, 0x66DF1622UL, 6560 0x38CC2A06UL, 0xCAA7A905UL, 0xD9F75AF1UL, 0x2B9CD9F2UL, 6561 0xFF56BD19UL, 0x0D3D3E1AUL, 0x1E6DCDEEUL, 0xEC064EEDUL, 6562 0xC38D26C4UL, 0x31E6A5C7UL, 0x22B65633UL, 0xD0DDD530UL, 6563 0x0417B1DBUL, 0xF67C32D8UL, 0xE52CC12CUL, 0x1747422FUL, 6564 0x49547E0BUL, 0xBB3FFD08UL, 0xA86F0EFCUL, 0x5A048DFFUL, 6565 0x8ECEE914UL, 0x7CA56A17UL, 0x6FF599E3UL, 0x9D9E1AE0UL, 6566 0xD3D3E1ABUL, 0x21B862A8UL, 0x32E8915CUL, 0xC083125FUL, 6567 0x144976B4UL, 0xE622F5B7UL, 0xF5720643UL, 0x07198540UL, 6568 0x590AB964UL, 0xAB613A67UL, 0xB831C993UL, 0x4A5A4A90UL, 6569 0x9E902E7BUL, 0x6CFBAD78UL, 0x7FAB5E8CUL, 0x8DC0DD8FUL, 6570 0xE330A81AUL, 0x115B2B19UL, 0x020BD8EDUL, 0xF0605BEEUL, 6571 0x24AA3F05UL, 0xD6C1BC06UL, 0xC5914FF2UL, 0x37FACCF1UL, 6572 0x69E9F0D5UL, 0x9B8273D6UL, 0x88D28022UL, 0x7AB90321UL, 6573 0xAE7367CAUL, 0x5C18E4C9UL, 0x4F48173DUL, 0xBD23943EUL, 6574 0xF36E6F75UL, 0x0105EC76UL, 0x12551F82UL, 0xE03E9C81UL, 6575 0x34F4F86AUL, 0xC69F7B69UL, 0xD5CF889DUL, 0x27A40B9EUL, 6576 0x79B737BAUL, 0x8BDCB4B9UL, 0x988C474DUL, 0x6AE7C44EUL, 6577 0xBE2DA0A5UL, 0x4C4623A6UL, 0x5F16D052UL, 0xAD7D5351UL, 6578 }; 6580 #endif 6582 /* Example of table build routine */ 6584 #include 6585 #include 6587 #define OUTPUT_FILE "crc32cr.h" 6588 #define CRC32C_POLY 0x1EDC6F41UL 6590 static FILE *tf; 6592 static uint32_t 6593 reflect_32(uint32_t b) 6594 { 6595 int i; 6596 uint32_t rw = 0UL; 6598 for (i = 0; i < 32; i++) { 6599 if (b & 1) 6600 rw |= 1 << (31 - i); 6601 b >>= 1; 6602 } 6603 return (rw); 6604 } 6606 static uint32_t 6607 build_crc_table (int index) 6608 { 6609 int i; 6610 uint32_t rb; 6612 rb = reflect_32(index); 6614 for (i = 0; i < 8; i++) { 6615 if (rb & 0x80000000UL) 6616 rb = (rb << 1) ^ (uint32_t)CRC32C_POLY; 6617 else 6618 rb <<= 1; 6619 } 6620 return (reflect_32(rb)); 6621 } 6623 int 6624 main (void) 6625 { 6626 int i; 6628 printf("\nGenerating CRC32c table file <%s>.\n", 6629 OUTPUT_FILE); 6630 if ((tf = fopen(OUTPUT_FILE, "w")) == NULL) { 6631 printf("Unable to open %s.\n", OUTPUT_FILE); 6632 exit (1); 6633 } 6634 fprintf(tf, "#ifndef __crc32cr_h__\n"); 6635 fprintf(tf, "#define __crc32cr_h__\n\n"); 6636 fprintf(tf, "#define CRC32C_POLY 0x%08XUL\n", 6637 (uint32_t)CRC32C_POLY); 6638 fprintf(tf, 6639 "#define CRC32C(c,d) (c=(c>>8)^crc_c[(c^(d))&0xFF])\n"); 6640 fprintf(tf, "\nuint32_t crc_c[256] =\n{\n"); 6641 for (i = 0; i < 256; i++) { 6642 fprintf(tf, "0x%08XUL,", build_crc_table (i)); 6643 if ((i & 3) == 3) 6644 fprintf(tf, "\n"); 6645 else 6646 fprintf(tf, " "); 6647 } 6648 fprintf(tf, "};\n\n#endif\n"); 6650 if (fclose(tf) != 0) 6651 printf("Unable to close <%s>.\n", OUTPUT_FILE); 6652 else 6653 printf("\nThe CRC32c table has been written to <%s>.\n", 6654 OUTPUT_FILE); 6655 return (0); 6656 } 6658 /* Example of crc insertion */ 6660 #include "crc32cr.h" 6662 uint32_t 6663 generate_crc32c(unsigned char *buffer, unsigned int length) 6664 { 6665 unsigned int i; 6666 uint32_t crc32 = 0xffffffffUL; 6667 uint32_t result; 6668 uint8_t byte0, byte1, byte2, byte3; 6670 for (i = 0; i < length; i++) { 6671 CRC32C(crc32, buffer[i]); 6672 } 6674 result = ~crc32; 6676 /* result now holds the negated polynomial remainder, 6677 * since the table and algorithm are "reflected" [williams95]. 6678 * That is, result has the same value as if we mapped the message 6679 * to a polynomial, computed the host-bit-order polynomial 6680 * remainder, performed final negation, and then did an 6681 * end-for-end bit-reversal. 6682 * Note that a 32-bit bit-reversal is identical to four in-place 6683 * 8-bit bit-reversals followed by an end-for-end byteswap. 6684 * In other words, the bits of each byte are in the right order, 6685 * but the bytes have been byteswapped. So, we now do an explicit 6686 * byteswap. On a little-endian machine, this byteswap and 6687 * the final ntohl cancel out and could be elided. 6688 */ 6690 byte0 = result & 0xff; 6691 byte1 = (result>>8) & 0xff; 6692 byte2 = (result>>16) & 0xff; 6693 byte3 = (result>>24) & 0xff; 6694 crc32 = ((byte0 << 24) | 6695 (byte1 << 16) | 6696 (byte2 << 8) | 6697 byte3); 6698 return (crc32); 6699 } 6701 int 6702 insert_crc32(unsigned char *buffer, unsigned int length) 6703 { 6704 SCTP_message *message; 6705 uint32_t crc32; 6706 message = (SCTP_message *) buffer; 6707 message->common_header.checksum = 0UL; 6708 crc32 = generate_crc32c(buffer,length); 6709 /* and insert it into the message */ 6710 message->common_header.checksum = htonl(crc32); 6711 return (1); 6712 } 6714 int 6715 validate_crc32(unsigned char *buffer, unsigned int length) 6716 { 6717 SCTP_message *message; 6718 unsigned int i; 6719 uint32_t original_crc32; 6720 uint32_t crc32; 6722 /* save and zero checksum */ 6723 message = (SCTP_message *)buffer; 6724 original_crc32 = ntohl(message->common_header.checksum); 6725 message->common_header.checksum = 0L; 6726 crc32 = generate_crc32c(buffer, length); 6727 return ((original_crc32 == crc32) ? 1 : -1); 6728 } 6729 6731 Appendix C. ICMP Handling 6733 Whenever an ICMP message is received by an SCTP endpoint, the 6734 following procedures MUST be followed to ensure proper utilization of 6735 the information being provided by layer 3. 6737 ICMP1) An implementation MAY ignore all ICMPv4 messages where the 6738 type field is not set to "Destination Unreachable". 6740 ICMP2) An implementation MAY ignore all ICMPv6 messages where the 6741 type field is not "Destination Unreachable", "Parameter 6742 Problem", or "Packet Too Big". 6744 ICMP3) An implementation SHOULD ignore any ICMP messages where the 6745 code indicates "Port Unreachable". 6747 ICMP4) An implementation MAY ignore all ICMPv6 messages of type 6748 "Parameter Problem" if the code is not "Unrecognized Next 6749 Header Type Encountered". 6751 ICMP5) An implementation MUST use the payload of the ICMP message 6752 (v4 or v6) to locate the association that sent the message to 6753 which ICMP is responding. If the association cannot be 6754 found, an implementation SHOULD ignore the ICMP message. 6756 ICMP6) An implementation MUST validate that the Verification Tag 6757 contained in the ICMP message matches the Verification Tag of 6758 the peer. If the Verification Tag is not 0 and does NOT 6759 match, discard the ICMP message. If it is 0 and the ICMP 6760 message contains enough bytes to verify that the chunk type 6761 is an INIT chunk and that the Initiate Tag matches the tag of 6762 the peer, continue with ICMP7. If the ICMP message is too 6763 short or the chunk type or the Initiate Tag does not match, 6764 silently discard the packet. 6766 ICMP7) If the ICMP message is either a v6 "Packet Too Big" or a v4 6767 "Fragmentation Needed", an implementation MAY process this 6768 information as defined for PMTU discovery. 6770 ICMP8) If the ICMP code is an "Unrecognized Next Header Type 6771 Encountered" or a "Protocol Unreachable", an implementation 6772 MUST treat this message as an abort with the T bit set if it 6773 does not contain an INIT chunk. If it does contain an INIT 6774 chunk and the association is in the COOKIE-WAIT state, handle 6775 the ICMP message like an ABORT. 6777 ICMP9) If the ICMP type is "Destination Unreachable", the 6778 implementation MAY move the destination to the unreachable 6779 state or, alternatively, increment the path error counter. 6780 SCTP MAY provide information to the upper layer indicating 6781 the reception of ICMP messages when reporting a network 6782 status change. 6784 Note that these procedures differ from [RFC1122] and from its 6785 requirements for processing of port-unreachable messages and the 6786 requirements that an implementation MUST abort associations in 6787 response to a "protocol unreachable" message. Port-unreachable 6788 messages are not processed, since an implementation will send an 6789 ABORT, not a port unreachable. The stricter handling of the 6790 "protocol unreachable" message is due to security concerns for hosts 6791 that do NOT support SCTP. 6793 Authors' Addresses 6795 Randall R. Stewart 6796 Netflix, Inc. 6797 2455 Heritage Green Ave 6798 Davenport, FL 33837 6799 United States 6801 Email: randall@lakerest.net 6803 Michael Tuexen 6804 Muenster University of Applied Sciences 6805 Stegerwaldstrasse 39 6806 Steinfurt 48565 6807 Germany 6809 Email: tuexen@fh-muenster.de 6811 Karen E. E. Nielsen 6812 Kamstrup A/S 6813 Industrivej 28 6814 Skanderborg DK-8660 6815 Denmark 6817 Email: kee@kamstrup.com