Austin Schuh | 8d0a285 | 2019-12-28 22:54:28 -0800 | [diff] [blame^] | 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | Network Working Group R. Stewart, Ed. |
| 8 | Request for Comments: 4960 September 2007 |
| 9 | Obsoletes: 2960, 3309 |
| 10 | Category: Standards Track |
| 11 | |
| 12 | |
| 13 | Stream Control Transmission Protocol |
| 14 | |
| 15 | Status of This Memo |
| 16 | |
| 17 | This document specifies an Internet standards track protocol for the |
| 18 | Internet community, and requests discussion and suggestions for |
| 19 | improvements. Please refer to the current edition of the "Internet |
| 20 | Official Protocol Standards" (STD 1) for the standardization state |
| 21 | and status of this protocol. Distribution of this memo is unlimited. |
| 22 | |
| 23 | Abstract |
| 24 | |
| 25 | This document obsoletes RFC 2960 and RFC 3309. It describes the |
| 26 | Stream Control Transmission Protocol (SCTP). SCTP is designed to |
| 27 | transport Public Switched Telephone Network (PSTN) signaling messages |
| 28 | over IP networks, but is capable of broader applications. |
| 29 | |
| 30 | SCTP is a reliable transport protocol operating on top of a |
| 31 | connectionless packet network such as IP. It offers the following |
| 32 | services to its users: |
| 33 | |
| 34 | -- acknowledged error-free non-duplicated transfer of user data, |
| 35 | |
| 36 | -- data fragmentation to conform to discovered path MTU size, |
| 37 | |
| 38 | -- sequenced delivery of user messages within multiple streams, with |
| 39 | an option for order-of-arrival delivery of individual user |
| 40 | messages, |
| 41 | |
| 42 | -- optional bundling of multiple user messages into a single SCTP |
| 43 | packet, and |
| 44 | |
| 45 | -- network-level fault tolerance through supporting of multi-homing |
| 46 | at either or both ends of an association. |
| 47 | |
| 48 | The design of SCTP includes appropriate congestion avoidance behavior |
| 49 | and resistance to flooding and masquerade attacks. |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | Stewart Standards Track [Page 1] |
| 59 | |
| 60 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 61 | |
| 62 | |
| 63 | Table of Contents |
| 64 | |
| 65 | 1. Introduction ....................................................5 |
| 66 | 1.1. Motivation .................................................5 |
| 67 | 1.2. Architectural View of SCTP .................................6 |
| 68 | 1.3. Key Terms ..................................................6 |
| 69 | 1.4. Abbreviations .............................................10 |
| 70 | 1.5. Functional View of SCTP ...................................10 |
| 71 | 1.5.1. Association Startup and Takedown ...................11 |
| 72 | 1.5.2. Sequenced Delivery within Streams ..................12 |
| 73 | 1.5.3. User Data Fragmentation ............................12 |
| 74 | 1.5.4. Acknowledgement and Congestion Avoidance ...........12 |
| 75 | 1.5.5. Chunk Bundling .....................................13 |
| 76 | 1.5.6. Packet Validation ..................................13 |
| 77 | 1.5.7. Path Management ....................................13 |
| 78 | 1.6. Serial Number Arithmetic ..................................14 |
| 79 | 1.7. Changes from RFC 2960 .....................................15 |
| 80 | 2. Conventions ....................................................15 |
| 81 | 3. SCTP Packet Format .............................................15 |
| 82 | 3.1. SCTP Common Header Field Descriptions .....................16 |
| 83 | 3.2. Chunk Field Descriptions ..................................17 |
| 84 | 3.2.1. Optional/Variable-Length Parameter Format ..........19 |
| 85 | 3.2.2. Reporting of Unrecognized Parameters ...............21 |
| 86 | 3.3. SCTP Chunk Definitions ....................................21 |
| 87 | 3.3.1. Payload Data (DATA) (0) ............................22 |
| 88 | 3.3.2. Initiation (INIT) (1) ..............................24 |
| 89 | 3.3.2.1. Optional/Variable-Length |
| 90 | Parameters in INIT ........................27 |
| 91 | 3.3.3. Initiation Acknowledgement (INIT ACK) (2) ..........30 |
| 92 | 3.3.3.1. Optional or Variable-Length Parameters ....33 |
| 93 | 3.3.4. Selective Acknowledgement (SACK) (3) ...............34 |
| 94 | 3.3.5. Heartbeat Request (HEARTBEAT) (4) ..................38 |
| 95 | 3.3.6. Heartbeat Acknowledgement (HEARTBEAT ACK) (5) ......39 |
| 96 | 3.3.7. Abort Association (ABORT) (6) ......................40 |
| 97 | 3.3.8. Shutdown Association (SHUTDOWN) (7) ................41 |
| 98 | 3.3.9. Shutdown Acknowledgement (SHUTDOWN ACK) (8) ........41 |
| 99 | 3.3.10. Operation Error (ERROR) (9) .......................42 |
| 100 | 3.3.10.1. Invalid Stream Identifier (1) ............44 |
| 101 | 3.3.10.2. Missing Mandatory Parameter (2) ..........44 |
| 102 | 3.3.10.3. Stale Cookie Error (3) ...................45 |
| 103 | 3.3.10.4. Out of Resource (4) ......................45 |
| 104 | 3.3.10.5. Unresolvable Address (5) .................46 |
| 105 | 3.3.10.6. Unrecognized Chunk Type (6) ..............46 |
| 106 | 3.3.10.7. Invalid Mandatory Parameter (7) ..........47 |
| 107 | 3.3.10.8. Unrecognized Parameters (8) ..............47 |
| 108 | 3.3.10.9. No User Data (9) .........................48 |
| 109 | 3.3.10.10. Cookie Received While Shutting |
| 110 | Down (10) ...............................48 |
| 111 | |
| 112 | |
| 113 | |
| 114 | Stewart Standards Track [Page 2] |
| 115 | |
| 116 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 117 | |
| 118 | |
| 119 | 3.3.10.11. Restart of an Association with |
| 120 | New Addresses (11) ......................49 |
| 121 | 3.3.10.12. User-Initiated Abort (12) ...............49 |
| 122 | 3.3.10.13. Protocol Violation (13) .................50 |
| 123 | 3.3.11. Cookie Echo (COOKIE ECHO) (10) ....................50 |
| 124 | 3.3.12. Cookie Acknowledgement (COOKIE ACK) (11) ..........51 |
| 125 | 3.3.13. Shutdown Complete (SHUTDOWN COMPLETE) (14) ........51 |
| 126 | 4. SCTP Association State Diagram .................................52 |
| 127 | 5. Association Initialization .....................................56 |
| 128 | 5.1. Normal Establishment of an Association ....................56 |
| 129 | 5.1.1. Handle Stream Parameters ...........................58 |
| 130 | 5.1.2. Handle Address Parameters ..........................58 |
| 131 | 5.1.3. Generating State Cookie ............................61 |
| 132 | 5.1.4. State Cookie Processing ............................62 |
| 133 | 5.1.5. State Cookie Authentication ........................62 |
| 134 | 5.1.6. An Example of Normal Association Establishment .....64 |
| 135 | 5.2. Handle Duplicate or Unexpected INIT, INIT ACK, |
| 136 | COOKIE ECHO, and ..........................................65 |
| 137 | 5.2.1. INIT Received in COOKIE-WAIT or |
| 138 | COOKIE-ECHOED State (Item B) .......................66 |
| 139 | 5.2.2. Unexpected INIT in States Other than |
| 140 | CLOSED, COOKIE-ECHOED, .............................66 |
| 141 | 5.2.3. Unexpected INIT ACK ................................67 |
| 142 | 5.2.4. Handle a COOKIE ECHO when a TCB Exists .............67 |
| 143 | 5.2.4.1. An Example of a Association Restart .......69 |
| 144 | 5.2.5. Handle Duplicate COOKIE-ACK. .......................71 |
| 145 | 5.2.6. Handle Stale COOKIE Error ..........................71 |
| 146 | 5.3. Other Initialization Issues ...............................72 |
| 147 | 5.3.1. Selection of Tag Value .............................72 |
| 148 | 5.4. Path Verification .........................................72 |
| 149 | 6. User Data Transfer .............................................73 |
| 150 | 6.1. Transmission of DATA Chunks ...............................75 |
| 151 | 6.2. Acknowledgement on Reception of DATA Chunks ...............78 |
| 152 | 6.2.1. Processing a Received SACK .........................81 |
| 153 | 6.3. Management of Retransmission Timer ........................83 |
| 154 | 6.3.1. RTO Calculation ....................................83 |
| 155 | 6.3.2. Retransmission Timer Rules .........................85 |
| 156 | 6.3.3. Handle T3-rtx Expiration ...........................86 |
| 157 | 6.4. Multi-Homed SCTP Endpoints ................................87 |
| 158 | 6.4.1. Failover from an Inactive Destination Address ......88 |
| 159 | 6.5. Stream Identifier and Stream Sequence Number ..............88 |
| 160 | 6.6. Ordered and Unordered Delivery ............................88 |
| 161 | 6.7. Report Gaps in Received DATA TSNs .........................89 |
| 162 | 6.8. CRC32c Checksum Calculation ...............................90 |
| 163 | 6.9. Fragmentation and Reassembly ..............................91 |
| 164 | 6.10. Bundling .................................................92 |
| 165 | 7. Congestion Control .............................................93 |
| 166 | 7.1. SCTP Differences from TCP Congestion Control ..............94 |
| 167 | |
| 168 | |
| 169 | |
| 170 | Stewart Standards Track [Page 3] |
| 171 | |
| 172 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 173 | |
| 174 | |
| 175 | 7.2. SCTP Slow-Start and Congestion Avoidance ..................95 |
| 176 | 7.2.1. Slow-Start .........................................96 |
| 177 | 7.2.2. Congestion Avoidance ...............................97 |
| 178 | 7.2.3. Congestion Control .................................98 |
| 179 | 7.2.4. Fast Retransmit on Gap Reports .....................98 |
| 180 | 7.3. Path MTU Discovery .......................................100 |
| 181 | 8. Fault Management ..............................................100 |
| 182 | 8.1. Endpoint Failure Detection ...............................100 |
| 183 | 8.2. Path Failure Detection ...................................101 |
| 184 | 8.3. Path Heartbeat ...........................................102 |
| 185 | 8.4. Handle "Out of the Blue" Packets .........................104 |
| 186 | 8.5. Verification Tag .........................................105 |
| 187 | 8.5.1. Exceptions in Verification Tag Rules ..............105 |
| 188 | 9. Termination of Association ....................................106 |
| 189 | 9.1. Abort of an Association ..................................107 |
| 190 | 9.2. Shutdown of an Association ...............................107 |
| 191 | 10. Interface with Upper Layer ...................................110 |
| 192 | 10.1. ULP-to-SCTP .............................................110 |
| 193 | 10.2. SCTP-to-ULP .............................................120 |
| 194 | 11. Security Considerations ......................................123 |
| 195 | 11.1. Security Objectives .....................................123 |
| 196 | 11.2. SCTP Responses to Potential Threats .....................124 |
| 197 | 11.2.1. Countering Insider Attacks .......................124 |
| 198 | 11.2.2. Protecting against Data Corruption in the |
| 199 | Network ..........................................124 |
| 200 | 11.2.3. Protecting Confidentiality .......................124 |
| 201 | 11.2.4. Protecting against Blind |
| 202 | Denial-of-Service Attacks ........................125 |
| 203 | 11.2.4.1. Flooding ................................125 |
| 204 | 11.2.4.2. Blind Masquerade ........................126 |
| 205 | 11.2.4.3. Improper Monopolization of Services .....127 |
| 206 | 11.3. SCTP Interactions with Firewalls ........................127 |
| 207 | 11.4. Protection of Non-SCTP-Capable Hosts ....................128 |
| 208 | 12. Network Management Considerations ............................128 |
| 209 | 13. Recommended Transmission Control Block (TCB) Parameters ......129 |
| 210 | 13.1. Parameters Necessary for the SCTP Instance ..............129 |
| 211 | 13.2. Parameters Necessary per Association (i.e., the TCB) ....129 |
| 212 | 13.3. Per Transport Address Data ..............................131 |
| 213 | 13.4. General Parameters Needed ...............................132 |
| 214 | 14. IANA Considerations ..........................................132 |
| 215 | 14.1. IETF-defined Chunk Extension ............................132 |
| 216 | 14.2. IETF-Defined Chunk Parameter Extension ..................133 |
| 217 | 14.3. IETF-Defined Additional Error Causes ....................133 |
| 218 | 14.4. Payload Protocol Identifiers ............................134 |
| 219 | 14.5. Port Numbers Registry ...................................134 |
| 220 | 15. Suggested SCTP Protocol Parameter Values .....................136 |
| 221 | 16. Acknowledgements .............................................137 |
| 222 | Appendix A. Explicit Congestion Notification .....................139 |
| 223 | |
| 224 | |
| 225 | |
| 226 | Stewart Standards Track [Page 4] |
| 227 | |
| 228 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 229 | |
| 230 | |
| 231 | Appendix B. CRC32c Checksum Calculation ..........................140 |
| 232 | Appendix C. ICMP Handling ........................................142 |
| 233 | References .......................................................149 |
| 234 | Normative References ..........................................149 |
| 235 | Informative References ........................................150 |
| 236 | |
| 237 | 1. Introduction |
| 238 | |
| 239 | This section explains the reasoning behind the development of the |
| 240 | Stream Control Transmission Protocol (SCTP), the services it offers, |
| 241 | and the basic concepts needed to understand the detailed description |
| 242 | of the protocol. |
| 243 | |
| 244 | This document obsoletes [RFC2960] and [RFC3309]. |
| 245 | |
| 246 | 1.1. Motivation |
| 247 | |
| 248 | TCP [RFC0793] has performed immense service as the primary means of |
| 249 | reliable data transfer in IP networks. However, an increasing number |
| 250 | of recent applications have found TCP too limiting, and have |
| 251 | incorporated their own reliable data transfer protocol on top of UDP |
| 252 | [RFC0768]. The limitations that users have wished to bypass include |
| 253 | the following: |
| 254 | |
| 255 | -- TCP provides both reliable data transfer and strict order-of- |
| 256 | transmission delivery of data. Some applications need reliable |
| 257 | transfer without sequence maintenance, while others would be |
| 258 | satisfied with partial ordering of the data. In both of these |
| 259 | cases, the head-of-line blocking offered by TCP causes unnecessary |
| 260 | delay. |
| 261 | |
| 262 | -- The stream-oriented nature of TCP is often an inconvenience. |
| 263 | Applications must add their own record marking to delineate their |
| 264 | messages, and must make explicit use of the push facility to |
| 265 | ensure that a complete message is transferred in a reasonable |
| 266 | time. |
| 267 | |
| 268 | -- The limited scope of TCP sockets complicates the task of providing |
| 269 | highly-available data transfer capability using multi-homed hosts. |
| 270 | |
| 271 | -- TCP is relatively vulnerable to denial-of-service attacks, such as |
| 272 | SYN attacks. |
| 273 | |
| 274 | Transport of PSTN signaling across the IP network is an application |
| 275 | for which all of these limitations of TCP are relevant. While this |
| 276 | application directly motivated the development of SCTP, other |
| 277 | applications may find SCTP a good match to their requirements. |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | Stewart Standards Track [Page 5] |
| 283 | |
| 284 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 285 | |
| 286 | |
| 287 | 1.2. Architectural View of SCTP |
| 288 | |
| 289 | SCTP is viewed as a layer between the SCTP user application ("SCTP |
| 290 | user" for short) and a connectionless packet network service such as |
| 291 | IP. The remainder of this document assumes SCTP runs on top of IP. |
| 292 | The basic service offered by SCTP is the reliable transfer of user |
| 293 | messages between peer SCTP users. It performs this service within |
| 294 | the context of an association between two SCTP endpoints. Section 10 |
| 295 | of this document sketches the API that should exist at the boundary |
| 296 | between the SCTP and the SCTP user layers. |
| 297 | |
| 298 | SCTP is connection-oriented in nature, but the SCTP association is a |
| 299 | broader concept than the TCP connection. SCTP provides the means for |
| 300 | each SCTP endpoint (Section 1.3) to provide the other endpoint |
| 301 | (during association startup) with a list of transport addresses |
| 302 | (i.e., multiple IP addresses in combination with an SCTP port) |
| 303 | through which that endpoint can be reached and from which it will |
| 304 | originate SCTP packets. The association spans transfers over all of |
| 305 | the possible source/destination combinations that may be generated |
| 306 | from each endpoint's lists. |
| 307 | |
| 308 | _____________ _____________ |
| 309 | | SCTP User | | SCTP User | |
| 310 | | Application | | Application | |
| 311 | |-------------| |-------------| |
| 312 | | SCTP | | SCTP | |
| 313 | | Transport | | Transport | |
| 314 | | Service | | Service | |
| 315 | |-------------| |-------------| |
| 316 | | |One or more ---- One or more| | |
| 317 | | IP Network |IP address \/ IP address| IP Network | |
| 318 | | Service |appearances /\ appearances| Service | |
| 319 | |_____________| ---- |_____________| |
| 320 | |
| 321 | SCTP Node A |<-------- Network transport ------->| SCTP Node B |
| 322 | |
| 323 | Figure 1: An SCTP Association |
| 324 | |
| 325 | 1.3. Key Terms |
| 326 | |
| 327 | Some of the language used to describe SCTP has been introduced in the |
| 328 | previous sections. This section provides a consolidated list of the |
| 329 | key terms and their definitions. |
| 330 | |
| 331 | o Active destination transport address: A transport address on a |
| 332 | peer endpoint that a transmitting endpoint considers available for |
| 333 | receiving user messages. |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | Stewart Standards Track [Page 6] |
| 339 | |
| 340 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 341 | |
| 342 | |
| 343 | o Bundling: An optional multiplexing operation, whereby more than |
| 344 | one user message may be carried in the same SCTP packet. Each |
| 345 | user message occupies its own DATA chunk. |
| 346 | |
| 347 | o Chunk: A unit of information within an SCTP packet, consisting of |
| 348 | a chunk header and chunk-specific content. |
| 349 | |
| 350 | o Congestion window (cwnd): An SCTP variable that limits the data, |
| 351 | in number of bytes, a sender can send to a particular destination |
| 352 | transport address before receiving an acknowledgement. |
| 353 | |
| 354 | o Cumulative TSN Ack Point: The TSN of the last DATA chunk |
| 355 | acknowledged via the Cumulative TSN Ack field of a SACK. |
| 356 | |
| 357 | o Idle destination address: An address that has not had user |
| 358 | messages sent to it within some length of time, normally the |
| 359 | HEARTBEAT interval or greater. |
| 360 | |
| 361 | o Inactive destination transport address: An address that is |
| 362 | considered inactive due to errors and unavailable to transport |
| 363 | user messages. |
| 364 | |
| 365 | o Message = user message: Data submitted to SCTP by the Upper Layer |
| 366 | Protocol (ULP). |
| 367 | |
| 368 | o Message Authentication Code (MAC): An integrity check mechanism |
| 369 | based on cryptographic hash functions using a secret key. |
| 370 | Typically, message authentication codes are used between two |
| 371 | parties that share a secret key in order to validate information |
| 372 | transmitted between these parties. In SCTP, it is used by an |
| 373 | endpoint to validate the State Cookie information that is returned |
| 374 | from the peer in the COOKIE ECHO chunk. The term "MAC" has |
| 375 | different meanings in different contexts. SCTP uses this term |
| 376 | with the same meaning as in [RFC2104]. |
| 377 | |
| 378 | o Network Byte Order: Most significant byte first, a.k.a., big |
| 379 | endian. |
| 380 | |
| 381 | o Ordered Message: A user message that is delivered in order with |
| 382 | respect to all previous user messages sent within the stream on |
| 383 | which the message was sent. |
| 384 | |
| 385 | o Outstanding TSN (at an SCTP endpoint): A TSN (and the associated |
| 386 | DATA chunk) that has been sent by the endpoint but for which it |
| 387 | has not yet received an acknowledgement. |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | Stewart Standards Track [Page 7] |
| 395 | |
| 396 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 397 | |
| 398 | |
| 399 | o Path: The route taken by the SCTP packets sent by one SCTP |
| 400 | endpoint to a specific destination transport address of its peer |
| 401 | SCTP endpoint. Sending to different destination transport |
| 402 | addresses does not necessarily guarantee getting separate paths. |
| 403 | |
| 404 | o Primary Path: The primary path is the destination and source |
| 405 | address that will be put into a packet outbound to the peer |
| 406 | endpoint by default. The definition includes the source address |
| 407 | since an implementation MAY wish to specify both destination and |
| 408 | source address to better control the return path taken by reply |
| 409 | chunks and on which interface the packet is transmitted when the |
| 410 | data sender is multi-homed. |
| 411 | |
| 412 | o Receiver Window (rwnd): An SCTP variable a data sender uses to |
| 413 | store the most recently calculated receiver window of its peer, in |
| 414 | number of bytes. This gives the sender an indication of the space |
| 415 | available in the receiver's inbound buffer. |
| 416 | |
| 417 | o SCTP association: A protocol relationship between SCTP endpoints, |
| 418 | composed of the two SCTP endpoints and protocol state information |
| 419 | including Verification Tags and the currently active set of |
| 420 | Transmission Sequence Numbers (TSNs), etc. An association can be |
| 421 | uniquely identified by the transport addresses used by the |
| 422 | endpoints in the association. Two SCTP endpoints MUST NOT have |
| 423 | more than one SCTP association between them at any given time. |
| 424 | |
| 425 | o SCTP endpoint: The logical sender/receiver of SCTP packets. On a |
| 426 | multi-homed host, an SCTP endpoint is represented to its peers as |
| 427 | a combination of a set of eligible destination transport addresses |
| 428 | to which SCTP packets can be sent and a set of eligible source |
| 429 | transport addresses from which SCTP packets can be received. All |
| 430 | transport addresses used by an SCTP endpoint must use the same |
| 431 | port number, but can use multiple IP addresses. A transport |
| 432 | address used by an SCTP endpoint must not be used by another SCTP |
| 433 | endpoint. In other words, a transport address is unique to an |
| 434 | SCTP endpoint. |
| 435 | |
| 436 | o SCTP packet (or packet): The unit of data delivery across the |
| 437 | interface between SCTP and the connectionless packet network |
| 438 | (e.g., IP). An SCTP packet includes the common SCTP header, |
| 439 | possible SCTP control chunks, and user data encapsulated within |
| 440 | SCTP DATA chunks. |
| 441 | |
| 442 | o SCTP user application (SCTP user): The logical higher-layer |
| 443 | application entity which uses the services of SCTP, also called |
| 444 | the Upper-Layer Protocol (ULP). |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | Stewart Standards Track [Page 8] |
| 451 | |
| 452 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 453 | |
| 454 | |
| 455 | o Slow-Start Threshold (ssthresh): An SCTP variable. This is the |
| 456 | threshold that the endpoint will use to determine whether to |
| 457 | perform slow start or congestion avoidance on a particular |
| 458 | destination transport address. Ssthresh is in number of bytes. |
| 459 | |
| 460 | o Stream: A unidirectional logical channel established from one to |
| 461 | another associated SCTP endpoint, within which all user messages |
| 462 | are delivered in sequence except for those submitted to the |
| 463 | unordered delivery service. |
| 464 | |
| 465 | Note: The relationship between stream numbers in opposite directions |
| 466 | is strictly a matter of how the applications use them. It is the |
| 467 | responsibility of the SCTP user to create and manage these |
| 468 | correlations if they are so desired. |
| 469 | |
| 470 | o Stream Sequence Number: A 16-bit sequence number used internally |
| 471 | by SCTP to ensure sequenced delivery of the user messages within a |
| 472 | given stream. One Stream Sequence Number is attached to each user |
| 473 | message. |
| 474 | |
| 475 | o Tie-Tags: Two 32-bit random numbers that together make a 64-bit |
| 476 | nonce. These tags are used within a State Cookie and TCB so that |
| 477 | a newly restarting association can be linked to the original |
| 478 | association within the endpoint that did not restart and yet not |
| 479 | reveal the true Verification Tags of an existing association. |
| 480 | |
| 481 | o Transmission Control Block (TCB): An internal data structure |
| 482 | created by an SCTP endpoint for each of its existing SCTP |
| 483 | associations to other SCTP endpoints. TCB contains all the status |
| 484 | and operational information for the endpoint to maintain and |
| 485 | manage the corresponding association. |
| 486 | |
| 487 | o Transmission Sequence Number (TSN): A 32-bit sequence number used |
| 488 | internally by SCTP. One TSN is attached to each chunk containing |
| 489 | user data to permit the receiving SCTP endpoint to acknowledge its |
| 490 | receipt and detect duplicate deliveries. |
| 491 | |
| 492 | o Transport address: A transport address is traditionally defined by |
| 493 | a network-layer address, a transport-layer protocol, and a |
| 494 | transport-layer port number. In the case of SCTP running over IP, |
| 495 | a transport address is defined by the combination of an IP address |
| 496 | and an SCTP port number (where SCTP is the transport protocol). |
| 497 | |
| 498 | o Unacknowledged TSN (at an SCTP endpoint): A TSN (and the |
| 499 | associated DATA chunk) that has been received by the endpoint but |
| 500 | for which an acknowledgement has not yet been sent. Or in the |
| 501 | opposite case, for a packet that has been sent but no |
| 502 | acknowledgement has been received. |
| 503 | |
| 504 | |
| 505 | |
| 506 | Stewart Standards Track [Page 9] |
| 507 | |
| 508 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 509 | |
| 510 | |
| 511 | o Unordered Message: Unordered messages are "unordered" with respect |
| 512 | to any other message; this includes both other unordered messages |
| 513 | as well as other ordered messages. An unordered message might be |
| 514 | delivered prior to or later than ordered messages sent on the same |
| 515 | stream. |
| 516 | |
| 517 | o User message: The unit of data delivery across the interface |
| 518 | between SCTP and its user. |
| 519 | |
| 520 | o Verification Tag: A 32-bit unsigned integer that is randomly |
| 521 | generated. The Verification Tag provides a key that allows a |
| 522 | receiver to verify that the SCTP packet belongs to the current |
| 523 | association and is not an old or stale packet from a previous |
| 524 | association. |
| 525 | |
| 526 | 1.4. Abbreviations |
| 527 | |
| 528 | MAC - Message Authentication Code [RFC2104] |
| 529 | |
| 530 | RTO - Retransmission Timeout |
| 531 | |
| 532 | RTT - Round-Trip Time |
| 533 | |
| 534 | RTTVAR - Round-Trip Time Variation |
| 535 | |
| 536 | SCTP - Stream Control Transmission Protocol |
| 537 | |
| 538 | SRTT - Smoothed RTT |
| 539 | |
| 540 | TCB - Transmission Control Block |
| 541 | |
| 542 | TLV - Type-Length-Value coding format |
| 543 | |
| 544 | TSN - Transmission Sequence Number |
| 545 | |
| 546 | ULP - Upper-Layer Protocol |
| 547 | |
| 548 | 1.5. Functional View of SCTP |
| 549 | |
| 550 | The SCTP transport service can be decomposed into a number of |
| 551 | functions. These are depicted in Figure 2 and explained in the |
| 552 | remainder of this section. |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | Stewart Standards Track [Page 10] |
| 563 | |
| 564 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 565 | |
| 566 | |
| 567 | SCTP User Application |
| 568 | |
| 569 | ----------------------------------------------------- |
| 570 | _____________ ____________________ |
| 571 | | | | Sequenced Delivery | |
| 572 | | Association | | within Streams | |
| 573 | | | |____________________| |
| 574 | | Startup | |
| 575 | | | ____________________________ |
| 576 | | and | | User Data Fragmentation | |
| 577 | | | |____________________________| |
| 578 | | Takedown | |
| 579 | | | ____________________________ |
| 580 | | | | Acknowledgement | |
| 581 | | | | and | |
| 582 | | | | Congestion Avoidance | |
| 583 | | | |____________________________| |
| 584 | | | |
| 585 | | | ____________________________ |
| 586 | | | | Chunk Bundling | |
| 587 | | | |____________________________| |
| 588 | | | |
| 589 | | | ________________________________ |
| 590 | | | | Packet Validation | |
| 591 | | | |________________________________| |
| 592 | | | |
| 593 | | | ________________________________ |
| 594 | | | | Path Management | |
| 595 | |_____________| |________________________________| |
| 596 | |
| 597 | Figure 2: Functional View of the SCTP Transport Service |
| 598 | |
| 599 | 1.5.1. Association Startup and Takedown |
| 600 | |
| 601 | An association is initiated by a request from the SCTP user (see the |
| 602 | description of the ASSOCIATE (or SEND) primitive in Section 10). |
| 603 | |
| 604 | A cookie mechanism, similar to one described by Karn and Simpson in |
| 605 | [RFC2522], is employed during the initialization to provide |
| 606 | protection against synchronization attacks. The cookie mechanism |
| 607 | uses a four-way handshake, the last two legs of which are allowed to |
| 608 | carry user data for fast setup. The startup sequence is described in |
| 609 | Section 5 of this document. |
| 610 | |
| 611 | SCTP provides for graceful close (i.e., shutdown) of an active |
| 612 | association on request from the SCTP user. See the description of |
| 613 | the SHUTDOWN primitive in Section 10. SCTP also allows ungraceful |
| 614 | close (i.e., abort), either on request from the user (ABORT |
| 615 | |
| 616 | |
| 617 | |
| 618 | Stewart Standards Track [Page 11] |
| 619 | |
| 620 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 621 | |
| 622 | |
| 623 | primitive) or as a result of an error condition detected within the |
| 624 | SCTP layer. Section 9 describes both the graceful and the ungraceful |
| 625 | close procedures. |
| 626 | |
| 627 | SCTP does not support a half-open state (like TCP) wherein one side |
| 628 | may continue sending data while the other end is closed. When either |
| 629 | endpoint performs a shutdown, the association on each peer will stop |
| 630 | accepting new data from its user and only deliver data in queue at |
| 631 | the time of the graceful close (see Section 9). |
| 632 | |
| 633 | 1.5.2. Sequenced Delivery within Streams |
| 634 | |
| 635 | The term "stream" is used in SCTP to refer to a sequence of user |
| 636 | messages that are to be delivered to the upper-layer protocol in |
| 637 | order with respect to other messages within the same stream. This is |
| 638 | in contrast to its usage in TCP, where it refers to a sequence of |
| 639 | bytes (in this document, a byte is assumed to be 8 bits). |
| 640 | |
| 641 | The SCTP user can specify at association startup time the number of |
| 642 | streams to be supported by the association. This number is |
| 643 | negotiated with the remote end (see Section 5.1.1). User messages |
| 644 | are associated with stream numbers (SEND, RECEIVE primitives, Section |
| 645 | 10). Internally, SCTP assigns a Stream Sequence Number to each |
| 646 | message passed to it by the SCTP user. On the receiving side, SCTP |
| 647 | ensures that messages are delivered to the SCTP user in sequence |
| 648 | within a given stream. However, while one stream may be blocked |
| 649 | waiting for the next in-sequence user message, delivery from other |
| 650 | streams may proceed. |
| 651 | |
| 652 | SCTP provides a mechanism for bypassing the sequenced delivery |
| 653 | service. User messages sent using this mechanism are delivered to |
| 654 | the SCTP user as soon as they are received. |
| 655 | |
| 656 | 1.5.3. User Data Fragmentation |
| 657 | |
| 658 | When needed, SCTP fragments user messages to ensure that the SCTP |
| 659 | packet passed to the lower layer conforms to the path MTU. On |
| 660 | receipt, fragments are reassembled into complete messages before |
| 661 | being passed to the SCTP user. |
| 662 | |
| 663 | 1.5.4. Acknowledgement and Congestion Avoidance |
| 664 | |
| 665 | SCTP assigns a Transmission Sequence Number (TSN) to each user data |
| 666 | fragment or unfragmented message. The TSN is independent of any |
| 667 | Stream Sequence Number assigned at the stream level. The receiving |
| 668 | end acknowledges all TSNs received, even if there are gaps in the |
| 669 | sequence. In this way, reliable delivery is kept functionally |
| 670 | separate from sequenced stream delivery. |
| 671 | |
| 672 | |
| 673 | |
| 674 | Stewart Standards Track [Page 12] |
| 675 | |
| 676 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 677 | |
| 678 | |
| 679 | The acknowledgement and congestion avoidance function is responsible |
| 680 | for packet retransmission when timely acknowledgement has not been |
| 681 | received. Packet retransmission is conditioned by congestion |
| 682 | avoidance procedures similar to those used for TCP. See Section 6 |
| 683 | and Section 7 for a detailed description of the protocol procedures |
| 684 | associated with this function. |
| 685 | |
| 686 | 1.5.5. Chunk Bundling |
| 687 | |
| 688 | As described in Section 3, the SCTP packet as delivered to the lower |
| 689 | layer consists of a common header followed by one or more chunks. |
| 690 | Each chunk may contain either user data or SCTP control information. |
| 691 | The SCTP user has the option to request bundling of more than one |
| 692 | user message into a single SCTP packet. The chunk bundling function |
| 693 | of SCTP is responsible for assembly of the complete SCTP packet and |
| 694 | its disassembly at the receiving end. |
| 695 | |
| 696 | During times of congestion, an SCTP implementation MAY still perform |
| 697 | bundling even if the user has requested that SCTP not bundle. The |
| 698 | user's disabling of bundling only affects SCTP implementations that |
| 699 | may delay a small period of time before transmission (to attempt to |
| 700 | encourage bundling). When the user layer disables bundling, this |
| 701 | small delay is prohibited but not bundling that is performed during |
| 702 | congestion or retransmission. |
| 703 | |
| 704 | 1.5.6. Packet Validation |
| 705 | |
| 706 | A mandatory Verification Tag field and a 32-bit checksum field (see |
| 707 | Appendix B for a description of the CRC32c checksum) are included in |
| 708 | the SCTP common header. The Verification Tag value is chosen by each |
| 709 | end of the association during association startup. Packets received |
| 710 | without the expected Verification Tag value are discarded, as a |
| 711 | protection against blind masquerade attacks and against stale SCTP |
| 712 | packets from a previous association. The CRC32c checksum should be |
| 713 | set by the sender of each SCTP packet to provide additional |
| 714 | protection against data corruption in the network. The receiver of |
| 715 | an SCTP packet with an invalid CRC32c checksum silently discards the |
| 716 | packet. |
| 717 | |
| 718 | 1.5.7. Path Management |
| 719 | |
| 720 | The sending SCTP user is able to manipulate the set of transport |
| 721 | addresses used as destinations for SCTP packets through the |
| 722 | primitives described in Section 10. The SCTP path management |
| 723 | function chooses the destination transport address for each outgoing |
| 724 | SCTP packet based on the SCTP user's instructions and the currently |
| 725 | perceived reachability status of the eligible destination set. The |
| 726 | path management function monitors reachability through heartbeats |
| 727 | |
| 728 | |
| 729 | |
| 730 | Stewart Standards Track [Page 13] |
| 731 | |
| 732 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 733 | |
| 734 | |
| 735 | when other packet traffic is inadequate to provide this information |
| 736 | and advises the SCTP user when reachability of any far-end transport |
| 737 | address changes. The path management function is also responsible |
| 738 | for reporting the eligible set of local transport addresses to the |
| 739 | far end during association startup, and for reporting the transport |
| 740 | addresses returned from the far end to the SCTP user. |
| 741 | |
| 742 | At association startup, a primary path is defined for each SCTP |
| 743 | endpoint, and is used for normal sending of SCTP packets. |
| 744 | |
| 745 | On the receiving end, the path management is responsible for |
| 746 | verifying the existence of a valid SCTP association to which the |
| 747 | inbound SCTP packet belongs before passing it for further processing. |
| 748 | |
| 749 | Note: Path Management and Packet Validation are done at the same |
| 750 | time, so although described separately above, in reality they cannot |
| 751 | be performed as separate items. |
| 752 | |
| 753 | 1.6. Serial Number Arithmetic |
| 754 | |
| 755 | It is essential to remember that the actual Transmission Sequence |
| 756 | Number space is finite, though very large. This space ranges from 0 |
| 757 | to 2**32 - 1. Since the space is finite, all arithmetic dealing with |
| 758 | Transmission Sequence Numbers must be performed modulo 2**32. This |
| 759 | unsigned arithmetic preserves the relationship of sequence numbers as |
| 760 | they cycle from 2**32 - 1 to 0 again. There are some subtleties to |
| 761 | computer modulo arithmetic, so great care should be taken in |
| 762 | programming the comparison of such values. When referring to TSNs, |
| 763 | the symbol "=<" means "less than or equal"(modulo 2**32). |
| 764 | |
| 765 | Comparisons and arithmetic on TSNs in this document SHOULD use Serial |
| 766 | Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 32. |
| 767 | |
| 768 | An endpoint SHOULD NOT transmit a DATA chunk with a TSN that is more |
| 769 | than 2**31 - 1 above the beginning TSN of its current send window. |
| 770 | Doing so will cause problems in comparing TSNs. |
| 771 | |
| 772 | Transmission Sequence Numbers wrap around when they reach 2**32 - 1. |
| 773 | That is, the next TSN a DATA chunk MUST use after transmitting TSN = |
| 774 | 2*32 - 1 is TSN = 0. |
| 775 | |
| 776 | Any arithmetic done on Stream Sequence Numbers SHOULD use Serial |
| 777 | Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 16. |
| 778 | All other arithmetic and comparisons in this document use normal |
| 779 | arithmetic. |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 786 | Stewart Standards Track [Page 14] |
| 787 | |
| 788 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 789 | |
| 790 | |
| 791 | 1.7. Changes from RFC 2960 |
| 792 | |
| 793 | SCTP was originally defined in [RFC2960], which this document |
| 794 | obsoletes. Readers interested in the details of the various changes |
| 795 | that this document incorporates are asked to consult [RFC4460]. |
| 796 | |
| 797 | 2. Conventions |
| 798 | |
| 799 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
| 800 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
| 801 | document are to be interpreted as described in RFC 2119 [RFC2119]. |
| 802 | |
| 803 | 3. SCTP Packet Format |
| 804 | |
| 805 | An SCTP packet is composed of a common header and chunks. A chunk |
| 806 | contains either control information or user data. |
| 807 | |
| 808 | The SCTP packet format is shown below: |
| 809 | |
| 810 | 0 1 2 3 |
| 811 | 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 |
| 812 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 813 | | Common Header | |
| 814 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 815 | | Chunk #1 | |
| 816 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 817 | | ... | |
| 818 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 819 | | Chunk #n | |
| 820 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 821 | |
| 822 | Multiple chunks can be bundled into one SCTP packet up to the MTU |
| 823 | size, except for the INIT, INIT ACK, and SHUTDOWN COMPLETE chunks. |
| 824 | These chunks MUST NOT be bundled with any other chunk in a packet. |
| 825 | See Section 6.10 for more details on chunk bundling. |
| 826 | |
| 827 | If a user data message doesn't fit into one SCTP packet it can be |
| 828 | fragmented into multiple chunks using the procedure defined in |
| 829 | Section 6.9. |
| 830 | |
| 831 | All integer fields in an SCTP packet MUST be transmitted in network |
| 832 | byte order, unless otherwise stated. |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | |
| 838 | |
| 839 | |
| 840 | |
| 841 | |
| 842 | Stewart Standards Track [Page 15] |
| 843 | |
| 844 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 845 | |
| 846 | |
| 847 | 3.1. SCTP Common Header Field Descriptions |
| 848 | |
| 849 | SCTP Common Header Format |
| 850 | |
| 851 | 0 1 2 3 |
| 852 | 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 |
| 853 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 854 | | Source Port Number | Destination Port Number | |
| 855 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 856 | | Verification Tag | |
| 857 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 858 | | Checksum | |
| 859 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 860 | |
| 861 | Source Port Number: 16 bits (unsigned integer) |
| 862 | |
| 863 | This is the SCTP sender's port number. It can be used by the |
| 864 | receiver in combination with the source IP address, the SCTP |
| 865 | destination port, and possibly the destination IP address to |
| 866 | identify the association to which this packet belongs. The port |
| 867 | number 0 MUST NOT be used. |
| 868 | |
| 869 | Destination Port Number: 16 bits (unsigned integer) |
| 870 | |
| 871 | This is the SCTP port number to which this packet is destined. |
| 872 | The receiving host will use this port number to de-multiplex the |
| 873 | SCTP packet to the correct receiving endpoint/application. The |
| 874 | port number 0 MUST NOT be used. |
| 875 | |
| 876 | Verification Tag: 32 bits (unsigned integer) |
| 877 | |
| 878 | The receiver of this packet uses the Verification Tag to validate |
| 879 | the sender of this SCTP packet. On transmit, the value of this |
| 880 | Verification Tag MUST be set to the value of the Initiate Tag |
| 881 | received from the peer endpoint during the association |
| 882 | initialization, with the following exceptions: |
| 883 | |
| 884 | - A packet containing an INIT chunk MUST have a zero Verification |
| 885 | Tag. |
| 886 | |
| 887 | - A packet containing a SHUTDOWN COMPLETE chunk with the T bit |
| 888 | set MUST have the Verification Tag copied from the packet with |
| 889 | the SHUTDOWN ACK chunk. |
| 890 | |
| 891 | - A packet containing an ABORT chunk may have the verification |
| 892 | tag copied from the packet that caused the ABORT to be sent. |
| 893 | For details see Section 8.4 and Section 8.5. |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | Stewart Standards Track [Page 16] |
| 899 | |
| 900 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 901 | |
| 902 | |
| 903 | An INIT chunk MUST be the only chunk in the SCTP packet carrying it. |
| 904 | |
| 905 | Checksum: 32 bits (unsigned integer) |
| 906 | |
| 907 | This field contains the checksum of this SCTP packet. Its |
| 908 | calculation is discussed in Section 6.8. SCTP uses the CRC32c |
| 909 | algorithm as described in Appendix B for calculating the checksum. |
| 910 | |
| 911 | 3.2. Chunk Field Descriptions |
| 912 | |
| 913 | The figure below illustrates the field format for the chunks to be |
| 914 | transmitted in the SCTP packet. Each chunk is formatted with a Chunk |
| 915 | Type field, a chunk-specific Flag field, a Chunk Length field, and a |
| 916 | Value field. |
| 917 | |
| 918 | 0 1 2 3 |
| 919 | 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 |
| 920 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 921 | | Chunk Type | Chunk Flags | Chunk Length | |
| 922 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 923 | \ \ |
| 924 | / Chunk Value / |
| 925 | \ \ |
| 926 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 927 | |
| 928 | Chunk Type: 8 bits (unsigned integer) |
| 929 | |
| 930 | This field identifies the type of information contained in the |
| 931 | Chunk Value field. It takes a value from 0 to 254. The value of |
| 932 | 255 is reserved for future use as an extension field. |
| 933 | |
| 934 | The values of Chunk Types are defined as follows: |
| 935 | |
| 936 | ID Value Chunk Type |
| 937 | ----- ---------- |
| 938 | 0 - Payload Data (DATA) |
| 939 | 1 - Initiation (INIT) |
| 940 | 2 - Initiation Acknowledgement (INIT ACK) |
| 941 | 3 - Selective Acknowledgement (SACK) |
| 942 | 4 - Heartbeat Request (HEARTBEAT) |
| 943 | 5 - Heartbeat Acknowledgement (HEARTBEAT ACK) |
| 944 | 6 - Abort (ABORT) |
| 945 | 7 - Shutdown (SHUTDOWN) |
| 946 | 8 - Shutdown Acknowledgement (SHUTDOWN ACK) |
| 947 | 9 - Operation Error (ERROR) |
| 948 | 10 - State Cookie (COOKIE ECHO) |
| 949 | 11 - Cookie Acknowledgement (COOKIE ACK) |
| 950 | |
| 951 | |
| 952 | |
| 953 | |
| 954 | Stewart Standards Track [Page 17] |
| 955 | |
| 956 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 957 | |
| 958 | |
| 959 | 12 - Reserved for Explicit Congestion Notification Echo |
| 960 | (ECNE) |
| 961 | 13 - Reserved for Congestion Window Reduced (CWR) |
| 962 | 14 - Shutdown Complete (SHUTDOWN COMPLETE) |
| 963 | 15 to 62 - available |
| 964 | 63 - reserved for IETF-defined Chunk Extensions |
| 965 | 64 to 126 - available |
| 966 | 127 - reserved for IETF-defined Chunk Extensions |
| 967 | 128 to 190 - available |
| 968 | 191 - reserved for IETF-defined Chunk Extensions |
| 969 | 192 to 254 - available |
| 970 | 255 - reserved for IETF-defined Chunk Extensions |
| 971 | |
| 972 | Chunk Types are encoded such that the highest-order 2 bits specify |
| 973 | the action that must be taken if the processing endpoint does not |
| 974 | recognize the Chunk Type. |
| 975 | |
| 976 | 00 - Stop processing this SCTP packet and discard it, do not |
| 977 | process any further chunks within it. |
| 978 | |
| 979 | 01 - Stop processing this SCTP packet and discard it, do not |
| 980 | process any further chunks within it, and report the |
| 981 | unrecognized chunk in an 'Unrecognized Chunk Type'. |
| 982 | |
| 983 | 10 - Skip this chunk and continue processing. |
| 984 | |
| 985 | 11 - Skip this chunk and continue processing, but report in an |
| 986 | ERROR chunk using the 'Unrecognized Chunk Type' cause of |
| 987 | error. |
| 988 | |
| 989 | Note: The ECNE and CWR chunk types are reserved for future use of |
| 990 | Explicit Congestion Notification (ECN); see Appendix A. |
| 991 | |
| 992 | Chunk Flags: 8 bits |
| 993 | |
| 994 | The usage of these bits depends on the Chunk type as given by the |
| 995 | Chunk Type field. Unless otherwise specified, they are set to 0 |
| 996 | on transmit and are ignored on receipt. |
| 997 | |
| 998 | Chunk Length: 16 bits (unsigned integer) |
| 999 | |
| 1000 | This value represents the size of the chunk in bytes, including |
| 1001 | the Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields. |
| 1002 | Therefore, if the Chunk Value field is zero-length, the Length |
| 1003 | field will be set to 4. The Chunk Length field does not count any |
| 1004 | chunk padding. |
| 1005 | |
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | Stewart Standards Track [Page 18] |
| 1011 | |
| 1012 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1013 | |
| 1014 | |
| 1015 | Chunks (including Type, Length, and Value fields) are padded out |
| 1016 | by the sender with all zero bytes to be a multiple of 4 bytes |
| 1017 | long. This padding MUST NOT be more than 3 bytes in total. The |
| 1018 | Chunk Length value does not include terminating padding of the |
| 1019 | chunk. However, it does include padding of any variable-length |
| 1020 | parameter except the last parameter in the chunk. The receiver |
| 1021 | MUST ignore the padding. |
| 1022 | |
| 1023 | Note: A robust implementation should accept the chunk whether or |
| 1024 | not the final padding has been included in the Chunk Length. |
| 1025 | |
| 1026 | Chunk Value: variable length |
| 1027 | |
| 1028 | The Chunk Value field contains the actual information to be |
| 1029 | transferred in the chunk. The usage and format of this field is |
| 1030 | dependent on the Chunk Type. |
| 1031 | |
| 1032 | The total length of a chunk (including Type, Length, and Value |
| 1033 | fields) MUST be a multiple of 4 bytes. If the length of the chunk is |
| 1034 | not a multiple of 4 bytes, the sender MUST pad the chunk with all |
| 1035 | zero bytes, and this padding is not included in the Chunk Length |
| 1036 | field. The sender MUST NOT pad with more than 3 bytes. The receiver |
| 1037 | MUST ignore the padding bytes. |
| 1038 | |
| 1039 | SCTP-defined chunks are described in detail in Section 3.3. The |
| 1040 | guidelines for IETF-defined chunk extensions can be found in Section |
| 1041 | 14.1 of this document. |
| 1042 | |
| 1043 | 3.2.1. Optional/Variable-Length Parameter Format |
| 1044 | |
| 1045 | Chunk values of SCTP control chunks consist of a chunk-type-specific |
| 1046 | header of required fields, followed by zero or more parameters. The |
| 1047 | optional and variable-length parameters contained in a chunk are |
| 1048 | defined in a Type-Length-Value format as shown below. |
| 1049 | |
| 1050 | 0 1 2 3 |
| 1051 | 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 |
| 1052 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1053 | | Parameter Type | Parameter Length | |
| 1054 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1055 | \ \ |
| 1056 | / Parameter Value / |
| 1057 | \ \ |
| 1058 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | |
| 1063 | |
| 1064 | |
| 1065 | |
| 1066 | Stewart Standards Track [Page 19] |
| 1067 | |
| 1068 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1069 | |
| 1070 | |
| 1071 | Chunk Parameter Type: 16 bits (unsigned integer) |
| 1072 | |
| 1073 | The Type field is a 16-bit identifier of the type of parameter. |
| 1074 | It takes a value of 0 to 65534. |
| 1075 | |
| 1076 | The value of 65535 is reserved for IETF-defined extensions. |
| 1077 | Values other than those defined in specific SCTP chunk |
| 1078 | descriptions are reserved for use by IETF. |
| 1079 | |
| 1080 | Chunk Parameter Length: 16 bits (unsigned integer) |
| 1081 | |
| 1082 | The Parameter Length field contains the size of the parameter in |
| 1083 | bytes, including the Parameter Type, Parameter Length, and |
| 1084 | Parameter Value fields. Thus, a parameter with a zero-length |
| 1085 | Parameter Value field would have a Length field of 4. The |
| 1086 | Parameter Length does not include any padding bytes. |
| 1087 | |
| 1088 | Chunk Parameter Value: variable length |
| 1089 | |
| 1090 | The Parameter Value field contains the actual information to be |
| 1091 | transferred in the parameter. |
| 1092 | |
| 1093 | The total length of a parameter (including Type, Parameter Length, |
| 1094 | and Value fields) MUST be a multiple of 4 bytes. If the length of |
| 1095 | the parameter is not a multiple of 4 bytes, the sender pads the |
| 1096 | parameter at the end (i.e., after the Parameter Value field) with |
| 1097 | all zero bytes. The length of the padding is not included in the |
| 1098 | Parameter Length field. A sender MUST NOT pad with more than 3 |
| 1099 | bytes. The receiver MUST ignore the padding bytes. |
| 1100 | |
| 1101 | The Parameter Types are encoded such that the highest-order 2 bits |
| 1102 | specify the action that must be taken if the processing endpoint |
| 1103 | does not recognize the Parameter Type. |
| 1104 | |
| 1105 | 00 - Stop processing this parameter; do not process any further |
| 1106 | parameters within this chunk. |
| 1107 | |
| 1108 | 01 - Stop processing this parameter, do not process any further |
| 1109 | parameters within this chunk, and report the unrecognized |
| 1110 | parameter in an 'Unrecognized Parameter', as described in |
| 1111 | Section 3.2.2. |
| 1112 | |
| 1113 | 10 - Skip this parameter and continue processing. |
| 1114 | |
| 1115 | 11 - Skip this parameter and continue processing but report the |
| 1116 | unrecognized parameter in an 'Unrecognized Parameter', as |
| 1117 | described in Section 3.2.2. |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | Stewart Standards Track [Page 20] |
| 1123 | |
| 1124 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1125 | |
| 1126 | |
| 1127 | Please note that in all four cases, an INIT ACK or COOKIE ECHO chunk |
| 1128 | is sent. In the 00 or 01 case, the processing of the parameters |
| 1129 | after the unknown parameter is canceled, but no processing already |
| 1130 | done is rolled back. |
| 1131 | |
| 1132 | The actual SCTP parameters are defined in the specific SCTP chunk |
| 1133 | sections. The rules for IETF-defined parameter extensions are |
| 1134 | defined in Section 14.2. Note that a parameter type MUST be unique |
| 1135 | across all chunks. For example, the parameter type '5' is used to |
| 1136 | represent an IPv4 address (see Section 3.3.2.1). The value '5' then |
| 1137 | is reserved across all chunks to represent an IPv4 address and MUST |
| 1138 | NOT be reused with a different meaning in any other chunk. |
| 1139 | |
| 1140 | 3.2.2. Reporting of Unrecognized Parameters |
| 1141 | |
| 1142 | If the receiver of an INIT chunk detects unrecognized parameters and |
| 1143 | has to report them according to Section 3.2.1, it MUST put the |
| 1144 | 'Unrecognized Parameter' parameter(s) in the INIT ACK chunk sent in |
| 1145 | response to the INIT chunk. Note that if the receiver of the INIT |
| 1146 | chunk is NOT going to establish an association (e.g., due to lack of |
| 1147 | resources), an 'Unrecognized Parameter' would NOT be included with |
| 1148 | any ABORT being sent to the sender of the INIT. |
| 1149 | |
| 1150 | If the receiver of an INIT ACK chunk detects unrecognized parameters |
| 1151 | and has to report them according to Section 3.2.1, it SHOULD bundle |
| 1152 | the ERROR chunk containing the 'Unrecognized Parameters' error cause |
| 1153 | with the COOKIE ECHO chunk sent in response to the INIT ACK chunk. |
| 1154 | If the receiver of the INIT ACK cannot bundle the COOKIE ECHO chunk |
| 1155 | with the ERROR chunk, the ERROR chunk MAY be sent separately but not |
| 1156 | before the COOKIE ACK has been received. |
| 1157 | |
| 1158 | Note: Any time a COOKIE ECHO is sent in a packet, it MUST be the |
| 1159 | first chunk. |
| 1160 | |
| 1161 | 3.3. SCTP Chunk Definitions |
| 1162 | |
| 1163 | This section defines the format of the different SCTP chunk types. |
| 1164 | |
| 1165 | |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | |
| 1172 | |
| 1173 | |
| 1174 | |
| 1175 | |
| 1176 | |
| 1177 | |
| 1178 | Stewart Standards Track [Page 21] |
| 1179 | |
| 1180 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1181 | |
| 1182 | |
| 1183 | 3.3.1. Payload Data (DATA) (0) |
| 1184 | |
| 1185 | The following format MUST be used for the DATA chunk: |
| 1186 | |
| 1187 | 0 1 2 3 |
| 1188 | 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 |
| 1189 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1190 | | Type = 0 | Reserved|U|B|E| Length | |
| 1191 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1192 | | TSN | |
| 1193 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1194 | | Stream Identifier S | Stream Sequence Number n | |
| 1195 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1196 | | Payload Protocol Identifier | |
| 1197 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1198 | \ \ |
| 1199 | / User Data (seq n of Stream S) / |
| 1200 | \ \ |
| 1201 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1202 | |
| 1203 | Reserved: 5 bits |
| 1204 | |
| 1205 | Should be set to all '0's and ignored by the receiver. |
| 1206 | |
| 1207 | U bit: 1 bit |
| 1208 | |
| 1209 | The (U)nordered bit, if set to '1', indicates that this is an |
| 1210 | unordered DATA chunk, and there is no Stream Sequence Number |
| 1211 | assigned to this DATA chunk. Therefore, the receiver MUST ignore |
| 1212 | the Stream Sequence Number field. |
| 1213 | |
| 1214 | After reassembly (if necessary), unordered DATA chunks MUST be |
| 1215 | dispatched to the upper layer by the receiver without any attempt |
| 1216 | to reorder. |
| 1217 | |
| 1218 | If an unordered user message is fragmented, each fragment of the |
| 1219 | message MUST have its U bit set to '1'. |
| 1220 | |
| 1221 | B bit: 1 bit |
| 1222 | |
| 1223 | The (B)eginning fragment bit, if set, indicates the first fragment |
| 1224 | of a user message. |
| 1225 | |
| 1226 | E bit: 1 bit |
| 1227 | |
| 1228 | The (E)nding fragment bit, if set, indicates the last fragment of |
| 1229 | a user message. |
| 1230 | |
| 1231 | |
| 1232 | |
| 1233 | |
| 1234 | Stewart Standards Track [Page 22] |
| 1235 | |
| 1236 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1237 | |
| 1238 | |
| 1239 | An unfragmented user message shall have both the B and E bits set to |
| 1240 | '1'. Setting both B and E bits to '0' indicates a middle fragment of |
| 1241 | a multi-fragment user message, as summarized in the following table: |
| 1242 | |
| 1243 | B E Description |
| 1244 | ============================================================ |
| 1245 | | 1 0 | First piece of a fragmented user message | |
| 1246 | +----------------------------------------------------------+ |
| 1247 | | 0 0 | Middle piece of a fragmented user message | |
| 1248 | +----------------------------------------------------------+ |
| 1249 | | 0 1 | Last piece of a fragmented user message | |
| 1250 | +----------------------------------------------------------+ |
| 1251 | | 1 1 | Unfragmented message | |
| 1252 | ============================================================ |
| 1253 | | Table 1: Fragment Description Flags | |
| 1254 | ============================================================ |
| 1255 | |
| 1256 | When a user message is fragmented into multiple chunks, the TSNs are |
| 1257 | used by the receiver to reassemble the message. This means that the |
| 1258 | TSNs for each fragment of a fragmented user message MUST be strictly |
| 1259 | sequential. |
| 1260 | |
| 1261 | Length: 16 bits (unsigned integer) |
| 1262 | |
| 1263 | This field indicates the length of the DATA chunk in bytes from |
| 1264 | the beginning of the type field to the end of the User Data field |
| 1265 | excluding any padding. A DATA chunk with one byte of user data |
| 1266 | will have Length set to 17 (indicating 17 bytes). |
| 1267 | |
| 1268 | A DATA chunk with a User Data field of length L will have the |
| 1269 | Length field set to (16 + L) (indicating 16+L bytes) where L MUST |
| 1270 | be greater than 0. |
| 1271 | |
| 1272 | TSN: 32 bits (unsigned integer) |
| 1273 | |
| 1274 | This value represents the TSN for this DATA chunk. The valid |
| 1275 | range of TSN is from 0 to 4294967295 (2**32 - 1). TSN wraps back |
| 1276 | to 0 after reaching 4294967295. |
| 1277 | |
| 1278 | Stream Identifier S: 16 bits (unsigned integer) |
| 1279 | |
| 1280 | Identifies the stream to which the following user data belongs. |
| 1281 | |
| 1282 | Stream Sequence Number n: 16 bits (unsigned integer) |
| 1283 | |
| 1284 | This value represents the Stream Sequence Number of the following |
| 1285 | user data within the stream S. Valid range is 0 to 65535. |
| 1286 | |
| 1287 | |
| 1288 | |
| 1289 | |
| 1290 | Stewart Standards Track [Page 23] |
| 1291 | |
| 1292 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1293 | |
| 1294 | |
| 1295 | When a user message is fragmented by SCTP for transport, the same |
| 1296 | Stream Sequence Number MUST be carried in each of the fragments of |
| 1297 | the message. |
| 1298 | |
| 1299 | Payload Protocol Identifier: 32 bits (unsigned integer) |
| 1300 | |
| 1301 | This value represents an application (or upper layer) specified |
| 1302 | protocol identifier. This value is passed to SCTP by its upper |
| 1303 | layer and sent to its peer. This identifier is not used by SCTP |
| 1304 | but can be used by certain network entities, as well as by the |
| 1305 | peer application, to identify the type of information being |
| 1306 | carried in this DATA chunk. This field must be sent even in |
| 1307 | fragmented DATA chunks (to make sure it is available for agents in |
| 1308 | the middle of the network). Note that this field is NOT touched |
| 1309 | by an SCTP implementation; therefore, its byte order is NOT |
| 1310 | necessarily big endian. The upper layer is responsible for any |
| 1311 | byte order conversions to this field. |
| 1312 | |
| 1313 | The value 0 indicates that no application identifier is specified |
| 1314 | by the upper layer for this payload data. |
| 1315 | |
| 1316 | User Data: variable length |
| 1317 | |
| 1318 | This is the payload user data. The implementation MUST pad the |
| 1319 | end of the data to a 4-byte boundary with all-zero bytes. Any |
| 1320 | padding MUST NOT be included in the Length field. A sender MUST |
| 1321 | never add more than 3 bytes of padding. |
| 1322 | |
| 1323 | 3.3.2. Initiation (INIT) (1) |
| 1324 | |
| 1325 | This chunk is used to initiate an SCTP association between two |
| 1326 | endpoints. The format of the INIT chunk is shown below: |
| 1327 | |
| 1328 | |
| 1329 | |
| 1330 | |
| 1331 | |
| 1332 | |
| 1333 | |
| 1334 | |
| 1335 | |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | |
| 1343 | |
| 1344 | |
| 1345 | |
| 1346 | Stewart Standards Track [Page 24] |
| 1347 | |
| 1348 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1349 | |
| 1350 | |
| 1351 | 0 1 2 3 |
| 1352 | 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 |
| 1353 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1354 | | Type = 1 | Chunk Flags | Chunk Length | |
| 1355 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1356 | | Initiate Tag | |
| 1357 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1358 | | Advertised Receiver Window Credit (a_rwnd) | |
| 1359 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1360 | | Number of Outbound Streams | Number of Inbound Streams | |
| 1361 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1362 | | Initial TSN | |
| 1363 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1364 | \ \ |
| 1365 | / Optional/Variable-Length Parameters / |
| 1366 | \ \ |
| 1367 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1368 | |
| 1369 | The INIT chunk contains the following parameters. Unless otherwise |
| 1370 | noted, each parameter MUST only be included once in the INIT chunk. |
| 1371 | |
| 1372 | Fixed Parameters Status |
| 1373 | ---------------------------------------------- |
| 1374 | Initiate Tag Mandatory |
| 1375 | Advertised Receiver Window Credit Mandatory |
| 1376 | Number of Outbound Streams Mandatory |
| 1377 | Number of Inbound Streams Mandatory |
| 1378 | Initial TSN Mandatory |
| 1379 | |
| 1380 | Variable Parameters Status Type Value |
| 1381 | ------------------------------------------------------------- |
| 1382 | IPv4 Address (Note 1) Optional 5 IPv6 Address |
| 1383 | (Note 1) Optional 6 Cookie Preservative |
| 1384 | Optional 9 Reserved for ECN Capable (Note 2) Optional |
| 1385 | 32768 (0x8000) Host Name Address (Note 3) Optional |
| 1386 | 11 Supported Address Types (Note 4) Optional 12 |
| 1387 | |
| 1388 | Note 1: The INIT chunks can contain multiple addresses that can be |
| 1389 | IPv4 and/or IPv6 in any combination. |
| 1390 | |
| 1391 | Note 2: The ECN Capable field is reserved for future use of Explicit |
| 1392 | Congestion Notification. |
| 1393 | |
| 1394 | Note 3: An INIT chunk MUST NOT contain more than one Host Name |
| 1395 | Address parameter. Moreover, the sender of the INIT MUST NOT combine |
| 1396 | any other address types with the Host Name Address in the INIT. The |
| 1397 | receiver of INIT MUST ignore any other address types if the Host Name |
| 1398 | Address parameter is present in the received INIT chunk. |
| 1399 | |
| 1400 | |
| 1401 | |
| 1402 | Stewart Standards Track [Page 25] |
| 1403 | |
| 1404 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1405 | |
| 1406 | |
| 1407 | Note 4: This parameter, when present, specifies all the address types |
| 1408 | the sending endpoint can support. The absence of this parameter |
| 1409 | indicates that the sending endpoint can support any address type. |
| 1410 | |
| 1411 | IMPLEMENTATION NOTE: If an INIT chunk is received with known |
| 1412 | parameters that are not optional parameters of the INIT chunk, then |
| 1413 | the receiver SHOULD process the INIT chunk and send back an INIT ACK. |
| 1414 | The receiver of the INIT chunk MAY bundle an ERROR chunk with the |
| 1415 | COOKIE ACK chunk later. However, restrictive implementations MAY |
| 1416 | send back an ABORT chunk in response to the INIT chunk. |
| 1417 | |
| 1418 | The Chunk Flags field in INIT is reserved, and all bits in it should |
| 1419 | be set to 0 by the sender and ignored by the receiver. The sequence |
| 1420 | of parameters within an INIT can be processed in any order. |
| 1421 | |
| 1422 | Initiate Tag: 32 bits (unsigned integer) |
| 1423 | |
| 1424 | The receiver of the INIT (the responding end) records the value of |
| 1425 | the Initiate Tag parameter. This value MUST be placed into the |
| 1426 | Verification Tag field of every SCTP packet that the receiver of |
| 1427 | the INIT transmits within this association. |
| 1428 | |
| 1429 | The Initiate Tag is allowed to have any value except 0. See |
| 1430 | Section 5.3.1 for more on the selection of the tag value. |
| 1431 | |
| 1432 | If the value of the Initiate Tag in a received INIT chunk is found |
| 1433 | to be 0, the receiver MUST treat it as an error and close the |
| 1434 | association by transmitting an ABORT. |
| 1435 | |
| 1436 | Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned |
| 1437 | integer) |
| 1438 | |
| 1439 | This value represents the dedicated buffer space, in number of |
| 1440 | bytes, the sender of the INIT has reserved in association with |
| 1441 | this window. During the life of the association, this buffer |
| 1442 | space SHOULD NOT be lessened (i.e., dedicated buffers taken away |
| 1443 | from this association); however, an endpoint MAY change the value |
| 1444 | of a_rwnd it sends in SACK chunks. |
| 1445 | |
| 1446 | Number of Outbound Streams (OS): 16 bits (unsigned integer) |
| 1447 | |
| 1448 | Defines the number of outbound streams the sender of this INIT |
| 1449 | chunk wishes to create in this association. The value of 0 MUST |
| 1450 | NOT be used. |
| 1451 | |
| 1452 | Note: A receiver of an INIT with the OS value set to 0 SHOULD |
| 1453 | abort the association. |
| 1454 | |
| 1455 | |
| 1456 | |
| 1457 | |
| 1458 | Stewart Standards Track [Page 26] |
| 1459 | |
| 1460 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1461 | |
| 1462 | |
| 1463 | Number of Inbound Streams (MIS): 16 bits (unsigned integer) |
| 1464 | |
| 1465 | Defines the maximum number of streams the sender of this INIT |
| 1466 | chunk allows the peer end to create in this association. The |
| 1467 | value 0 MUST NOT be used. |
| 1468 | |
| 1469 | Note: There is no negotiation of the actual number of streams but |
| 1470 | instead the two endpoints will use the min(requested, offered). |
| 1471 | See Section 5.1.1 for details. |
| 1472 | |
| 1473 | Note: A receiver of an INIT with the MIS value of 0 SHOULD abort |
| 1474 | the association. |
| 1475 | |
| 1476 | Initial TSN (I-TSN): 32 bits (unsigned integer) |
| 1477 | |
| 1478 | Defines the initial TSN that the sender will use. The valid range |
| 1479 | is from 0 to 4294967295. This field MAY be set to the value of |
| 1480 | the Initiate Tag field. |
| 1481 | |
| 1482 | 3.3.2.1. Optional/Variable-Length Parameters in INIT |
| 1483 | |
| 1484 | The following parameters follow the Type-Length-Value format as |
| 1485 | defined in Section 3.2.1. Any Type-Length-Value fields MUST come |
| 1486 | after the fixed-length fields defined in the previous section. |
| 1487 | |
| 1488 | IPv4 Address Parameter (5) |
| 1489 | |
| 1490 | 0 1 2 3 |
| 1491 | 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 |
| 1492 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1493 | | Type = 5 | Length = 8 | |
| 1494 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1495 | | IPv4 Address | |
| 1496 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1497 | |
| 1498 | IPv4 Address: 32 bits (unsigned integer) |
| 1499 | |
| 1500 | Contains an IPv4 address of the sending endpoint. It is binary |
| 1501 | encoded. |
| 1502 | |
| 1503 | |
| 1504 | |
| 1505 | |
| 1506 | |
| 1507 | |
| 1508 | |
| 1509 | |
| 1510 | |
| 1511 | |
| 1512 | |
| 1513 | |
| 1514 | Stewart Standards Track [Page 27] |
| 1515 | |
| 1516 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1517 | |
| 1518 | |
| 1519 | IPv6 Address Parameter (6) |
| 1520 | |
| 1521 | 0 1 2 3 |
| 1522 | 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 |
| 1523 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1524 | | Type = 6 | Length = 20 | |
| 1525 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1526 | | | |
| 1527 | | IPv6 Address | |
| 1528 | | | |
| 1529 | | | |
| 1530 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1531 | |
| 1532 | IPv6 Address: 128 bits (unsigned integer) |
| 1533 | |
| 1534 | Contains an IPv6 [RFC2460] address of the sending endpoint. It is |
| 1535 | binary encoded. |
| 1536 | |
| 1537 | Note: A sender MUST NOT use an IPv4-mapped IPv6 address [RFC4291], |
| 1538 | but should instead use an IPv4 Address parameter for an IPv4 |
| 1539 | address. |
| 1540 | |
| 1541 | Combined with the Source Port Number in the SCTP common header, |
| 1542 | the value passed in an IPv4 or IPv6 Address parameter indicates a |
| 1543 | transport address the sender of the INIT will support for the |
| 1544 | association being initiated. That is, during the life time of |
| 1545 | this association, this IP address can appear in the source address |
| 1546 | field of an IP datagram sent from the sender of the INIT, and can |
| 1547 | be used as a destination address of an IP datagram sent from the |
| 1548 | receiver of the INIT. |
| 1549 | |
| 1550 | More than one IP Address parameter can be included in an INIT |
| 1551 | chunk when the INIT sender is multi-homed. Moreover, a multi- |
| 1552 | homed endpoint may have access to different types of network; |
| 1553 | thus, more than one address type can be present in one INIT chunk, |
| 1554 | i.e., IPv4 and IPv6 addresses are allowed in the same INIT chunk. |
| 1555 | |
| 1556 | If the INIT contains at least one IP Address parameter, then the |
| 1557 | source address of the IP datagram containing the INIT chunk and |
| 1558 | any additional address(es) provided within the INIT can be used as |
| 1559 | destinations by the endpoint receiving the INIT. If the INIT does |
| 1560 | not contain any IP Address parameters, the endpoint receiving the |
| 1561 | INIT MUST use the source address associated with the received IP |
| 1562 | datagram as its sole destination address for the association. |
| 1563 | |
| 1564 | Note that not using any IP Address parameters in the INIT and INIT |
| 1565 | ACK is an alternative to make an association more likely to work |
| 1566 | across a NAT box. |
| 1567 | |
| 1568 | |
| 1569 | |
| 1570 | Stewart Standards Track [Page 28] |
| 1571 | |
| 1572 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1573 | |
| 1574 | |
| 1575 | Cookie Preservative (9) |
| 1576 | |
| 1577 | The sender of the INIT shall use this parameter to suggest to the |
| 1578 | receiver of the INIT for a longer life-span of the State Cookie. |
| 1579 | |
| 1580 | 0 1 2 3 |
| 1581 | 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 |
| 1582 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1583 | | Type = 9 | Length = 8 | |
| 1584 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1585 | | Suggested Cookie Life-Span Increment (msec.) | |
| 1586 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1587 | |
| 1588 | Suggested Cookie Life-Span Increment: 32 bits (unsigned integer) |
| 1589 | |
| 1590 | This parameter indicates to the receiver how much increment in |
| 1591 | milliseconds the sender wishes the receiver to add to its default |
| 1592 | cookie life-span. |
| 1593 | |
| 1594 | This optional parameter should be added to the INIT chunk by the |
| 1595 | sender when it reattempts establishing an association with a peer |
| 1596 | to which its previous attempt of establishing the association |
| 1597 | failed due to a stale cookie operation error. The receiver MAY |
| 1598 | choose to ignore the suggested cookie life-span increase for its |
| 1599 | own security reasons. |
| 1600 | |
| 1601 | Host Name Address (11) |
| 1602 | |
| 1603 | The sender of INIT uses this parameter to pass its Host Name (in |
| 1604 | place of its IP addresses) to its peer. The peer is responsible for |
| 1605 | resolving the name. Using this parameter might make it more likely |
| 1606 | for the association to work across a NAT box. |
| 1607 | |
| 1608 | 0 1 2 3 |
| 1609 | 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 |
| 1610 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1611 | | Type = 11 | Length | |
| 1612 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1613 | / Host Name / |
| 1614 | \ \ |
| 1615 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1616 | |
| 1617 | Host Name: variable length |
| 1618 | |
| 1619 | This field contains a host name in "host name syntax" per RFC 1123 |
| 1620 | Section 2.1 [RFC1123]. The method for resolving the host name is |
| 1621 | out of scope of SCTP. |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | |
| 1626 | Stewart Standards Track [Page 29] |
| 1627 | |
| 1628 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1629 | |
| 1630 | |
| 1631 | Note: At least one null terminator is included in the Host Name |
| 1632 | string and must be included in the length. |
| 1633 | |
| 1634 | Supported Address Types (12) |
| 1635 | |
| 1636 | The sender of INIT uses this parameter to list all the address types |
| 1637 | it can support. |
| 1638 | |
| 1639 | 0 1 2 3 |
| 1640 | 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 |
| 1641 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1642 | | Type = 12 | Length | |
| 1643 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1644 | | Address Type #1 | Address Type #2 | |
| 1645 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1646 | | ...... | |
| 1647 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+ |
| 1648 | |
| 1649 | Address Type: 16 bits (unsigned integer) |
| 1650 | |
| 1651 | This is filled with the type value of the corresponding address |
| 1652 | TLV (e.g., IPv4 = 5, IPv6 = 6, Host name = 11). |
| 1653 | |
| 1654 | 3.3.3. Initiation Acknowledgement (INIT ACK) (2) |
| 1655 | |
| 1656 | The INIT ACK chunk is used to acknowledge the initiation of an SCTP |
| 1657 | association. |
| 1658 | |
| 1659 | The parameter part of INIT ACK is formatted similarly to the INIT |
| 1660 | chunk. It uses two extra variable parameters: The State Cookie and |
| 1661 | the Unrecognized Parameter: |
| 1662 | |
| 1663 | |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | |
| 1671 | |
| 1672 | |
| 1673 | |
| 1674 | |
| 1675 | |
| 1676 | |
| 1677 | |
| 1678 | |
| 1679 | |
| 1680 | |
| 1681 | |
| 1682 | Stewart Standards Track [Page 30] |
| 1683 | |
| 1684 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1685 | |
| 1686 | |
| 1687 | The format of the INIT ACK chunk is shown below: |
| 1688 | |
| 1689 | 0 1 2 3 |
| 1690 | 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 |
| 1691 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1692 | | Type = 2 | Chunk Flags | Chunk Length | |
| 1693 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1694 | | Initiate Tag | |
| 1695 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1696 | | Advertised Receiver Window Credit | |
| 1697 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1698 | | Number of Outbound Streams | Number of Inbound Streams | |
| 1699 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1700 | | Initial TSN | |
| 1701 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1702 | \ \ |
| 1703 | / Optional/Variable-Length Parameters / |
| 1704 | \ \ |
| 1705 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1706 | |
| 1707 | Initiate Tag: 32 bits (unsigned integer) |
| 1708 | |
| 1709 | The receiver of the INIT ACK records the value of the Initiate Tag |
| 1710 | parameter. This value MUST be placed into the Verification Tag |
| 1711 | field of every SCTP packet that the INIT ACK receiver transmits |
| 1712 | within this association. |
| 1713 | |
| 1714 | The Initiate Tag MUST NOT take the value 0. See Section 5.3.1 for |
| 1715 | more on the selection of the Initiate Tag value. |
| 1716 | |
| 1717 | If the value of the Initiate Tag in a received INIT ACK chunk is |
| 1718 | found to be 0, the receiver MUST destroy the association |
| 1719 | discarding its TCB. The receiver MAY send an ABORT for debugging |
| 1720 | purpose. |
| 1721 | |
| 1722 | Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned |
| 1723 | integer) |
| 1724 | |
| 1725 | This value represents the dedicated buffer space, in number of |
| 1726 | bytes, the sender of the INIT ACK has reserved in association with |
| 1727 | this window. During the life of the association, this buffer |
| 1728 | space SHOULD NOT be lessened (i.e., dedicated buffers taken away |
| 1729 | from this association). |
| 1730 | |
| 1731 | Number of Outbound Streams (OS): 16 bits (unsigned integer) |
| 1732 | |
| 1733 | Defines the number of outbound streams the sender of this INIT ACK |
| 1734 | chunk wishes to create in this association. The value of 0 MUST |
| 1735 | |
| 1736 | |
| 1737 | |
| 1738 | Stewart Standards Track [Page 31] |
| 1739 | |
| 1740 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1741 | |
| 1742 | |
| 1743 | NOT be used, and the value MUST NOT be greater than the MIS value |
| 1744 | sent in the INIT chunk. |
| 1745 | |
| 1746 | Note: A receiver of an INIT ACK with the OS value set to 0 SHOULD |
| 1747 | destroy the association discarding its TCB. |
| 1748 | |
| 1749 | Number of Inbound Streams (MIS): 16 bits (unsigned integer) |
| 1750 | |
| 1751 | Defines the maximum number of streams the sender of this INIT ACK |
| 1752 | chunk allows the peer end to create in this association. The |
| 1753 | value 0 MUST NOT be used. |
| 1754 | |
| 1755 | Note: There is no negotiation of the actual number of streams but |
| 1756 | instead the two endpoints will use the min(requested, offered). |
| 1757 | See Section 5.1.1 for details. |
| 1758 | |
| 1759 | Note: A receiver of an INIT ACK with the MIS value set to 0 SHOULD |
| 1760 | destroy the association discarding its TCB. |
| 1761 | |
| 1762 | Initial TSN (I-TSN): 32 bits (unsigned integer) |
| 1763 | |
| 1764 | Defines the initial TSN that the INIT ACK sender will use. The |
| 1765 | valid range is from 0 to 4294967295. This field MAY be set to the |
| 1766 | value of the Initiate Tag field. |
| 1767 | |
| 1768 | Fixed Parameters Status |
| 1769 | ---------------------------------------------- |
| 1770 | Initiate Tag Mandatory |
| 1771 | Advertised Receiver Window Credit Mandatory |
| 1772 | Number of Outbound Streams Mandatory |
| 1773 | Number of Inbound Streams Mandatory |
| 1774 | Initial TSN Mandatory |
| 1775 | |
| 1776 | Variable Parameters Status Type Value |
| 1777 | ------------------------------------------------------------- |
| 1778 | State Cookie Mandatory 7 |
| 1779 | IPv4 Address (Note 1) Optional 5 |
| 1780 | IPv6 Address (Note 1) Optional 6 |
| 1781 | Unrecognized Parameter Optional 8 |
| 1782 | Reserved for ECN Capable (Note 2) Optional 32768 (0x8000) |
| 1783 | Host Name Address (Note 3) Optional 11 |
| 1784 | |
| 1785 | Note 1: The INIT ACK chunks can contain any number of IP address |
| 1786 | parameters that can be IPv4 and/or IPv6 in any combination. |
| 1787 | |
| 1788 | Note 2: The ECN Capable field is reserved for future use of Explicit |
| 1789 | Congestion Notification. |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | Stewart Standards Track [Page 32] |
| 1795 | |
| 1796 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1797 | |
| 1798 | |
| 1799 | Note 3: The INIT ACK chunks MUST NOT contain more than one Host Name |
| 1800 | Address parameter. Moreover, the sender of the INIT ACK MUST NOT |
| 1801 | combine any other address types with the Host Name Address in the |
| 1802 | INIT ACK. The receiver of the INIT ACK MUST ignore any other address |
| 1803 | types if the Host Name Address parameter is present. |
| 1804 | |
| 1805 | IMPLEMENTATION NOTE: An implementation MUST be prepared to receive an |
| 1806 | INIT ACK that is quite large (more than 1500 bytes) due to the |
| 1807 | variable size of the State Cookie AND the variable address list. For |
| 1808 | example if a responder to the INIT has 1000 IPv4 addresses it wishes |
| 1809 | to send, it would need at least 8,000 bytes to encode this in the |
| 1810 | INIT ACK. |
| 1811 | |
| 1812 | IMPLEMENTATION NOTE: If an INIT ACK chunk is received with known |
| 1813 | parameters that are not optional parameters of the INIT ACK chunk, |
| 1814 | then the receiver SHOULD process the INIT ACK chunk and send back a |
| 1815 | COOKIE ECHO. The receiver of the INIT ACK chunk MAY bundle an ERROR |
| 1816 | chunk with the COOKIE ECHO chunk. However, restrictive |
| 1817 | implementations MAY send back an ABORT chunk in response to the INIT |
| 1818 | ACK chunk. |
| 1819 | |
| 1820 | In combination with the Source Port carried in the SCTP common |
| 1821 | header, each IP Address parameter in the INIT ACK indicates to the |
| 1822 | receiver of the INIT ACK a valid transport address supported by the |
| 1823 | sender of the INIT ACK for the life time of the association being |
| 1824 | initiated. |
| 1825 | |
| 1826 | If the INIT ACK contains at least one IP Address parameter, then the |
| 1827 | source address of the IP datagram containing the INIT ACK and any |
| 1828 | additional address(es) provided within the INIT ACK may be used as |
| 1829 | destinations by the receiver of the INIT ACK. If the INIT ACK does |
| 1830 | not contain any IP Address parameters, the receiver of the INIT ACK |
| 1831 | MUST use the source address associated with the received IP datagram |
| 1832 | as its sole destination address for the association. |
| 1833 | |
| 1834 | The State Cookie and Unrecognized Parameters use the Type-Length- |
| 1835 | Value format as defined in Section 3.2.1 and are described below. |
| 1836 | The other fields are defined the same as their counterparts in the |
| 1837 | INIT chunk. |
| 1838 | |
| 1839 | 3.3.3.1. Optional or Variable-Length Parameters |
| 1840 | |
| 1841 | State Cookie |
| 1842 | |
| 1843 | Parameter Type Value: 7 |
| 1844 | |
| 1845 | Parameter Length: Variable size, depending on size of Cookie. |
| 1846 | |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | Stewart Standards Track [Page 33] |
| 1851 | |
| 1852 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1853 | |
| 1854 | |
| 1855 | Parameter Value: |
| 1856 | |
| 1857 | This parameter value MUST contain all the necessary state and |
| 1858 | parameter information required for the sender of this INIT ACK to |
| 1859 | create the association, along with a Message Authentication Code |
| 1860 | (MAC). See Section 5.1.3 for details on State Cookie definition. |
| 1861 | |
| 1862 | Unrecognized Parameter: |
| 1863 | |
| 1864 | Parameter Type Value: 8 |
| 1865 | |
| 1866 | Parameter Length: Variable size. |
| 1867 | |
| 1868 | Parameter Value: |
| 1869 | |
| 1870 | This parameter is returned to the originator of the INIT chunk |
| 1871 | when the INIT contains an unrecognized parameter that has a value |
| 1872 | that indicates it should be reported to the sender. This |
| 1873 | parameter value field will contain unrecognized parameters copied |
| 1874 | from the INIT chunk complete with Parameter Type, Length, and |
| 1875 | Value fields. |
| 1876 | |
| 1877 | 3.3.4. Selective Acknowledgement (SACK) (3) |
| 1878 | |
| 1879 | This chunk is sent to the peer endpoint to acknowledge received DATA |
| 1880 | chunks and to inform the peer endpoint of gaps in the received |
| 1881 | subsequences of DATA chunks as represented by their TSNs. |
| 1882 | |
| 1883 | The SACK MUST contain the Cumulative TSN Ack, Advertised Receiver |
| 1884 | Window Credit (a_rwnd), Number of Gap Ack Blocks, and Number of |
| 1885 | Duplicate TSNs fields. |
| 1886 | |
| 1887 | By definition, the value of the Cumulative TSN Ack parameter is the |
| 1888 | last TSN received before a break in the sequence of received TSNs |
| 1889 | occurs; the next TSN value following this one has not yet been |
| 1890 | received at the endpoint sending the SACK. This parameter therefore |
| 1891 | acknowledges receipt of all TSNs less than or equal to its value. |
| 1892 | |
| 1893 | The handling of a_rwnd by the receiver of the SACK is discussed in |
| 1894 | detail in Section 6.2.1. |
| 1895 | |
| 1896 | The SACK also contains zero or more Gap Ack Blocks. Each Gap Ack |
| 1897 | Block acknowledges a subsequence of TSNs received following a break |
| 1898 | in the sequence of received TSNs. By definition, all TSNs |
| 1899 | acknowledged by Gap Ack Blocks are greater than the value of the |
| 1900 | Cumulative TSN Ack. |
| 1901 | |
| 1902 | |
| 1903 | |
| 1904 | |
| 1905 | |
| 1906 | Stewart Standards Track [Page 34] |
| 1907 | |
| 1908 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1909 | |
| 1910 | |
| 1911 | 0 1 2 3 |
| 1912 | 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 |
| 1913 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1914 | | Type = 3 |Chunk Flags | Chunk Length | |
| 1915 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1916 | | Cumulative TSN Ack | |
| 1917 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1918 | | Advertised Receiver Window Credit (a_rwnd) | |
| 1919 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1920 | | Number of Gap Ack Blocks = N | Number of Duplicate TSNs = X | |
| 1921 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1922 | | Gap Ack Block #1 Start | Gap Ack Block #1 End | |
| 1923 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1924 | / / |
| 1925 | \ ... \ |
| 1926 | / / |
| 1927 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1928 | | Gap Ack Block #N Start | Gap Ack Block #N End | |
| 1929 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1930 | | Duplicate TSN 1 | |
| 1931 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1932 | / / |
| 1933 | \ ... \ |
| 1934 | / / |
| 1935 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1936 | | Duplicate TSN X | |
| 1937 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 1938 | |
| 1939 | Chunk Flags: 8 bits |
| 1940 | |
| 1941 | Set to all '0's on transmit and ignored on receipt. |
| 1942 | |
| 1943 | Cumulative TSN Ack: 32 bits (unsigned integer) |
| 1944 | |
| 1945 | This parameter contains the TSN of the last DATA chunk received in |
| 1946 | sequence before a gap. In the case where no DATA chunk has been |
| 1947 | received, this value is set to the peer's Initial TSN minus one. |
| 1948 | |
| 1949 | Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned |
| 1950 | integer) |
| 1951 | |
| 1952 | This field indicates the updated receive buffer space in bytes of |
| 1953 | the sender of this SACK; see Section 6.2.1 for details. |
| 1954 | |
| 1955 | Number of Gap Ack Blocks: 16 bits (unsigned integer) |
| 1956 | |
| 1957 | Indicates the number of Gap Ack Blocks included in this SACK. |
| 1958 | |
| 1959 | |
| 1960 | |
| 1961 | |
| 1962 | Stewart Standards Track [Page 35] |
| 1963 | |
| 1964 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 1965 | |
| 1966 | |
| 1967 | Number of Duplicate TSNs: 16 bit |
| 1968 | |
| 1969 | This field contains the number of duplicate TSNs the endpoint has |
| 1970 | received. Each duplicate TSN is listed following the Gap Ack |
| 1971 | Block list. |
| 1972 | |
| 1973 | Gap Ack Blocks: |
| 1974 | |
| 1975 | These fields contain the Gap Ack Blocks. They are repeated for |
| 1976 | each Gap Ack Block up to the number of Gap Ack Blocks defined in |
| 1977 | the Number of Gap Ack Blocks field. All DATA chunks with TSNs |
| 1978 | greater than or equal to (Cumulative TSN Ack + Gap Ack Block |
| 1979 | Start) and less than or equal to (Cumulative TSN Ack + Gap Ack |
| 1980 | Block End) of each Gap Ack Block are assumed to have been received |
| 1981 | correctly. |
| 1982 | |
| 1983 | Gap Ack Block Start: 16 bits (unsigned integer) |
| 1984 | |
| 1985 | Indicates the Start offset TSN for this Gap Ack Block. To |
| 1986 | calculate the actual TSN number the Cumulative TSN Ack is added to |
| 1987 | this offset number. This calculated TSN identifies the first TSN |
| 1988 | in this Gap Ack Block that has been received. |
| 1989 | |
| 1990 | Gap Ack Block End: 16 bits (unsigned integer) |
| 1991 | |
| 1992 | Indicates the End offset TSN for this Gap Ack Block. To calculate |
| 1993 | the actual TSN number, the Cumulative TSN Ack is added to this |
| 1994 | offset number. This calculated TSN identifies the TSN of the last |
| 1995 | DATA chunk received in this Gap Ack Block. |
| 1996 | |
| 1997 | |
| 1998 | |
| 1999 | |
| 2000 | |
| 2001 | |
| 2002 | |
| 2003 | |
| 2004 | |
| 2005 | |
| 2006 | |
| 2007 | |
| 2008 | |
| 2009 | |
| 2010 | |
| 2011 | |
| 2012 | |
| 2013 | |
| 2014 | |
| 2015 | |
| 2016 | |
| 2017 | |
| 2018 | Stewart Standards Track [Page 36] |
| 2019 | |
| 2020 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2021 | |
| 2022 | |
| 2023 | For example, assume that the receiver has the following DATA chunks |
| 2024 | newly arrived at the time when it decides to send a Selective ACK, |
| 2025 | |
| 2026 | ---------- |
| 2027 | | TSN=17 | |
| 2028 | ---------- |
| 2029 | | | <- still missing |
| 2030 | ---------- |
| 2031 | | TSN=15 | |
| 2032 | ---------- |
| 2033 | | TSN=14 | |
| 2034 | ---------- |
| 2035 | | | <- still missing |
| 2036 | ---------- |
| 2037 | | TSN=12 | |
| 2038 | ---------- |
| 2039 | | TSN=11 | |
| 2040 | ---------- |
| 2041 | | TSN=10 | |
| 2042 | ---------- |
| 2043 | |
| 2044 | then the parameter part of the SACK MUST be constructed as follows |
| 2045 | (assuming the new a_rwnd is set to 4660 by the sender): |
| 2046 | |
| 2047 | +--------------------------------+ |
| 2048 | | Cumulative TSN Ack = 12 | |
| 2049 | +--------------------------------+ |
| 2050 | | a_rwnd = 4660 | |
| 2051 | +----------------+---------------+ |
| 2052 | | num of block=2 | num of dup=0 | |
| 2053 | +----------------+---------------+ |
| 2054 | |block #1 strt=2 |block #1 end=3 | |
| 2055 | +----------------+---------------+ |
| 2056 | |block #2 strt=5 |block #2 end=5 | |
| 2057 | +----------------+---------------+ |
| 2058 | |
| 2059 | Duplicate TSN: 32 bits (unsigned integer) |
| 2060 | |
| 2061 | Indicates the number of times a TSN was received in duplicate |
| 2062 | since the last SACK was sent. Every time a receiver gets a |
| 2063 | duplicate TSN (before sending the SACK), it adds it to the list of |
| 2064 | duplicates. The duplicate count is reinitialized to zero after |
| 2065 | sending each SACK. |
| 2066 | |
| 2067 | For example, if a receiver were to get the TSN 19 three times it |
| 2068 | would list 19 twice in the outbound SACK. After sending the SACK, if |
| 2069 | it received yet one more TSN 19 it would list 19 as a duplicate once |
| 2070 | in the next outgoing SACK. |
| 2071 | |
| 2072 | |
| 2073 | |
| 2074 | Stewart Standards Track [Page 37] |
| 2075 | |
| 2076 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2077 | |
| 2078 | |
| 2079 | 3.3.5. Heartbeat Request (HEARTBEAT) (4) |
| 2080 | |
| 2081 | An endpoint should send this chunk to its peer endpoint to probe the |
| 2082 | reachability of a particular destination transport address defined in |
| 2083 | the present association. |
| 2084 | |
| 2085 | The parameter field contains the Heartbeat Information, which is a |
| 2086 | variable-length opaque data structure understood only by the sender. |
| 2087 | |
| 2088 | 0 1 2 3 |
| 2089 | 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 |
| 2090 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2091 | | Type = 4 | Chunk Flags | Heartbeat Length | |
| 2092 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2093 | \ \ |
| 2094 | / Heartbeat Information TLV (Variable-Length) / |
| 2095 | \ \ |
| 2096 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2097 | |
| 2098 | Chunk Flags: 8 bits |
| 2099 | |
| 2100 | Set to 0 on transmit and ignored on receipt. |
| 2101 | |
| 2102 | Heartbeat Length: 16 bits (unsigned integer) |
| 2103 | |
| 2104 | Set to the size of the chunk in bytes, including the chunk header |
| 2105 | and the Heartbeat Information field. |
| 2106 | |
| 2107 | Heartbeat Information: variable length |
| 2108 | |
| 2109 | Defined as a variable-length parameter using the format described |
| 2110 | in Section 3.2.1, i.e.: |
| 2111 | |
| 2112 | Variable Parameters Status Type Value |
| 2113 | ------------------------------------------------------------- |
| 2114 | Heartbeat Info Mandatory 1 |
| 2115 | |
| 2116 | 0 1 2 3 |
| 2117 | 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 |
| 2118 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2119 | | Heartbeat Info Type=1 | HB Info Length | |
| 2120 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2121 | / Sender-Specific Heartbeat Info / |
| 2122 | \ \ |
| 2123 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2124 | |
| 2125 | The Sender-Specific Heartbeat Info field should normally include |
| 2126 | information about the sender's current time when this HEARTBEAT |
| 2127 | |
| 2128 | |
| 2129 | |
| 2130 | Stewart Standards Track [Page 38] |
| 2131 | |
| 2132 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2133 | |
| 2134 | |
| 2135 | chunk is sent and the destination transport address to which this |
| 2136 | HEARTBEAT is sent (see Section 8.3). This information is simply |
| 2137 | reflected back by the receiver in the HEARTBEAT ACK message (see |
| 2138 | Section 3.3.6). Note also that the HEARTBEAT message is both for |
| 2139 | reachability checking and for path verification (see Section 5.4). |
| 2140 | When a HEARTBEAT chunk is being used for path verification |
| 2141 | purposes, it MUST hold a 64-bit random nonce. |
| 2142 | |
| 2143 | 3.3.6. Heartbeat Acknowledgement (HEARTBEAT ACK) (5) |
| 2144 | |
| 2145 | An endpoint should send this chunk to its peer endpoint as a response |
| 2146 | to a HEARTBEAT chunk (see Section 8.3). A HEARTBEAT ACK is always |
| 2147 | sent to the source IP address of the IP datagram containing the |
| 2148 | HEARTBEAT chunk to which this ack is responding. |
| 2149 | |
| 2150 | The parameter field contains a variable-length opaque data structure. |
| 2151 | |
| 2152 | 0 1 2 3 |
| 2153 | 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 |
| 2154 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2155 | | Type = 5 | Chunk Flags | Heartbeat Ack Length | |
| 2156 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2157 | \ \ |
| 2158 | / Heartbeat Information TLV (Variable-Length) / |
| 2159 | \ \ |
| 2160 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2161 | |
| 2162 | Chunk Flags: 8 bits |
| 2163 | |
| 2164 | Set to 0 on transmit and ignored on receipt. |
| 2165 | |
| 2166 | Heartbeat Ack Length: 16 bits (unsigned integer) |
| 2167 | |
| 2168 | Set to the size of the chunk in bytes, including the chunk header |
| 2169 | and the Heartbeat Information field. |
| 2170 | |
| 2171 | Heartbeat Information: variable length |
| 2172 | |
| 2173 | This field MUST contain the Heartbeat Information parameter of the |
| 2174 | Heartbeat Request to which this Heartbeat Acknowledgement is |
| 2175 | responding. |
| 2176 | |
| 2177 | Variable Parameters Status Type Value |
| 2178 | ------------------------------------------------------------- |
| 2179 | Heartbeat Info Mandatory 1 |
| 2180 | |
| 2181 | |
| 2182 | |
| 2183 | |
| 2184 | |
| 2185 | |
| 2186 | Stewart Standards Track [Page 39] |
| 2187 | |
| 2188 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2189 | |
| 2190 | |
| 2191 | 3.3.7. Abort Association (ABORT) (6) |
| 2192 | |
| 2193 | The ABORT chunk is sent to the peer of an association to close the |
| 2194 | association. The ABORT chunk may contain Cause Parameters to inform |
| 2195 | the receiver about the reason of the abort. DATA chunks MUST NOT be |
| 2196 | bundled with ABORT. Control chunks (except for INIT, INIT ACK, and |
| 2197 | SHUTDOWN COMPLETE) MAY be bundled with an ABORT, but they MUST be |
| 2198 | placed before the ABORT in the SCTP packet or they will be ignored by |
| 2199 | the receiver. |
| 2200 | |
| 2201 | If an endpoint receives an ABORT with a format error or no TCB is |
| 2202 | found, it MUST silently discard it. Moreover, under any |
| 2203 | circumstances, an endpoint that receives an ABORT MUST NOT respond to |
| 2204 | that ABORT by sending an ABORT of its own. |
| 2205 | |
| 2206 | 0 1 2 3 |
| 2207 | 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 |
| 2208 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2209 | | Type = 6 |Reserved |T| Length | |
| 2210 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2211 | \ \ |
| 2212 | / zero or more Error Causes / |
| 2213 | \ \ |
| 2214 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2215 | |
| 2216 | Chunk Flags: 8 bits |
| 2217 | |
| 2218 | Reserved: 7 bits |
| 2219 | |
| 2220 | Set to 0 on transmit and ignored on receipt. |
| 2221 | |
| 2222 | T bit: 1 bit |
| 2223 | |
| 2224 | The T bit is set to 0 if the sender filled in the Verification Tag |
| 2225 | expected by the peer. If the Verification Tag is reflected, the T |
| 2226 | bit MUST be set to 1. Reflecting means that the sent Verification |
| 2227 | Tag is the same as the received one. |
| 2228 | |
| 2229 | Note: Special rules apply to this chunk for verification; please |
| 2230 | see Section 8.5.1 for details. |
| 2231 | |
| 2232 | Length: 16 bits (unsigned integer) |
| 2233 | |
| 2234 | Set to the size of the chunk in bytes, including the chunk header |
| 2235 | and all the Error Cause fields present. |
| 2236 | |
| 2237 | See Section 3.3.10 for Error Cause definitions. |
| 2238 | |
| 2239 | |
| 2240 | |
| 2241 | |
| 2242 | Stewart Standards Track [Page 40] |
| 2243 | |
| 2244 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2245 | |
| 2246 | |
| 2247 | 3.3.8. Shutdown Association (SHUTDOWN) (7) |
| 2248 | |
| 2249 | An endpoint in an association MUST use this chunk to initiate a |
| 2250 | graceful close of the association with its peer. This chunk has the |
| 2251 | following format. |
| 2252 | |
| 2253 | 0 1 2 3 |
| 2254 | 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 |
| 2255 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2256 | | Type = 7 | Chunk Flags | Length = 8 | |
| 2257 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2258 | | Cumulative TSN Ack | |
| 2259 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2260 | |
| 2261 | Chunk Flags: 8 bits |
| 2262 | |
| 2263 | Set to 0 on transmit and ignored on receipt. |
| 2264 | |
| 2265 | Length: 16 bits (unsigned integer) |
| 2266 | |
| 2267 | Indicates the length of the parameter. Set to 8. |
| 2268 | |
| 2269 | Cumulative TSN Ack: 32 bits (unsigned integer) |
| 2270 | |
| 2271 | This parameter contains the TSN of the last chunk received in |
| 2272 | sequence before any gaps. |
| 2273 | |
| 2274 | Note: Since the SHUTDOWN message does not contain Gap Ack Blocks, |
| 2275 | it cannot be used to acknowledge TSNs received out of order. In a |
| 2276 | SACK, lack of Gap Ack Blocks that were previously included |
| 2277 | indicates that the data receiver reneged on the associated DATA |
| 2278 | chunks. Since SHUTDOWN does not contain Gap Ack Blocks, the |
| 2279 | receiver of the SHUTDOWN shouldn't interpret the lack of a Gap Ack |
| 2280 | Block as a renege. (See Section 6.2 for information on reneging.) |
| 2281 | |
| 2282 | 3.3.9. Shutdown Acknowledgement (SHUTDOWN ACK) (8) |
| 2283 | |
| 2284 | This chunk MUST be used to acknowledge the receipt of the SHUTDOWN |
| 2285 | chunk at the completion of the shutdown process; see Section 9.2 for |
| 2286 | details. |
| 2287 | |
| 2288 | The SHUTDOWN ACK chunk has no parameters. |
| 2289 | |
| 2290 | |
| 2291 | |
| 2292 | |
| 2293 | |
| 2294 | |
| 2295 | |
| 2296 | |
| 2297 | |
| 2298 | Stewart Standards Track [Page 41] |
| 2299 | |
| 2300 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2301 | |
| 2302 | |
| 2303 | 0 1 2 3 |
| 2304 | 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 |
| 2305 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2306 | | Type = 8 |Chunk Flags | Length = 4 | |
| 2307 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2308 | |
| 2309 | Chunk Flags: 8 bits |
| 2310 | |
| 2311 | Set to 0 on transmit and ignored on receipt. |
| 2312 | |
| 2313 | 3.3.10. Operation Error (ERROR) (9) |
| 2314 | |
| 2315 | An endpoint sends this chunk to its peer endpoint to notify it of |
| 2316 | certain error conditions. It contains one or more error causes. An |
| 2317 | Operation Error is not considered fatal in and of itself, but may be |
| 2318 | used with an ABORT chunk to report a fatal condition. It has the |
| 2319 | following parameters: |
| 2320 | |
| 2321 | 0 1 2 3 |
| 2322 | 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 |
| 2323 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2324 | | Type = 9 | Chunk Flags | Length | |
| 2325 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2326 | \ \ |
| 2327 | / one or more Error Causes / |
| 2328 | \ \ |
| 2329 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2330 | |
| 2331 | Chunk Flags: 8 bits |
| 2332 | |
| 2333 | Set to 0 on transmit and ignored on receipt. |
| 2334 | |
| 2335 | Length: 16 bits (unsigned integer) |
| 2336 | |
| 2337 | Set to the size of the chunk in bytes, including the chunk header |
| 2338 | and all the Error Cause fields present. |
| 2339 | |
| 2340 | |
| 2341 | |
| 2342 | |
| 2343 | |
| 2344 | |
| 2345 | |
| 2346 | |
| 2347 | |
| 2348 | |
| 2349 | |
| 2350 | |
| 2351 | |
| 2352 | |
| 2353 | |
| 2354 | Stewart Standards Track [Page 42] |
| 2355 | |
| 2356 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2357 | |
| 2358 | |
| 2359 | Error causes are defined as variable-length parameters using the |
| 2360 | format described in Section 3.2.1, that is: |
| 2361 | |
| 2362 | 0 1 2 3 |
| 2363 | 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 |
| 2364 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2365 | | Cause Code | Cause Length | |
| 2366 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2367 | / Cause-Specific Information / |
| 2368 | \ \ |
| 2369 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2370 | |
| 2371 | Cause Code: 16 bits (unsigned integer) |
| 2372 | |
| 2373 | Defines the type of error conditions being reported. |
| 2374 | |
| 2375 | Cause Code |
| 2376 | Value Cause Code |
| 2377 | --------- ---------------- |
| 2378 | 1 Invalid Stream Identifier |
| 2379 | 2 Missing Mandatory Parameter |
| 2380 | 3 Stale Cookie Error |
| 2381 | 4 Out of Resource |
| 2382 | 5 Unresolvable Address |
| 2383 | 6 Unrecognized Chunk Type |
| 2384 | 7 Invalid Mandatory Parameter |
| 2385 | 8 Unrecognized Parameters |
| 2386 | 9 No User Data |
| 2387 | 10 Cookie Received While Shutting Down |
| 2388 | 11 Restart of an Association with New Addresses |
| 2389 | 12 User Initiated Abort |
| 2390 | 13 Protocol Violation |
| 2391 | |
| 2392 | Cause Length: 16 bits (unsigned integer) |
| 2393 | |
| 2394 | Set to the size of the parameter in bytes, including the Cause |
| 2395 | Code, Cause Length, and Cause-Specific Information fields. |
| 2396 | |
| 2397 | Cause-Specific Information: variable length |
| 2398 | |
| 2399 | This field carries the details of the error condition. |
| 2400 | |
| 2401 | Section 3.3.10.1 - Section 3.3.10.13 define error causes for SCTP. |
| 2402 | Guidelines for the IETF to define new error cause values are |
| 2403 | discussed in Section 14.3. |
| 2404 | |
| 2405 | |
| 2406 | |
| 2407 | |
| 2408 | |
| 2409 | |
| 2410 | Stewart Standards Track [Page 43] |
| 2411 | |
| 2412 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2413 | |
| 2414 | |
| 2415 | 3.3.10.1. Invalid Stream Identifier (1) |
| 2416 | |
| 2417 | Cause of error |
| 2418 | --------------- |
| 2419 | |
| 2420 | Invalid Stream Identifier: Indicates endpoint received a DATA chunk |
| 2421 | sent to a nonexistent stream. |
| 2422 | |
| 2423 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2424 | | Cause Code=1 | Cause Length=8 | |
| 2425 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2426 | | Stream Identifier | (Reserved) | |
| 2427 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2428 | |
| 2429 | Stream Identifier: 16 bits (unsigned integer) |
| 2430 | |
| 2431 | Contains the Stream Identifier of the DATA chunk received in |
| 2432 | error. |
| 2433 | |
| 2434 | Reserved: 16 bits |
| 2435 | |
| 2436 | This field is reserved. It is set to all 0's on transmit and |
| 2437 | ignored on receipt. |
| 2438 | |
| 2439 | 3.3.10.2. Missing Mandatory Parameter (2) |
| 2440 | |
| 2441 | Cause of error |
| 2442 | --------------- |
| 2443 | |
| 2444 | Missing Mandatory Parameter: Indicates that one or more mandatory TLV |
| 2445 | parameters are missing in a received INIT or INIT ACK. |
| 2446 | |
| 2447 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2448 | | Cause Code=2 | Cause Length=8+N*2 | |
| 2449 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2450 | | Number of missing params=N | |
| 2451 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2452 | | Missing Param Type #1 | Missing Param Type #2 | |
| 2453 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2454 | | Missing Param Type #N-1 | Missing Param Type #N | |
| 2455 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2456 | |
| 2457 | Number of Missing params: 32 bits (unsigned integer) |
| 2458 | |
| 2459 | This field contains the number of parameters contained in the |
| 2460 | Cause-Specific Information field. |
| 2461 | |
| 2462 | |
| 2463 | |
| 2464 | |
| 2465 | |
| 2466 | Stewart Standards Track [Page 44] |
| 2467 | |
| 2468 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2469 | |
| 2470 | |
| 2471 | Missing Param Type: 16 bits (unsigned integer) |
| 2472 | |
| 2473 | Each field will contain the missing mandatory parameter number. |
| 2474 | |
| 2475 | 3.3.10.3. Stale Cookie Error (3) |
| 2476 | |
| 2477 | Cause of error |
| 2478 | -------------- |
| 2479 | |
| 2480 | Stale Cookie Error: Indicates the receipt of a valid State Cookie |
| 2481 | that has expired. |
| 2482 | |
| 2483 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2484 | | Cause Code=3 | Cause Length=8 | |
| 2485 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2486 | | Measure of Staleness (usec.) | |
| 2487 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2488 | |
| 2489 | Measure of Staleness: 32 bits (unsigned integer) |
| 2490 | |
| 2491 | This field contains the difference, in microseconds, between the |
| 2492 | current time and the time the State Cookie expired. |
| 2493 | |
| 2494 | The sender of this error cause MAY choose to report how long past |
| 2495 | expiration the State Cookie is by including a non-zero value in |
| 2496 | the Measure of Staleness field. If the sender does not wish to |
| 2497 | provide this information, it should set the Measure of Staleness |
| 2498 | field to the value of zero. |
| 2499 | |
| 2500 | 3.3.10.4. Out of Resource (4) |
| 2501 | |
| 2502 | Cause of error |
| 2503 | --------------- |
| 2504 | |
| 2505 | Out of Resource: Indicates that the sender is out of resource. This |
| 2506 | is usually sent in combination with or within an ABORT. |
| 2507 | |
| 2508 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2509 | | Cause Code=4 | Cause Length=4 | |
| 2510 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2511 | |
| 2512 | |
| 2513 | |
| 2514 | |
| 2515 | |
| 2516 | |
| 2517 | |
| 2518 | |
| 2519 | |
| 2520 | |
| 2521 | |
| 2522 | Stewart Standards Track [Page 45] |
| 2523 | |
| 2524 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2525 | |
| 2526 | |
| 2527 | 3.3.10.5. Unresolvable Address (5) |
| 2528 | |
| 2529 | Cause of error |
| 2530 | --------------- |
| 2531 | |
| 2532 | Unresolvable Address: Indicates that the sender is not able to |
| 2533 | resolve the specified address parameter (e.g., type of address is not |
| 2534 | supported by the sender). This is usually sent in combination with |
| 2535 | or within an ABORT. |
| 2536 | |
| 2537 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2538 | | Cause Code=5 | Cause Length | |
| 2539 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2540 | / Unresolvable Address / |
| 2541 | \ \ |
| 2542 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2543 | |
| 2544 | Unresolvable Address: variable length |
| 2545 | |
| 2546 | The Unresolvable Address field contains the complete Type, Length, |
| 2547 | and Value of the address parameter (or Host Name parameter) that |
| 2548 | contains the unresolvable address or host name. |
| 2549 | |
| 2550 | 3.3.10.6. Unrecognized Chunk Type (6) |
| 2551 | |
| 2552 | Cause of error |
| 2553 | --------------- |
| 2554 | |
| 2555 | Unrecognized Chunk Type: This error cause is returned to the |
| 2556 | originator of the chunk if the receiver does not understand the chunk |
| 2557 | and the upper bits of the 'Chunk Type' are set to 01 or 11. |
| 2558 | |
| 2559 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2560 | | Cause Code=6 | Cause Length | |
| 2561 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2562 | / Unrecognized Chunk / |
| 2563 | \ \ |
| 2564 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2565 | |
| 2566 | Unrecognized Chunk: variable length |
| 2567 | |
| 2568 | The Unrecognized Chunk field contains the unrecognized chunk from |
| 2569 | the SCTP packet complete with Chunk Type, Chunk Flags, and Chunk |
| 2570 | Length. |
| 2571 | |
| 2572 | |
| 2573 | |
| 2574 | |
| 2575 | |
| 2576 | |
| 2577 | |
| 2578 | Stewart Standards Track [Page 46] |
| 2579 | |
| 2580 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2581 | |
| 2582 | |
| 2583 | 3.3.10.7. Invalid Mandatory Parameter (7) |
| 2584 | |
| 2585 | Cause of error |
| 2586 | --------------- |
| 2587 | |
| 2588 | Invalid Mandatory Parameter: This error cause is returned to the |
| 2589 | originator of an INIT or INIT ACK chunk when one of the mandatory |
| 2590 | parameters is set to an invalid value. |
| 2591 | |
| 2592 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2593 | | Cause Code=7 | Cause Length=4 | |
| 2594 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2595 | |
| 2596 | 3.3.10.8. Unrecognized Parameters (8) |
| 2597 | |
| 2598 | Cause of error |
| 2599 | --------------- |
| 2600 | |
| 2601 | Unrecognized Parameters: This error cause is returned to the |
| 2602 | originator of the INIT ACK chunk if the receiver does not recognize |
| 2603 | one or more Optional TLV parameters in the INIT ACK chunk. |
| 2604 | |
| 2605 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2606 | | Cause Code=8 | Cause Length | |
| 2607 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2608 | / Unrecognized Parameters / |
| 2609 | \ \ |
| 2610 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2611 | |
| 2612 | Unrecognized Parameters: variable length |
| 2613 | |
| 2614 | The Unrecognized Parameters field contains the unrecognized |
| 2615 | parameters copied from the INIT ACK chunk complete with TLV. This |
| 2616 | error cause is normally contained in an ERROR chunk bundled with |
| 2617 | the COOKIE ECHO chunk when responding to the INIT ACK, when the |
| 2618 | sender of the COOKIE ECHO chunk wishes to report unrecognized |
| 2619 | parameters. |
| 2620 | |
| 2621 | |
| 2622 | |
| 2623 | |
| 2624 | |
| 2625 | |
| 2626 | |
| 2627 | |
| 2628 | |
| 2629 | |
| 2630 | |
| 2631 | |
| 2632 | |
| 2633 | |
| 2634 | Stewart Standards Track [Page 47] |
| 2635 | |
| 2636 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2637 | |
| 2638 | |
| 2639 | 3.3.10.9. No User Data (9) |
| 2640 | |
| 2641 | Cause of error |
| 2642 | --------------- |
| 2643 | |
| 2644 | No User Data: This error cause is returned to the originator of a |
| 2645 | |
| 2646 | DATA chunk if a received DATA chunk has no user data. |
| 2647 | |
| 2648 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2649 | | Cause Code=9 | Cause Length=8 | |
| 2650 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2651 | / TSN value / |
| 2652 | \ \ |
| 2653 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2654 | |
| 2655 | TSN value: 32 bits (unsigned integer) |
| 2656 | |
| 2657 | The TSN value field contains the TSN of the DATA chunk received |
| 2658 | with no user data field. |
| 2659 | |
| 2660 | This cause code is normally returned in an ABORT chunk (see |
| 2661 | Section 6.2). |
| 2662 | |
| 2663 | 3.3.10.10. Cookie Received While Shutting Down (10) |
| 2664 | |
| 2665 | Cause of error |
| 2666 | --------------- |
| 2667 | |
| 2668 | Cookie Received While Shutting Down: A COOKIE ECHO was received while |
| 2669 | the endpoint was in the SHUTDOWN-ACK-SENT state. This error is |
| 2670 | usually returned in an ERROR chunk bundled with the retransmitted |
| 2671 | SHUTDOWN ACK. |
| 2672 | |
| 2673 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2674 | | Cause Code=10 | Cause Length=4 | |
| 2675 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2676 | |
| 2677 | |
| 2678 | |
| 2679 | |
| 2680 | |
| 2681 | |
| 2682 | |
| 2683 | |
| 2684 | |
| 2685 | |
| 2686 | |
| 2687 | |
| 2688 | |
| 2689 | |
| 2690 | Stewart Standards Track [Page 48] |
| 2691 | |
| 2692 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2693 | |
| 2694 | |
| 2695 | 3.3.10.11. Restart of an Association with New Addresses (11) |
| 2696 | |
| 2697 | Cause of error |
| 2698 | -------------- |
| 2699 | |
| 2700 | Restart of an association with new addresses: An INIT was received on |
| 2701 | an existing association. But the INIT added addresses to the |
| 2702 | association that were previously NOT part of the association. The |
| 2703 | new addresses are listed in the error code. This ERROR is normally |
| 2704 | sent as part of an ABORT refusing the INIT (see Section 5.2). |
| 2705 | |
| 2706 | 0 1 2 3 |
| 2707 | 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 |
| 2708 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2709 | | Cause Code=11 | Cause Length=Variable | |
| 2710 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2711 | / New Address TLVs / |
| 2712 | \ \ |
| 2713 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2714 | |
| 2715 | Note: Each New Address TLV is an exact copy of the TLV that was found |
| 2716 | in the INIT chunk that was new, including the Parameter Type and the |
| 2717 | Parameter Length. |
| 2718 | |
| 2719 | 3.3.10.12. User-Initiated Abort (12) |
| 2720 | |
| 2721 | Cause of error |
| 2722 | -------------- |
| 2723 | |
| 2724 | This error cause MAY be included in ABORT chunks that are sent |
| 2725 | because of an upper-layer request. The upper layer can specify an |
| 2726 | Upper Layer Abort Reason that is transported by SCTP transparently |
| 2727 | and MAY be delivered to the upper-layer protocol at the peer. |
| 2728 | |
| 2729 | 0 1 2 3 |
| 2730 | 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 |
| 2731 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2732 | | Cause Code=12 | Cause Length=Variable | |
| 2733 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2734 | / Upper Layer Abort Reason / |
| 2735 | \ \ |
| 2736 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2737 | |
| 2738 | |
| 2739 | |
| 2740 | |
| 2741 | |
| 2742 | |
| 2743 | |
| 2744 | |
| 2745 | |
| 2746 | Stewart Standards Track [Page 49] |
| 2747 | |
| 2748 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2749 | |
| 2750 | |
| 2751 | 3.3.10.13. Protocol Violation (13) |
| 2752 | |
| 2753 | Cause of error |
| 2754 | -------------- |
| 2755 | |
| 2756 | This error cause MAY be included in ABORT chunks that are sent |
| 2757 | because an SCTP endpoint detects a protocol violation of the peer |
| 2758 | that is not covered by the error causes described in Section 3.3.10.1 |
| 2759 | to Section 3.3.10.12. An implementation MAY provide additional |
| 2760 | information specifying what kind of protocol violation has been |
| 2761 | detected. |
| 2762 | |
| 2763 | 0 1 2 3 |
| 2764 | 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 |
| 2765 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2766 | | Cause Code=13 | Cause Length=Variable | |
| 2767 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2768 | / Additional Information / |
| 2769 | \ \ |
| 2770 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2771 | |
| 2772 | 3.3.11. Cookie Echo (COOKIE ECHO) (10) |
| 2773 | |
| 2774 | This chunk is used only during the initialization of an association. |
| 2775 | It is sent by the initiator of an association to its peer to complete |
| 2776 | the initialization process. This chunk MUST precede any DATA chunk |
| 2777 | sent within the association, but MAY be bundled with one or more DATA |
| 2778 | chunks in the same packet. |
| 2779 | |
| 2780 | 0 1 2 3 |
| 2781 | 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 |
| 2782 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2783 | | Type = 10 |Chunk Flags | Length | |
| 2784 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2785 | / Cookie / |
| 2786 | \ \ |
| 2787 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2788 | |
| 2789 | Chunk Flags: 8 bit |
| 2790 | |
| 2791 | Set to 0 on transmit and ignored on receipt. |
| 2792 | |
| 2793 | Length: 16 bits (unsigned integer) |
| 2794 | |
| 2795 | Set to the size of the chunk in bytes, including the 4 bytes of |
| 2796 | the chunk header and the size of the cookie. |
| 2797 | |
| 2798 | |
| 2799 | |
| 2800 | |
| 2801 | |
| 2802 | Stewart Standards Track [Page 50] |
| 2803 | |
| 2804 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2805 | |
| 2806 | |
| 2807 | Cookie: variable size |
| 2808 | |
| 2809 | This field must contain the exact cookie received in the State |
| 2810 | Cookie parameter from the previous INIT ACK. |
| 2811 | |
| 2812 | An implementation SHOULD make the cookie as small as possible to |
| 2813 | ensure interoperability. |
| 2814 | |
| 2815 | Note: A Cookie Echo does NOT contain a State Cookie parameter; |
| 2816 | instead, the data within the State Cookie's Parameter Value |
| 2817 | becomes the data within the Cookie Echo's Chunk Value. This |
| 2818 | allows an implementation to change only the first 2 bytes of the |
| 2819 | State Cookie parameter to become a COOKIE ECHO chunk. |
| 2820 | |
| 2821 | 3.3.12. Cookie Acknowledgement (COOKIE ACK) (11) |
| 2822 | |
| 2823 | This chunk is used only during the initialization of an association. |
| 2824 | It is used to acknowledge the receipt of a COOKIE ECHO chunk. This |
| 2825 | chunk MUST precede any DATA or SACK chunk sent within the |
| 2826 | association, but MAY be bundled with one or more DATA chunks or SACK |
| 2827 | chunk's in the same SCTP packet. |
| 2828 | |
| 2829 | 0 1 2 3 |
| 2830 | 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 |
| 2831 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2832 | | Type = 11 |Chunk Flags | Length = 4 | |
| 2833 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2834 | |
| 2835 | Chunk Flags: 8 bits |
| 2836 | |
| 2837 | Set to 0 on transmit and ignored on receipt. |
| 2838 | |
| 2839 | 3.3.13. Shutdown Complete (SHUTDOWN COMPLETE) (14) |
| 2840 | |
| 2841 | This chunk MUST be used to acknowledge the receipt of the SHUTDOWN |
| 2842 | ACK chunk at the completion of the shutdown process; see Section 9.2 |
| 2843 | for details. |
| 2844 | |
| 2845 | The SHUTDOWN COMPLETE chunk has no parameters. |
| 2846 | |
| 2847 | 0 1 2 3 |
| 2848 | 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 |
| 2849 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2850 | | Type = 14 |Reserved |T| Length = 4 | |
| 2851 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 2852 | |
| 2853 | Chunk Flags: 8 bits |
| 2854 | |
| 2855 | |
| 2856 | |
| 2857 | |
| 2858 | Stewart Standards Track [Page 51] |
| 2859 | |
| 2860 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2861 | |
| 2862 | |
| 2863 | Reserved: 7 bits |
| 2864 | |
| 2865 | Set to 0 on transmit and ignored on receipt. |
| 2866 | |
| 2867 | T bit: 1 bit |
| 2868 | |
| 2869 | The T bit is set to 0 if the sender filled in the Verification Tag |
| 2870 | expected by the peer. If the Verification Tag is reflected, the T |
| 2871 | bit MUST be set to 1. Reflecting means that the sent Verification |
| 2872 | Tag is the same as the received one. |
| 2873 | |
| 2874 | Note: Special rules apply to this chunk for verification, please see |
| 2875 | Section 8.5.1 for details. |
| 2876 | |
| 2877 | 4. SCTP Association State Diagram |
| 2878 | |
| 2879 | During the life time of an SCTP association, the SCTP endpoint's |
| 2880 | association progresses from one state to another in response to |
| 2881 | various events. The events that may potentially advance an |
| 2882 | association's state include: |
| 2883 | |
| 2884 | o SCTP user primitive calls, e.g., [ASSOCIATE], [SHUTDOWN], [ABORT], |
| 2885 | |
| 2886 | o Reception of INIT, COOKIE ECHO, ABORT, SHUTDOWN, etc., control |
| 2887 | chunks, or |
| 2888 | |
| 2889 | o Some timeout events. |
| 2890 | |
| 2891 | The state diagram in the figures below illustrates state changes, |
| 2892 | together with the causing events and resulting actions. Note that |
| 2893 | some of the error conditions are not shown in the state diagram. |
| 2894 | Full descriptions of all special cases are found in the text. |
| 2895 | |
| 2896 | Note: Chunk names are given in all capital letters, while parameter |
| 2897 | names have the first letter capitalized, e.g., COOKIE ECHO chunk type |
| 2898 | vs. State Cookie parameter. If more than one event/message can occur |
| 2899 | that causes a state transition, it is labeled (A), (B), etc. |
| 2900 | |
| 2901 | |
| 2902 | |
| 2903 | |
| 2904 | |
| 2905 | |
| 2906 | |
| 2907 | |
| 2908 | |
| 2909 | |
| 2910 | |
| 2911 | |
| 2912 | |
| 2913 | |
| 2914 | Stewart Standards Track [Page 52] |
| 2915 | |
| 2916 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2917 | |
| 2918 | |
| 2919 | ----- -------- (from any state) |
| 2920 | / \ / rcv ABORT [ABORT] |
| 2921 | rcv INIT | | | ---------- or ---------- |
| 2922 | --------------- | v v delete TCB snd ABORT |
| 2923 | generate Cookie \ +---------+ delete TCB |
| 2924 | snd INIT ACK ---| CLOSED | |
| 2925 | +---------+ |
| 2926 | / \ [ASSOCIATE] |
| 2927 | / \ --------------- |
| 2928 | | | create TCB |
| 2929 | | | snd INIT |
| 2930 | | | strt init timer |
| 2931 | rcv valid | | |
| 2932 | COOKIE ECHO | v |
| 2933 | (1) ---------------- | +------------+ |
| 2934 | create TCB | | COOKIE-WAIT| (2) |
| 2935 | snd COOKIE ACK | +------------+ |
| 2936 | | | |
| 2937 | | | rcv INIT ACK |
| 2938 | | | ----------------- |
| 2939 | | | snd COOKIE ECHO |
| 2940 | | | stop init timer |
| 2941 | | | strt cookie timer |
| 2942 | | v |
| 2943 | | +--------------+ |
| 2944 | | | COOKIE-ECHOED| (3) |
| 2945 | | +--------------+ |
| 2946 | | | |
| 2947 | | | rcv COOKIE ACK |
| 2948 | | | ----------------- |
| 2949 | | | stop cookie timer |
| 2950 | v v |
| 2951 | +---------------+ |
| 2952 | | ESTABLISHED | |
| 2953 | +---------------+ |
| 2954 | |
| 2955 | |
| 2956 | |
| 2957 | |
| 2958 | |
| 2959 | |
| 2960 | |
| 2961 | |
| 2962 | |
| 2963 | |
| 2964 | |
| 2965 | |
| 2966 | |
| 2967 | |
| 2968 | |
| 2969 | |
| 2970 | Stewart Standards Track [Page 53] |
| 2971 | |
| 2972 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 2973 | |
| 2974 | |
| 2975 | (from the ESTABLISHED state only) |
| 2976 | | |
| 2977 | | |
| 2978 | /--------+--------\ |
| 2979 | [SHUTDOWN] / \ |
| 2980 | -------------------| | |
| 2981 | check outstanding | | |
| 2982 | DATA chunks | | |
| 2983 | v | |
| 2984 | +---------+ | |
| 2985 | |SHUTDOWN-| | rcv SHUTDOWN |
| 2986 | |PENDING | |------------------ |
| 2987 | +---------+ | check outstanding |
| 2988 | | | DATA chunks |
| 2989 | No more outstanding | | |
| 2990 | ---------------------| | |
| 2991 | snd SHUTDOWN | | |
| 2992 | strt shutdown timer | | |
| 2993 | v v |
| 2994 | +---------+ +-----------+ |
| 2995 | (4) |SHUTDOWN-| | SHUTDOWN- | (5,6) |
| 2996 | |SENT | | RECEIVED | |
| 2997 | +---------+ +-----------+ |
| 2998 | | \ | |
| 2999 | (A) rcv SHUTDOWN ACK | \ | |
| 3000 | ----------------------| \ | |
| 3001 | stop shutdown timer | \rcv:SHUTDOWN | |
| 3002 | send SHUTDOWN COMPLETE| \ (B) | |
| 3003 | delete TCB | \ | |
| 3004 | | \ | No more outstanding |
| 3005 | | \ |----------------- |
| 3006 | | \ | send SHUTDOWN ACK |
| 3007 | (B)rcv SHUTDOWN | \ | strt shutdown timer |
| 3008 | ----------------------| \ | |
| 3009 | send SHUTDOWN ACK | \ | |
| 3010 | start shutdown timer | \ | |
| 3011 | move to SHUTDOWN- | \ | |
| 3012 | ACK-SENT | | | |
| 3013 | | v | |
| 3014 | | +-----------+ |
| 3015 | | | SHUTDOWN- | (7) |
| 3016 | | | ACK-SENT | |
| 3017 | | +----------+- |
| 3018 | | | (C)rcv SHUTDOWN COMPLETE |
| 3019 | | |----------------- |
| 3020 | | | stop shutdown timer |
| 3021 | | | delete TCB |
| 3022 | | | |
| 3023 | |
| 3024 | |
| 3025 | |
| 3026 | Stewart Standards Track [Page 54] |
| 3027 | |
| 3028 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3029 | |
| 3030 | |
| 3031 | | | (D)rcv SHUTDOWN ACK |
| 3032 | | |-------------- |
| 3033 | | | stop shutdown timer |
| 3034 | | | send SHUTDOWN COMPLETE |
| 3035 | | | delete TCB |
| 3036 | | | |
| 3037 | \ +---------+ / |
| 3038 | \-->| CLOSED |<--/ |
| 3039 | +---------+ |
| 3040 | |
| 3041 | Figure 3: State Transition Diagram of SCTP |
| 3042 | |
| 3043 | Notes: |
| 3044 | |
| 3045 | 1) If the State Cookie in the received COOKIE ECHO is invalid (i.e., |
| 3046 | failed to pass the integrity check), the receiver MUST silently |
| 3047 | discard the packet. Or, if the received State Cookie is expired |
| 3048 | (see Section 5.1.5), the receiver MUST send back an ERROR chunk. |
| 3049 | In either case, the receiver stays in the CLOSED state. |
| 3050 | |
| 3051 | 2) If the T1-init timer expires, the endpoint MUST retransmit INIT |
| 3052 | and restart the T1-init timer without changing state. This MUST |
| 3053 | be repeated up to 'Max.Init.Retransmits' times. After that, the |
| 3054 | endpoint MUST abort the initialization process and report the |
| 3055 | error to the SCTP user. |
| 3056 | |
| 3057 | 3) If the T1-cookie timer expires, the endpoint MUST retransmit |
| 3058 | COOKIE ECHO and restart the T1-cookie timer without changing |
| 3059 | state. This MUST be repeated up to 'Max.Init.Retransmits' times. |
| 3060 | After that, the endpoint MUST abort the initialization process |
| 3061 | and report the error to the SCTP user. |
| 3062 | |
| 3063 | 4) In the SHUTDOWN-SENT state, the endpoint MUST acknowledge any |
| 3064 | received DATA chunks without delay. |
| 3065 | |
| 3066 | 5) In the SHUTDOWN-RECEIVED state, the endpoint MUST NOT accept any |
| 3067 | new send requests from its SCTP user. |
| 3068 | |
| 3069 | 6) In the SHUTDOWN-RECEIVED state, the endpoint MUST transmit or |
| 3070 | retransmit data and leave this state when all data in queue is |
| 3071 | transmitted. |
| 3072 | |
| 3073 | 7) In the SHUTDOWN-ACK-SENT state, the endpoint MUST NOT accept any |
| 3074 | new send requests from its SCTP user. |
| 3075 | |
| 3076 | The CLOSED state is used to indicate that an association is not |
| 3077 | created (i.e., doesn't exist). |
| 3078 | |
| 3079 | |
| 3080 | |
| 3081 | |
| 3082 | Stewart Standards Track [Page 55] |
| 3083 | |
| 3084 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3085 | |
| 3086 | |
| 3087 | 5. Association Initialization |
| 3088 | |
| 3089 | Before the first data transmission can take place from one SCTP |
| 3090 | endpoint ("A") to another SCTP endpoint ("Z"), the two endpoints must |
| 3091 | complete an initialization process in order to set up an SCTP |
| 3092 | association between them. |
| 3093 | |
| 3094 | The SCTP user at an endpoint should use the ASSOCIATE primitive to |
| 3095 | initialize an SCTP association to another SCTP endpoint. |
| 3096 | |
| 3097 | IMPLEMENTATION NOTE: From an SCTP user's point of view, an |
| 3098 | association may be implicitly opened, without an ASSOCIATE primitive |
| 3099 | (see Section 10.1 B) being invoked, by the initiating endpoint's |
| 3100 | sending of the first user data to the destination endpoint. The |
| 3101 | initiating SCTP will assume default values for all mandatory and |
| 3102 | optional parameters for the INIT/INIT ACK. |
| 3103 | |
| 3104 | Once the association is established, unidirectional streams are open |
| 3105 | for data transfer on both ends (see Section 5.1.1). |
| 3106 | |
| 3107 | 5.1. Normal Establishment of an Association |
| 3108 | |
| 3109 | The initialization process consists of the following steps (assuming |
| 3110 | that SCTP endpoint "A" tries to set up an association with SCTP |
| 3111 | endpoint "Z" and "Z" accepts the new association): |
| 3112 | |
| 3113 | A) "A" first sends an INIT chunk to "Z". In the INIT, "A" must |
| 3114 | provide its Verification Tag (Tag_A) in the Initiate Tag field. |
| 3115 | Tag_A SHOULD be a random number in the range of 1 to 4294967295 |
| 3116 | (see Section 5.3.1 for Tag value selection). After sending the |
| 3117 | INIT, "A" starts the T1-init timer and enters the COOKIE-WAIT |
| 3118 | state. |
| 3119 | |
| 3120 | B) "Z" shall respond immediately with an INIT ACK chunk. The |
| 3121 | destination IP address of the INIT ACK MUST be set to the source |
| 3122 | IP address of the INIT to which this INIT ACK is responding. In |
| 3123 | the response, besides filling in other parameters, "Z" must set |
| 3124 | the Verification Tag field to Tag_A, and also provide its own |
| 3125 | Verification Tag (Tag_Z) in the Initiate Tag field. |
| 3126 | |
| 3127 | Moreover, "Z" MUST generate and send along with the INIT ACK a |
| 3128 | State Cookie. See Section 5.1.3 for State Cookie generation. |
| 3129 | |
| 3130 | Note: After sending out INIT ACK with the State Cookie parameter, |
| 3131 | "Z" MUST NOT allocate any resources or keep any states for the new |
| 3132 | association. Otherwise, "Z" will be vulnerable to resource |
| 3133 | attacks. |
| 3134 | |
| 3135 | |
| 3136 | |
| 3137 | |
| 3138 | Stewart Standards Track [Page 56] |
| 3139 | |
| 3140 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3141 | |
| 3142 | |
| 3143 | C) Upon reception of the INIT ACK from "Z", "A" shall stop the T1- |
| 3144 | init timer and leave the COOKIE-WAIT state. "A" shall then send |
| 3145 | the State Cookie received in the INIT ACK chunk in a COOKIE ECHO |
| 3146 | chunk, start the T1-cookie timer, and enter the COOKIE-ECHOED |
| 3147 | state. |
| 3148 | |
| 3149 | Note: The COOKIE ECHO chunk can be bundled with any pending |
| 3150 | outbound DATA chunks, but it MUST be the first chunk in the packet |
| 3151 | and until the COOKIE ACK is returned the sender MUST NOT send any |
| 3152 | other packets to the peer. |
| 3153 | |
| 3154 | D) Upon reception of the COOKIE ECHO chunk, endpoint "Z" will reply |
| 3155 | with a COOKIE ACK chunk after building a TCB and moving to the |
| 3156 | ESTABLISHED state. A COOKIE ACK chunk may be bundled with any |
| 3157 | pending DATA chunks (and/or SACK chunks), but the COOKIE ACK chunk |
| 3158 | MUST be the first chunk in the packet. |
| 3159 | |
| 3160 | IMPLEMENTATION NOTE: An implementation may choose to send the |
| 3161 | Communication Up notification to the SCTP user upon reception of a |
| 3162 | valid COOKIE ECHO chunk. |
| 3163 | |
| 3164 | E) Upon reception of the COOKIE ACK, endpoint "A" will move from the |
| 3165 | COOKIE-ECHOED state to the ESTABLISHED state, stopping the T1- |
| 3166 | cookie timer. It may also notify its ULP about the successful |
| 3167 | establishment of the association with a Communication Up |
| 3168 | notification (see Section 10). |
| 3169 | |
| 3170 | An INIT or INIT ACK chunk MUST NOT be bundled with any other chunk. |
| 3171 | They MUST be the only chunks present in the SCTP packets that carry |
| 3172 | them. |
| 3173 | |
| 3174 | An endpoint MUST send the INIT ACK to the IP address from which it |
| 3175 | received the INIT. |
| 3176 | |
| 3177 | Note: T1-init timer and T1-cookie timer shall follow the same rules |
| 3178 | given in Section 6.3. |
| 3179 | |
| 3180 | If an endpoint receives an INIT, INIT ACK, or COOKIE ECHO chunk but |
| 3181 | decides not to establish the new association due to missing mandatory |
| 3182 | parameters in the received INIT or INIT ACK, invalid parameter |
| 3183 | values, or lack of local resources, it SHOULD respond with an ABORT |
| 3184 | chunk. It SHOULD also specify the cause of abort, such as the type |
| 3185 | of the missing mandatory parameters, etc., by including the error |
| 3186 | cause parameters with the ABORT chunk. The Verification Tag field in |
| 3187 | the common header of the outbound SCTP packet containing the ABORT |
| 3188 | chunk MUST be set to the Initiate Tag value of the peer. |
| 3189 | |
| 3190 | |
| 3191 | |
| 3192 | |
| 3193 | |
| 3194 | Stewart Standards Track [Page 57] |
| 3195 | |
| 3196 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3197 | |
| 3198 | |
| 3199 | Note that a COOKIE ECHO chunk that does NOT pass the integrity check |
| 3200 | is NOT considered an 'invalid parameter' and requires special |
| 3201 | handling; see Section 5.1.5. |
| 3202 | |
| 3203 | After the reception of the first DATA chunk in an association the |
| 3204 | endpoint MUST immediately respond with a SACK to acknowledge the DATA |
| 3205 | chunk. Subsequent acknowledgements should be done as described in |
| 3206 | Section 6.2. |
| 3207 | |
| 3208 | When the TCB is created, each endpoint MUST set its internal |
| 3209 | Cumulative TSN Ack Point to the value of its transmitted Initial TSN |
| 3210 | minus one. |
| 3211 | |
| 3212 | IMPLEMENTATION NOTE: The IP addresses and SCTP port are generally |
| 3213 | used as the key to find the TCB within an SCTP instance. |
| 3214 | |
| 3215 | 5.1.1. Handle Stream Parameters |
| 3216 | |
| 3217 | In the INIT and INIT ACK chunks, the sender of the chunk MUST |
| 3218 | indicate the number of outbound streams (OSs) it wishes to have in |
| 3219 | the association, as well as the maximum inbound streams (MISs) it |
| 3220 | will accept from the other endpoint. |
| 3221 | |
| 3222 | After receiving the stream configuration information from the other |
| 3223 | side, each endpoint MUST perform the following check: If the peer's |
| 3224 | MIS is less than the endpoint's OS, meaning that the peer is |
| 3225 | incapable of supporting all the outbound streams the endpoint wants |
| 3226 | to configure, the endpoint MUST use MIS outbound streams and MAY |
| 3227 | report any shortage to the upper layer. The upper layer can then |
| 3228 | choose to abort the association if the resource shortage is |
| 3229 | unacceptable. |
| 3230 | |
| 3231 | After the association is initialized, the valid outbound stream |
| 3232 | identifier range for either endpoint shall be 0 to min(local OS, |
| 3233 | remote MIS)-1. |
| 3234 | |
| 3235 | 5.1.2. Handle Address Parameters |
| 3236 | |
| 3237 | During the association initialization, an endpoint shall use the |
| 3238 | following rules to discover and collect the destination transport |
| 3239 | address(es) of its peer. |
| 3240 | |
| 3241 | A) If there are no address parameters present in the received INIT or |
| 3242 | INIT ACK chunk, the endpoint shall take the source IP address from |
| 3243 | which the chunk arrives and record it, in combination with the |
| 3244 | SCTP source port number, as the only destination transport address |
| 3245 | for this peer. |
| 3246 | |
| 3247 | |
| 3248 | |
| 3249 | |
| 3250 | Stewart Standards Track [Page 58] |
| 3251 | |
| 3252 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3253 | |
| 3254 | |
| 3255 | B) If there is a Host Name parameter present in the received INIT or |
| 3256 | INIT ACK chunk, the endpoint shall resolve that host name to a |
| 3257 | list of IP address(es) and derive the transport address(es) of |
| 3258 | this peer by combining the resolved IP address(es) with the SCTP |
| 3259 | source port. |
| 3260 | |
| 3261 | The endpoint MUST ignore any other IP Address parameters if they |
| 3262 | are also present in the received INIT or INIT ACK chunk. |
| 3263 | |
| 3264 | The time at which the receiver of an INIT resolves the host name |
| 3265 | has potential security implications to SCTP. If the receiver of |
| 3266 | an INIT resolves the host name upon the reception of the chunk, |
| 3267 | and the mechanism the receiver uses to resolve the host name |
| 3268 | involves potential long delay (e.g., DNS query), the receiver may |
| 3269 | open itself up to resource attacks for the period of time while it |
| 3270 | is waiting for the name resolution results before it can build the |
| 3271 | State Cookie and release local resources. |
| 3272 | |
| 3273 | Therefore, in cases where the name translation involves potential |
| 3274 | long delay, the receiver of the INIT MUST postpone the name |
| 3275 | resolution till the reception of the COOKIE ECHO chunk from the |
| 3276 | peer. In such a case, the receiver of the INIT SHOULD build the |
| 3277 | State Cookie using the received Host Name (instead of destination |
| 3278 | transport addresses) and send the INIT ACK to the source IP |
| 3279 | address from which the INIT was received. |
| 3280 | |
| 3281 | The receiver of an INIT ACK shall always immediately attempt to |
| 3282 | resolve the name upon the reception of the chunk. |
| 3283 | |
| 3284 | The receiver of the INIT or INIT ACK MUST NOT send user data |
| 3285 | (piggy-backed or stand-alone) to its peer until the host name is |
| 3286 | successfully resolved. |
| 3287 | |
| 3288 | If the name resolution is not successful, the endpoint MUST |
| 3289 | immediately send an ABORT with "Unresolvable Address" error cause |
| 3290 | to its peer. The ABORT shall be sent to the source IP address |
| 3291 | from which the last peer packet was received. |
| 3292 | |
| 3293 | C) If there are only IPv4/IPv6 addresses present in the received INIT |
| 3294 | or INIT ACK chunk, the receiver MUST derive and record all the |
| 3295 | transport addresses from the received chunk AND the source IP |
| 3296 | address that sent the INIT or INIT ACK. The transport addresses |
| 3297 | are derived by the combination of SCTP source port (from the |
| 3298 | common header) and the IP Address parameter(s) carried in the INIT |
| 3299 | or INIT ACK chunk and the source IP address of the IP datagram. |
| 3300 | The receiver should use only these transport addresses as |
| 3301 | destination transport addresses when sending subsequent packets to |
| 3302 | its peer. |
| 3303 | |
| 3304 | |
| 3305 | |
| 3306 | Stewart Standards Track [Page 59] |
| 3307 | |
| 3308 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3309 | |
| 3310 | |
| 3311 | D) An INIT or INIT ACK chunk MUST be treated as belonging to an |
| 3312 | already established association (or one in the process of being |
| 3313 | established) if the use of any of the valid address parameters |
| 3314 | contained within the chunk would identify an existing TCB. |
| 3315 | |
| 3316 | IMPLEMENTATION NOTE: In some cases (e.g., when the implementation |
| 3317 | doesn't control the source IP address that is used for transmitting), |
| 3318 | an endpoint might need to include in its INIT or INIT ACK all |
| 3319 | possible IP addresses from which packets to the peer could be |
| 3320 | transmitted. |
| 3321 | |
| 3322 | After all transport addresses are derived from the INIT or INIT ACK |
| 3323 | chunk using the above rules, the endpoint shall select one of the |
| 3324 | transport addresses as the initial primary path. |
| 3325 | |
| 3326 | Note: The INIT ACK MUST be sent to the source address of the INIT. |
| 3327 | |
| 3328 | The sender of INIT may include a 'Supported Address Types' parameter |
| 3329 | in the INIT to indicate what types of address are acceptable. When |
| 3330 | this parameter is present, the receiver of INIT (initiate) MUST |
| 3331 | either use one of the address types indicated in the Supported |
| 3332 | Address Types parameter when responding to the INIT, or abort the |
| 3333 | association with an "Unresolvable Address" error cause if it is |
| 3334 | unwilling or incapable of using any of the address types indicated by |
| 3335 | its peer. |
| 3336 | |
| 3337 | IMPLEMENTATION NOTE: In the case that the receiver of an INIT ACK |
| 3338 | fails to resolve the address parameter due to an unsupported type, it |
| 3339 | can abort the initiation process and then attempt a reinitiation by |
| 3340 | using a 'Supported Address Types' parameter in the new INIT to |
| 3341 | indicate what types of address it prefers. |
| 3342 | |
| 3343 | IMPLEMENTATION NOTE: If an SCTP endpoint that only supports either |
| 3344 | IPv4 or IPv6 receives IPv4 and IPv6 addresses in an INIT or INIT ACK |
| 3345 | chunk from its peer, it MUST use all the addresses belonging to the |
| 3346 | supported address family. The other addresses MAY be ignored. The |
| 3347 | endpoint SHOULD NOT respond with any kind of error indication. |
| 3348 | |
| 3349 | IMPLEMENTATION NOTE: If an SCTP endpoint lists in the 'Supported |
| 3350 | Address Types' parameter either IPv4 or IPv6, but uses the other |
| 3351 | family for sending the packet containing the INIT chunk, or if it |
| 3352 | also lists addresses of the other family in the INIT chunk, then the |
| 3353 | address family that is not listed in the 'Supported Address Types' |
| 3354 | parameter SHOULD also be considered as supported by the receiver of |
| 3355 | the INIT chunk. The receiver of the INIT chunk SHOULD NOT respond |
| 3356 | with any kind of error indication. |
| 3357 | |
| 3358 | |
| 3359 | |
| 3360 | |
| 3361 | |
| 3362 | Stewart Standards Track [Page 60] |
| 3363 | |
| 3364 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3365 | |
| 3366 | |
| 3367 | 5.1.3. Generating State Cookie |
| 3368 | |
| 3369 | When sending an INIT ACK as a response to an INIT chunk, the sender |
| 3370 | of INIT ACK creates a State Cookie and sends it in the State Cookie |
| 3371 | parameter of the INIT ACK. Inside this State Cookie, the sender |
| 3372 | should include a MAC (see [RFC2104] for an example), a timestamp on |
| 3373 | when the State Cookie is created, and the lifespan of the State |
| 3374 | Cookie, along with all the information necessary for it to establish |
| 3375 | the association. |
| 3376 | |
| 3377 | The following steps SHOULD be taken to generate the State Cookie: |
| 3378 | |
| 3379 | 1) Create an association TCB using information from both the |
| 3380 | received INIT and the outgoing INIT ACK chunk, |
| 3381 | |
| 3382 | 2) In the TCB, set the creation time to the current time of day, and |
| 3383 | the lifespan to the protocol parameter 'Valid.Cookie.Life' (see |
| 3384 | Section 15), |
| 3385 | |
| 3386 | 3) From the TCB, identify and collect the minimal subset of |
| 3387 | information needed to re-create the TCB, and generate a MAC using |
| 3388 | this subset of information and a secret key (see [RFC2104] for an |
| 3389 | example of generating a MAC), and |
| 3390 | |
| 3391 | 4) Generate the State Cookie by combining this subset of information |
| 3392 | and the resultant MAC. |
| 3393 | |
| 3394 | After sending the INIT ACK with the State Cookie parameter, the |
| 3395 | sender SHOULD delete the TCB and any other local resource related to |
| 3396 | the new association, so as to prevent resource attacks. |
| 3397 | |
| 3398 | The hashing method used to generate the MAC is strictly a private |
| 3399 | matter for the receiver of the INIT chunk. The use of a MAC is |
| 3400 | mandatory to prevent denial-of-service attacks. The secret key |
| 3401 | SHOULD be random ([RFC4086] provides some information on randomness |
| 3402 | guidelines); it SHOULD be changed reasonably frequently, and the |
| 3403 | timestamp in the State Cookie MAY be used to determine which key |
| 3404 | should be used to verify the MAC. |
| 3405 | |
| 3406 | An implementation SHOULD make the cookie as small as possible to |
| 3407 | ensure interoperability. |
| 3408 | |
| 3409 | |
| 3410 | |
| 3411 | |
| 3412 | |
| 3413 | |
| 3414 | |
| 3415 | |
| 3416 | |
| 3417 | |
| 3418 | Stewart Standards Track [Page 61] |
| 3419 | |
| 3420 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3421 | |
| 3422 | |
| 3423 | 5.1.4. State Cookie Processing |
| 3424 | |
| 3425 | When an endpoint (in the COOKIE-WAIT state) receives an INIT ACK |
| 3426 | chunk with a State Cookie parameter, it MUST immediately send a |
| 3427 | COOKIE ECHO chunk to its peer with the received State Cookie. The |
| 3428 | sender MAY also add any pending DATA chunks to the packet after the |
| 3429 | COOKIE ECHO chunk. |
| 3430 | |
| 3431 | The endpoint shall also start the T1-cookie timer after sending out |
| 3432 | the COOKIE ECHO chunk. If the timer expires, the endpoint shall |
| 3433 | retransmit the COOKIE ECHO chunk and restart the T1-cookie timer. |
| 3434 | This is repeated until either a COOKIE ACK is received or |
| 3435 | 'Max.Init.Retransmits' (see Section 15) is reached causing the peer |
| 3436 | endpoint to be marked unreachable (and thus the association enters |
| 3437 | the CLOSED state). |
| 3438 | |
| 3439 | 5.1.5. State Cookie Authentication |
| 3440 | |
| 3441 | When an endpoint receives a COOKIE ECHO chunk from another endpoint |
| 3442 | with which it has no association, it shall take the following |
| 3443 | actions: |
| 3444 | |
| 3445 | 1) Compute a MAC using the TCB data carried in the State Cookie and |
| 3446 | the secret key (note the timestamp in the State Cookie MAY be |
| 3447 | used to determine which secret key to use). [RFC2104] can be |
| 3448 | used as a guideline for generating the MAC, |
| 3449 | |
| 3450 | 2) Authenticate the State Cookie as one that it previously generated |
| 3451 | by comparing the computed MAC against the one carried in the |
| 3452 | State Cookie. If this comparison fails, the SCTP packet, |
| 3453 | including the COOKIE ECHO and any DATA chunks, should be silently |
| 3454 | discarded, |
| 3455 | |
| 3456 | 3) Compare the port numbers and the Verification Tag contained |
| 3457 | within the COOKIE ECHO chunk to the actual port numbers and the |
| 3458 | Verification Tag within the SCTP common header of the received |
| 3459 | packet. If these values do not match, the packet MUST be |
| 3460 | silently discarded. |
| 3461 | |
| 3462 | 4) Compare the creation timestamp in the State Cookie to the current |
| 3463 | local time. If the elapsed time is longer than the lifespan |
| 3464 | carried in the State Cookie, then the packet, including the |
| 3465 | COOKIE ECHO and any attached DATA chunks, SHOULD be discarded, |
| 3466 | and the endpoint MUST transmit an ERROR chunk with a "Stale |
| 3467 | Cookie" error cause to the peer endpoint. |
| 3468 | |
| 3469 | |
| 3470 | |
| 3471 | |
| 3472 | |
| 3473 | |
| 3474 | Stewart Standards Track [Page 62] |
| 3475 | |
| 3476 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3477 | |
| 3478 | |
| 3479 | 5) If the State Cookie is valid, create an association to the sender |
| 3480 | of the COOKIE ECHO chunk with the information in the TCB data |
| 3481 | carried in the COOKIE ECHO and enter the ESTABLISHED state. |
| 3482 | |
| 3483 | 6) Send a COOKIE ACK chunk to the peer acknowledging receipt of the |
| 3484 | COOKIE ECHO. The COOKIE ACK MAY be bundled with an outbound DATA |
| 3485 | chunk or SACK chunk; however, the COOKIE ACK MUST be the first |
| 3486 | chunk in the SCTP packet. |
| 3487 | |
| 3488 | 7) Immediately acknowledge any DATA chunk bundled with the COOKIE |
| 3489 | ECHO with a SACK (subsequent DATA chunk acknowledgement should |
| 3490 | follow the rules defined in Section 6.2). As mentioned in step |
| 3491 | 6, if the SACK is bundled with the COOKIE ACK, the COOKIE ACK |
| 3492 | MUST appear first in the SCTP packet. |
| 3493 | |
| 3494 | If a COOKIE ECHO is received from an endpoint with which the receiver |
| 3495 | of the COOKIE ECHO has an existing association, the procedures in |
| 3496 | Section 5.2 should be followed. |
| 3497 | |
| 3498 | |
| 3499 | |
| 3500 | |
| 3501 | |
| 3502 | |
| 3503 | |
| 3504 | |
| 3505 | |
| 3506 | |
| 3507 | |
| 3508 | |
| 3509 | |
| 3510 | |
| 3511 | |
| 3512 | |
| 3513 | |
| 3514 | |
| 3515 | |
| 3516 | |
| 3517 | |
| 3518 | |
| 3519 | |
| 3520 | |
| 3521 | |
| 3522 | |
| 3523 | |
| 3524 | |
| 3525 | |
| 3526 | |
| 3527 | |
| 3528 | |
| 3529 | |
| 3530 | Stewart Standards Track [Page 63] |
| 3531 | |
| 3532 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3533 | |
| 3534 | |
| 3535 | 5.1.6. An Example of Normal Association Establishment |
| 3536 | |
| 3537 | In the following example, "A" initiates the association and then |
| 3538 | sends a user message to "Z", then "Z" sends two user messages to "A" |
| 3539 | later (assuming no bundling or fragmentation occurs): |
| 3540 | |
| 3541 | Endpoint A Endpoint Z |
| 3542 | {app sets association with Z} |
| 3543 | (build TCB) |
| 3544 | INIT [I-Tag=Tag_A |
| 3545 | & other info] ------\ |
| 3546 | (Start T1-init timer) \ |
| 3547 | (Enter COOKIE-WAIT state) \---> (compose temp TCB and Cookie_Z) |
| 3548 | /-- INIT ACK [Veri Tag=Tag_A, |
| 3549 | / I-Tag=Tag_Z, |
| 3550 | (Cancel T1-init timer) <------/ Cookie_Z, & other info] |
| 3551 | (destroy temp TCB) |
| 3552 | COOKIE ECHO [Cookie_Z] ------\ |
| 3553 | (Start T1-init timer) \ |
| 3554 | (Enter COOKIE-ECHOED state) \---> (build TCB enter ESTABLISHED |
| 3555 | state) |
| 3556 | /---- COOKIE-ACK |
| 3557 | / |
| 3558 | (Cancel T1-init timer, <-----/ |
| 3559 | Enter ESTABLISHED state) |
| 3560 | {app sends 1st user data; strm 0} |
| 3561 | DATA [TSN=initial TSN_A |
| 3562 | Strm=0,Seq=0 & user data]--\ |
| 3563 | (Start T3-rtx timer) \ |
| 3564 | \-> |
| 3565 | /----- SACK [TSN Ack=init |
| 3566 | / TSN_A,Block=0] |
| 3567 | (Cancel T3-rtx timer) <------/ |
| 3568 | ... |
| 3569 | {app sends 2 messages;strm 0} |
| 3570 | /---- DATA |
| 3571 | / [TSN=init TSN_Z |
| 3572 | <--/ Strm=0,Seq=0 & user data 1] |
| 3573 | SACK [TSN Ack=init TSN_Z, /---- DATA |
| 3574 | Block=0] --------\ / [TSN=init TSN_Z +1, |
| 3575 | \/ Strm=0,Seq=1 & user data 2] |
| 3576 | <------/\ |
| 3577 | \ |
| 3578 | \------> |
| 3579 | |
| 3580 | Figure 4: INITIATION Example |
| 3581 | |
| 3582 | |
| 3583 | |
| 3584 | |
| 3585 | |
| 3586 | Stewart Standards Track [Page 64] |
| 3587 | |
| 3588 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3589 | |
| 3590 | |
| 3591 | If the T1-init timer expires at "A" after the INIT or COOKIE ECHO |
| 3592 | chunks are sent, the same INIT or COOKIE ECHO chunk with the same |
| 3593 | Initiate Tag (i.e., Tag_A) or State Cookie shall be retransmitted and |
| 3594 | the timer restarted. This shall be repeated Max.Init.Retransmits |
| 3595 | times before "A" considers "Z" unreachable and reports the failure to |
| 3596 | its upper layer (and thus the association enters the CLOSED state). |
| 3597 | |
| 3598 | When retransmitting the INIT, the endpoint MUST follow the rules |
| 3599 | defined in Section 6.3 to determine the proper timer value. |
| 3600 | |
| 3601 | 5.2. Handle Duplicate or Unexpected INIT, INIT ACK, COOKIE ECHO, and |
| 3602 | COOKIE ACK |
| 3603 | |
| 3604 | During the life time of an association (in one of the possible |
| 3605 | states), an endpoint may receive from its peer endpoint one of the |
| 3606 | setup chunks (INIT, INIT ACK, COOKIE ECHO, and COOKIE ACK). The |
| 3607 | receiver shall treat such a setup chunk as a duplicate and process it |
| 3608 | as described in this section. |
| 3609 | |
| 3610 | Note: An endpoint will not receive the chunk unless the chunk was |
| 3611 | sent to an SCTP transport address and is from an SCTP transport |
| 3612 | address associated with this endpoint. Therefore, the endpoint |
| 3613 | processes such a chunk as part of its current association. |
| 3614 | |
| 3615 | The following scenarios can cause duplicated or unexpected chunks: |
| 3616 | |
| 3617 | A) The peer has crashed without being detected, restarted itself, and |
| 3618 | sent out a new INIT chunk trying to restore the association, |
| 3619 | |
| 3620 | B) Both sides are trying to initialize the association at about the |
| 3621 | same time, |
| 3622 | |
| 3623 | C) The chunk is from a stale packet that was used to establish the |
| 3624 | present association or a past association that is no longer in |
| 3625 | existence, |
| 3626 | |
| 3627 | D) The chunk is a false packet generated by an attacker, or |
| 3628 | |
| 3629 | E) The peer never received the COOKIE ACK and is retransmitting its |
| 3630 | COOKIE ECHO. |
| 3631 | |
| 3632 | The rules in the following sections shall be applied in order to |
| 3633 | identify and correctly handle these cases. |
| 3634 | |
| 3635 | |
| 3636 | |
| 3637 | |
| 3638 | |
| 3639 | |
| 3640 | |
| 3641 | |
| 3642 | Stewart Standards Track [Page 65] |
| 3643 | |
| 3644 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3645 | |
| 3646 | |
| 3647 | 5.2.1. INIT Received in COOKIE-WAIT or COOKIE-ECHOED State (Item B) |
| 3648 | |
| 3649 | This usually indicates an initialization collision, i.e., each |
| 3650 | endpoint is attempting, at about the same time, to establish an |
| 3651 | association with the other endpoint. |
| 3652 | |
| 3653 | Upon receipt of an INIT in the COOKIE-WAIT state, an endpoint MUST |
| 3654 | respond with an INIT ACK using the same parameters it sent in its |
| 3655 | original INIT chunk (including its Initiate Tag, unchanged). When |
| 3656 | responding, the endpoint MUST send the INIT ACK back to the same |
| 3657 | address that the original INIT (sent by this endpoint) was sent. |
| 3658 | |
| 3659 | Upon receipt of an INIT in the COOKIE-ECHOED state, an endpoint MUST |
| 3660 | respond with an INIT ACK using the same parameters it sent in its |
| 3661 | original INIT chunk (including its Initiate Tag, unchanged), provided |
| 3662 | that no NEW address has been added to the forming association. If |
| 3663 | the INIT message indicates that a new address has been added to the |
| 3664 | association, then the entire INIT MUST be discarded, and NO changes |
| 3665 | should be made to the existing association. An ABORT SHOULD be sent |
| 3666 | in response that MAY include the error 'Restart of an association |
| 3667 | with new addresses'. The error SHOULD list the addresses that were |
| 3668 | added to the restarting association. |
| 3669 | |
| 3670 | When responding in either state (COOKIE-WAIT or COOKIE-ECHOED) with |
| 3671 | an INIT ACK, the original parameters are combined with those from the |
| 3672 | newly received INIT chunk. The endpoint shall also generate a State |
| 3673 | Cookie with the INIT ACK. The endpoint uses the parameters sent in |
| 3674 | its INIT to calculate the State Cookie. |
| 3675 | |
| 3676 | After that, the endpoint MUST NOT change its state, the T1-init timer |
| 3677 | shall be left running, and the corresponding TCB MUST NOT be |
| 3678 | destroyed. The normal procedures for handling State Cookies when a |
| 3679 | TCB exists will resolve the duplicate INITs to a single association. |
| 3680 | |
| 3681 | For an endpoint that is in the COOKIE-ECHOED state, it MUST populate |
| 3682 | its Tie-Tags within both the association TCB and inside the State |
| 3683 | Cookie (see Section 5.2.2 for a description of the Tie-Tags). |
| 3684 | |
| 3685 | 5.2.2. Unexpected INIT in States Other than CLOSED, COOKIE-ECHOED, |
| 3686 | COOKIE-WAIT, and SHUTDOWN-ACK-SENT |
| 3687 | |
| 3688 | Unless otherwise stated, upon receipt of an unexpected INIT for this |
| 3689 | association, the endpoint shall generate an INIT ACK with a State |
| 3690 | Cookie. Before responding, the endpoint MUST check to see if the |
| 3691 | unexpected INIT adds new addresses to the association. If new |
| 3692 | addresses are added to the association, the endpoint MUST respond |
| 3693 | with an ABORT, copying the 'Initiate Tag' of the unexpected INIT into |
| 3694 | the 'Verification Tag' of the outbound packet carrying the ABORT. In |
| 3695 | |
| 3696 | |
| 3697 | |
| 3698 | Stewart Standards Track [Page 66] |
| 3699 | |
| 3700 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3701 | |
| 3702 | |
| 3703 | the ABORT response, the cause of error MAY be set to 'restart of an |
| 3704 | association with new addresses'. The error SHOULD list the addresses |
| 3705 | that were added to the restarting association. If no new addresses |
| 3706 | are added, when responding to the INIT in the outbound INIT ACK, the |
| 3707 | endpoint MUST copy its current Tie-Tags to a reserved place within |
| 3708 | the State Cookie and the association's TCB. We shall refer to these |
| 3709 | locations inside the cookie as the Peer's-Tie-Tag and the Local-Tie- |
| 3710 | Tag. We will refer to the copy within an association's TCB as the |
| 3711 | Local Tag and Peer's Tag. The outbound SCTP packet containing this |
| 3712 | INIT ACK MUST carry a Verification Tag value equal to the Initiate |
| 3713 | Tag found in the unexpected INIT. And the INIT ACK MUST contain a |
| 3714 | new Initiate Tag (randomly generated; see Section 5.3.1). Other |
| 3715 | parameters for the endpoint SHOULD be copied from the existing |
| 3716 | parameters of the association (e.g., number of outbound streams) into |
| 3717 | the INIT ACK and cookie. |
| 3718 | |
| 3719 | After sending out the INIT ACK or ABORT, the endpoint shall take no |
| 3720 | further actions; i.e., the existing association, including its |
| 3721 | current state, and the corresponding TCB MUST NOT be changed. |
| 3722 | |
| 3723 | Note: Only when a TCB exists and the association is not in a COOKIE- |
| 3724 | WAIT or SHUTDOWN-ACK-SENT state are the Tie-Tags populated with a |
| 3725 | value other than 0. For a normal association INIT (i.e., the |
| 3726 | endpoint is in the CLOSED state), the Tie-Tags MUST be set to 0 |
| 3727 | (indicating that no previous TCB existed). |
| 3728 | |
| 3729 | 5.2.3. Unexpected INIT ACK |
| 3730 | |
| 3731 | If an INIT ACK is received by an endpoint in any state other than the |
| 3732 | COOKIE-WAIT state, the endpoint should discard the INIT ACK chunk. |
| 3733 | An unexpected INIT ACK usually indicates the processing of an old or |
| 3734 | duplicated INIT chunk. |
| 3735 | |
| 3736 | 5.2.4. Handle a COOKIE ECHO when a TCB Exists |
| 3737 | |
| 3738 | When a COOKIE ECHO chunk is received by an endpoint in any state for |
| 3739 | an existing association (i.e., not in the CLOSED state) the following |
| 3740 | rules shall be applied: |
| 3741 | |
| 3742 | 1) Compute a MAC as described in step 1 of Section 5.1.5, |
| 3743 | |
| 3744 | 2) Authenticate the State Cookie as described in step 2 of Section |
| 3745 | 5.1.5 (this is case C or D above). |
| 3746 | |
| 3747 | 3) Compare the timestamp in the State Cookie to the current time. |
| 3748 | If the State Cookie is older than the lifespan carried in the |
| 3749 | State Cookie and the Verification Tags contained in the State |
| 3750 | Cookie do not match the current association's Verification Tags, |
| 3751 | |
| 3752 | |
| 3753 | |
| 3754 | Stewart Standards Track [Page 67] |
| 3755 | |
| 3756 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3757 | |
| 3758 | |
| 3759 | the packet, including the COOKIE ECHO and any DATA chunks, should |
| 3760 | be discarded. The endpoint also MUST transmit an ERROR chunk |
| 3761 | with a "Stale Cookie" error cause to the peer endpoint (this is |
| 3762 | case C or D in Section 5.2). |
| 3763 | |
| 3764 | If both Verification Tags in the State Cookie match the |
| 3765 | Verification Tags of the current association, consider the State |
| 3766 | Cookie valid (this is case E in Section 5.2) even if the lifespan |
| 3767 | is exceeded. |
| 3768 | |
| 3769 | 4) If the State Cookie proves to be valid, unpack the TCB into a |
| 3770 | temporary TCB. |
| 3771 | |
| 3772 | 5) Refer to Table 2 to determine the correct action to be taken. |
| 3773 | |
| 3774 | +------------+------------+---------------+--------------+-------------+ |
| 3775 | | Local Tag | Peer's Tag | Local-Tie-Tag |Peer's-Tie-Tag| Action/ | |
| 3776 | | | | | | Description | |
| 3777 | +------------+------------+---------------+--------------+-------------+ |
| 3778 | | X | X | M | M | (A) | |
| 3779 | +------------+------------+---------------+--------------+-------------+ |
| 3780 | | M | X | A | A | (B) | |
| 3781 | +------------+------------+---------------+--------------+-------------+ |
| 3782 | | M | 0 | A | A | (B) | |
| 3783 | +------------+------------+---------------+--------------+-------------+ |
| 3784 | | X | M | 0 | 0 | (C) | |
| 3785 | +------------+------------+---------------+--------------+-------------+ |
| 3786 | | M | M | A | A | (D) | |
| 3787 | +======================================================================+ |
| 3788 | | Table 2: Handling of a COOKIE ECHO when a TCB Exists | |
| 3789 | +======================================================================+ |
| 3790 | |
| 3791 | Legend: |
| 3792 | |
| 3793 | X - Tag does not match the existing TCB. |
| 3794 | M - Tag matches the existing TCB. |
| 3795 | 0 - No Tie-Tag in cookie (unknown). |
| 3796 | A - All cases, i.e., M, X, or 0. |
| 3797 | |
| 3798 | Note: For any case not shown in Table 2, the cookie should be |
| 3799 | silently discarded. |
| 3800 | |
| 3801 | Action |
| 3802 | |
| 3803 | A) In this case, the peer may have restarted. When the endpoint |
| 3804 | recognizes this potential 'restart', the existing session is |
| 3805 | treated the same as if it received an ABORT followed by a new |
| 3806 | COOKIE ECHO with the following exceptions: |
| 3807 | |
| 3808 | |
| 3809 | |
| 3810 | Stewart Standards Track [Page 68] |
| 3811 | |
| 3812 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3813 | |
| 3814 | |
| 3815 | - Any SCTP DATA chunks MAY be retained (this is an |
| 3816 | implementation-specific option). |
| 3817 | |
| 3818 | - A notification of RESTART SHOULD be sent to the ULP instead of |
| 3819 | a "COMMUNICATION LOST" notification. |
| 3820 | |
| 3821 | All the congestion control parameters (e.g., cwnd, ssthresh) |
| 3822 | related to this peer MUST be reset to their initial values (see |
| 3823 | Section 6.2.1). |
| 3824 | |
| 3825 | After this, the endpoint shall enter the ESTABLISHED state. |
| 3826 | |
| 3827 | If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes |
| 3828 | that the peer has restarted (Action A), it MUST NOT set up a new |
| 3829 | association but instead resend the SHUTDOWN ACK and send an ERROR |
| 3830 | chunk with a "Cookie Received While Shutting Down" error cause to |
| 3831 | its peer. |
| 3832 | |
| 3833 | B) In this case, both sides may be attempting to start an association |
| 3834 | at about the same time, but the peer endpoint started its INIT |
| 3835 | after responding to the local endpoint's INIT. Thus, it may have |
| 3836 | picked a new Verification Tag, not being aware of the previous tag |
| 3837 | it had sent this endpoint. The endpoint should stay in or enter |
| 3838 | the ESTABLISHED state, but it MUST update its peer's Verification |
| 3839 | Tag from the State Cookie, stop any init or cookie timers that may |
| 3840 | be running, and send a COOKIE ACK. |
| 3841 | |
| 3842 | C) In this case, the local endpoint's cookie has arrived late. |
| 3843 | Before it arrived, the local endpoint sent an INIT and received an |
| 3844 | INIT ACK and finally sent a COOKIE ECHO with the peer's same tag |
| 3845 | but a new tag of its own. The cookie should be silently |
| 3846 | discarded. The endpoint SHOULD NOT change states and should leave |
| 3847 | any timers running. |
| 3848 | |
| 3849 | D) When both local and remote tags match, the endpoint should enter |
| 3850 | the ESTABLISHED state, if it is in the COOKIE-ECHOED state. It |
| 3851 | should stop any cookie timer that may be running and send a COOKIE |
| 3852 | ACK. |
| 3853 | |
| 3854 | Note: The "peer's Verification Tag" is the tag received in the |
| 3855 | Initiate Tag field of the INIT or INIT ACK chunk. |
| 3856 | |
| 3857 | 5.2.4.1. An Example of a Association Restart |
| 3858 | |
| 3859 | In the following example, "A" initiates the association after a |
| 3860 | restart has occurred. Endpoint "Z" had no knowledge of the restart |
| 3861 | until the exchange (i.e., Heartbeats had not yet detected the failure |
| 3862 | of "A") (assuming no bundling or fragmentation occurs): |
| 3863 | |
| 3864 | |
| 3865 | |
| 3866 | Stewart Standards Track [Page 69] |
| 3867 | |
| 3868 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3869 | |
| 3870 | |
| 3871 | Endpoint A Endpoint Z |
| 3872 | <-------------- Association is established----------------------> |
| 3873 | Tag=Tag_A Tag=Tag_Z |
| 3874 | <---------------------------------------------------------------> |
| 3875 | {A crashes and restarts} |
| 3876 | {app sets up a association with Z} |
| 3877 | (build TCB) |
| 3878 | INIT [I-Tag=Tag_A' |
| 3879 | & other info] --------\ |
| 3880 | (Start T1-init timer) \ |
| 3881 | (Enter COOKIE-WAIT state) \---> (find an existing TCB |
| 3882 | compose temp TCB and Cookie_Z |
| 3883 | with Tie-Tags to previous |
| 3884 | association) |
| 3885 | /--- INIT ACK [Veri Tag=Tag_A', |
| 3886 | / I-Tag=Tag_Z', |
| 3887 | (Cancel T1-init timer) <------/ Cookie_Z[TieTags= |
| 3888 | Tag_A,Tag_Z |
| 3889 | & other info] |
| 3890 | (destroy temp TCB,leave original |
| 3891 | in place) |
| 3892 | COOKIE ECHO [Veri=Tag_Z', |
| 3893 | Cookie_Z |
| 3894 | Tie=Tag_A, |
| 3895 | Tag_Z]----------\ |
| 3896 | (Start T1-init timer) \ |
| 3897 | (Enter COOKIE-ECHOED state) \---> (Find existing association, |
| 3898 | Tie-Tags match old tags, |
| 3899 | Tags do not match, i.e., |
| 3900 | case X X M M above, |
| 3901 | Announce Restart to ULP |
| 3902 | and reset association). |
| 3903 | /---- COOKIE ACK |
| 3904 | (Cancel T1-init timer, <------/ |
| 3905 | Enter ESTABLISHED state) |
| 3906 | {app sends 1st user data; strm 0} |
| 3907 | DATA [TSN=initial TSN_A |
| 3908 | Strm=0,Seq=0 & user data]--\ |
| 3909 | (Start T3-rtx timer) \ |
| 3910 | \-> |
| 3911 | /--- SACK [TSN Ack=init TSN_A,Block=0] |
| 3912 | (Cancel T3-rtx timer) <------/ |
| 3913 | |
| 3914 | Figure 5: A Restart Example |
| 3915 | |
| 3916 | |
| 3917 | |
| 3918 | |
| 3919 | |
| 3920 | |
| 3921 | |
| 3922 | Stewart Standards Track [Page 70] |
| 3923 | |
| 3924 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3925 | |
| 3926 | |
| 3927 | 5.2.5. Handle Duplicate COOKIE-ACK. |
| 3928 | |
| 3929 | At any state other than COOKIE-ECHOED, an endpoint should silently |
| 3930 | discard a received COOKIE ACK chunk. |
| 3931 | |
| 3932 | 5.2.6. Handle Stale COOKIE Error |
| 3933 | |
| 3934 | Receipt of an ERROR chunk with a "Stale Cookie" error cause indicates |
| 3935 | one of a number of possible events: |
| 3936 | |
| 3937 | A) The association failed to completely setup before the State Cookie |
| 3938 | issued by the sender was processed. |
| 3939 | |
| 3940 | B) An old State Cookie was processed after setup completed. |
| 3941 | |
| 3942 | C) An old State Cookie is received from someone that the receiver is |
| 3943 | not interested in having an association with and the ABORT chunk |
| 3944 | was lost. |
| 3945 | |
| 3946 | When processing an ERROR chunk with a "Stale Cookie" error cause an |
| 3947 | endpoint should first examine if an association is in the process of |
| 3948 | being set up, i.e., the association is in the COOKIE-ECHOED state. |
| 3949 | In all cases, if the association is not in the COOKIE-ECHOED state, |
| 3950 | the ERROR chunk should be silently discarded. |
| 3951 | |
| 3952 | If the association is in the COOKIE-ECHOED state, the endpoint may |
| 3953 | elect one of the following three alternatives. |
| 3954 | |
| 3955 | 1) Send a new INIT chunk to the endpoint to generate a new State |
| 3956 | Cookie and reattempt the setup procedure. |
| 3957 | |
| 3958 | 2) Discard the TCB and report to the upper layer the inability to |
| 3959 | set up the association. |
| 3960 | |
| 3961 | 3) Send a new INIT chunk to the endpoint, adding a Cookie |
| 3962 | Preservative parameter requesting an extension to the life time |
| 3963 | of the State Cookie. When calculating the time extension, an |
| 3964 | implementation SHOULD use the RTT information measured based on |
| 3965 | the previous COOKIE ECHO / ERROR exchange, and should add no more |
| 3966 | than 1 second beyond the measured RTT, due to long State Cookie |
| 3967 | life times making the endpoint more subject to a replay attack. |
| 3968 | |
| 3969 | |
| 3970 | |
| 3971 | |
| 3972 | |
| 3973 | |
| 3974 | |
| 3975 | |
| 3976 | |
| 3977 | |
| 3978 | Stewart Standards Track [Page 71] |
| 3979 | |
| 3980 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 3981 | |
| 3982 | |
| 3983 | 5.3. Other Initialization Issues |
| 3984 | |
| 3985 | 5.3.1. Selection of Tag Value |
| 3986 | |
| 3987 | Initiate Tag values should be selected from the range of 1 to 2**32 - |
| 3988 | 1. It is very important that the Initiate Tag value be randomized to |
| 3989 | help protect against "man in the middle" and "sequence number" |
| 3990 | attacks. The methods described in [RFC4086] can be used for the |
| 3991 | Initiate Tag randomization. Careful selection of Initiate Tags is |
| 3992 | also necessary to prevent old duplicate packets from previous |
| 3993 | associations being mistakenly processed as belonging to the current |
| 3994 | association. |
| 3995 | |
| 3996 | Moreover, the Verification Tag value used by either endpoint in a |
| 3997 | given association MUST NOT change during the life time of an |
| 3998 | association. A new Verification Tag value MUST be used each time the |
| 3999 | endpoint tears down and then reestablishes an association to the same |
| 4000 | peer. |
| 4001 | |
| 4002 | 5.4. Path Verification |
| 4003 | |
| 4004 | During association establishment, the two peers exchange a list of |
| 4005 | addresses. In the predominant case, these lists accurately represent |
| 4006 | the addresses owned by each peer. However, it is possible that a |
| 4007 | misbehaving peer may supply addresses that it does not own. To |
| 4008 | prevent this, the following rules are applied to all addresses of the |
| 4009 | new association: |
| 4010 | |
| 4011 | 1) Any address passed to the sender of the INIT by its upper layer |
| 4012 | is automatically considered to be CONFIRMED. |
| 4013 | |
| 4014 | 2) For the receiver of the COOKIE ECHO, the only CONFIRMED address |
| 4015 | is the one to which the INIT-ACK was sent. |
| 4016 | |
| 4017 | 3) All other addresses not covered by rules 1 and 2 are considered |
| 4018 | UNCONFIRMED and are subject to probing for verification. |
| 4019 | |
| 4020 | To probe an address for verification, an endpoint will send |
| 4021 | HEARTBEATs including a 64-bit random nonce and a path indicator (to |
| 4022 | identify the address that the HEARTBEAT is sent to) within the |
| 4023 | HEARTBEAT parameter. |
| 4024 | |
| 4025 | Upon receipt of the HEARTBEAT ACK, a verification is made that the |
| 4026 | nonce included in the HEARTBEAT parameter is the one sent to the |
| 4027 | address indicated inside the HEARTBEAT parameter. When this match |
| 4028 | occurs, the address that the original HEARTBEAT was sent to is now |
| 4029 | considered CONFIRMED and available for normal data transfer. |
| 4030 | |
| 4031 | |
| 4032 | |
| 4033 | |
| 4034 | Stewart Standards Track [Page 72] |
| 4035 | |
| 4036 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4037 | |
| 4038 | |
| 4039 | These probing procedures are started when an association moves to the |
| 4040 | ESTABLISHED state and are ended when all paths are confirmed. |
| 4041 | |
| 4042 | In each RTO, a probe may be sent on an active UNCONFIRMED path in an |
| 4043 | attempt to move it to the CONFIRMED state. If during this probing |
| 4044 | the path becomes inactive, this rate is lowered to the normal |
| 4045 | HEARTBEAT rate. At the expiration of the RTO timer, the error |
| 4046 | counter of any path that was probed but not CONFIRMED is incremented |
| 4047 | by one and subjected to path failure detection, as defined in Section |
| 4048 | 8.2. When probing UNCONFIRMED addresses, however, the association |
| 4049 | overall error count is NOT incremented. |
| 4050 | |
| 4051 | The number of HEARTBEATS sent at each RTO SHOULD be limited by the |
| 4052 | HB.Max.Burst parameter. It is an implementation decision as to how |
| 4053 | to distribute HEARTBEATS to the peer's addresses for path |
| 4054 | verification. |
| 4055 | |
| 4056 | Whenever a path is confirmed, an indication MAY be given to the upper |
| 4057 | layer. |
| 4058 | |
| 4059 | An endpoint MUST NOT send any chunks to an UNCONFIRMED address, with |
| 4060 | the following exceptions: |
| 4061 | |
| 4062 | - A HEARTBEAT including a nonce MAY be sent to an UNCONFIRMED |
| 4063 | address. |
| 4064 | |
| 4065 | - A HEARTBEAT ACK MAY be sent to an UNCONFIRMED address. |
| 4066 | |
| 4067 | - A COOKIE ACK MAY be sent to an UNCONFIRMED address, but it MUST be |
| 4068 | bundled with a HEARTBEAT including a nonce. An implementation |
| 4069 | that does NOT support bundling MUST NOT send a COOKIE ACK to an |
| 4070 | UNCONFIRMED address. |
| 4071 | |
| 4072 | - A COOKIE ECHO MAY be sent to an UNCONFIRMED address, but it MUST |
| 4073 | be bundled with a HEARTBEAT including a nonce, and the packet MUST |
| 4074 | NOT exceed the path MTU. If the implementation does NOT support |
| 4075 | bundling or if the bundled COOKIE ECHO plus HEARTBEAT (including |
| 4076 | nonce) would exceed the path MTU, then the implementation MUST NOT |
| 4077 | send a COOKIE ECHO to an UNCONFIRMED address. |
| 4078 | |
| 4079 | 6. User Data Transfer |
| 4080 | |
| 4081 | Data transmission MUST only happen in the ESTABLISHED, SHUTDOWN- |
| 4082 | PENDING, and SHUTDOWN-RECEIVED states. The only exception to this is |
| 4083 | that DATA chunks are allowed to be bundled with an outbound COOKIE |
| 4084 | ECHO chunk when in the COOKIE-WAIT state. |
| 4085 | |
| 4086 | |
| 4087 | |
| 4088 | |
| 4089 | |
| 4090 | Stewart Standards Track [Page 73] |
| 4091 | |
| 4092 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4093 | |
| 4094 | |
| 4095 | DATA chunks MUST only be received according to the rules below in |
| 4096 | ESTABLISHED, SHUTDOWN-PENDING, and SHUTDOWN-SENT. A DATA chunk |
| 4097 | received in CLOSED is out of the blue and SHOULD be handled per |
| 4098 | Section 8.4. A DATA chunk received in any other state SHOULD be |
| 4099 | discarded. |
| 4100 | |
| 4101 | A SACK MUST be processed in ESTABLISHED, SHUTDOWN-PENDING, and |
| 4102 | SHUTDOWN-RECEIVED. An incoming SACK MAY be processed in COOKIE- |
| 4103 | ECHOED. A SACK in the CLOSED state is out of the blue and SHOULD be |
| 4104 | processed according to the rules in Section 8.4. A SACK chunk |
| 4105 | received in any other state SHOULD be discarded. |
| 4106 | |
| 4107 | An SCTP receiver MUST be able to receive a minimum of 1500 bytes in |
| 4108 | one SCTP packet. This means that an SCTP endpoint MUST NOT indicate |
| 4109 | less than 1500 bytes in its initial a_rwnd sent in the INIT or INIT |
| 4110 | ACK. |
| 4111 | |
| 4112 | For transmission efficiency, SCTP defines mechanisms for bundling of |
| 4113 | small user messages and fragmentation of large user messages. The |
| 4114 | following diagram depicts the flow of user messages through SCTP. |
| 4115 | |
| 4116 | In this section, the term "data sender" refers to the endpoint that |
| 4117 | transmits a DATA chunk and the term "data receiver" refers to the |
| 4118 | endpoint that receives a DATA chunk. A data receiver will transmit |
| 4119 | SACK chunks. |
| 4120 | |
| 4121 | |
| 4122 | |
| 4123 | |
| 4124 | |
| 4125 | |
| 4126 | |
| 4127 | |
| 4128 | |
| 4129 | |
| 4130 | |
| 4131 | |
| 4132 | |
| 4133 | |
| 4134 | |
| 4135 | |
| 4136 | |
| 4137 | |
| 4138 | |
| 4139 | |
| 4140 | |
| 4141 | |
| 4142 | |
| 4143 | |
| 4144 | |
| 4145 | |
| 4146 | Stewart Standards Track [Page 74] |
| 4147 | |
| 4148 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4149 | |
| 4150 | |
| 4151 | +--------------------------+ |
| 4152 | | User Messages | |
| 4153 | +--------------------------+ |
| 4154 | SCTP user ^ | |
| 4155 | ==================|==|======================================= |
| 4156 | | v (1) |
| 4157 | +------------------+ +--------------------+ |
| 4158 | | SCTP DATA Chunks | |SCTP Control Chunks | |
| 4159 | +------------------+ +--------------------+ |
| 4160 | ^ | ^ | |
| 4161 | | v (2) | v (2) |
| 4162 | +--------------------------+ |
| 4163 | | SCTP packets | |
| 4164 | +--------------------------+ |
| 4165 | SCTP ^ | |
| 4166 | ===========================|==|=========================== |
| 4167 | | v |
| 4168 | Connectionless Packet Transfer Service (e.g., IP) |
| 4169 | |
| 4170 | Notes: |
| 4171 | |
| 4172 | 1) When converting user messages into DATA chunks, an endpoint |
| 4173 | will fragment user messages larger than the current association |
| 4174 | path MTU into multiple DATA chunks. The data receiver will |
| 4175 | normally reassemble the fragmented message from DATA chunks |
| 4176 | before delivery to the user (see Section 6.9 for details). |
| 4177 | |
| 4178 | 2) Multiple DATA and control chunks may be bundled by the sender |
| 4179 | into a single SCTP packet for transmission, as long as the |
| 4180 | final size of the packet does not exceed the current path MTU. |
| 4181 | The receiver will unbundle the packet back into the original |
| 4182 | chunks. Control chunks MUST come before DATA chunks in the |
| 4183 | packet. |
| 4184 | |
| 4185 | Figure 6: Illustration of User Data Transfer |
| 4186 | |
| 4187 | The fragmentation and bundling mechanisms, as detailed in Section 6.9 |
| 4188 | and Section 6.10, are OPTIONAL to implement by the data sender, but |
| 4189 | they MUST be implemented by the data receiver, i.e., an endpoint MUST |
| 4190 | properly receive and process bundled or fragmented data. |
| 4191 | |
| 4192 | 6.1. Transmission of DATA Chunks |
| 4193 | |
| 4194 | This document is specified as if there is a single retransmission |
| 4195 | timer per destination transport address, but implementations MAY have |
| 4196 | a retransmission timer for each DATA chunk. |
| 4197 | |
| 4198 | |
| 4199 | |
| 4200 | |
| 4201 | |
| 4202 | Stewart Standards Track [Page 75] |
| 4203 | |
| 4204 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4205 | |
| 4206 | |
| 4207 | The following general rules MUST be applied by the data sender for |
| 4208 | transmission and/or retransmission of outbound DATA chunks: |
| 4209 | |
| 4210 | A) At any given time, the data sender MUST NOT transmit new data to |
| 4211 | any destination transport address if its peer's rwnd indicates |
| 4212 | that the peer has no buffer space (i.e., rwnd is 0; see Section |
| 4213 | 6.2.1). However, regardless of the value of rwnd (including if it |
| 4214 | is 0), the data sender can always have one DATA chunk in flight to |
| 4215 | the receiver if allowed by cwnd (see rule B, below). This rule |
| 4216 | allows the sender to probe for a change in rwnd that the sender |
| 4217 | missed due to the SACK's having been lost in transit from the data |
| 4218 | receiver to the data sender. |
| 4219 | |
| 4220 | When the receiver's advertised window is zero, this probe is |
| 4221 | called a zero window probe. Note that a zero window probe SHOULD |
| 4222 | only be sent when all outstanding DATA chunks have been |
| 4223 | cumulatively acknowledged and no DATA chunks are in flight. Zero |
| 4224 | window probing MUST be supported. |
| 4225 | |
| 4226 | If the sender continues to receive new packets from the receiver |
| 4227 | while doing zero window probing, the unacknowledged window probes |
| 4228 | should not increment the error counter for the association or any |
| 4229 | destination transport address. This is because the receiver MAY |
| 4230 | keep its window closed for an indefinite time. Refer to Section |
| 4231 | 6.2 on the receiver behavior when it advertises a zero window. |
| 4232 | The sender SHOULD send the first zero window probe after 1 RTO |
| 4233 | when it detects that the receiver has closed its window and SHOULD |
| 4234 | increase the probe interval exponentially afterwards. Also note |
| 4235 | that the cwnd SHOULD be adjusted according to Section 7.2.1. Zero |
| 4236 | window probing does not affect the calculation of cwnd. |
| 4237 | |
| 4238 | The sender MUST also have an algorithm for sending new DATA chunks |
| 4239 | to avoid silly window syndrome (SWS) as described in [RFC0813]. |
| 4240 | The algorithm can be similar to the one described in Section |
| 4241 | 4.2.3.4 of [RFC1122]. |
| 4242 | |
| 4243 | However, regardless of the value of rwnd (including if it is 0), |
| 4244 | the data sender can always have one DATA chunk in flight to the |
| 4245 | receiver if allowed by cwnd (see rule B below). This rule allows |
| 4246 | the sender to probe for a change in rwnd that the sender missed |
| 4247 | due to the SACK having been lost in transit from the data receiver |
| 4248 | to the data sender. |
| 4249 | |
| 4250 | B) At any given time, the sender MUST NOT transmit new data to a |
| 4251 | given transport address if it has cwnd or more bytes of data |
| 4252 | outstanding to that transport address. |
| 4253 | |
| 4254 | |
| 4255 | |
| 4256 | |
| 4257 | |
| 4258 | Stewart Standards Track [Page 76] |
| 4259 | |
| 4260 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4261 | |
| 4262 | |
| 4263 | C) When the time comes for the sender to transmit, before sending new |
| 4264 | DATA chunks, the sender MUST first transmit any outstanding DATA |
| 4265 | chunks that are marked for retransmission (limited by the current |
| 4266 | cwnd). |
| 4267 | |
| 4268 | D) When the time comes for the sender to transmit new DATA chunks, |
| 4269 | the protocol parameter Max.Burst SHOULD be used to limit the |
| 4270 | number of packets sent. The limit MAY be applied by adjusting |
| 4271 | cwnd as follows: |
| 4272 | |
| 4273 | if((flightsize + Max.Burst*MTU) < cwnd) cwnd = flightsize + |
| 4274 | Max.Burst*MTU |
| 4275 | |
| 4276 | Or it MAY be applied by strictly limiting the number of packets |
| 4277 | emitted by the output routine. |
| 4278 | |
| 4279 | E) Then, the sender can send out as many new DATA chunks as rule A |
| 4280 | and rule B allow. |
| 4281 | |
| 4282 | Multiple DATA chunks committed for transmission MAY be bundled in a |
| 4283 | single packet. Furthermore, DATA chunks being retransmitted MAY be |
| 4284 | bundled with new DATA chunks, as long as the resulting packet size |
| 4285 | does not exceed the path MTU. A ULP may request that no bundling is |
| 4286 | performed, but this should only turn off any delays that an SCTP |
| 4287 | implementation may be using to increase bundling efficiency. It does |
| 4288 | not in itself stop all bundling from occurring (i.e., in case of |
| 4289 | congestion or retransmission). |
| 4290 | |
| 4291 | Before an endpoint transmits a DATA chunk, if any received DATA |
| 4292 | chunks have not been acknowledged (e.g., due to delayed ack), the |
| 4293 | sender should create a SACK and bundle it with the outbound DATA |
| 4294 | chunk, as long as the size of the final SCTP packet does not exceed |
| 4295 | the current MTU. See Section 6.2. |
| 4296 | |
| 4297 | IMPLEMENTATION NOTE: When the window is full (i.e., transmission is |
| 4298 | disallowed by rule A and/or rule B), the sender MAY still accept send |
| 4299 | requests from its upper layer, but MUST transmit no more DATA chunks |
| 4300 | until some or all of the outstanding DATA chunks are acknowledged and |
| 4301 | transmission is allowed by rule A and rule B again. |
| 4302 | |
| 4303 | Whenever a transmission or retransmission is made to any address, if |
| 4304 | the T3-rtx timer of that address is not currently running, the sender |
| 4305 | MUST start that timer. If the timer for that address is already |
| 4306 | running, the sender MUST restart the timer if the earliest (i.e., |
| 4307 | lowest TSN) outstanding DATA chunk sent to that address is being |
| 4308 | retransmitted. Otherwise, the data sender MUST NOT restart the |
| 4309 | timer. |
| 4310 | |
| 4311 | |
| 4312 | |
| 4313 | |
| 4314 | Stewart Standards Track [Page 77] |
| 4315 | |
| 4316 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4317 | |
| 4318 | |
| 4319 | When starting or restarting the T3-rtx timer, the timer value must be |
| 4320 | adjusted according to the timer rules defined in Sections 6.3.2 and |
| 4321 | 6.3.3. |
| 4322 | |
| 4323 | Note: The data sender SHOULD NOT use a TSN that is more than 2**31 - |
| 4324 | 1 above the beginning TSN of the current send window. |
| 4325 | |
| 4326 | 6.2. Acknowledgement on Reception of DATA Chunks |
| 4327 | |
| 4328 | The SCTP endpoint MUST always acknowledge the reception of each valid |
| 4329 | DATA chunk when the DATA chunk received is inside its receive window. |
| 4330 | |
| 4331 | When the receiver's advertised window is 0, the receiver MUST drop |
| 4332 | any new incoming DATA chunk with a TSN larger than the largest TSN |
| 4333 | received so far. If the new incoming DATA chunk holds a TSN value |
| 4334 | less than the largest TSN received so far, then the receiver SHOULD |
| 4335 | drop the largest TSN held for reordering and accept the new incoming |
| 4336 | DATA chunk. In either case, if such a DATA chunk is dropped, the |
| 4337 | receiver MUST immediately send back a SACK with the current receive |
| 4338 | window showing only DATA chunks received and accepted so far. The |
| 4339 | dropped DATA chunk(s) MUST NOT be included in the SACK, as they were |
| 4340 | not accepted. The receiver MUST also have an algorithm for |
| 4341 | advertising its receive window to avoid receiver silly window |
| 4342 | syndrome (SWS), as described in [RFC0813]. The algorithm can be |
| 4343 | similar to the one described in Section 4.2.3.3 of [RFC1122]. |
| 4344 | |
| 4345 | The guidelines on delayed acknowledgement algorithm specified in |
| 4346 | Section 4.2 of [RFC2581] SHOULD be followed. Specifically, an |
| 4347 | acknowledgement SHOULD be generated for at least every second packet |
| 4348 | (not every second DATA chunk) received, and SHOULD be generated |
| 4349 | within 200 ms of the arrival of any unacknowledged DATA chunk. In |
| 4350 | some situations, it may be beneficial for an SCTP transmitter to be |
| 4351 | more conservative than the algorithms detailed in this document |
| 4352 | allow. However, an SCTP transmitter MUST NOT be more aggressive than |
| 4353 | the following algorithms allow. |
| 4354 | |
| 4355 | An SCTP receiver MUST NOT generate more than one SACK for every |
| 4356 | incoming packet, other than to update the offered window as the |
| 4357 | receiving application consumes new data. |
| 4358 | |
| 4359 | IMPLEMENTATION NOTE: The maximum delay for generating an |
| 4360 | acknowledgement may be configured by the SCTP administrator, either |
| 4361 | statically or dynamically, in order to meet the specific timing |
| 4362 | requirement of the protocol being carried. |
| 4363 | |
| 4364 | An implementation MUST NOT allow the maximum delay to be configured |
| 4365 | to be more than 500 ms. In other words, an implementation MAY lower |
| 4366 | this value below 500 ms but MUST NOT raise it above 500 ms. |
| 4367 | |
| 4368 | |
| 4369 | |
| 4370 | Stewart Standards Track [Page 78] |
| 4371 | |
| 4372 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4373 | |
| 4374 | |
| 4375 | Acknowledgements MUST be sent in SACK chunks unless shutdown was |
| 4376 | requested by the ULP, in which case an endpoint MAY send an |
| 4377 | acknowledgement in the SHUTDOWN chunk. A SACK chunk can acknowledge |
| 4378 | the reception of multiple DATA chunks. See Section 3.3.4 for SACK |
| 4379 | chunk format. In particular, the SCTP endpoint MUST fill in the |
| 4380 | Cumulative TSN Ack field to indicate the latest sequential TSN (of a |
| 4381 | valid DATA chunk) it has received. Any received DATA chunks with TSN |
| 4382 | greater than the value in the Cumulative TSN Ack field are reported |
| 4383 | in the Gap Ack Block fields. The SCTP endpoint MUST report as many |
| 4384 | Gap Ack Blocks as can fit in a single SACK chunk limited by the |
| 4385 | current path MTU. |
| 4386 | |
| 4387 | Note: The SHUTDOWN chunk does not contain Gap Ack Block fields. |
| 4388 | Therefore, the endpoint should use a SACK instead of the SHUTDOWN |
| 4389 | chunk to acknowledge DATA chunks received out of order. |
| 4390 | |
| 4391 | When a packet arrives with duplicate DATA chunk(s) and with no new |
| 4392 | DATA chunk(s), the endpoint MUST immediately send a SACK with no |
| 4393 | delay. If a packet arrives with duplicate DATA chunk(s) bundled with |
| 4394 | new DATA chunks, the endpoint MAY immediately send a SACK. Normally, |
| 4395 | receipt of duplicate DATA chunks will occur when the original SACK |
| 4396 | chunk was lost and the peer's RTO has expired. The duplicate TSN |
| 4397 | number(s) SHOULD be reported in the SACK as duplicate. |
| 4398 | |
| 4399 | When an endpoint receives a SACK, it MAY use the duplicate TSN |
| 4400 | information to determine if SACK loss is occurring. Further use of |
| 4401 | this data is for future study. |
| 4402 | |
| 4403 | The data receiver is responsible for maintaining its receive buffers. |
| 4404 | The data receiver SHOULD notify the data sender in a timely manner of |
| 4405 | changes in its ability to receive data. How an implementation |
| 4406 | manages its receive buffers is dependent on many factors (e.g., |
| 4407 | operating system, memory management system, amount of memory, etc.). |
| 4408 | However, the data sender strategy defined in Section 6.2.1 is based |
| 4409 | on the assumption of receiver operation similar to the following: |
| 4410 | |
| 4411 | A) At initialization of the association, the endpoint tells the peer |
| 4412 | how much receive buffer space it has allocated to the association |
| 4413 | in the INIT or INIT ACK. The endpoint sets a_rwnd to this value. |
| 4414 | |
| 4415 | B) As DATA chunks are received and buffered, decrement a_rwnd by the |
| 4416 | number of bytes received and buffered. This is, in effect, |
| 4417 | closing rwnd at the data sender and restricting the amount of data |
| 4418 | it can transmit. |
| 4419 | |
| 4420 | |
| 4421 | |
| 4422 | |
| 4423 | |
| 4424 | |
| 4425 | |
| 4426 | Stewart Standards Track [Page 79] |
| 4427 | |
| 4428 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4429 | |
| 4430 | |
| 4431 | C) As DATA chunks are delivered to the ULP and released from the |
| 4432 | receive buffers, increment a_rwnd by the number of bytes delivered |
| 4433 | to the upper layer. This is, in effect, opening up rwnd on the |
| 4434 | data sender and allowing it to send more data. The data receiver |
| 4435 | SHOULD NOT increment a_rwnd unless it has released bytes from its |
| 4436 | receive buffer. For example, if the receiver is holding |
| 4437 | fragmented DATA chunks in a reassembly queue, it should not |
| 4438 | increment a_rwnd. |
| 4439 | |
| 4440 | D) When sending a SACK, the data receiver SHOULD place the current |
| 4441 | value of a_rwnd into the a_rwnd field. The data receiver SHOULD |
| 4442 | take into account that the data sender will not retransmit DATA |
| 4443 | chunks that are acked via the Cumulative TSN Ack (i.e., will drop |
| 4444 | from its retransmit queue). |
| 4445 | |
| 4446 | Under certain circumstances, the data receiver may need to drop DATA |
| 4447 | chunks that it has received but hasn't released from its receive |
| 4448 | buffers (i.e., delivered to the ULP). These DATA chunks may have |
| 4449 | been acked in Gap Ack Blocks. For example, the data receiver may be |
| 4450 | holding data in its receive buffers while reassembling a fragmented |
| 4451 | user message from its peer when it runs out of receive buffer space. |
| 4452 | It may drop these DATA chunks even though it has acknowledged them in |
| 4453 | Gap Ack Blocks. If a data receiver drops DATA chunks, it MUST NOT |
| 4454 | include them in Gap Ack Blocks in subsequent SACKs until they are |
| 4455 | received again via retransmission. In addition, the endpoint should |
| 4456 | take into account the dropped data when calculating its a_rwnd. |
| 4457 | |
| 4458 | An endpoint SHOULD NOT revoke a SACK and discard data. Only in |
| 4459 | extreme circumstances should an endpoint use this procedure (such as |
| 4460 | out of buffer space). The data receiver should take into account |
| 4461 | that dropping data that has been acked in Gap Ack Blocks can result |
| 4462 | in suboptimal retransmission strategies in the data sender and thus |
| 4463 | in suboptimal performance. |
| 4464 | |
| 4465 | |
| 4466 | |
| 4467 | |
| 4468 | |
| 4469 | |
| 4470 | |
| 4471 | |
| 4472 | |
| 4473 | |
| 4474 | |
| 4475 | |
| 4476 | |
| 4477 | |
| 4478 | |
| 4479 | |
| 4480 | |
| 4481 | |
| 4482 | Stewart Standards Track [Page 80] |
| 4483 | |
| 4484 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4485 | |
| 4486 | |
| 4487 | The following example illustrates the use of delayed |
| 4488 | acknowledgements: |
| 4489 | |
| 4490 | Endpoint A Endpoint Z |
| 4491 | |
| 4492 | {App sends 3 messages; strm 0} |
| 4493 | DATA [TSN=7,Strm=0,Seq=3] ------------> (ack delayed) |
| 4494 | (Start T3-rtx timer) |
| 4495 | |
| 4496 | DATA [TSN=8,Strm=0,Seq=4] ------------> (send ack) |
| 4497 | /------- SACK [TSN Ack=8,block=0] |
| 4498 | (cancel T3-rtx timer) <-----/ |
| 4499 | |
| 4500 | DATA [TSN=9,Strm=0,Seq=5] ------------> (ack delayed) |
| 4501 | (Start T3-rtx timer) |
| 4502 | ... |
| 4503 | {App sends 1 message; strm 1} |
| 4504 | (bundle SACK with DATA) |
| 4505 | /----- SACK [TSN Ack=9,block=0] \ |
| 4506 | / DATA [TSN=6,Strm=1,Seq=2] |
| 4507 | (cancel T3-rtx timer) <------/ (Start T3-rtx timer) |
| 4508 | |
| 4509 | (ack delayed) |
| 4510 | (send ack) |
| 4511 | SACK [TSN Ack=6,block=0] -------------> (cancel T3-rtx timer) |
| 4512 | |
| 4513 | Figure 7: Delayed Acknowledgement Example |
| 4514 | |
| 4515 | If an endpoint receives a DATA chunk with no user data (i.e., the |
| 4516 | Length field is set to 16), it MUST send an ABORT with error cause |
| 4517 | set to "No User Data". |
| 4518 | |
| 4519 | An endpoint SHOULD NOT send a DATA chunk with no user data part. |
| 4520 | |
| 4521 | 6.2.1. Processing a Received SACK |
| 4522 | |
| 4523 | Each SACK an endpoint receives contains an a_rwnd value. This value |
| 4524 | represents the amount of buffer space the data receiver, at the time |
| 4525 | of transmitting the SACK, has left of its total receive buffer space |
| 4526 | (as specified in the INIT/INIT ACK). Using a_rwnd, Cumulative TSN |
| 4527 | Ack, and Gap Ack Blocks, the data sender can develop a representation |
| 4528 | of the peer's receive buffer space. |
| 4529 | |
| 4530 | One of the problems the data sender must take into account when |
| 4531 | processing a SACK is that a SACK can be received out of order. That |
| 4532 | is, a SACK sent by the data receiver can pass an earlier SACK and be |
| 4533 | received first by the data sender. If a SACK is received out of |
| 4534 | |
| 4535 | |
| 4536 | |
| 4537 | |
| 4538 | Stewart Standards Track [Page 81] |
| 4539 | |
| 4540 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4541 | |
| 4542 | |
| 4543 | order, the data sender can develop an incorrect view of the peer's |
| 4544 | receive buffer space. |
| 4545 | |
| 4546 | Since there is no explicit identifier that can be used to detect |
| 4547 | out-of-order SACKs, the data sender must use heuristics to determine |
| 4548 | if a SACK is new. |
| 4549 | |
| 4550 | An endpoint SHOULD use the following rules to calculate the rwnd, |
| 4551 | using the a_rwnd value, the Cumulative TSN Ack, and Gap Ack Blocks in |
| 4552 | a received SACK. |
| 4553 | |
| 4554 | A) At the establishment of the association, the endpoint initializes |
| 4555 | the rwnd to the Advertised Receiver Window Credit (a_rwnd) the |
| 4556 | peer specified in the INIT or INIT ACK. |
| 4557 | |
| 4558 | B) Any time a DATA chunk is transmitted (or retransmitted) to a peer, |
| 4559 | the endpoint subtracts the data size of the chunk from the rwnd of |
| 4560 | that peer. |
| 4561 | |
| 4562 | C) Any time a DATA chunk is marked for retransmission, either via |
| 4563 | T3-rtx timer expiration (Section 6.3.3) or via Fast Retransmit |
| 4564 | (Section 7.2.4), add the data size of those chunks to the rwnd. |
| 4565 | |
| 4566 | Note: If the implementation is maintaining a timer on each DATA |
| 4567 | chunk, then only DATA chunks whose timer expired would be marked |
| 4568 | for retransmission. |
| 4569 | |
| 4570 | D) Any time a SACK arrives, the endpoint performs the following: |
| 4571 | |
| 4572 | i) If Cumulative TSN Ack is less than the Cumulative TSN Ack |
| 4573 | Point, then drop the SACK. Since Cumulative TSN Ack is |
| 4574 | monotonically increasing, a SACK whose Cumulative TSN Ack is |
| 4575 | less than the Cumulative TSN Ack Point indicates an out-of- |
| 4576 | order SACK. |
| 4577 | |
| 4578 | ii) Set rwnd equal to the newly received a_rwnd minus the number |
| 4579 | of bytes still outstanding after processing the Cumulative |
| 4580 | TSN Ack and the Gap Ack Blocks. |
| 4581 | |
| 4582 | iii) If the SACK is missing a TSN that was previously acknowledged |
| 4583 | via a Gap Ack Block (e.g., the data receiver reneged on the |
| 4584 | data), then consider the corresponding DATA that might be |
| 4585 | possibly missing: Count one miss indication towards Fast |
| 4586 | Retransmit as described in Section 7.2.4, and if no |
| 4587 | retransmit timer is running for the destination address to |
| 4588 | which the DATA chunk was originally transmitted, then T3-rtx |
| 4589 | is started for that destination address. |
| 4590 | |
| 4591 | |
| 4592 | |
| 4593 | |
| 4594 | Stewart Standards Track [Page 82] |
| 4595 | |
| 4596 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4597 | |
| 4598 | |
| 4599 | iv) If the Cumulative TSN Ack matches or exceeds the Fast |
| 4600 | Recovery exitpoint (Section 7.2.4), Fast Recovery is exited. |
| 4601 | |
| 4602 | 6.3. Management of Retransmission Timer |
| 4603 | |
| 4604 | An SCTP endpoint uses a retransmission timer T3-rtx to ensure data |
| 4605 | delivery in the absence of any feedback from its peer. The duration |
| 4606 | of this timer is referred to as RTO (retransmission timeout). |
| 4607 | |
| 4608 | When an endpoint's peer is multi-homed, the endpoint will calculate a |
| 4609 | separate RTO for each different destination transport address of its |
| 4610 | peer endpoint. |
| 4611 | |
| 4612 | The computation and management of RTO in SCTP follow closely how TCP |
| 4613 | manages its retransmission timer. To compute the current RTO, an |
| 4614 | endpoint maintains two state variables per destination transport |
| 4615 | address: SRTT (smoothed round-trip time) and RTTVAR (round-trip time |
| 4616 | variation). |
| 4617 | |
| 4618 | 6.3.1. RTO Calculation |
| 4619 | |
| 4620 | The rules governing the computation of SRTT, RTTVAR, and RTO are as |
| 4621 | follows: |
| 4622 | |
| 4623 | C1) Until an RTT measurement has been made for a packet sent to the |
| 4624 | given destination transport address, set RTO to the protocol |
| 4625 | parameter 'RTO.Initial'. |
| 4626 | |
| 4627 | C2) When the first RTT measurement R is made, set |
| 4628 | |
| 4629 | SRTT <- R, |
| 4630 | |
| 4631 | RTTVAR <- R/2, and |
| 4632 | |
| 4633 | RTO <- SRTT + 4 * RTTVAR. |
| 4634 | |
| 4635 | C3) When a new RTT measurement R' is made, set |
| 4636 | |
| 4637 | RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| |
| 4638 | |
| 4639 | and |
| 4640 | |
| 4641 | SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R' |
| 4642 | |
| 4643 | Note: The value of SRTT used in the update to RTTVAR is its |
| 4644 | value before updating SRTT itself using the second assignment. |
| 4645 | |
| 4646 | After the computation, update RTO <- SRTT + 4 * RTTVAR. |
| 4647 | |
| 4648 | |
| 4649 | |
| 4650 | Stewart Standards Track [Page 83] |
| 4651 | |
| 4652 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4653 | |
| 4654 | |
| 4655 | C4) When data is in flight and when allowed by rule C5 below, a new |
| 4656 | RTT measurement MUST be made each round trip. Furthermore, new |
| 4657 | RTT measurements SHOULD be made no more than once per round trip |
| 4658 | for a given destination transport address. There are two |
| 4659 | reasons for this recommendation: First, it appears that |
| 4660 | measuring more frequently often does not in practice yield any |
| 4661 | significant benefit [ALLMAN99]; second, if measurements are made |
| 4662 | more often, then the values of RTO.Alpha and RTO.Beta in rule C3 |
| 4663 | above should be adjusted so that SRTT and RTTVAR still adjust to |
| 4664 | changes at roughly the same rate (in terms of how many round |
| 4665 | trips it takes them to reflect new values) as they would if |
| 4666 | making only one measurement per round-trip and using RTO.Alpha |
| 4667 | and RTO.Beta as given in rule C3. However, the exact nature of |
| 4668 | these adjustments remains a research issue. |
| 4669 | |
| 4670 | C5) Karn's algorithm: RTT measurements MUST NOT be made using |
| 4671 | packets that were retransmitted (and thus for which it is |
| 4672 | ambiguous whether the reply was for the first instance of the |
| 4673 | chunk or for a later instance) |
| 4674 | |
| 4675 | IMPLEMENTATION NOTE: RTT measurements should only be made using |
| 4676 | a chunk with TSN r if no chunk with TSN less than or equal to r |
| 4677 | is retransmitted since r is first sent. |
| 4678 | |
| 4679 | C6) Whenever RTO is computed, if it is less than RTO.Min seconds |
| 4680 | then it is rounded up to RTO.Min seconds. The reason for this |
| 4681 | rule is that RTOs that do not have a high minimum value are |
| 4682 | susceptible to unnecessary timeouts [ALLMAN99]. |
| 4683 | |
| 4684 | C7) A maximum value may be placed on RTO provided it is at least |
| 4685 | RTO.max seconds. |
| 4686 | |
| 4687 | There is no requirement for the clock granularity G used for |
| 4688 | computing RTT measurements and the different state variables, other |
| 4689 | than: |
| 4690 | |
| 4691 | G1) Whenever RTTVAR is computed, if RTTVAR = 0, then adjust RTTVAR <- |
| 4692 | G. |
| 4693 | |
| 4694 | Experience [ALLMAN99] has shown that finer clock granularities (<= |
| 4695 | 100 msec) perform somewhat better than more coarse granularities. |
| 4696 | |
| 4697 | |
| 4698 | |
| 4699 | |
| 4700 | |
| 4701 | |
| 4702 | |
| 4703 | |
| 4704 | |
| 4705 | |
| 4706 | Stewart Standards Track [Page 84] |
| 4707 | |
| 4708 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4709 | |
| 4710 | |
| 4711 | 6.3.2. Retransmission Timer Rules |
| 4712 | |
| 4713 | The rules for managing the retransmission timer are as follows: |
| 4714 | |
| 4715 | R1) Every time a DATA chunk is sent to any address (including a |
| 4716 | retransmission), if the T3-rtx timer of that address is not |
| 4717 | running, start it running so that it will expire after the RTO |
| 4718 | of that address. The RTO used here is that obtained after any |
| 4719 | doubling due to previous T3-rtx timer expirations on the |
| 4720 | corresponding destination address as discussed in rule E2 below. |
| 4721 | |
| 4722 | R2) Whenever all outstanding data sent to an address have been |
| 4723 | acknowledged, turn off the T3-rtx timer of that address. |
| 4724 | |
| 4725 | R3) Whenever a SACK is received that acknowledges the DATA chunk |
| 4726 | with the earliest outstanding TSN for that address, restart the |
| 4727 | T3-rtx timer for that address with its current RTO (if there is |
| 4728 | still outstanding data on that address). |
| 4729 | |
| 4730 | R4) Whenever a SACK is received missing a TSN that was previously |
| 4731 | acknowledged via a Gap Ack Block, start the T3-rtx for the |
| 4732 | destination address to which the DATA chunk was originally |
| 4733 | transmitted if it is not already running. |
| 4734 | |
| 4735 | The following example shows the use of various timer rules (assuming |
| 4736 | that the receiver uses delayed acks). |
| 4737 | |
| 4738 | Endpoint A Endpoint Z |
| 4739 | {App begins to send} |
| 4740 | Data [TSN=7,Strm=0,Seq=3] ------------> (ack delayed) |
| 4741 | (Start T3-rtx timer) |
| 4742 | {App sends 1 message; strm 1} |
| 4743 | (bundle ack with data) |
| 4744 | DATA [TSN=8,Strm=0,Seq=4] ----\ /-- SACK [TSN Ack=7,Block=0] |
| 4745 | \ / DATA [TSN=6,Strm=1,Seq=2] |
| 4746 | \ / (Start T3-rtx timer) |
| 4747 | \ |
| 4748 | / \ |
| 4749 | (Restart T3-rtx timer) <------/ \--> (ack delayed) |
| 4750 | (ack delayed) |
| 4751 | {send ack} |
| 4752 | SACK [TSN Ack=6,Block=0] --------------> (Cancel T3-rtx timer) |
| 4753 | .. |
| 4754 | (send ack) |
| 4755 | (Cancel T3-rtx timer) <-------------- SACK [TSN Ack=8,Block=0] |
| 4756 | |
| 4757 | Figure 8: Timer Rule Examples |
| 4758 | |
| 4759 | |
| 4760 | |
| 4761 | |
| 4762 | Stewart Standards Track [Page 85] |
| 4763 | |
| 4764 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4765 | |
| 4766 | |
| 4767 | 6.3.3. Handle T3-rtx Expiration |
| 4768 | |
| 4769 | Whenever the retransmission timer T3-rtx expires for a destination |
| 4770 | address, do the following: |
| 4771 | |
| 4772 | E1) For the destination address for which the timer expires, adjust |
| 4773 | its ssthresh with rules defined in Section 7.2.3 and set the |
| 4774 | cwnd <- MTU. |
| 4775 | |
| 4776 | E2) For the destination address for which the timer expires, set RTO |
| 4777 | <- RTO * 2 ("back off the timer"). The maximum value discussed |
| 4778 | in rule C7 above (RTO.max) may be used to provide an upper bound |
| 4779 | to this doubling operation. |
| 4780 | |
| 4781 | E3) Determine how many of the earliest (i.e., lowest TSN) |
| 4782 | outstanding DATA chunks for the address for which the T3-rtx has |
| 4783 | expired will fit into a single packet, subject to the MTU |
| 4784 | constraint for the path corresponding to the destination |
| 4785 | transport address to which the retransmission is being sent |
| 4786 | (this may be different from the address for which the timer |
| 4787 | expires; see Section 6.4). Call this value K. Bundle and |
| 4788 | retransmit those K DATA chunks in a single packet to the |
| 4789 | destination endpoint. |
| 4790 | |
| 4791 | E4) Start the retransmission timer T3-rtx on the destination address |
| 4792 | to which the retransmission is sent, if rule R1 above indicates |
| 4793 | to do so. The RTO to be used for starting T3-rtx should be the |
| 4794 | one for the destination address to which the retransmission is |
| 4795 | sent, which, when the receiver is multi-homed, may be different |
| 4796 | from the destination address for which the timer expired (see |
| 4797 | Section 6.4 below). |
| 4798 | |
| 4799 | After retransmitting, once a new RTT measurement is obtained (which |
| 4800 | can happen only when new data has been sent and acknowledged, per |
| 4801 | rule C5, or for a measurement made from a HEARTBEAT; see Section |
| 4802 | 8.3), the computation in rule C3 is performed, including the |
| 4803 | computation of RTO, which may result in "collapsing" RTO back down |
| 4804 | after it has been subject to doubling (rule E2). |
| 4805 | |
| 4806 | Note: Any DATA chunks that were sent to the address for which the |
| 4807 | T3-rtx timer expired but did not fit in one MTU (rule E3 above) |
| 4808 | should be marked for retransmission and sent as soon as cwnd allows |
| 4809 | (normally, when a SACK arrives). |
| 4810 | |
| 4811 | The final rule for managing the retransmission timer concerns |
| 4812 | failover (see Section 6.4.1): |
| 4813 | |
| 4814 | |
| 4815 | |
| 4816 | |
| 4817 | |
| 4818 | Stewart Standards Track [Page 86] |
| 4819 | |
| 4820 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4821 | |
| 4822 | |
| 4823 | F1) Whenever an endpoint switches from the current destination |
| 4824 | transport address to a different one, the current retransmission |
| 4825 | timers are left running. As soon as the endpoint transmits a |
| 4826 | packet containing DATA chunk(s) to the new transport address, |
| 4827 | start the timer on that transport address, using the RTO value |
| 4828 | of the destination address to which the data is being sent, if |
| 4829 | rule R1 indicates to do so. |
| 4830 | |
| 4831 | 6.4. Multi-Homed SCTP Endpoints |
| 4832 | |
| 4833 | An SCTP endpoint is considered multi-homed if there are more than one |
| 4834 | transport address that can be used as a destination address to reach |
| 4835 | that endpoint. |
| 4836 | |
| 4837 | Moreover, the ULP of an endpoint shall select one of the multiple |
| 4838 | destination addresses of a multi-homed peer endpoint as the primary |
| 4839 | path (see Section 5.1.2 and Section 10.1 for details). |
| 4840 | |
| 4841 | By default, an endpoint SHOULD always transmit to the primary path, |
| 4842 | unless the SCTP user explicitly specifies the destination transport |
| 4843 | address (and possibly source transport address) to use. |
| 4844 | |
| 4845 | An endpoint SHOULD transmit reply chunks (e.g., SACK, HEARTBEAT ACK, |
| 4846 | etc.) to the same destination transport address from which it |
| 4847 | received the DATA or control chunk to which it is replying. This |
| 4848 | rule should also be followed if the endpoint is bundling DATA chunks |
| 4849 | together with the reply chunk. |
| 4850 | |
| 4851 | However, when acknowledging multiple DATA chunks received in packets |
| 4852 | from different source addresses in a single SACK, the SACK chunk may |
| 4853 | be transmitted to one of the destination transport addresses from |
| 4854 | which the DATA or control chunks being acknowledged were received. |
| 4855 | |
| 4856 | When a receiver of a duplicate DATA chunk sends a SACK to a multi- |
| 4857 | homed endpoint, it MAY be beneficial to vary the destination address |
| 4858 | and not use the source address of the DATA chunk. The reason is that |
| 4859 | receiving a duplicate from a multi-homed endpoint might indicate that |
| 4860 | the return path (as specified in the source address of the DATA |
| 4861 | chunk) for the SACK is broken. |
| 4862 | |
| 4863 | Furthermore, when its peer is multi-homed, an endpoint SHOULD try to |
| 4864 | retransmit a chunk that timed out to an active destination transport |
| 4865 | address that is different from the last destination address to which |
| 4866 | the DATA chunk was sent. |
| 4867 | |
| 4868 | Retransmissions do not affect the total outstanding data count. |
| 4869 | However, if the DATA chunk is retransmitted onto a different |
| 4870 | destination address, both the outstanding data counts on the new |
| 4871 | |
| 4872 | |
| 4873 | |
| 4874 | Stewart Standards Track [Page 87] |
| 4875 | |
| 4876 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4877 | |
| 4878 | |
| 4879 | destination address and the old destination address to which the data |
| 4880 | chunk was last sent shall be adjusted accordingly. |
| 4881 | |
| 4882 | 6.4.1. Failover from an Inactive Destination Address |
| 4883 | |
| 4884 | Some of the transport addresses of a multi-homed SCTP endpoint may |
| 4885 | become inactive due to either the occurrence of certain error |
| 4886 | conditions (see Section 8.2) or adjustments from the SCTP user. |
| 4887 | |
| 4888 | When there is outbound data to send and the primary path becomes |
| 4889 | inactive (e.g., due to failures), or where the SCTP user explicitly |
| 4890 | requests to send data to an inactive destination transport address, |
| 4891 | before reporting an error to its ULP, the SCTP endpoint should try to |
| 4892 | send the data to an alternate active destination transport address if |
| 4893 | one exists. |
| 4894 | |
| 4895 | When retransmitting data that timed out, if the endpoint is multi- |
| 4896 | homed, it should consider each source-destination address pair in its |
| 4897 | retransmission selection policy. When retransmitting timed-out data, |
| 4898 | the endpoint should attempt to pick the most divergent source- |
| 4899 | destination pair from the original source-destination pair to which |
| 4900 | the packet was transmitted. |
| 4901 | |
| 4902 | Note: Rules for picking the most divergent source-destination pair |
| 4903 | are an implementation decision and are not specified within this |
| 4904 | document. |
| 4905 | |
| 4906 | 6.5. Stream Identifier and Stream Sequence Number |
| 4907 | |
| 4908 | Every DATA chunk MUST carry a valid stream identifier. If an |
| 4909 | endpoint receives a DATA chunk with an invalid stream identifier, it |
| 4910 | shall acknowledge the reception of the DATA chunk following the |
| 4911 | normal procedure, immediately send an ERROR chunk with cause set to |
| 4912 | "Invalid Stream Identifier" (see Section 3.3.10), and discard the |
| 4913 | DATA chunk. The endpoint may bundle the ERROR chunk in the same |
| 4914 | packet as the SACK as long as the ERROR follows the SACK. |
| 4915 | |
| 4916 | The Stream Sequence Number in all the streams MUST start from 0 when |
| 4917 | the association is established. Also, when the Stream Sequence |
| 4918 | Number reaches the value 65535 the next Stream Sequence Number MUST |
| 4919 | be set to 0. |
| 4920 | |
| 4921 | 6.6. Ordered and Unordered Delivery |
| 4922 | |
| 4923 | Within a stream, an endpoint MUST deliver DATA chunks received with |
| 4924 | the U flag set to 0 to the upper layer according to the order of |
| 4925 | their Stream Sequence Number. If DATA chunks arrive out of order of |
| 4926 | |
| 4927 | |
| 4928 | |
| 4929 | |
| 4930 | Stewart Standards Track [Page 88] |
| 4931 | |
| 4932 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4933 | |
| 4934 | |
| 4935 | their Stream Sequence Number, the endpoint MUST hold the received |
| 4936 | DATA chunks from delivery to the ULP until they are reordered. |
| 4937 | |
| 4938 | However, an SCTP endpoint can indicate that no ordered delivery is |
| 4939 | required for a particular DATA chunk transmitted within the stream by |
| 4940 | setting the U flag of the DATA chunk to 1. |
| 4941 | |
| 4942 | When an endpoint receives a DATA chunk with the U flag set to 1, it |
| 4943 | must bypass the ordering mechanism and immediately deliver the data |
| 4944 | to the upper layer (after reassembly if the user data is fragmented |
| 4945 | by the data sender). |
| 4946 | |
| 4947 | This provides an effective way of transmitting "out-of-band" data in |
| 4948 | a given stream. Also, a stream can be used as an "unordered" stream |
| 4949 | by simply setting the U flag to 1 in all DATA chunks sent through |
| 4950 | that stream. |
| 4951 | |
| 4952 | IMPLEMENTATION NOTE: When sending an unordered DATA chunk, an |
| 4953 | implementation may choose to place the DATA chunk in an outbound |
| 4954 | packet that is at the head of the outbound transmission queue if |
| 4955 | possible. |
| 4956 | |
| 4957 | The 'Stream Sequence Number' field in a DATA chunk with U flag set to |
| 4958 | 1 has no significance. The sender can fill it with arbitrary value, |
| 4959 | but the receiver MUST ignore the field. |
| 4960 | |
| 4961 | Note: When transmitting ordered and unordered data, an endpoint does |
| 4962 | not increment its Stream Sequence Number when transmitting a DATA |
| 4963 | chunk with U flag set to 1. |
| 4964 | |
| 4965 | 6.7. Report Gaps in Received DATA TSNs |
| 4966 | |
| 4967 | Upon the reception of a new DATA chunk, an endpoint shall examine the |
| 4968 | continuity of the TSNs received. If the endpoint detects a gap in |
| 4969 | the received DATA chunk sequence, it SHOULD send a SACK with Gap Ack |
| 4970 | Blocks immediately. The data receiver continues sending a SACK after |
| 4971 | receipt of each SCTP packet that doesn't fill the gap. |
| 4972 | |
| 4973 | Based on the Gap Ack Block from the received SACK, the endpoint can |
| 4974 | calculate the missing DATA chunks and make decisions on whether to |
| 4975 | retransmit them (see Section 6.2.1 for details). |
| 4976 | |
| 4977 | Multiple gaps can be reported in one single SACK (see Section 3.3.4). |
| 4978 | |
| 4979 | When its peer is multi-homed, the SCTP endpoint SHOULD always try to |
| 4980 | send the SACK to the same destination address from which the last |
| 4981 | DATA chunk was received. |
| 4982 | |
| 4983 | |
| 4984 | |
| 4985 | |
| 4986 | Stewart Standards Track [Page 89] |
| 4987 | |
| 4988 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 4989 | |
| 4990 | |
| 4991 | Upon the reception of a SACK, the endpoint MUST remove all DATA |
| 4992 | chunks that have been acknowledged by the SACK's Cumulative TSN Ack |
| 4993 | from its transmit queue. The endpoint MUST also treat all the DATA |
| 4994 | chunks with TSNs not included in the Gap Ack Blocks reported by the |
| 4995 | SACK as "missing". The number of "missing" reports for each |
| 4996 | outstanding DATA chunk MUST be recorded by the data sender in order |
| 4997 | to make retransmission decisions. See Section 7.2.4 for details. |
| 4998 | |
| 4999 | The following example shows the use of SACK to report a gap. |
| 5000 | |
| 5001 | Endpoint A Endpoint Z {App |
| 5002 | sends 3 messages; strm 0} DATA [TSN=6,Strm=0,Seq=2] ---------- |
| 5003 | -----> (ack delayed) (Start T3-rtx timer) |
| 5004 | |
| 5005 | DATA [TSN=7,Strm=0,Seq=3] --------> X (lost) |
| 5006 | |
| 5007 | DATA [TSN=8,Strm=0,Seq=4] ---------------> (gap detected, |
| 5008 | immediately send ack) |
| 5009 | /----- SACK [TSN Ack=6,Block=1, |
| 5010 | / Start=2,End=2] |
| 5011 | <-----/ (remove 6 from out-queue, |
| 5012 | and mark 7 as "1" missing report) |
| 5013 | |
| 5014 | Figure 9: Reporting a Gap using SACK |
| 5015 | |
| 5016 | The maximum number of Gap Ack Blocks that can be reported within a |
| 5017 | single SACK chunk is limited by the current path MTU. When a single |
| 5018 | SACK cannot cover all the Gap Ack Blocks needed to be reported due to |
| 5019 | the MTU limitation, the endpoint MUST send only one SACK, reporting |
| 5020 | the Gap Ack Blocks from the lowest to highest TSNs, within the size |
| 5021 | limit set by the MTU, and leave the remaining highest TSN numbers |
| 5022 | unacknowledged. |
| 5023 | |
| 5024 | 6.8. CRC32c Checksum Calculation |
| 5025 | |
| 5026 | When sending an SCTP packet, the endpoint MUST strengthen the data |
| 5027 | integrity of the transmission by including the CRC32c checksum value |
| 5028 | calculated on the packet, as described below. |
| 5029 | |
| 5030 | After the packet is constructed (containing the SCTP common header |
| 5031 | and one or more control or DATA chunks), the transmitter MUST |
| 5032 | |
| 5033 | 1) fill in the proper Verification Tag in the SCTP common header and |
| 5034 | initialize the checksum field to '0's, |
| 5035 | |
| 5036 | 2) calculate the CRC32c checksum of the whole packet, including the |
| 5037 | SCTP common header and all the chunks (refer to Appendix B for |
| 5038 | details of the CRC32c algorithm); and |
| 5039 | |
| 5040 | |
| 5041 | |
| 5042 | Stewart Standards Track [Page 90] |
| 5043 | |
| 5044 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5045 | |
| 5046 | |
| 5047 | 3) put the resultant value into the checksum field in the common |
| 5048 | header, and leave the rest of the bits unchanged. |
| 5049 | |
| 5050 | When an SCTP packet is received, the receiver MUST first check the |
| 5051 | CRC32c checksum as follows: |
| 5052 | |
| 5053 | 1) Store the received CRC32c checksum value aside. |
| 5054 | |
| 5055 | 2) Replace the 32 bits of the checksum field in the received SCTP |
| 5056 | packet with all '0's and calculate a CRC32c checksum value of the |
| 5057 | whole received packet. |
| 5058 | |
| 5059 | 3) Verify that the calculated CRC32c checksum is the same as the |
| 5060 | received CRC32c checksum. If it is not, the receiver MUST treat |
| 5061 | the packet as an invalid SCTP packet. |
| 5062 | |
| 5063 | The default procedure for handling invalid SCTP packets is to |
| 5064 | silently discard them. |
| 5065 | |
| 5066 | Any hardware implementation SHOULD be done in a way that is |
| 5067 | verifiable by the software. |
| 5068 | |
| 5069 | 6.9. Fragmentation and Reassembly |
| 5070 | |
| 5071 | An endpoint MAY support fragmentation when sending DATA chunks, but |
| 5072 | it MUST support reassembly when receiving DATA chunks. If an |
| 5073 | endpoint supports fragmentation, it MUST fragment a user message if |
| 5074 | the size of the user message to be sent causes the outbound SCTP |
| 5075 | packet size to exceed the current MTU. If an implementation does not |
| 5076 | support fragmentation of outbound user messages, the endpoint MUST |
| 5077 | return an error to its upper layer and not attempt to send the user |
| 5078 | message. |
| 5079 | |
| 5080 | Note: If an implementation that supports fragmentation makes |
| 5081 | available to its upper layer a mechanism to turn off fragmentation, |
| 5082 | it may do so. However, in so doing, it MUST react just like an |
| 5083 | implementation that does NOT support fragmentation, i.e., it MUST |
| 5084 | reject sends that exceed the current Path MTU (P-MTU). |
| 5085 | |
| 5086 | IMPLEMENTATION NOTE: In this error case, the Send primitive discussed |
| 5087 | in Section 10.1 would need to return an error to the upper layer. |
| 5088 | |
| 5089 | If its peer is multi-homed, the endpoint shall choose a size no |
| 5090 | larger than the association Path MTU. The association Path MTU is |
| 5091 | the smallest Path MTU of all destination addresses. |
| 5092 | |
| 5093 | |
| 5094 | |
| 5095 | |
| 5096 | |
| 5097 | |
| 5098 | Stewart Standards Track [Page 91] |
| 5099 | |
| 5100 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5101 | |
| 5102 | |
| 5103 | Note: Once a message is fragmented, it cannot be re-fragmented. |
| 5104 | Instead, if the PMTU has been reduced, then IP fragmentation must be |
| 5105 | used. Please see Section 7.3 for details of PMTU discovery. |
| 5106 | |
| 5107 | When determining when to fragment, the SCTP implementation MUST take |
| 5108 | into account the SCTP packet header as well as the DATA chunk |
| 5109 | header(s). The implementation MUST also take into account the space |
| 5110 | required for a SACK chunk if bundling a SACK chunk with the DATA |
| 5111 | chunk. |
| 5112 | |
| 5113 | Fragmentation takes the following steps: |
| 5114 | |
| 5115 | 1) The data sender MUST break the user message into a series of DATA |
| 5116 | chunks such that each chunk plus SCTP overhead fits into an IP |
| 5117 | datagram smaller than or equal to the association Path MTU. |
| 5118 | |
| 5119 | 2) The transmitter MUST then assign, in sequence, a separate TSN to |
| 5120 | each of the DATA chunks in the series. The transmitter assigns |
| 5121 | the same SSN to each of the DATA chunks. If the user indicates |
| 5122 | that the user message is to be delivered using unordered |
| 5123 | delivery, then the U flag of each DATA chunk of the user message |
| 5124 | MUST be set to 1. |
| 5125 | |
| 5126 | 3) The transmitter MUST also set the B/E bits of the first DATA |
| 5127 | chunk in the series to '10', the B/E bits of the last DATA chunk |
| 5128 | in the series to '01', and the B/E bits of all other DATA chunks |
| 5129 | in the series to '00'. |
| 5130 | |
| 5131 | An endpoint MUST recognize fragmented DATA chunks by examining the |
| 5132 | B/E bits in each of the received DATA chunks, and queue the |
| 5133 | fragmented DATA chunks for reassembly. Once the user message is |
| 5134 | reassembled, SCTP shall pass the reassembled user message to the |
| 5135 | specific stream for possible reordering and final dispatching. |
| 5136 | |
| 5137 | Note: If the data receiver runs out of buffer space while still |
| 5138 | waiting for more fragments to complete the reassembly of the message, |
| 5139 | it should dispatch part of its inbound message through a partial |
| 5140 | delivery API (see Section 10), freeing some of its receive buffer |
| 5141 | space so that the rest of the message may be received. |
| 5142 | |
| 5143 | 6.10. Bundling |
| 5144 | |
| 5145 | An endpoint bundles chunks by simply including multiple chunks in one |
| 5146 | outbound SCTP packet. The total size of the resultant IP datagram, |
| 5147 | |
| 5148 | including the SCTP packet and IP headers, MUST be less that or equal |
| 5149 | to the current Path MTU. |
| 5150 | |
| 5151 | |
| 5152 | |
| 5153 | |
| 5154 | Stewart Standards Track [Page 92] |
| 5155 | |
| 5156 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5157 | |
| 5158 | |
| 5159 | If its peer endpoint is multi-homed, the sending endpoint shall |
| 5160 | choose a size no larger than the latest MTU of the current primary |
| 5161 | path. |
| 5162 | |
| 5163 | When bundling control chunks with DATA chunks, an endpoint MUST place |
| 5164 | control chunks first in the outbound SCTP packet. The transmitter |
| 5165 | MUST transmit DATA chunks within an SCTP packet in increasing order |
| 5166 | of TSN. |
| 5167 | |
| 5168 | Note: Since control chunks must be placed first in a packet and since |
| 5169 | DATA chunks must be transmitted before SHUTDOWN or SHUTDOWN ACK |
| 5170 | chunks, DATA chunks cannot be bundled with SHUTDOWN or SHUTDOWN ACK |
| 5171 | chunks. |
| 5172 | |
| 5173 | Partial chunks MUST NOT be placed in an SCTP packet. A partial chunk |
| 5174 | is a chunk that is not completely contained in the SCTP packet; i.e., |
| 5175 | the SCTP packet is too short to contain all the bytes of the chunk as |
| 5176 | indicated by the chunk length. |
| 5177 | |
| 5178 | An endpoint MUST process received chunks in their order in the |
| 5179 | packet. The receiver uses the Chunk Length field to determine the |
| 5180 | end of a chunk and beginning of the next chunk taking account of the |
| 5181 | fact that all chunks end on a 4-byte boundary. If the receiver |
| 5182 | detects a partial chunk, it MUST drop the chunk. |
| 5183 | |
| 5184 | An endpoint MUST NOT bundle INIT, INIT ACK, or SHUTDOWN COMPLETE with |
| 5185 | any other chunks. |
| 5186 | |
| 5187 | 7. Congestion Control |
| 5188 | |
| 5189 | Congestion control is one of the basic functions in SCTP. For some |
| 5190 | applications, it may be likely that adequate resources will be |
| 5191 | allocated to SCTP traffic to ensure prompt delivery of time-critical |
| 5192 | data -- thus, it would appear to be unlikely, during normal |
| 5193 | operations, that transmissions encounter severe congestion |
| 5194 | conditions. However, SCTP must operate under adverse operational |
| 5195 | conditions, which can develop upon partial network failures or |
| 5196 | unexpected traffic surges. In such situations, SCTP must follow |
| 5197 | correct congestion control steps to recover from congestion quickly |
| 5198 | in order to get data delivered as soon as possible. In the absence |
| 5199 | of network congestion, these preventive congestion control algorithms |
| 5200 | should show no impact on the protocol performance. |
| 5201 | |
| 5202 | IMPLEMENTATION NOTE: As far as its specific performance requirements |
| 5203 | are met, an implementation is always allowed to adopt a more |
| 5204 | conservative congestion control algorithm than the one defined below. |
| 5205 | |
| 5206 | |
| 5207 | |
| 5208 | |
| 5209 | |
| 5210 | Stewart Standards Track [Page 93] |
| 5211 | |
| 5212 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5213 | |
| 5214 | |
| 5215 | The congestion control algorithms used by SCTP are based on |
| 5216 | [RFC2581]. This section describes how the algorithms defined in |
| 5217 | [RFC2581] are adapted for use in SCTP. We first list differences in |
| 5218 | protocol designs between TCP and SCTP, and then describe SCTP's |
| 5219 | congestion control scheme. The description will use the same |
| 5220 | terminology as in TCP congestion control whenever appropriate. |
| 5221 | |
| 5222 | SCTP congestion control is always applied to the entire association, |
| 5223 | and not to individual streams. |
| 5224 | |
| 5225 | 7.1. SCTP Differences from TCP Congestion Control |
| 5226 | |
| 5227 | Gap Ack Blocks in the SCTP SACK carry the same semantic meaning as |
| 5228 | the TCP SACK. TCP considers the information carried in the SACK as |
| 5229 | advisory information only. SCTP considers the information carried in |
| 5230 | the Gap Ack Blocks in the SACK chunk as advisory. In SCTP, any DATA |
| 5231 | chunk that has been acknowledged by SACK, including DATA that arrived |
| 5232 | at the receiving end out of order, is not considered fully delivered |
| 5233 | until the Cumulative TSN Ack Point passes the TSN of the DATA chunk |
| 5234 | (i.e., the DATA chunk has been acknowledged by the Cumulative TSN Ack |
| 5235 | field in the SACK). Consequently, the value of cwnd controls the |
| 5236 | amount of outstanding data, rather than (as in the case of non-SACK |
| 5237 | TCP) the upper bound between the highest acknowledged sequence number |
| 5238 | and the latest DATA chunk that can be sent within the congestion |
| 5239 | window. SCTP SACK leads to different implementations of Fast |
| 5240 | Retransmit and Fast Recovery than non-SACK TCP. As an example, see |
| 5241 | [FALL96]. |
| 5242 | |
| 5243 | The biggest difference between SCTP and TCP, however, is multi- |
| 5244 | homing. SCTP is designed to establish robust communication |
| 5245 | associations between two endpoints each of which may be reachable by |
| 5246 | more than one transport address. Potentially different addresses may |
| 5247 | lead to different data paths between the two endpoints; thus, ideally |
| 5248 | one may need a separate set of congestion control parameters for each |
| 5249 | of the paths. The treatment here of congestion control for multi- |
| 5250 | homed receivers is new with SCTP and may require refinement in the |
| 5251 | future. The current algorithms make the following assumptions: |
| 5252 | |
| 5253 | o The sender usually uses the same destination address until being |
| 5254 | instructed by the upper layer to do otherwise; however, SCTP may |
| 5255 | change to an alternate destination in the event an address is |
| 5256 | marked inactive (see Section 8.2). Also, SCTP may retransmit to a |
| 5257 | different transport address than the original transmission. |
| 5258 | |
| 5259 | o The sender keeps a separate congestion control parameter set for |
| 5260 | each of the destination addresses it can send to (not each |
| 5261 | source-destination pair but for each destination). The parameters |
| 5262 | |
| 5263 | |
| 5264 | |
| 5265 | |
| 5266 | Stewart Standards Track [Page 94] |
| 5267 | |
| 5268 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5269 | |
| 5270 | |
| 5271 | should decay if the address is not used for a long enough time |
| 5272 | period. |
| 5273 | |
| 5274 | o For each of the destination addresses, an endpoint does slow start |
| 5275 | upon the first transmission to that address. |
| 5276 | |
| 5277 | Note: TCP guarantees in-sequence delivery of data to its upper-layer |
| 5278 | protocol within a single TCP session. This means that when TCP |
| 5279 | notices a gap in the received sequence number, it waits until the gap |
| 5280 | is filled before delivering the data that was received with sequence |
| 5281 | numbers higher than that of the missing data. On the other hand, |
| 5282 | SCTP can deliver data to its upper-layer protocol even if there is a |
| 5283 | gap in TSN if the Stream Sequence Numbers are in sequence for a |
| 5284 | particular stream (i.e., the missing DATA chunks are for a different |
| 5285 | stream) or if unordered delivery is indicated. Although this does |
| 5286 | not affect cwnd, it might affect rwnd calculation. |
| 5287 | |
| 5288 | 7.2. SCTP Slow-Start and Congestion Avoidance |
| 5289 | |
| 5290 | The slow-start and congestion avoidance algorithms MUST be used by an |
| 5291 | endpoint to control the amount of data being injected into the |
| 5292 | network. The congestion control in SCTP is employed in regard to the |
| 5293 | association, not to an individual stream. In some situations, it may |
| 5294 | be beneficial for an SCTP sender to be more conservative than the |
| 5295 | algorithms allow; however, an SCTP sender MUST NOT be more aggressive |
| 5296 | than the following algorithms allow. |
| 5297 | |
| 5298 | Like TCP, an SCTP endpoint uses the following three control variables |
| 5299 | to regulate its transmission rate. |
| 5300 | |
| 5301 | o Receiver advertised window size (rwnd, in bytes), which is set by |
| 5302 | the receiver based on its available buffer space for incoming |
| 5303 | packets. |
| 5304 | |
| 5305 | Note: This variable is kept on the entire association. |
| 5306 | |
| 5307 | o Congestion control window (cwnd, in bytes), which is adjusted by |
| 5308 | the sender based on observed network conditions. |
| 5309 | |
| 5310 | Note: This variable is maintained on a per-destination-address |
| 5311 | basis. |
| 5312 | |
| 5313 | o Slow-start threshold (ssthresh, in bytes), which is used by the |
| 5314 | sender to distinguish slow-start and congestion avoidance phases. |
| 5315 | |
| 5316 | Note: This variable is maintained on a per-destination-address |
| 5317 | basis. |
| 5318 | |
| 5319 | |
| 5320 | |
| 5321 | |
| 5322 | Stewart Standards Track [Page 95] |
| 5323 | |
| 5324 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5325 | |
| 5326 | |
| 5327 | SCTP also requires one additional control variable, |
| 5328 | partial_bytes_acked, which is used during congestion avoidance phase |
| 5329 | to facilitate cwnd adjustment. |
| 5330 | |
| 5331 | Unlike TCP, an SCTP sender MUST keep a set of these control variables |
| 5332 | cwnd, ssthresh, and partial_bytes_acked for EACH destination address |
| 5333 | of its peer (when its peer is multi-homed). Only one rwnd is kept |
| 5334 | for the whole association (no matter if the peer is multi-homed or |
| 5335 | has a single address). |
| 5336 | |
| 5337 | 7.2.1. Slow-Start |
| 5338 | |
| 5339 | Beginning data transmission into a network with unknown conditions or |
| 5340 | after a sufficiently long idle period requires SCTP to probe the |
| 5341 | network to determine the available capacity. The slow-start |
| 5342 | algorithm is used for this purpose at the beginning of a transfer, or |
| 5343 | after repairing loss detected by the retransmission timer. |
| 5344 | |
| 5345 | o The initial cwnd before DATA transmission or after a sufficiently |
| 5346 | long idle period MUST be set to min(4*MTU, max (2*MTU, 4380 |
| 5347 | bytes)). |
| 5348 | |
| 5349 | o The initial cwnd after a retransmission timeout MUST be no more |
| 5350 | than 1*MTU. |
| 5351 | |
| 5352 | o The initial value of ssthresh MAY be arbitrarily high (for |
| 5353 | example, implementations MAY use the size of the receiver |
| 5354 | advertised window). |
| 5355 | |
| 5356 | o Whenever cwnd is greater than zero, the endpoint is allowed to |
| 5357 | have cwnd bytes of data outstanding on that transport address. |
| 5358 | |
| 5359 | o When cwnd is less than or equal to ssthresh, an SCTP endpoint MUST |
| 5360 | use the slow-start algorithm to increase cwnd only if the current |
| 5361 | congestion window is being fully utilized, an incoming SACK |
| 5362 | advances the Cumulative TSN Ack Point, and the data sender is not |
| 5363 | in Fast Recovery. Only when these three conditions are met can |
| 5364 | the cwnd be increased; otherwise, the cwnd MUST not be increased. |
| 5365 | If these conditions are met, then cwnd MUST be increased by, at |
| 5366 | most, the lesser of 1) the total size of the previously |
| 5367 | outstanding DATA chunk(s) acknowledged, and 2) the destination's |
| 5368 | path MTU. This upper bound protects against the ACK-Splitting |
| 5369 | attack outlined in [SAVAGE99]. |
| 5370 | |
| 5371 | In instances where its peer endpoint is multi-homed, if an endpoint |
| 5372 | receives a SACK that advances its Cumulative TSN Ack Point, then it |
| 5373 | should update its cwnd (or cwnds) apportioned to the destination |
| 5374 | addresses to which it transmitted the acknowledged data. However, if |
| 5375 | |
| 5376 | |
| 5377 | |
| 5378 | Stewart Standards Track [Page 96] |
| 5379 | |
| 5380 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5381 | |
| 5382 | |
| 5383 | the received SACK does not advance the Cumulative TSN Ack Point, the |
| 5384 | endpoint MUST NOT adjust the cwnd of any of the destination |
| 5385 | addresses. |
| 5386 | |
| 5387 | Because an endpoint's cwnd is not tied to its Cumulative TSN Ack |
| 5388 | Point, as duplicate SACKs come in, even though they may not advance |
| 5389 | the Cumulative TSN Ack Point an endpoint can still use them to clock |
| 5390 | out new data. That is, the data newly acknowledged by the SACK |
| 5391 | diminishes the amount of data now in flight to less than cwnd, and so |
| 5392 | the current, unchanged value of cwnd now allows new data to be sent. |
| 5393 | On the other hand, the increase of cwnd must be tied to the |
| 5394 | Cumulative TSN Ack Point advancement as specified above. Otherwise, |
| 5395 | the duplicate SACKs will not only clock out new data, but also will |
| 5396 | adversely clock out more new data than what has just left the |
| 5397 | network, during a time of possible congestion. |
| 5398 | |
| 5399 | o When the endpoint does not transmit data on a given transport |
| 5400 | address, the cwnd of the transport address should be adjusted to |
| 5401 | max(cwnd/2, 4*MTU) per RTO. |
| 5402 | |
| 5403 | 7.2.2. Congestion Avoidance |
| 5404 | |
| 5405 | When cwnd is greater than ssthresh, cwnd should be incremented by |
| 5406 | 1*MTU per RTT if the sender has cwnd or more bytes of data |
| 5407 | outstanding for the corresponding transport address. |
| 5408 | |
| 5409 | In practice, an implementation can achieve this goal in the following |
| 5410 | way: |
| 5411 | |
| 5412 | o partial_bytes_acked is initialized to 0. |
| 5413 | |
| 5414 | o Whenever cwnd is greater than ssthresh, upon each SACK arrival |
| 5415 | that advances the Cumulative TSN Ack Point, increase |
| 5416 | partial_bytes_acked by the total number of bytes of all new chunks |
| 5417 | acknowledged in that SACK including chunks acknowledged by the new |
| 5418 | Cumulative TSN Ack and by Gap Ack Blocks. |
| 5419 | |
| 5420 | o When partial_bytes_acked is equal to or greater than cwnd and |
| 5421 | before the arrival of the SACK the sender had cwnd or more bytes |
| 5422 | of data outstanding (i.e., before arrival of the SACK, flightsize |
| 5423 | was greater than or equal to cwnd), increase cwnd by MTU, and |
| 5424 | reset partial_bytes_acked to (partial_bytes_acked - cwnd). |
| 5425 | |
| 5426 | o Same as in the slow start, when the sender does not transmit DATA |
| 5427 | on a given transport address, the cwnd of the transport address |
| 5428 | should be adjusted to max(cwnd / 2, 4*MTU) per RTO. |
| 5429 | |
| 5430 | |
| 5431 | |
| 5432 | |
| 5433 | |
| 5434 | Stewart Standards Track [Page 97] |
| 5435 | |
| 5436 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5437 | |
| 5438 | |
| 5439 | o When all of the data transmitted by the sender has been |
| 5440 | acknowledged by the receiver, partial_bytes_acked is initialized |
| 5441 | to 0. |
| 5442 | |
| 5443 | 7.2.3. Congestion Control |
| 5444 | |
| 5445 | Upon detection of packet losses from SACK (see Section 7.2.4), an |
| 5446 | endpoint should do the following: |
| 5447 | |
| 5448 | ssthresh = max(cwnd/2, 4*MTU) |
| 5449 | cwnd = ssthresh |
| 5450 | partial_bytes_acked = 0 |
| 5451 | |
| 5452 | Basically, a packet loss causes cwnd to be cut in half. |
| 5453 | |
| 5454 | When the T3-rtx timer expires on an address, SCTP should perform slow |
| 5455 | start by: |
| 5456 | |
| 5457 | ssthresh = max(cwnd/2, 4*MTU) |
| 5458 | cwnd = 1*MTU |
| 5459 | |
| 5460 | and ensure that no more than one SCTP packet will be in flight for |
| 5461 | that address until the endpoint receives acknowledgement for |
| 5462 | successful delivery of data to that address. |
| 5463 | |
| 5464 | 7.2.4. Fast Retransmit on Gap Reports |
| 5465 | |
| 5466 | In the absence of data loss, an endpoint performs delayed |
| 5467 | acknowledgement. However, whenever an endpoint notices a hole in the |
| 5468 | arriving TSN sequence, it SHOULD start sending a SACK back every time |
| 5469 | a packet arrives carrying data until the hole is filled. |
| 5470 | |
| 5471 | Whenever an endpoint receives a SACK that indicates that some TSNs |
| 5472 | are missing, it SHOULD wait for two further miss indications (via |
| 5473 | subsequent SACKs for a total of three missing reports) on the same |
| 5474 | TSNs before taking action with regard to Fast Retransmit. |
| 5475 | |
| 5476 | Miss indications SHOULD follow the HTNA (Highest TSN Newly |
| 5477 | Acknowledged) algorithm. For each incoming SACK, miss indications |
| 5478 | are incremented only for missing TSNs prior to the highest TSN newly |
| 5479 | acknowledged in the SACK. A newly acknowledged DATA chunk is one not |
| 5480 | previously acknowledged in a SACK. If an endpoint is in Fast |
| 5481 | Recovery and a SACK arrives that advances the Cumulative TSN Ack |
| 5482 | Point, the miss indications are incremented for all TSNs reported |
| 5483 | missing in the SACK. |
| 5484 | |
| 5485 | When the third consecutive miss indication is received for a TSN(s), |
| 5486 | the data sender shall do the following: |
| 5487 | |
| 5488 | |
| 5489 | |
| 5490 | Stewart Standards Track [Page 98] |
| 5491 | |
| 5492 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5493 | |
| 5494 | |
| 5495 | 1) Mark the DATA chunk(s) with three miss indications for |
| 5496 | retransmission. |
| 5497 | |
| 5498 | 2) If not in Fast Recovery, adjust the ssthresh and cwnd of the |
| 5499 | destination address(es) to which the missing DATA chunks were |
| 5500 | last sent, according to the formula described in Section 7.2.3. |
| 5501 | |
| 5502 | 3) Determine how many of the earliest (i.e., lowest TSN) DATA chunks |
| 5503 | marked for retransmission will fit into a single packet, subject |
| 5504 | to constraint of the path MTU of the destination transport |
| 5505 | address to which the packet is being sent. Call this value K. |
| 5506 | Retransmit those K DATA chunks in a single packet. When a Fast |
| 5507 | Retransmit is being performed, the sender SHOULD ignore the value |
| 5508 | of cwnd and SHOULD NOT delay retransmission for this single |
| 5509 | packet. |
| 5510 | |
| 5511 | 4) Restart the T3-rtx timer only if the last SACK acknowledged the |
| 5512 | lowest outstanding TSN number sent to that address, or the |
| 5513 | endpoint is retransmitting the first outstanding DATA chunk sent |
| 5514 | to that address. |
| 5515 | |
| 5516 | 5) Mark the DATA chunk(s) as being fast retransmitted and thus |
| 5517 | ineligible for a subsequent Fast Retransmit. Those TSNs marked |
| 5518 | for retransmission due to the Fast-Retransmit algorithm that did |
| 5519 | not fit in the sent datagram carrying K other TSNs are also |
| 5520 | marked as ineligible for a subsequent Fast Retransmit. However, |
| 5521 | as they are marked for retransmission they will be retransmitted |
| 5522 | later on as soon as cwnd allows. |
| 5523 | |
| 5524 | 6) If not in Fast Recovery, enter Fast Recovery and mark the highest |
| 5525 | outstanding TSN as the Fast Recovery exit point. When a SACK |
| 5526 | acknowledges all TSNs up to and including this exit point, Fast |
| 5527 | Recovery is exited. While in Fast Recovery, the ssthresh and |
| 5528 | cwnd SHOULD NOT change for any destinations due to a subsequent |
| 5529 | Fast Recovery event (i.e., one SHOULD NOT reduce the cwnd further |
| 5530 | due to a subsequent Fast Retransmit). |
| 5531 | |
| 5532 | Note: Before the above adjustments, if the received SACK also |
| 5533 | acknowledges new DATA chunks and advances the Cumulative TSN Ack |
| 5534 | Point, the cwnd adjustment rules defined in Section 7.2.1 and Section |
| 5535 | 7.2.2 must be applied first. |
| 5536 | |
| 5537 | A straightforward implementation of the above keeps a counter for |
| 5538 | each TSN hole reported by a SACK. The counter increments for each |
| 5539 | consecutive SACK reporting the TSN hole. After reaching 3 and |
| 5540 | starting the Fast-Retransmit procedure, the counter resets to 0. |
| 5541 | |
| 5542 | |
| 5543 | |
| 5544 | |
| 5545 | |
| 5546 | Stewart Standards Track [Page 99] |
| 5547 | |
| 5548 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5549 | |
| 5550 | |
| 5551 | Because cwnd in SCTP indirectly bounds the number of outstanding |
| 5552 | TSN's, the effect of TCP Fast Recovery is achieved automatically with |
| 5553 | no adjustment to the congestion control window size. |
| 5554 | |
| 5555 | 7.3. Path MTU Discovery |
| 5556 | |
| 5557 | [RFC4821], [RFC1981], and [RFC1191] specify "Packetization Layer Path |
| 5558 | MTU Discovery", whereby an endpoint maintains an estimate of the |
| 5559 | maximum transmission unit (MTU) along a given Internet path and |
| 5560 | refrains from sending packets along that path that exceed the MTU, |
| 5561 | other than occasional attempts to probe for a change in the Path MTU |
| 5562 | (PMTU). [RFC4821] is thorough in its discussion of the MTU discovery |
| 5563 | mechanism and strategies for determining the current end-to-end MTU |
| 5564 | setting as well as detecting changes in this value. |
| 5565 | |
| 5566 | An endpoint SHOULD apply these techniques, and SHOULD do so on a |
| 5567 | per-destination-address basis. |
| 5568 | |
| 5569 | There are two important SCTP-specific points regarding Path MTU |
| 5570 | discovery: |
| 5571 | |
| 5572 | 1) SCTP associations can span multiple addresses. An endpoint MUST |
| 5573 | maintain separate MTU estimates for each destination address of |
| 5574 | its peer. |
| 5575 | |
| 5576 | 2) The sender should track an association PMTU that will be the |
| 5577 | smallest PMTU discovered for all of the peer's destination |
| 5578 | addresses. When fragmenting messages into multiple parts this |
| 5579 | association PMTU should be used to calculate the size of each |
| 5580 | fragment. This will allow retransmissions to be seamlessly sent |
| 5581 | to an alternate address without encountering IP fragmentation. |
| 5582 | |
| 5583 | 8. Fault Management |
| 5584 | |
| 5585 | 8.1. Endpoint Failure Detection |
| 5586 | |
| 5587 | An endpoint shall keep a counter on the total number of consecutive |
| 5588 | retransmissions to its peer (this includes retransmissions to all the |
| 5589 | destination transport addresses of the peer if it is multi-homed), |
| 5590 | including unacknowledged HEARTBEAT chunks. If the value of this |
| 5591 | counter exceeds the limit indicated in the protocol parameter |
| 5592 | 'Association.Max.Retrans', the endpoint shall consider the peer |
| 5593 | endpoint unreachable and shall stop transmitting any more data to it |
| 5594 | (and thus the association enters the CLOSED state). In addition, the |
| 5595 | endpoint MAY report the failure to the upper layer and optionally |
| 5596 | report back all outstanding user data remaining in its outbound |
| 5597 | queue. The association is automatically closed when the peer |
| 5598 | endpoint becomes unreachable. |
| 5599 | |
| 5600 | |
| 5601 | |
| 5602 | Stewart Standards Track [Page 100] |
| 5603 | |
| 5604 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5605 | |
| 5606 | |
| 5607 | The counter shall be reset each time a DATA chunk sent to that peer |
| 5608 | endpoint is acknowledged (by the reception of a SACK) or a HEARTBEAT |
| 5609 | ACK is received from the peer endpoint. |
| 5610 | |
| 5611 | 8.2. Path Failure Detection |
| 5612 | |
| 5613 | When its peer endpoint is multi-homed, an endpoint should keep an |
| 5614 | error counter for each of the destination transport addresses of the |
| 5615 | peer endpoint. |
| 5616 | |
| 5617 | Each time the T3-rtx timer expires on any address, or when a |
| 5618 | HEARTBEAT sent to an idle address is not acknowledged within an RTO, |
| 5619 | the error counter of that destination address will be incremented. |
| 5620 | When the value in the error counter exceeds the protocol parameter |
| 5621 | 'Path.Max.Retrans' of that destination address, the endpoint should |
| 5622 | mark the destination transport address as inactive, and a |
| 5623 | notification SHOULD be sent to the upper layer. |
| 5624 | |
| 5625 | When an outstanding TSN is acknowledged or a HEARTBEAT sent to that |
| 5626 | address is acknowledged with a HEARTBEAT ACK, the endpoint shall |
| 5627 | clear the error counter of the destination transport address to which |
| 5628 | the DATA chunk was last sent (or HEARTBEAT was sent). When the peer |
| 5629 | endpoint is multi-homed and the last chunk sent to it was a |
| 5630 | retransmission to an alternate address, there exists an ambiguity as |
| 5631 | to whether or not the acknowledgement should be credited to the |
| 5632 | address of the last chunk sent. However, this ambiguity does not |
| 5633 | seem to bear any significant consequence to SCTP behavior. If this |
| 5634 | ambiguity is undesirable, the transmitter may choose not to clear the |
| 5635 | error counter if the last chunk sent was a retransmission. |
| 5636 | |
| 5637 | Note: When configuring the SCTP endpoint, the user should avoid |
| 5638 | having the value of 'Association.Max.Retrans' larger than the |
| 5639 | summation of the 'Path.Max.Retrans' of all the destination addresses |
| 5640 | for the remote endpoint. Otherwise, all the destination addresses |
| 5641 | may become inactive while the endpoint still considers the peer |
| 5642 | endpoint reachable. When this condition occurs, how SCTP chooses to |
| 5643 | function is implementation specific. |
| 5644 | |
| 5645 | When the primary path is marked inactive (due to excessive |
| 5646 | retransmissions, for instance), the sender MAY automatically transmit |
| 5647 | new packets to an alternate destination address if one exists and is |
| 5648 | active. If more than one alternate address is active when the |
| 5649 | primary path is marked inactive, only ONE transport address SHOULD be |
| 5650 | chosen and used as the new destination transport address. |
| 5651 | |
| 5652 | |
| 5653 | |
| 5654 | |
| 5655 | |
| 5656 | |
| 5657 | |
| 5658 | Stewart Standards Track [Page 101] |
| 5659 | |
| 5660 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5661 | |
| 5662 | |
| 5663 | 8.3. Path Heartbeat |
| 5664 | |
| 5665 | By default, an SCTP endpoint SHOULD monitor the reachability of the |
| 5666 | idle destination transport address(es) of its peer by sending a |
| 5667 | HEARTBEAT chunk periodically to the destination transport |
| 5668 | address(es). HEARTBEAT sending MAY begin upon reaching the |
| 5669 | ESTABLISHED state and is discontinued after sending either SHUTDOWN |
| 5670 | or SHUTDOWN-ACK. A receiver of a HEARTBEAT MUST respond to a |
| 5671 | HEARTBEAT with a HEARTBEAT-ACK after entering the COOKIE-ECHOED state |
| 5672 | (INIT sender) or the ESTABLISHED state (INIT receiver), up until |
| 5673 | reaching the SHUTDOWN-SENT state (SHUTDOWN sender) or the SHUTDOWN- |
| 5674 | ACK-SENT state (SHUTDOWN receiver). |
| 5675 | |
| 5676 | A destination transport address is considered "idle" if no new chunk |
| 5677 | that can be used for updating path RTT (usually including first |
| 5678 | transmission DATA, INIT, COOKIE ECHO, HEARTBEAT, etc.) and no |
| 5679 | HEARTBEAT has been sent to it within the current heartbeat period of |
| 5680 | that address. This applies to both active and inactive destination |
| 5681 | addresses. |
| 5682 | |
| 5683 | The upper layer can optionally initiate the following functions: |
| 5684 | |
| 5685 | A) Disable heartbeat on a specific destination transport address of a |
| 5686 | given association, |
| 5687 | |
| 5688 | B) Change the HB.interval, |
| 5689 | |
| 5690 | C) Re-enable heartbeat on a specific destination transport address of |
| 5691 | a given association, and |
| 5692 | |
| 5693 | D) Request an on-demand HEARTBEAT on a specific destination transport |
| 5694 | address of a given association. |
| 5695 | |
| 5696 | The endpoint should increment the respective error counter of the |
| 5697 | destination transport address each time a HEARTBEAT is sent to that |
| 5698 | address and not acknowledged within one RTO. |
| 5699 | |
| 5700 | When the value of this counter reaches the protocol parameter |
| 5701 | 'Path.Max.Retrans', the endpoint should mark the corresponding |
| 5702 | destination address as inactive if it is not so marked, and may also |
| 5703 | optionally report to the upper layer the change of reachability of |
| 5704 | this destination address. After this, the endpoint should continue |
| 5705 | HEARTBEAT on this destination address but should stop increasing the |
| 5706 | counter. |
| 5707 | |
| 5708 | The sender of the HEARTBEAT chunk should include in the Heartbeat |
| 5709 | Information field of the chunk the current time when the packet is |
| 5710 | sent out and the destination address to which the packet is sent. |
| 5711 | |
| 5712 | |
| 5713 | |
| 5714 | Stewart Standards Track [Page 102] |
| 5715 | |
| 5716 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5717 | |
| 5718 | |
| 5719 | IMPLEMENTATION NOTE: An alternative implementation of the heartbeat |
| 5720 | mechanism that can be used is to increment the error counter variable |
| 5721 | every time a HEARTBEAT is sent to a destination. Whenever a |
| 5722 | HEARTBEAT ACK arrives, the sender SHOULD clear the error counter of |
| 5723 | the destination that the HEARTBEAT was sent to. This in effect would |
| 5724 | clear the previously stroked error (and any other error counts as |
| 5725 | well). |
| 5726 | |
| 5727 | The receiver of the HEARTBEAT should immediately respond with a |
| 5728 | HEARTBEAT ACK that contains the Heartbeat Information TLV, together |
| 5729 | with any other received TLVs, copied unchanged from the received |
| 5730 | HEARTBEAT chunk. |
| 5731 | |
| 5732 | Upon the receipt of the HEARTBEAT ACK, the sender of the HEARTBEAT |
| 5733 | should clear the error counter of the destination transport address |
| 5734 | to which the HEARTBEAT was sent, and mark the destination transport |
| 5735 | address as active if it is not so marked. The endpoint may |
| 5736 | optionally report to the upper layer when an inactive destination |
| 5737 | address is marked as active due to the reception of the latest |
| 5738 | HEARTBEAT ACK. The receiver of the HEARTBEAT ACK must also clear the |
| 5739 | association overall error count as well (as defined in Section 8.1). |
| 5740 | |
| 5741 | The receiver of the HEARTBEAT ACK should also perform an RTT |
| 5742 | measurement for that destination transport address using the time |
| 5743 | value carried in the HEARTBEAT ACK chunk. |
| 5744 | |
| 5745 | On an idle destination address that is allowed to heartbeat, it is |
| 5746 | recommended that a HEARTBEAT chunk is sent once per RTO of that |
| 5747 | destination address plus the protocol parameter 'HB.interval', with |
| 5748 | jittering of +/- 50% of the RTO value, and exponential backoff of the |
| 5749 | RTO if the previous HEARTBEAT is unanswered. |
| 5750 | |
| 5751 | A primitive is provided for the SCTP user to change the HB.interval |
| 5752 | and turn on or off the heartbeat on a given destination address. The |
| 5753 | heartbeat interval set by the SCTP user is added to the RTO of that |
| 5754 | destination (including any exponential backoff). Only one heartbeat |
| 5755 | should be sent each time the heartbeat timer expires (if multiple |
| 5756 | destinations are idle). It is an implementation decision on how to |
| 5757 | choose which of the candidate idle destinations to heartbeat to (if |
| 5758 | more than one destination is idle). |
| 5759 | |
| 5760 | Note: When tuning the heartbeat interval, there is a side effect that |
| 5761 | SHOULD be taken into account. When this value is increased, i.e., |
| 5762 | the HEARTBEAT takes longer, the detection of lost ABORT messages |
| 5763 | takes longer as well. If a peer endpoint ABORTs the association for |
| 5764 | any reason and the ABORT chunk is lost, the local endpoint will only |
| 5765 | discover the lost ABORT by sending a DATA chunk or HEARTBEAT chunk |
| 5766 | (thus causing the peer to send another ABORT). This must be |
| 5767 | |
| 5768 | |
| 5769 | |
| 5770 | Stewart Standards Track [Page 103] |
| 5771 | |
| 5772 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5773 | |
| 5774 | |
| 5775 | considered when tuning the HEARTBEAT timer. If the HEARTBEAT is |
| 5776 | disabled, only sending DATA to the association will discover a lost |
| 5777 | ABORT from the peer. |
| 5778 | |
| 5779 | 8.4. Handle "Out of the Blue" Packets |
| 5780 | |
| 5781 | An SCTP packet is called an "out of the blue" (OOTB) packet if it is |
| 5782 | correctly formed (i.e., passed the receiver's CRC32c check; see |
| 5783 | Section 6.8), but the receiver is not able to identify the |
| 5784 | association to which this packet belongs. |
| 5785 | |
| 5786 | The receiver of an OOTB packet MUST do the following: |
| 5787 | |
| 5788 | 1) If the OOTB packet is to or from a non-unicast address, a |
| 5789 | receiver SHOULD silently discard the packet. Otherwise, |
| 5790 | |
| 5791 | 2) If the OOTB packet contains an ABORT chunk, the receiver MUST |
| 5792 | silently discard the OOTB packet and take no further action. |
| 5793 | Otherwise, |
| 5794 | |
| 5795 | 3) If the packet contains an INIT chunk with a Verification Tag set |
| 5796 | to '0', process it as described in Section 5.1. If, for whatever |
| 5797 | reason, the INIT cannot be processed normally and an ABORT has to |
| 5798 | be sent in response, the Verification Tag of the packet |
| 5799 | containing the ABORT chunk MUST be the Initiate Tag of the |
| 5800 | received INIT chunk, and the T bit of the ABORT chunk has to be |
| 5801 | set to 0, indicating that the Verification Tag is NOT reflected. |
| 5802 | |
| 5803 | 4) If the packet contains a COOKIE ECHO in the first chunk, process |
| 5804 | it as described in Section 5.1. Otherwise, |
| 5805 | |
| 5806 | 5) If the packet contains a SHUTDOWN ACK chunk, the receiver should |
| 5807 | respond to the sender of the OOTB packet with a SHUTDOWN |
| 5808 | COMPLETE. When sending the SHUTDOWN COMPLETE, the receiver of |
| 5809 | the OOTB packet must fill in the Verification Tag field of the |
| 5810 | outbound packet with the Verification Tag received in the |
| 5811 | SHUTDOWN ACK and set the T bit in the Chunk Flags to indicate |
| 5812 | that the Verification Tag is reflected. Otherwise, |
| 5813 | |
| 5814 | 6) If the packet contains a SHUTDOWN COMPLETE chunk, the receiver |
| 5815 | should silently discard the packet and take no further action. |
| 5816 | Otherwise, |
| 5817 | |
| 5818 | 7) If the packet contains a "Stale Cookie" ERROR or a COOKIE ACK, |
| 5819 | the SCTP packet should be silently discarded. Otherwise, |
| 5820 | |
| 5821 | |
| 5822 | |
| 5823 | |
| 5824 | |
| 5825 | |
| 5826 | Stewart Standards Track [Page 104] |
| 5827 | |
| 5828 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5829 | |
| 5830 | |
| 5831 | 8) The receiver should respond to the sender of the OOTB packet with |
| 5832 | an ABORT. When sending the ABORT, the receiver of the OOTB |
| 5833 | packet MUST fill in the Verification Tag field of the outbound |
| 5834 | packet with the value found in the Verification Tag field of the |
| 5835 | OOTB packet and set the T bit in the Chunk Flags to indicate that |
| 5836 | the Verification Tag is reflected. After sending this ABORT, the |
| 5837 | receiver of the OOTB packet shall discard the OOTB packet and |
| 5838 | take no further action. |
| 5839 | |
| 5840 | 8.5. Verification Tag |
| 5841 | |
| 5842 | The Verification Tag rules defined in this section apply when sending |
| 5843 | or receiving SCTP packets that do not contain an INIT, SHUTDOWN |
| 5844 | COMPLETE, COOKIE ECHO (see Section 5.1), ABORT, or SHUTDOWN ACK |
| 5845 | chunk. The rules for sending and receiving SCTP packets containing |
| 5846 | one of these chunk types are discussed separately in Section 8.5.1. |
| 5847 | |
| 5848 | When sending an SCTP packet, the endpoint MUST fill in the |
| 5849 | Verification Tag field of the outbound packet with the tag value in |
| 5850 | the Initiate Tag parameter of the INIT or INIT ACK received from its |
| 5851 | peer. |
| 5852 | |
| 5853 | When receiving an SCTP packet, the endpoint MUST ensure that the |
| 5854 | value in the Verification Tag field of the received SCTP packet |
| 5855 | matches its own tag. If the received Verification Tag value does not |
| 5856 | match the receiver's own tag value, the receiver shall silently |
| 5857 | discard the packet and shall not process it any further except for |
| 5858 | those cases listed in Section 8.5.1 below. |
| 5859 | |
| 5860 | 8.5.1. Exceptions in Verification Tag Rules |
| 5861 | |
| 5862 | A) Rules for packet carrying INIT: |
| 5863 | |
| 5864 | - The sender MUST set the Verification Tag of the packet to 0. |
| 5865 | |
| 5866 | - When an endpoint receives an SCTP packet with the Verification |
| 5867 | Tag set to 0, it should verify that the packet contains only an |
| 5868 | INIT chunk. Otherwise, the receiver MUST silently discard the |
| 5869 | packet. |
| 5870 | |
| 5871 | B) Rules for packet carrying ABORT: |
| 5872 | |
| 5873 | - The endpoint MUST always fill in the Verification Tag field of |
| 5874 | the outbound packet with the destination endpoint's tag value, if |
| 5875 | it is known. |
| 5876 | |
| 5877 | - If the ABORT is sent in response to an OOTB packet, the endpoint |
| 5878 | MUST follow the procedure described in Section 8.4. |
| 5879 | |
| 5880 | |
| 5881 | |
| 5882 | Stewart Standards Track [Page 105] |
| 5883 | |
| 5884 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5885 | |
| 5886 | |
| 5887 | - The receiver of an ABORT MUST accept the packet if the |
| 5888 | Verification Tag field of the packet matches its own tag and the |
| 5889 | T bit is not set OR if it is set to its peer's tag and the T bit |
| 5890 | is set in the Chunk Flags. Otherwise, the receiver MUST silently |
| 5891 | discard the packet and take no further action. |
| 5892 | |
| 5893 | C) Rules for packet carrying SHUTDOWN COMPLETE: |
| 5894 | |
| 5895 | - When sending a SHUTDOWN COMPLETE, if the receiver of the SHUTDOWN |
| 5896 | ACK has a TCB, then the destination endpoint's tag MUST be used, |
| 5897 | and the T bit MUST NOT be set. Only where no TCB exists should |
| 5898 | the sender use the Verification Tag from the SHUTDOWN ACK, and |
| 5899 | MUST set the T bit. |
| 5900 | |
| 5901 | - The receiver of a SHUTDOWN COMPLETE shall accept the packet if |
| 5902 | the Verification Tag field of the packet matches its own tag and |
| 5903 | the T bit is not set OR if it is set to its peer's tag and the T |
| 5904 | bit is set in the Chunk Flags. Otherwise, the receiver MUST |
| 5905 | silently discard the packet and take no further action. An |
| 5906 | endpoint MUST ignore the SHUTDOWN COMPLETE if it is not in the |
| 5907 | SHUTDOWN-ACK-SENT state. |
| 5908 | |
| 5909 | D) Rules for packet carrying a COOKIE ECHO |
| 5910 | |
| 5911 | - When sending a COOKIE ECHO, the endpoint MUST use the value of |
| 5912 | the Initiate Tag received in the INIT ACK. |
| 5913 | |
| 5914 | - The receiver of a COOKIE ECHO follows the procedures in Section |
| 5915 | 5. |
| 5916 | |
| 5917 | E) Rules for packet carrying a SHUTDOWN ACK |
| 5918 | |
| 5919 | - If the receiver is in COOKIE-ECHOED or COOKIE-WAIT state the |
| 5920 | procedures in Section 8.4 SHOULD be followed; in other words, it |
| 5921 | should be treated as an Out Of The Blue packet. |
| 5922 | |
| 5923 | 9. Termination of Association |
| 5924 | |
| 5925 | An endpoint should terminate its association when it exits from |
| 5926 | service. An association can be terminated by either abort or |
| 5927 | shutdown. An abort of an association is abortive by definition in |
| 5928 | that any data pending on either end of the association is discarded |
| 5929 | and not delivered to the peer. A shutdown of an association is |
| 5930 | considered a graceful close where all data in queue by either |
| 5931 | endpoint is delivered to the respective peers. However, in the case |
| 5932 | of a shutdown, SCTP does not support a half-open state (like TCP) |
| 5933 | wherein one side may continue sending data while the other end is |
| 5934 | closed. When either endpoint performs a shutdown, the association on |
| 5935 | |
| 5936 | |
| 5937 | |
| 5938 | Stewart Standards Track [Page 106] |
| 5939 | |
| 5940 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5941 | |
| 5942 | |
| 5943 | each peer will stop accepting new data from its user and only deliver |
| 5944 | data in queue at the time of sending or receiving the SHUTDOWN chunk. |
| 5945 | |
| 5946 | 9.1. Abort of an Association |
| 5947 | |
| 5948 | When an endpoint decides to abort an existing association, it MUST |
| 5949 | send an ABORT chunk to its peer endpoint. The sender MUST fill in |
| 5950 | the peer's Verification Tag in the outbound packet and MUST NOT |
| 5951 | bundle any DATA chunk with the ABORT. If the association is aborted |
| 5952 | on request of the upper layer, a User-Initiated Abort error cause |
| 5953 | (see Section 3.3.10.12) SHOULD be present in the ABORT chunk. |
| 5954 | |
| 5955 | An endpoint MUST NOT respond to any received packet that contains an |
| 5956 | ABORT chunk (also see Section 8.4). |
| 5957 | |
| 5958 | An endpoint receiving an ABORT MUST apply the special Verification |
| 5959 | Tag check rules described in Section 8.5.1. |
| 5960 | |
| 5961 | After checking the Verification Tag, the receiving endpoint MUST |
| 5962 | remove the association from its record and SHOULD report the |
| 5963 | termination to its upper layer. If a User-Initiated Abort error |
| 5964 | cause is present in the ABORT chunk, the Upper Layer Abort Reason |
| 5965 | SHOULD be made available to the upper layer. |
| 5966 | |
| 5967 | 9.2. Shutdown of an Association |
| 5968 | |
| 5969 | Using the SHUTDOWN primitive (see Section 10.1), the upper layer of |
| 5970 | an endpoint in an association can gracefully close the association. |
| 5971 | This will allow all outstanding DATA chunks from the peer of the |
| 5972 | shutdown initiator to be delivered before the association terminates. |
| 5973 | |
| 5974 | Upon receipt of the SHUTDOWN primitive from its upper layer, the |
| 5975 | endpoint enters the SHUTDOWN-PENDING state and remains there until |
| 5976 | all outstanding data has been acknowledged by its peer. The endpoint |
| 5977 | accepts no new data from its upper layer, but retransmits data to the |
| 5978 | far end if necessary to fill gaps. |
| 5979 | |
| 5980 | Once all its outstanding data has been acknowledged, the endpoint |
| 5981 | shall send a SHUTDOWN chunk to its peer including in the Cumulative |
| 5982 | TSN Ack field the last sequential TSN it has received from the peer. |
| 5983 | It shall then start the T2-shutdown timer and enter the SHUTDOWN-SENT |
| 5984 | state. If the timer expires, the endpoint must resend the SHUTDOWN |
| 5985 | with the updated last sequential TSN received from its peer. |
| 5986 | |
| 5987 | The rules in Section 6.3 MUST be followed to determine the proper |
| 5988 | timer value for T2-shutdown. To indicate any gaps in TSN, the |
| 5989 | endpoint may also bundle a SACK with the SHUTDOWN chunk in the same |
| 5990 | SCTP packet. |
| 5991 | |
| 5992 | |
| 5993 | |
| 5994 | Stewart Standards Track [Page 107] |
| 5995 | |
| 5996 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 5997 | |
| 5998 | |
| 5999 | An endpoint should limit the number of retransmissions of the |
| 6000 | SHUTDOWN chunk to the protocol parameter 'Association.Max.Retrans'. |
| 6001 | If this threshold is exceeded, the endpoint should destroy the TCB |
| 6002 | and MUST report the peer endpoint unreachable to the upper layer (and |
| 6003 | thus the association enters the CLOSED state). The reception of any |
| 6004 | packet from its peer (i.e., as the peer sends all of its queued DATA |
| 6005 | chunks) should clear the endpoint's retransmission count and restart |
| 6006 | the T2-shutdown timer, giving its peer ample opportunity to transmit |
| 6007 | all of its queued DATA chunks that have not yet been sent. |
| 6008 | |
| 6009 | Upon reception of the SHUTDOWN, the peer endpoint shall |
| 6010 | |
| 6011 | - enter the SHUTDOWN-RECEIVED state, |
| 6012 | |
| 6013 | - stop accepting new data from its SCTP user, and |
| 6014 | |
| 6015 | - verify, by checking the Cumulative TSN Ack field of the chunk, |
| 6016 | that all its outstanding DATA chunks have been received by the |
| 6017 | SHUTDOWN sender. |
| 6018 | |
| 6019 | Once an endpoint has reached the SHUTDOWN-RECEIVED state, it MUST NOT |
| 6020 | send a SHUTDOWN in response to a ULP request, and should discard |
| 6021 | subsequent SHUTDOWN chunks. |
| 6022 | |
| 6023 | If there are still outstanding DATA chunks left, the SHUTDOWN |
| 6024 | receiver MUST continue to follow normal data transmission procedures |
| 6025 | defined in Section 6, until all outstanding DATA chunks are |
| 6026 | acknowledged; however, the SHUTDOWN receiver MUST NOT accept new data |
| 6027 | from its SCTP user. |
| 6028 | |
| 6029 | While in the SHUTDOWN-SENT state, the SHUTDOWN sender MUST |
| 6030 | immediately respond to each received packet containing one or more |
| 6031 | DATA chunks with a SHUTDOWN chunk and restart the T2-shutdown timer. |
| 6032 | If a SHUTDOWN chunk by itself cannot acknowledge all of the received |
| 6033 | DATA chunks (i.e., there are TSNs that can be acknowledged that are |
| 6034 | larger than the cumulative TSN, and thus gaps exist in the TSN |
| 6035 | sequence), or if duplicate TSNs have been received, then a SACK chunk |
| 6036 | MUST also be sent. |
| 6037 | |
| 6038 | The sender of the SHUTDOWN MAY also start an overall guard timer |
| 6039 | 'T5-shutdown-guard' to bound the overall time for the shutdown |
| 6040 | sequence. At the expiration of this timer, the sender SHOULD abort |
| 6041 | the association by sending an ABORT chunk. If the 'T5-shutdown- |
| 6042 | guard' timer is used, it SHOULD be set to the recommended value of 5 |
| 6043 | times 'RTO.Max'. |
| 6044 | |
| 6045 | If the receiver of the SHUTDOWN has no more outstanding DATA chunks, |
| 6046 | the SHUTDOWN receiver MUST send a SHUTDOWN ACK and start a T2- |
| 6047 | |
| 6048 | |
| 6049 | |
| 6050 | Stewart Standards Track [Page 108] |
| 6051 | |
| 6052 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6053 | |
| 6054 | |
| 6055 | shutdown timer of its own, entering the SHUTDOWN-ACK-SENT state. If |
| 6056 | the timer expires, the endpoint must resend the SHUTDOWN ACK. |
| 6057 | |
| 6058 | The sender of the SHUTDOWN ACK should limit the number of |
| 6059 | retransmissions of the SHUTDOWN ACK chunk to the protocol parameter |
| 6060 | 'Association.Max.Retrans'. If this threshold is exceeded, the |
| 6061 | endpoint should destroy the TCB and may report the peer endpoint |
| 6062 | unreachable to the upper layer (and thus the association enters the |
| 6063 | CLOSED state). |
| 6064 | |
| 6065 | Upon the receipt of the SHUTDOWN ACK, the SHUTDOWN sender shall stop |
| 6066 | the T2-shutdown timer, send a SHUTDOWN COMPLETE chunk to its peer, |
| 6067 | and remove all record of the association. |
| 6068 | |
| 6069 | Upon reception of the SHUTDOWN COMPLETE chunk, the endpoint will |
| 6070 | verify that it is in the SHUTDOWN-ACK-SENT state; if it is not, the |
| 6071 | chunk should be discarded. If the endpoint is in the SHUTDOWN-ACK- |
| 6072 | SENT state, the endpoint should stop the T2-shutdown timer and remove |
| 6073 | all knowledge of the association (and thus the association enters the |
| 6074 | CLOSED state). |
| 6075 | |
| 6076 | An endpoint SHOULD ensure that all its outstanding DATA chunks have |
| 6077 | been acknowledged before initiating the shutdown procedure. |
| 6078 | |
| 6079 | An endpoint should reject any new data request from its upper layer |
| 6080 | if it is in the SHUTDOWN-PENDING, SHUTDOWN-SENT, SHUTDOWN-RECEIVED, |
| 6081 | or SHUTDOWN-ACK-SENT state. |
| 6082 | |
| 6083 | If an endpoint is in the SHUTDOWN-ACK-SENT state and receives an INIT |
| 6084 | chunk (e.g., if the SHUTDOWN COMPLETE was lost) with source and |
| 6085 | destination transport addresses (either in the IP addresses or in the |
| 6086 | INIT chunk) that belong to this association, it should discard the |
| 6087 | INIT chunk and retransmit the SHUTDOWN ACK chunk. |
| 6088 | |
| 6089 | Note: Receipt of an INIT with the same source and destination IP |
| 6090 | addresses as used in transport addresses assigned to an endpoint but |
| 6091 | with a different port number indicates the initialization of a |
| 6092 | separate association. |
| 6093 | |
| 6094 | The sender of the INIT or COOKIE ECHO should respond to the receipt |
| 6095 | of a SHUTDOWN ACK with a stand-alone SHUTDOWN COMPLETE in an SCTP |
| 6096 | packet with the Verification Tag field of its common header set to |
| 6097 | the same tag that was received in the SHUTDOWN ACK packet. This is |
| 6098 | considered an Out of the Blue packet as defined in Section 8.4. The |
| 6099 | sender of the INIT lets T1-init continue running and remains in the |
| 6100 | COOKIE-WAIT or COOKIE-ECHOED state. Normal T1-init timer expiration |
| 6101 | will cause the INIT or COOKIE chunk to be retransmitted and thus |
| 6102 | start a new association. |
| 6103 | |
| 6104 | |
| 6105 | |
| 6106 | Stewart Standards Track [Page 109] |
| 6107 | |
| 6108 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6109 | |
| 6110 | |
| 6111 | If a SHUTDOWN is received in the COOKIE-WAIT or COOKIE ECHOED state, |
| 6112 | the SHUTDOWN chunk SHOULD be silently discarded. |
| 6113 | |
| 6114 | If an endpoint is in the SHUTDOWN-SENT state and receives a SHUTDOWN |
| 6115 | chunk from its peer, the endpoint shall respond immediately with a |
| 6116 | SHUTDOWN ACK to its peer, and move into the SHUTDOWN-ACK-SENT state |
| 6117 | restarting its T2-shutdown timer. |
| 6118 | |
| 6119 | If an endpoint is in the SHUTDOWN-ACK-SENT state and receives a |
| 6120 | SHUTDOWN ACK, it shall stop the T2-shutdown timer, send a SHUTDOWN |
| 6121 | COMPLETE chunk to its peer, and remove all record of the association. |
| 6122 | |
| 6123 | 10. Interface with Upper Layer |
| 6124 | |
| 6125 | The Upper Layer Protocols (ULPs) shall request services by passing |
| 6126 | primitives to SCTP and shall receive notifications from SCTP for |
| 6127 | various events. |
| 6128 | |
| 6129 | The primitives and notifications described in this section should be |
| 6130 | used as a guideline for implementing SCTP. The following functional |
| 6131 | description of ULP interface primitives is shown for illustrative |
| 6132 | purposes. Different SCTP implementations may have different ULP |
| 6133 | interfaces. However, all SCTPs must provide a certain minimum set of |
| 6134 | services to guarantee that all SCTP implementations can support the |
| 6135 | same protocol hierarchy. |
| 6136 | |
| 6137 | 10.1. ULP-to-SCTP |
| 6138 | |
| 6139 | The following sections functionally characterize a ULP/SCTP |
| 6140 | interface. The notation used is similar to most procedure or |
| 6141 | function calls in high-level languages. |
| 6142 | |
| 6143 | The ULP primitives described below specify the basic functions that |
| 6144 | SCTP must perform to support inter-process communication. Individual |
| 6145 | implementations must define their own exact format, and may provide |
| 6146 | combinations or subsets of the basic functions in single calls. |
| 6147 | |
| 6148 | A) Initialize |
| 6149 | |
| 6150 | Format: INITIALIZE ([local port],[local eligible address list])-> |
| 6151 | local SCTP instance name |
| 6152 | |
| 6153 | This primitive allows SCTP to initialize its internal data structures |
| 6154 | and allocate necessary resources for setting up its operation |
| 6155 | environment. Once SCTP is initialized, ULP can communicate directly |
| 6156 | with other endpoints without re-invoking this primitive. |
| 6157 | |
| 6158 | SCTP will return a local SCTP instance name to the ULP. |
| 6159 | |
| 6160 | |
| 6161 | |
| 6162 | Stewart Standards Track [Page 110] |
| 6163 | |
| 6164 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6165 | |
| 6166 | |
| 6167 | Mandatory attributes: |
| 6168 | |
| 6169 | None. |
| 6170 | |
| 6171 | Optional attributes: |
| 6172 | |
| 6173 | The following types of attributes may be passed along with the |
| 6174 | primitive: |
| 6175 | |
| 6176 | o local port - SCTP port number, if ULP wants it to be specified. |
| 6177 | |
| 6178 | o local eligible address list - an address list that the local SCTP |
| 6179 | endpoint should bind. By default, if an address list is not |
| 6180 | included, all IP addresses assigned to the host should be used by |
| 6181 | the local endpoint. |
| 6182 | |
| 6183 | IMPLEMENTATION NOTE: If this optional attribute is supported by an |
| 6184 | implementation, it will be the responsibility of the implementation |
| 6185 | to enforce that the IP source address field of any SCTP packets sent |
| 6186 | out by this endpoint contains one of the IP addresses indicated in |
| 6187 | the local eligible address list. |
| 6188 | |
| 6189 | B) Associate |
| 6190 | |
| 6191 | Format: ASSOCIATE(local SCTP instance name, |
| 6192 | destination transport addr, outbound stream count) |
| 6193 | -> association id [,destination transport addr list] |
| 6194 | [,outbound stream count] |
| 6195 | |
| 6196 | This primitive allows the upper layer to initiate an association to a |
| 6197 | specific peer endpoint. |
| 6198 | |
| 6199 | The peer endpoint shall be specified by one of the transport |
| 6200 | addresses that defines the endpoint (see Section 1.3). If the local |
| 6201 | SCTP instance has not been initialized, the ASSOCIATE is considered |
| 6202 | an error. |
| 6203 | |
| 6204 | An association id, which is a local handle to the SCTP association, |
| 6205 | will be returned on successful establishment of the association. If |
| 6206 | SCTP is not able to open an SCTP association with the peer endpoint, |
| 6207 | an error is returned. |
| 6208 | |
| 6209 | Other association parameters may be returned, including the complete |
| 6210 | destination transport addresses of the peer as well as the outbound |
| 6211 | stream count of the local endpoint. One of the transport addresses |
| 6212 | from the returned destination addresses will be selected by the local |
| 6213 | endpoint as default primary path for sending SCTP packets to this |
| 6214 | peer. The returned "destination transport addr list" can be used by |
| 6215 | |
| 6216 | |
| 6217 | |
| 6218 | Stewart Standards Track [Page 111] |
| 6219 | |
| 6220 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6221 | |
| 6222 | |
| 6223 | the ULP to change the default primary path or to force sending a |
| 6224 | packet to a specific transport address. |
| 6225 | |
| 6226 | IMPLEMENTATION NOTE: If ASSOCIATE primitive is implemented as a |
| 6227 | blocking function call, the ASSOCIATE primitive can return |
| 6228 | association parameters in addition to the association id upon |
| 6229 | successful establishment. If ASSOCIATE primitive is implemented as a |
| 6230 | non-blocking call, only the association id shall be returned and |
| 6231 | association parameters shall be passed using the COMMUNICATION UP |
| 6232 | notification. |
| 6233 | |
| 6234 | Mandatory attributes: |
| 6235 | |
| 6236 | o local SCTP instance name - obtained from the INITIALIZE operation. |
| 6237 | |
| 6238 | o destination transport addr - specified as one of the transport |
| 6239 | addresses of the peer endpoint with which the association is to be |
| 6240 | established. |
| 6241 | |
| 6242 | o outbound stream count - the number of outbound streams the ULP |
| 6243 | would like to open towards this peer endpoint. |
| 6244 | |
| 6245 | Optional attributes: |
| 6246 | |
| 6247 | None. |
| 6248 | |
| 6249 | C) Shutdown |
| 6250 | |
| 6251 | Format: SHUTDOWN(association id) |
| 6252 | -> result |
| 6253 | |
| 6254 | Gracefully closes an association. Any locally queued user data will |
| 6255 | be delivered to the peer. The association will be terminated only |
| 6256 | after the peer acknowledges all the SCTP packets sent. A success |
| 6257 | code will be returned on successful termination of the association. |
| 6258 | If attempting to terminate the association results in a failure, an |
| 6259 | error code shall be returned. |
| 6260 | |
| 6261 | Mandatory attributes: |
| 6262 | |
| 6263 | o association id - local handle to the SCTP association. |
| 6264 | |
| 6265 | Optional attributes: |
| 6266 | |
| 6267 | None. |
| 6268 | |
| 6269 | |
| 6270 | |
| 6271 | |
| 6272 | |
| 6273 | |
| 6274 | Stewart Standards Track [Page 112] |
| 6275 | |
| 6276 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6277 | |
| 6278 | |
| 6279 | D) Abort |
| 6280 | |
| 6281 | Format: ABORT(association id [, Upper Layer Abort Reason]) -> |
| 6282 | result |
| 6283 | |
| 6284 | Ungracefully closes an association. Any locally queued user data |
| 6285 | will be discarded, and an ABORT chunk is sent to the peer. A success |
| 6286 | code will be returned on successful abort of the association. If |
| 6287 | attempting to abort the association results in a failure, an error |
| 6288 | code shall be returned. |
| 6289 | |
| 6290 | Mandatory attributes: |
| 6291 | |
| 6292 | o association id - local handle to the SCTP association. |
| 6293 | |
| 6294 | Optional attributes: |
| 6295 | |
| 6296 | o Upper Layer Abort Reason - reason of the abort to be passed to the |
| 6297 | peer. |
| 6298 | |
| 6299 | None. |
| 6300 | |
| 6301 | E) Send |
| 6302 | |
| 6303 | Format: SEND(association id, buffer address, byte count [,context] |
| 6304 | [,stream id] [,life time] [,destination transport address] |
| 6305 | [,unordered flag] [,no-bundle flag] [,payload protocol-id] ) |
| 6306 | -> result |
| 6307 | |
| 6308 | This is the main method to send user data via SCTP. |
| 6309 | |
| 6310 | Mandatory attributes: |
| 6311 | |
| 6312 | o association id - local handle to the SCTP association. |
| 6313 | |
| 6314 | o buffer address - the location where the user message to be |
| 6315 | transmitted is stored. |
| 6316 | |
| 6317 | o byte count - the size of the user data in number of bytes. |
| 6318 | |
| 6319 | Optional attributes: |
| 6320 | |
| 6321 | o context - an optional 32-bit integer that will be carried in the |
| 6322 | sending failure notification to the ULP if the transportation of |
| 6323 | this user message fails. |
| 6324 | |
| 6325 | o stream id - to indicate which stream to send the data on. If not |
| 6326 | specified, stream 0 will be used. |
| 6327 | |
| 6328 | |
| 6329 | |
| 6330 | Stewart Standards Track [Page 113] |
| 6331 | |
| 6332 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6333 | |
| 6334 | |
| 6335 | o life time - specifies the life time of the user data. The user |
| 6336 | data will not be sent by SCTP after the life time expires. This |
| 6337 | parameter can be used to avoid efforts to transmit stale user |
| 6338 | messages. SCTP notifies the ULP if the data cannot be initiated |
| 6339 | to transport (i.e., sent to the destination via SCTP's send |
| 6340 | primitive) within the life time variable. However, the user data |
| 6341 | will be transmitted if SCTP has attempted to transmit a chunk |
| 6342 | before the life time expired. |
| 6343 | |
| 6344 | IMPLEMENTATION NOTE: In order to better support the data life time |
| 6345 | option, the transmitter may hold back the assigning of the TSN number |
| 6346 | to an outbound DATA chunk to the last moment. And, for |
| 6347 | implementation simplicity, once a TSN number has been assigned the |
| 6348 | sender should consider the send of this DATA chunk as committed, |
| 6349 | overriding any life time option attached to the DATA chunk. |
| 6350 | |
| 6351 | o destination transport address - specified as one of the |
| 6352 | destination transport addresses of the peer endpoint to which this |
| 6353 | packet should be sent. Whenever possible, SCTP should use this |
| 6354 | destination transport address for sending the packets, instead of |
| 6355 | the current primary path. |
| 6356 | |
| 6357 | o unordered flag - this flag, if present, indicates that the user |
| 6358 | would like the data delivered in an unordered fashion to the peer |
| 6359 | (i.e., the U flag is set to 1 on all DATA chunks carrying this |
| 6360 | message). |
| 6361 | |
| 6362 | o no-bundle flag - instructs SCTP not to bundle this user data with |
| 6363 | other outbound DATA chunks. SCTP MAY still bundle even when this |
| 6364 | flag is present, when faced with network congestion. |
| 6365 | |
| 6366 | o payload protocol-id - a 32-bit unsigned integer that is to be |
| 6367 | passed to the peer indicating the type of payload protocol data |
| 6368 | being transmitted. This value is passed as opaque data by SCTP. |
| 6369 | |
| 6370 | F) Set Primary |
| 6371 | |
| 6372 | Format: SETPRIMARY(association id, destination transport address, |
| 6373 | [source transport address] ) |
| 6374 | -> result |
| 6375 | |
| 6376 | Instructs the local SCTP to use the specified destination transport |
| 6377 | address as the primary path for sending packets. |
| 6378 | |
| 6379 | The result of attempting this operation shall be returned. If the |
| 6380 | specified destination transport address is not present in the |
| 6381 | "destination transport address list" returned earlier in an associate |
| 6382 | command or communication up notification, an error shall be returned. |
| 6383 | |
| 6384 | |
| 6385 | |
| 6386 | Stewart Standards Track [Page 114] |
| 6387 | |
| 6388 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6389 | |
| 6390 | |
| 6391 | Mandatory attributes: |
| 6392 | |
| 6393 | o association id - local handle to the SCTP association. |
| 6394 | |
| 6395 | o destination transport address - specified as one of the transport |
| 6396 | addresses of the peer endpoint, which should be used as the |
| 6397 | primary address for sending packets. This overrides the current |
| 6398 | primary address information maintained by the local SCTP endpoint. |
| 6399 | |
| 6400 | Optional attributes: |
| 6401 | |
| 6402 | o source transport address - optionally, some implementations may |
| 6403 | allow you to set the default source address placed in all outgoing |
| 6404 | IP datagrams. |
| 6405 | |
| 6406 | G) Receive |
| 6407 | |
| 6408 | Format: RECEIVE(association id, buffer address, buffer size |
| 6409 | [,stream id]) |
| 6410 | -> byte count [,transport address] [,stream id] [,stream sequence |
| 6411 | number] [,partial flag] [,delivery number] [,payload protocol-id] |
| 6412 | |
| 6413 | This primitive shall read the first user message in the SCTP in-queue |
| 6414 | into the buffer specified by ULP, if there is one available. The |
| 6415 | size of the message read, in bytes, will be returned. It may, |
| 6416 | depending on the specific implementation, also return other |
| 6417 | information such as the sender's address, the stream id on which it |
| 6418 | is received, whether there are more messages available for retrieval, |
| 6419 | etc. For ordered messages, their Stream Sequence Number may also be |
| 6420 | returned. |
| 6421 | |
| 6422 | Depending upon the implementation, if this primitive is invoked when |
| 6423 | no message is available the implementation should return an |
| 6424 | indication of this condition or should block the invoking process |
| 6425 | until data does become available. |
| 6426 | |
| 6427 | Mandatory attributes: |
| 6428 | |
| 6429 | o association id - local handle to the SCTP association |
| 6430 | |
| 6431 | o buffer address - the memory location indicated by the ULP to store |
| 6432 | the received message. |
| 6433 | |
| 6434 | o buffer size - the maximum size of data to be received, in bytes. |
| 6435 | |
| 6436 | Optional attributes: |
| 6437 | |
| 6438 | o stream id - to indicate which stream to receive the data on. |
| 6439 | |
| 6440 | |
| 6441 | |
| 6442 | Stewart Standards Track [Page 115] |
| 6443 | |
| 6444 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6445 | |
| 6446 | |
| 6447 | o Stream Sequence Number - the Stream Sequence Number assigned by |
| 6448 | the sending SCTP peer. |
| 6449 | |
| 6450 | o partial flag - if this returned flag is set to 1, then this |
| 6451 | Receive contains a partial delivery of the whole message. When |
| 6452 | this flag is set, the stream id and Stream Sequence Number MUST |
| 6453 | accompany this receive. When this flag is set to 0, it indicates |
| 6454 | that no more deliveries will be received for this Stream Sequence |
| 6455 | Number. |
| 6456 | |
| 6457 | o payload protocol-id - a 32-bit unsigned integer that is received |
| 6458 | from the peer indicating the type of payload protocol of the |
| 6459 | received data. This value is passed as opaque data by SCTP. |
| 6460 | |
| 6461 | H) Status |
| 6462 | |
| 6463 | Format: STATUS(association id) |
| 6464 | -> status data |
| 6465 | |
| 6466 | This primitive should return a data block containing the following |
| 6467 | information: |
| 6468 | |
| 6469 | association connection state, |
| 6470 | destination transport address list, |
| 6471 | destination transport address reachability states, |
| 6472 | current receiver window size, |
| 6473 | current congestion window sizes, |
| 6474 | number of unacknowledged DATA chunks, |
| 6475 | number of DATA chunks pending receipt, |
| 6476 | primary path, |
| 6477 | most recent SRTT on primary path, |
| 6478 | RTO on primary path, |
| 6479 | SRTT and RTO on other destination addresses, etc. |
| 6480 | |
| 6481 | Mandatory attributes: |
| 6482 | |
| 6483 | o association id - local handle to the SCTP association. |
| 6484 | |
| 6485 | Optional attributes: |
| 6486 | |
| 6487 | None. |
| 6488 | |
| 6489 | I) Change Heartbeat |
| 6490 | |
| 6491 | Format: CHANGE HEARTBEAT(association id, |
| 6492 | destination transport address, new state [,interval]) |
| 6493 | -> result |
| 6494 | |
| 6495 | |
| 6496 | |
| 6497 | |
| 6498 | Stewart Standards Track [Page 116] |
| 6499 | |
| 6500 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6501 | |
| 6502 | |
| 6503 | Instructs the local endpoint to enable or disable heartbeat on the |
| 6504 | specified destination transport address. |
| 6505 | |
| 6506 | The result of attempting this operation shall be returned. |
| 6507 | |
| 6508 | Note: Even when enabled, heartbeat will not take place if the |
| 6509 | destination transport address is not idle. |
| 6510 | |
| 6511 | Mandatory attributes: |
| 6512 | |
| 6513 | o association id - local handle to the SCTP association. |
| 6514 | |
| 6515 | o destination transport address - specified as one of the transport |
| 6516 | addresses of the peer endpoint. |
| 6517 | |
| 6518 | o new state - the new state of heartbeat for this destination |
| 6519 | transport address (either enabled or disabled). |
| 6520 | |
| 6521 | Optional attributes: |
| 6522 | |
| 6523 | o interval - if present, indicates the frequency of the heartbeat if |
| 6524 | this is to enable heartbeat on a destination transport address. |
| 6525 | This value is added to the RTO of the destination transport |
| 6526 | address. This value, if present, affects all destinations. |
| 6527 | |
| 6528 | J) Request HeartBeat |
| 6529 | |
| 6530 | Format: REQUESTHEARTBEAT(association id, destination transport |
| 6531 | address) |
| 6532 | -> result |
| 6533 | |
| 6534 | Instructs the local endpoint to perform a HeartBeat on the specified |
| 6535 | destination transport address of the given association. The returned |
| 6536 | result should indicate whether the transmission of the HEARTBEAT |
| 6537 | chunk to the destination address is successful. |
| 6538 | |
| 6539 | Mandatory attributes: |
| 6540 | |
| 6541 | o association id - local handle to the SCTP association. |
| 6542 | |
| 6543 | o destination transport address - the transport address of the |
| 6544 | association on which a heartbeat should be issued. |
| 6545 | |
| 6546 | K) Get SRTT Report |
| 6547 | |
| 6548 | Format: GETSRTTREPORT(association id, |
| 6549 | destination transport address) |
| 6550 | -> srtt result |
| 6551 | |
| 6552 | |
| 6553 | |
| 6554 | Stewart Standards Track [Page 117] |
| 6555 | |
| 6556 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6557 | |
| 6558 | |
| 6559 | Instructs the local SCTP to report the current SRTT measurement on |
| 6560 | the specified destination transport address of the given association. |
| 6561 | The returned result can be an integer containing the most recent SRTT |
| 6562 | in milliseconds. |
| 6563 | |
| 6564 | Mandatory attributes: |
| 6565 | |
| 6566 | o association id - local handle to the SCTP association. |
| 6567 | |
| 6568 | o destination transport address - the transport address of the |
| 6569 | association on which the SRTT measurement is to be reported. |
| 6570 | |
| 6571 | L) Set Failure Threshold |
| 6572 | |
| 6573 | Format: SETFAILURETHRESHOLD(association id, destination transport |
| 6574 | address, failure threshold) |
| 6575 | |
| 6576 | -> result |
| 6577 | |
| 6578 | This primitive allows the local SCTP to customize the reachability |
| 6579 | failure detection threshold 'Path.Max.Retrans' for the specified |
| 6580 | destination address. |
| 6581 | |
| 6582 | Mandatory attributes: |
| 6583 | |
| 6584 | o association id - local handle to the SCTP association. |
| 6585 | |
| 6586 | o destination transport address - the transport address of the |
| 6587 | association on which the failure detection threshold is to be set. |
| 6588 | |
| 6589 | o failure threshold - the new value of 'Path.Max.Retrans' for the |
| 6590 | destination address. |
| 6591 | |
| 6592 | M) Set Protocol Parameters |
| 6593 | |
| 6594 | Format: SETPROTOCOLPARAMETERS(association id, |
| 6595 | [,destination transport address,] |
| 6596 | protocol parameter list) |
| 6597 | -> result |
| 6598 | |
| 6599 | This primitive allows the local SCTP to customize the protocol |
| 6600 | parameters. |
| 6601 | |
| 6602 | Mandatory attributes: |
| 6603 | |
| 6604 | o association id - local handle to the SCTP association. |
| 6605 | |
| 6606 | |
| 6607 | |
| 6608 | |
| 6609 | |
| 6610 | Stewart Standards Track [Page 118] |
| 6611 | |
| 6612 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6613 | |
| 6614 | |
| 6615 | o protocol parameter list - the specific names and values of the |
| 6616 | protocol parameters (e.g., Association.Max.Retrans; see Section |
| 6617 | 15) that the SCTP user wishes to customize. |
| 6618 | |
| 6619 | Optional attributes: |
| 6620 | |
| 6621 | o destination transport address - some of the protocol parameters |
| 6622 | may be set on a per destination transport address basis. |
| 6623 | |
| 6624 | N) Receive Unsent Message |
| 6625 | |
| 6626 | Format: RECEIVE_UNSENT(data retrieval id, buffer address, buffer |
| 6627 | size [,stream id] [, stream sequence number] [,partial |
| 6628 | flag] [,payload protocol-id]) |
| 6629 | |
| 6630 | o data retrieval id - the identification passed to the ULP in the |
| 6631 | failure notification. |
| 6632 | |
| 6633 | o buffer address - the memory location indicated by the ULP to store |
| 6634 | the received message. |
| 6635 | |
| 6636 | o buffer size - the maximum size of data to be received, in bytes. |
| 6637 | |
| 6638 | Optional attributes: |
| 6639 | |
| 6640 | o stream id - this is a return value that is set to indicate which |
| 6641 | stream the data was sent to. |
| 6642 | |
| 6643 | o Stream Sequence Number - this value is returned indicating the |
| 6644 | Stream Sequence Number that was associated with the message. |
| 6645 | |
| 6646 | o partial flag - if this returned flag is set to 1, then this |
| 6647 | message is a partial delivery of the whole message. When this |
| 6648 | flag is set, the stream id and Stream Sequence Number MUST |
| 6649 | accompany this receive. When this flag is set to 0, it indicates |
| 6650 | that no more deliveries will be received for this Stream Sequence |
| 6651 | Number. |
| 6652 | |
| 6653 | o payload protocol-id - The 32 bit unsigned integer that was sent to |
| 6654 | be sent to the peer indicating the type of payload protocol of the |
| 6655 | received data. |
| 6656 | |
| 6657 | o Receive Unacknowledged Message |
| 6658 | |
| 6659 | Format: RECEIVE_UNACKED(data retrieval id, buffer address, buffer |
| 6660 | size, [,stream id] [, stream sequence number] [,partial |
| 6661 | flag] [,payload protocol-id]) |
| 6662 | |
| 6663 | |
| 6664 | |
| 6665 | |
| 6666 | Stewart Standards Track [Page 119] |
| 6667 | |
| 6668 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6669 | |
| 6670 | |
| 6671 | o data retrieval id - the identification passed to the ULP in the |
| 6672 | failure notification. |
| 6673 | |
| 6674 | o buffer address - the memory location indicated by the ULP to store |
| 6675 | the received message. |
| 6676 | |
| 6677 | o buffer size - the maximum size of data to be received, in bytes. |
| 6678 | |
| 6679 | Optional attributes: |
| 6680 | |
| 6681 | o stream id - this is a return value that is set to indicate which |
| 6682 | stream the data was sent to. |
| 6683 | |
| 6684 | o Stream Sequence Number - this value is returned indicating the |
| 6685 | Stream Sequence Number that was associated with the message. |
| 6686 | |
| 6687 | o partial flag - if this returned flag is set to 1, then this |
| 6688 | message is a partial delivery of the whole message. When this |
| 6689 | flag is set, the stream id and Stream Sequence Number MUST |
| 6690 | accompany this receive. When this flag is set to 0, it indicates |
| 6691 | that no more deliveries will be received for this Stream Sequence |
| 6692 | Number. |
| 6693 | |
| 6694 | o payload protocol-id - the 32-bit unsigned integer that was sent to |
| 6695 | the peer indicating the type of payload protocol of the received |
| 6696 | data. |
| 6697 | |
| 6698 | P) Destroy SCTP Instance |
| 6699 | |
| 6700 | Format: DESTROY(local SCTP instance name) |
| 6701 | |
| 6702 | o local SCTP instance name - this is the value that was passed to |
| 6703 | the application in the initialize primitive and it indicates which |
| 6704 | SCTP instance is to be destroyed. |
| 6705 | |
| 6706 | 10.2. SCTP-to-ULP |
| 6707 | |
| 6708 | It is assumed that the operating system or application environment |
| 6709 | provides a means for the SCTP to asynchronously signal the ULP |
| 6710 | process. When SCTP does signal a ULP process, certain information is |
| 6711 | passed to the ULP. |
| 6712 | |
| 6713 | IMPLEMENTATION NOTE: In some cases, this may be done through a |
| 6714 | separate socket or error channel. |
| 6715 | |
| 6716 | |
| 6717 | |
| 6718 | |
| 6719 | |
| 6720 | |
| 6721 | |
| 6722 | Stewart Standards Track [Page 120] |
| 6723 | |
| 6724 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6725 | |
| 6726 | |
| 6727 | A) DATA ARRIVE notification |
| 6728 | |
| 6729 | SCTP shall invoke this notification on the ULP when a user message is |
| 6730 | successfully received and ready for retrieval. |
| 6731 | |
| 6732 | The following may optionally be passed with the notification: |
| 6733 | |
| 6734 | o association id - local handle to the SCTP association. |
| 6735 | |
| 6736 | o stream id - to indicate which stream the data is received on. |
| 6737 | |
| 6738 | B) SEND FAILURE notification |
| 6739 | |
| 6740 | If a message cannot be delivered, SCTP shall invoke this notification |
| 6741 | on the ULP. |
| 6742 | |
| 6743 | The following may optionally be passed with the notification: |
| 6744 | |
| 6745 | o association id - local handle to the SCTP association. |
| 6746 | |
| 6747 | o data retrieval id - an identification used to retrieve unsent and |
| 6748 | unacknowledged data. |
| 6749 | |
| 6750 | o cause code - indicating the reason of the failure, e.g., size too |
| 6751 | large, message life time expiration, etc. |
| 6752 | |
| 6753 | o context - optional information associated with this message (see D |
| 6754 | in Section 10.1). |
| 6755 | |
| 6756 | C) NETWORK STATUS CHANGE notification |
| 6757 | |
| 6758 | When a destination transport address is marked inactive (e.g., when |
| 6759 | SCTP detects a failure) or marked active (e.g., when SCTP detects a |
| 6760 | recovery), SCTP shall invoke this notification on the ULP. |
| 6761 | |
| 6762 | The following shall be passed with the notification: |
| 6763 | |
| 6764 | o association id - local handle to the SCTP association. |
| 6765 | |
| 6766 | o destination transport address - this indicates the destination |
| 6767 | transport address of the peer endpoint affected by the change. |
| 6768 | |
| 6769 | o new-status - this indicates the new status. |
| 6770 | |
| 6771 | |
| 6772 | |
| 6773 | |
| 6774 | |
| 6775 | |
| 6776 | |
| 6777 | |
| 6778 | Stewart Standards Track [Page 121] |
| 6779 | |
| 6780 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6781 | |
| 6782 | |
| 6783 | D) COMMUNICATION UP notification |
| 6784 | |
| 6785 | This notification is used when SCTP becomes ready to send or receive |
| 6786 | user messages, or when a lost communication to an endpoint is |
| 6787 | restored. |
| 6788 | |
| 6789 | IMPLEMENTATION NOTE: If the ASSOCIATE primitive is implemented as a |
| 6790 | blocking function call, the association parameters are returned as a |
| 6791 | result of the ASSOCIATE primitive itself. In that case, |
| 6792 | COMMUNICATION UP notification is optional at the association |
| 6793 | initiator's side. |
| 6794 | |
| 6795 | The following shall be passed with the notification: |
| 6796 | |
| 6797 | o association id - local handle to the SCTP association. |
| 6798 | |
| 6799 | o status - This indicates what type of event has occurred. |
| 6800 | |
| 6801 | o destination transport address list - the complete set of |
| 6802 | transport addresses of the peer. |
| 6803 | |
| 6804 | o outbound stream count - the maximum number of streams allowed to |
| 6805 | be used in this association by the ULP. |
| 6806 | |
| 6807 | o inbound stream count - the number of streams the peer endpoint |
| 6808 | has requested with this association (this may not be the same |
| 6809 | number as 'outbound stream count'). |
| 6810 | |
| 6811 | E) COMMUNICATION LOST notification |
| 6812 | |
| 6813 | When SCTP loses communication to an endpoint completely (e.g., via |
| 6814 | Heartbeats) or detects that the endpoint has performed an abort |
| 6815 | operation, it shall invoke this notification on the ULP. |
| 6816 | |
| 6817 | The following shall be passed with the notification: |
| 6818 | |
| 6819 | o association id - local handle to the SCTP association. |
| 6820 | |
| 6821 | o status - this indicates what type of event has occurred; the |
| 6822 | status may indicate that a failure OR a normal |
| 6823 | termination event occurred in response to a shutdown or |
| 6824 | abort request. |
| 6825 | |
| 6826 | The following may be passed with the notification: |
| 6827 | |
| 6828 | o data retrieval id - an identification used to retrieve unsent and |
| 6829 | unacknowledged data. |
| 6830 | |
| 6831 | |
| 6832 | |
| 6833 | |
| 6834 | Stewart Standards Track [Page 122] |
| 6835 | |
| 6836 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6837 | |
| 6838 | |
| 6839 | o last-acked - the TSN last acked by that peer endpoint. |
| 6840 | |
| 6841 | o last-sent - the TSN last sent to that peer endpoint. |
| 6842 | |
| 6843 | o Upper Layer Abort Reason - the abort reason specified in case of |
| 6844 | a user-initiated abort. |
| 6845 | |
| 6846 | F) COMMUNICATION ERROR notification |
| 6847 | |
| 6848 | When SCTP receives an ERROR chunk from its peer and decides to notify |
| 6849 | its ULP, it can invoke this notification on the ULP. |
| 6850 | |
| 6851 | The following can be passed with the notification: |
| 6852 | |
| 6853 | o association id - local handle to the SCTP association. |
| 6854 | |
| 6855 | o error info - this indicates the type of error and optionally some |
| 6856 | additional information received through the ERROR chunk. |
| 6857 | |
| 6858 | G) RESTART notification |
| 6859 | |
| 6860 | When SCTP detects that the peer has restarted, it may send this |
| 6861 | notification to its ULP. |
| 6862 | |
| 6863 | The following can be passed with the notification: |
| 6864 | |
| 6865 | o association id - local handle to the SCTP association. |
| 6866 | |
| 6867 | H) SHUTDOWN COMPLETE notification |
| 6868 | |
| 6869 | When SCTP completes the shutdown procedures (Section 9.2), this |
| 6870 | notification is passed to the upper layer. |
| 6871 | |
| 6872 | The following can be passed with the notification: |
| 6873 | |
| 6874 | o association id - local handle to the SCTP association. |
| 6875 | |
| 6876 | 11. Security Considerations |
| 6877 | |
| 6878 | 11.1. Security Objectives |
| 6879 | |
| 6880 | As a common transport protocol designed to reliably carry time- |
| 6881 | sensitive user messages, such as billing or signaling messages for |
| 6882 | telephony services, between two networked endpoints, SCTP has the |
| 6883 | following security objectives. |
| 6884 | |
| 6885 | - availability of reliable and timely data transport services |
| 6886 | |
| 6887 | |
| 6888 | |
| 6889 | |
| 6890 | Stewart Standards Track [Page 123] |
| 6891 | |
| 6892 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6893 | |
| 6894 | |
| 6895 | - integrity of the user-to-user information carried by SCTP |
| 6896 | |
| 6897 | 11.2. SCTP Responses to Potential Threats |
| 6898 | |
| 6899 | SCTP may potentially be used in a wide variety of risk situations. |
| 6900 | It is important for operators of systems running SCTP to analyze |
| 6901 | their particular situations and decide on the appropriate counter- |
| 6902 | measures. |
| 6903 | |
| 6904 | Operators of systems running SCTP should consult [RFC2196] for |
| 6905 | guidance in securing their site. |
| 6906 | |
| 6907 | 11.2.1. Countering Insider Attacks |
| 6908 | |
| 6909 | The principles of [RFC2196] should be applied to minimize the risk of |
| 6910 | theft of information or sabotage by insiders. Such procedures |
| 6911 | include publication of security policies, control of access at the |
| 6912 | physical, software, and network levels, and separation of services. |
| 6913 | |
| 6914 | 11.2.2. Protecting against Data Corruption in the Network |
| 6915 | |
| 6916 | Where the risk of undetected errors in datagrams delivered by the |
| 6917 | lower-layer transport services is considered to be too great, |
| 6918 | additional integrity protection is required. If this additional |
| 6919 | protection were provided in the application layer, the SCTP header |
| 6920 | would remain vulnerable to deliberate integrity attacks. While the |
| 6921 | existing SCTP mechanisms for detection of packet replays are |
| 6922 | considered sufficient for normal operation, stronger protections are |
| 6923 | needed to protect SCTP when the operating environment contains |
| 6924 | significant risk of deliberate attacks from a sophisticated |
| 6925 | adversary. |
| 6926 | |
| 6927 | The SCTP Authentication extension SCTP-AUTH [RFC4895] MAY be used |
| 6928 | when the threat environment requires stronger integrity protections, |
| 6929 | but does not require confidentiality. |
| 6930 | |
| 6931 | 11.2.3. Protecting Confidentiality |
| 6932 | |
| 6933 | In most cases, the risk of breach of confidentiality applies to the |
| 6934 | signaling data payload, not to the SCTP or lower-layer protocol |
| 6935 | overheads. If that is true, encryption of the SCTP user data only |
| 6936 | might be considered. As with the supplementary checksum service, |
| 6937 | user data encryption MAY be performed by the SCTP user application. |
| 6938 | Alternately, the user application MAY use an implementation-specific |
| 6939 | API to request that the IP Encapsulating Security Payload (ESP) |
| 6940 | [RFC4303] be used to provide confidentiality and integrity. |
| 6941 | |
| 6942 | |
| 6943 | |
| 6944 | |
| 6945 | |
| 6946 | Stewart Standards Track [Page 124] |
| 6947 | |
| 6948 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 6949 | |
| 6950 | |
| 6951 | Particularly for mobile users, the requirement for confidentiality |
| 6952 | might include the masking of IP addresses and ports. In this case, |
| 6953 | ESP SHOULD be used instead of application-level confidentiality. If |
| 6954 | ESP is used to protect confidentiality of SCTP traffic, an ESP |
| 6955 | cryptographic transform that includes cryptographic integrity |
| 6956 | protection MUST be used, because if there is a confidentiality threat |
| 6957 | there will also be a strong integrity threat. |
| 6958 | |
| 6959 | Whenever ESP is in use, application-level encryption is not generally |
| 6960 | required. |
| 6961 | |
| 6962 | Regardless of where confidentiality is provided, the Internet Key |
| 6963 | Exchange Protocol version 2 (IKEv2) [RFC4306] SHOULD be used for key |
| 6964 | management. |
| 6965 | |
| 6966 | Operators should consult [RFC4301] for more information on the |
| 6967 | security services available at and immediately above the Internet |
| 6968 | Protocol layer. |
| 6969 | |
| 6970 | 11.2.4. Protecting against Blind Denial-of-Service Attacks |
| 6971 | |
| 6972 | A blind attack is one where the attacker is unable to intercept or |
| 6973 | otherwise see the content of data flows passing to and from the |
| 6974 | target SCTP node. Blind denial-of-service attacks may take the form |
| 6975 | of flooding, masquerade, or improper monopolization of services. |
| 6976 | |
| 6977 | 11.2.4.1. Flooding |
| 6978 | |
| 6979 | The objective of flooding is to cause loss of service and incorrect |
| 6980 | behavior at target systems through resource exhaustion, interference |
| 6981 | with legitimate transactions, and exploitation of buffer-related |
| 6982 | software bugs. Flooding may be directed either at the SCTP node or |
| 6983 | at resources in the intervening IP Access Links or the Internet. |
| 6984 | Where the latter entities are the target, flooding will manifest |
| 6985 | itself as loss of network services, including potentially the breach |
| 6986 | of any firewalls in place. |
| 6987 | |
| 6988 | In general, protection against flooding begins at the equipment |
| 6989 | design level, where it includes measures such as: |
| 6990 | |
| 6991 | - avoiding commitment of limited resources before determining that |
| 6992 | the request for service is legitimate. |
| 6993 | |
| 6994 | - giving priority to completion of processing in progress over the |
| 6995 | acceptance of new work. |
| 6996 | |
| 6997 | - identification and removal of duplicate or stale queued requests |
| 6998 | for service. |
| 6999 | |
| 7000 | |
| 7001 | |
| 7002 | Stewart Standards Track [Page 125] |
| 7003 | |
| 7004 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7005 | |
| 7006 | |
| 7007 | - not responding to unexpected packets sent to non-unicast |
| 7008 | addresses. |
| 7009 | |
| 7010 | Network equipment should be capable of generating an alarm and log if |
| 7011 | a suspicious increase in traffic occurs. The log should provide |
| 7012 | information such as the identity of the incoming link and source |
| 7013 | address(es) used, which will help the network or SCTP system operator |
| 7014 | to take protective measures. Procedures should be in place for the |
| 7015 | operator to act on such alarms if a clear pattern of abuse emerges. |
| 7016 | |
| 7017 | The design of SCTP is resistant to flooding attacks, particularly in |
| 7018 | its use of a four-way startup handshake, its use of a cookie to defer |
| 7019 | commitment of resources at the responding SCTP node until the |
| 7020 | handshake is completed, and its use of a Verification Tag to prevent |
| 7021 | insertion of extraneous packets into the flow of an established |
| 7022 | association. |
| 7023 | |
| 7024 | The IP Authentication Header and Encapsulating Security Payload might |
| 7025 | be useful in reducing the risk of certain kinds of denial-of-service |
| 7026 | attacks. |
| 7027 | |
| 7028 | The use of the host name feature in the INIT chunk could be used to |
| 7029 | flood a target DNS server. A large backlog of DNS queries, resolving |
| 7030 | the host name received in the INIT chunk to IP addresses, could be |
| 7031 | accomplished by sending INITs to multiple hosts in a given domain. |
| 7032 | In addition, an attacker could use the host name feature in an |
| 7033 | indirect attack on a third party by sending large numbers of INITs to |
| 7034 | random hosts containing the host name of the target. In addition to |
| 7035 | the strain on DNS resources, this could also result in large numbers |
| 7036 | of INIT ACKs being sent to the target. One method to protect against |
| 7037 | this type of attack is to verify that the IP addresses received from |
| 7038 | DNS include the source IP address of the original INIT. If the list |
| 7039 | of IP addresses received from DNS does not include the source IP |
| 7040 | address of the INIT, the endpoint MAY silently discard the INIT. |
| 7041 | This last option will not protect against the attack against the DNS. |
| 7042 | |
| 7043 | 11.2.4.2. Blind Masquerade |
| 7044 | |
| 7045 | Masquerade can be used to deny service in several ways: |
| 7046 | |
| 7047 | - by tying up resources at the target SCTP node to which the |
| 7048 | impersonated node has limited access. For example, the target |
| 7049 | node may by policy permit a maximum of one SCTP association with |
| 7050 | the impersonated SCTP node. The masquerading attacker may attempt |
| 7051 | to establish an association purporting to come from the |
| 7052 | impersonated node so that the latter cannot do so when it requires |
| 7053 | it. |
| 7054 | |
| 7055 | |
| 7056 | |
| 7057 | |
| 7058 | Stewart Standards Track [Page 126] |
| 7059 | |
| 7060 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7061 | |
| 7062 | |
| 7063 | - by deliberately allowing the impersonation to be detected, thereby |
| 7064 | provoking counter-measures that cause the impersonated node to be |
| 7065 | locked out of the target SCTP node. |
| 7066 | |
| 7067 | - by interfering with an established association by inserting |
| 7068 | extraneous content such as a SHUTDOWN request. |
| 7069 | |
| 7070 | SCTP reduces the risk of blind masquerade attacks through IP spoofing |
| 7071 | by use of the four-way startup handshake. Because the initial |
| 7072 | exchange is memory-less, no lockout mechanism is triggered by blind |
| 7073 | masquerade attacks. In addition, the INIT ACK containing the State |
| 7074 | Cookie is transmitted back to the IP address from which it received |
| 7075 | the INIT. Thus, the attacker would not receive the INIT ACK |
| 7076 | containing the State Cookie. SCTP protects against insertion of |
| 7077 | extraneous packets into the flow of an established association by use |
| 7078 | of the Verification Tag. |
| 7079 | |
| 7080 | Logging of received INIT requests and abnormalities such as |
| 7081 | unexpected INIT ACKs might be considered as a way to detect patterns |
| 7082 | of hostile activity. However, the potential usefulness of such |
| 7083 | logging must be weighed against the increased SCTP startup processing |
| 7084 | it implies, rendering the SCTP node more vulnerable to flooding |
| 7085 | attacks. Logging is pointless without the establishment of operating |
| 7086 | procedures to review and analyze the logs on a routine basis. |
| 7087 | |
| 7088 | 11.2.4.3. Improper Monopolization of Services |
| 7089 | |
| 7090 | Attacks under this heading are performed openly and legitimately by |
| 7091 | the attacker. They are directed against fellow users of the target |
| 7092 | SCTP node or of the shared resources between the attacker and the |
| 7093 | target node. Possible attacks include the opening of a large number |
| 7094 | of associations between the attacker's node and the target, or |
| 7095 | transfer of large volumes of information within a legitimately |
| 7096 | established association. |
| 7097 | |
| 7098 | Policy limits should be placed on the number of associations per |
| 7099 | adjoining SCTP node. SCTP user applications should be capable of |
| 7100 | detecting large volumes of illegitimate or "no-op" messages within a |
| 7101 | given association and either logging or terminating the association |
| 7102 | as a result, based on local policy. |
| 7103 | |
| 7104 | 11.3. SCTP Interactions with Firewalls |
| 7105 | |
| 7106 | It is helpful for some firewalls if they can inspect just the first |
| 7107 | fragment of a fragmented SCTP packet and unambiguously determine |
| 7108 | whether it corresponds to an INIT chunk (for further information, |
| 7109 | please refer to [RFC1858]). Accordingly, we stress the requirements, |
| 7110 | stated in Section 3.1, that (1) an INIT chunk MUST NOT be bundled |
| 7111 | |
| 7112 | |
| 7113 | |
| 7114 | Stewart Standards Track [Page 127] |
| 7115 | |
| 7116 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7117 | |
| 7118 | |
| 7119 | with any other chunk in a packet, and (2) a packet containing an INIT |
| 7120 | chunk MUST have a zero Verification Tag. Furthermore, we require |
| 7121 | that the receiver of an INIT chunk MUST enforce these rules by |
| 7122 | silently discarding an arriving packet with an INIT chunk that is |
| 7123 | bundled with other chunks or has a non-zero verification tag and |
| 7124 | contains an INIT-chunk. |
| 7125 | |
| 7126 | 11.4. Protection of Non-SCTP-Capable Hosts |
| 7127 | |
| 7128 | To provide a non-SCTP-capable host with the same level of protection |
| 7129 | against attacks as for SCTP-capable ones, all SCTP stacks MUST |
| 7130 | implement the ICMP handling described in Appendix C. |
| 7131 | |
| 7132 | When an SCTP stack receives a packet containing multiple control or |
| 7133 | DATA chunks and the processing of the packet requires the sending of |
| 7134 | multiple chunks in response, the sender of the response chunk(s) MUST |
| 7135 | NOT send more than one packet. If bundling is supported, multiple |
| 7136 | response chunks that fit into a single packet MAY be bundled together |
| 7137 | into one single response packet. If bundling is not supported, then |
| 7138 | the sender MUST NOT send more than one response chunk and MUST |
| 7139 | discard all other responses. Note that this rule does NOT apply to a |
| 7140 | SACK chunk, since a SACK chunk is, in itself, a response to DATA and |
| 7141 | a SACK does not require a response of more DATA. |
| 7142 | |
| 7143 | An SCTP implementation SHOULD abort the association if it receives a |
| 7144 | SACK acknowledging a TSN that has not been sent. |
| 7145 | |
| 7146 | An SCTP implementation that receives an INIT that would require a |
| 7147 | large packet in response, due to the inclusion of multiple ERROR |
| 7148 | parameters, MAY (at its discretion) elect to omit some or all of the |
| 7149 | ERROR parameters to reduce the size of the INIT ACK. Due to a |
| 7150 | combination of the size of the COOKIE parameter and the number of |
| 7151 | addresses a receiver of an INIT may be indicating to a peer, it is |
| 7152 | always possible that the INIT ACK will be larger than the original |
| 7153 | INIT. An SCTP implementation SHOULD attempt to make the INIT ACK as |
| 7154 | small as possible to reduce the possibility of byte amplification |
| 7155 | attacks. |
| 7156 | |
| 7157 | 12. Network Management Considerations |
| 7158 | |
| 7159 | The MIB module for SCTP defined in [RFC3873] applies for the version |
| 7160 | of the protocol specified in this document. |
| 7161 | |
| 7162 | |
| 7163 | |
| 7164 | |
| 7165 | |
| 7166 | |
| 7167 | |
| 7168 | |
| 7169 | |
| 7170 | Stewart Standards Track [Page 128] |
| 7171 | |
| 7172 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7173 | |
| 7174 | |
| 7175 | 13. Recommended Transmission Control Block (TCB) Parameters |
| 7176 | |
| 7177 | This section details a recommended set of parameters that should be |
| 7178 | contained within the TCB for an implementation. This section is for |
| 7179 | illustrative purposes and should not be deemed as requirements on an |
| 7180 | implementation or as an exhaustive list of all parameters inside an |
| 7181 | SCTP TCB. Each implementation may need its own additional parameters |
| 7182 | for optimization. |
| 7183 | |
| 7184 | 13.1. Parameters Necessary for the SCTP Instance |
| 7185 | |
| 7186 | Associations: A list of current associations and mappings to the data |
| 7187 | consumers for each association. This may be in the |
| 7188 | form of a hash table or other implementation-dependent |
| 7189 | structure. The data consumers may be process |
| 7190 | identification information such as file descriptors, |
| 7191 | named pipe pointer, or table pointers dependent on how |
| 7192 | SCTP is implemented. |
| 7193 | |
| 7194 | Secret Key: A secret key used by this endpoint to compute the MAC. |
| 7195 | This SHOULD be a cryptographic quality random number |
| 7196 | with a sufficient length. Discussion in RFC 4086 can |
| 7197 | be helpful in selection of the key. |
| 7198 | |
| 7199 | Address List: The list of IP addresses that this instance has bound. |
| 7200 | This information is passed to one's peer(s) in INIT and |
| 7201 | INIT ACK chunks. |
| 7202 | |
| 7203 | SCTP Port: The local SCTP port number to which the endpoint is |
| 7204 | bound. |
| 7205 | |
| 7206 | 13.2. Parameters Necessary per Association (i.e., the TCB) |
| 7207 | |
| 7208 | Peer : Tag value to be sent in every packet and is received |
| 7209 | Verification: in the INIT or INIT ACK chunk. |
| 7210 | Tag : |
| 7211 | |
| 7212 | My : Tag expected in every inbound packet and sent in the |
| 7213 | Verification: INIT or INIT ACK chunk. |
| 7214 | Tag : |
| 7215 | |
| 7216 | State : A state variable indicating what state the association |
| 7217 | : is in, i.e., COOKIE-WAIT, COOKIE-ECHOED, ESTABLISHED, |
| 7218 | : SHUTDOWN-PENDING, SHUTDOWN-SENT, SHUTDOWN-RECEIVED, |
| 7219 | : SHUTDOWN-ACK-SENT. |
| 7220 | |
| 7221 | Note: No "CLOSED" state is illustrated since if a |
| 7222 | association is "CLOSED" its TCB SHOULD be removed. |
| 7223 | |
| 7224 | |
| 7225 | |
| 7226 | Stewart Standards Track [Page 129] |
| 7227 | |
| 7228 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7229 | |
| 7230 | |
| 7231 | Peer : A list of SCTP transport addresses to which the peer |
| 7232 | Transport : is bound. This information is derived from the INIT or |
| 7233 | Address : INIT ACK and is used to associate an inbound packet |
| 7234 | List : with a given association. Normally, this information |
| 7235 | : is hashed or keyed for quick lookup and access of the |
| 7236 | : TCB. |
| 7237 | |
| 7238 | Primary : This is the current primary destination transport |
| 7239 | Path : address of the peer endpoint. It may also specify a |
| 7240 | : source transport address on this endpoint. |
| 7241 | |
| 7242 | Overall : The overall association error count. |
| 7243 | Error Count : |
| 7244 | |
| 7245 | Overall : The threshold for this association that if the Overall |
| 7246 | Error : Error Count reaches will cause this association to be |
| 7247 | Threshold : torn down. |
| 7248 | |
| 7249 | Peer Rwnd : Current calculated value of the peer's rwnd. |
| 7250 | |
| 7251 | Next TSN : The next TSN number to be assigned to a new DATA chunk. |
| 7252 | : This is sent in the INIT or INIT ACK chunk to the peer |
| 7253 | : and incremented each time a DATA chunk is assigned a |
| 7254 | : TSN (normally just prior to transmit or during |
| 7255 | : fragmentation). |
| 7256 | |
| 7257 | Last Rcvd : This is the last TSN received in sequence. This value |
| 7258 | TSN : is set initially by taking the peer's initial TSN, |
| 7259 | : received in the INIT or INIT ACK chunk, and |
| 7260 | : subtracting one from it. |
| 7261 | |
| 7262 | Mapping : An array of bits or bytes indicating which out-of- |
| 7263 | Array : order TSNs have been received (relative to the |
| 7264 | : Last Rcvd TSN). If no gaps exist, i.e., no out-of- |
| 7265 | : order packets have been received, this array will |
| 7266 | : be set to all zero. This structure may be in the |
| 7267 | : form of a circular buffer or bit array. |
| 7268 | |
| 7269 | Ack State : This flag indicates if the next received packet |
| 7270 | : is to be responded to with a SACK. This is initialized |
| 7271 | : to 0. When a packet is received it is incremented. |
| 7272 | : If this value reaches 2 or more, a SACK is sent and the |
| 7273 | : value is reset to 0. Note: This is used only when no |
| 7274 | : DATA chunks are received out of order. When DATA |
| 7275 | : chunks are out of order, SACKs are not delayed (see |
| 7276 | : Section 6). |
| 7277 | |
| 7278 | |
| 7279 | |
| 7280 | |
| 7281 | |
| 7282 | Stewart Standards Track [Page 130] |
| 7283 | |
| 7284 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7285 | |
| 7286 | |
| 7287 | Inbound : An array of structures to track the inbound streams, |
| 7288 | Streams : normally including the next sequence number expected |
| 7289 | : and possibly the stream number. |
| 7290 | |
| 7291 | Outbound : An array of structures to track the outbound streams, |
| 7292 | Streams : normally including the next sequence number to |
| 7293 | : be sent on the stream. |
| 7294 | |
| 7295 | Reasm Queue : A reassembly queue. |
| 7296 | |
| 7297 | Local : The list of local IP addresses bound in to this |
| 7298 | Transport : association. |
| 7299 | Address : |
| 7300 | List : |
| 7301 | |
| 7302 | Association : The smallest PMTU discovered for all of the |
| 7303 | PMTU : peer's transport addresses. |
| 7304 | |
| 7305 | 13.3. Per Transport Address Data |
| 7306 | |
| 7307 | For each destination transport address in the peer's address list |
| 7308 | derived from the INIT or INIT ACK chunk, a number of data elements |
| 7309 | need to be maintained including: |
| 7310 | |
| 7311 | Error Count : The current error count for this destination. |
| 7312 | |
| 7313 | Error : Current error threshold for this destination, i.e., |
| 7314 | Threshold : what value marks the destination down if error count |
| 7315 | : reaches this value. |
| 7316 | |
| 7317 | cwnd : The current congestion window. |
| 7318 | |
| 7319 | ssthresh : The current ssthresh value. |
| 7320 | |
| 7321 | RTO : The current retransmission timeout value. |
| 7322 | |
| 7323 | SRTT : The current smoothed round-trip time. |
| 7324 | |
| 7325 | RTTVAR : The current RTT variation. |
| 7326 | |
| 7327 | partial : The tracking method for increase of cwnd when in |
| 7328 | bytes acked : congestion avoidance mode (see Section 7.2.2). |
| 7329 | |
| 7330 | state : The current state of this destination, i.e., DOWN, UP, |
| 7331 | : ALLOW-HB, NO-HEARTBEAT, etc. |
| 7332 | |
| 7333 | |
| 7334 | |
| 7335 | |
| 7336 | |
| 7337 | |
| 7338 | Stewart Standards Track [Page 131] |
| 7339 | |
| 7340 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7341 | |
| 7342 | |
| 7343 | PMTU : The current known path MTU. |
| 7344 | |
| 7345 | Per : A timer used by each destination. |
| 7346 | Destination : |
| 7347 | Timer : |
| 7348 | |
| 7349 | RTO-Pending : A flag used to track if one of the DATA chunks sent to |
| 7350 | : this address is currently being used to compute an |
| 7351 | : RTT. If this flag is 0, the next DATA chunk sent to |
| 7352 | : this destination should be used to compute an RTT and |
| 7353 | : this flag should be set. Every time the RTT |
| 7354 | : calculation completes (i.e., the DATA chunk is SACK'd), |
| 7355 | : clear this flag. |
| 7356 | |
| 7357 | last-time : The time to which this destination was last sent. |
| 7358 | : This can be to determine if a HEARTBEAT is needed. |
| 7359 | |
| 7360 | 13.4. General Parameters Needed |
| 7361 | |
| 7362 | Out Queue : A queue of outbound DATA chunks. |
| 7363 | |
| 7364 | In Queue : A queue of inbound DATA chunks. |
| 7365 | |
| 7366 | 14. IANA Considerations |
| 7367 | |
| 7368 | SCTP defines three registries that IANA maintains: |
| 7369 | |
| 7370 | - through definition of additional chunk types, |
| 7371 | - through definition of additional parameter types, or |
| 7372 | - through definition of additional cause codes within ERROR chunks. |
| 7373 | |
| 7374 | SCTP requires that the IANA Port Numbers registry be opened for SCTP |
| 7375 | port registrations, Section 14.5 describes how. An IESG-appointed |
| 7376 | Expert Reviewer supports IANA in evaluating SCTP port allocation |
| 7377 | requests. |
| 7378 | |
| 7379 | 14.1. IETF-Defined Chunk Extension |
| 7380 | |
| 7381 | The assignment of new chunk parameter type codes is done through an |
| 7382 | IETF Consensus action, as defined in [RFC2434]. Documentation of the |
| 7383 | chunk parameter MUST contain the following information: |
| 7384 | |
| 7385 | a) A long and short name for the new chunk type. |
| 7386 | |
| 7387 | b) A detailed description of the structure of the chunk, which MUST |
| 7388 | conform to the basic structure defined in Section 3.2. |
| 7389 | |
| 7390 | |
| 7391 | |
| 7392 | |
| 7393 | |
| 7394 | Stewart Standards Track [Page 132] |
| 7395 | |
| 7396 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7397 | |
| 7398 | |
| 7399 | c) A detailed definition and description of intended use of each |
| 7400 | field within the chunk, including the chunk flags if any. |
| 7401 | |
| 7402 | d) A detailed procedural description of the use of the new chunk type |
| 7403 | within the operation of the protocol. |
| 7404 | |
| 7405 | The last chunk type (255) is reserved for future extension if |
| 7406 | necessary. |
| 7407 | |
| 7408 | 14.2. IETF-Defined Chunk Parameter Extension |
| 7409 | |
| 7410 | The assignment of new chunk parameter type codes is done through an |
| 7411 | IETF Consensus action as defined in [RFC2434]. Documentation of the |
| 7412 | chunk parameter MUST contain the following information: |
| 7413 | |
| 7414 | a) Name of the parameter type. |
| 7415 | |
| 7416 | b) Detailed description of the structure of the parameter field. |
| 7417 | This structure MUST conform to the general Type-Length-Value |
| 7418 | format described in Section 3.2.1. |
| 7419 | |
| 7420 | c) Detailed definition of each component of the parameter value. |
| 7421 | |
| 7422 | d) Detailed description of the intended use of this parameter type, |
| 7423 | and an indication of whether and under what circumstances multiple |
| 7424 | instances of this parameter type may be found within the same |
| 7425 | chunk. |
| 7426 | |
| 7427 | e) Each parameter type MUST be unique across all chunks. |
| 7428 | |
| 7429 | 14.3. IETF-Defined Additional Error Causes |
| 7430 | |
| 7431 | Additional cause codes may be allocated in the range 11 to 65535 |
| 7432 | through a Specification Required action as defined in [RFC2434]. |
| 7433 | Provided documentation must include the following information: |
| 7434 | |
| 7435 | a) Name of the error condition. |
| 7436 | |
| 7437 | b) Detailed description of the conditions under which an SCTP |
| 7438 | endpoint should issue an ERROR (or ABORT) with this cause code. |
| 7439 | |
| 7440 | c) Expected action by the SCTP endpoint that receives an ERROR (or |
| 7441 | ABORT) chunk containing this cause code. |
| 7442 | |
| 7443 | d) Detailed description of the structure and content of data fields |
| 7444 | that accompany this cause code. |
| 7445 | |
| 7446 | |
| 7447 | |
| 7448 | |
| 7449 | |
| 7450 | Stewart Standards Track [Page 133] |
| 7451 | |
| 7452 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7453 | |
| 7454 | |
| 7455 | The initial word (32 bits) of a cause code parameter MUST conform to |
| 7456 | the format shown in Section 3.3.10, i.e.: |
| 7457 | |
| 7458 | - first 2 bytes contain the cause code value |
| 7459 | - last 2 bytes contain the length of the cause parameter. |
| 7460 | |
| 7461 | 14.4. Payload Protocol Identifiers |
| 7462 | |
| 7463 | Except for value 0, which is reserved by SCTP to indicate an |
| 7464 | unspecified payload protocol identifier in a DATA chunk, SCTP will |
| 7465 | not be responsible for standardizing or verifying any payload |
| 7466 | protocol identifiers; SCTP simply receives the identifier from the |
| 7467 | upper layer and carries it with the corresponding payload data. |
| 7468 | |
| 7469 | The upper layer, i.e., the SCTP user, SHOULD standardize any specific |
| 7470 | protocol identifier with IANA if it is so desired. The use of any |
| 7471 | specific payload protocol identifier is out of the scope of SCTP. |
| 7472 | |
| 7473 | 14.5. Port Numbers Registry |
| 7474 | |
| 7475 | SCTP services may use contact port numbers to provide service to |
| 7476 | unknown callers, as in TCP and UDP. IANA is therefore requested to |
| 7477 | open the existing Port Numbers registry for SCTP using the following |
| 7478 | rules, which we intend to mesh well with existing Port Numbers |
| 7479 | registration procedures. An IESG-appointed Expert Reviewer supports |
| 7480 | IANA in evaluating SCTP port allocation requests, according to the |
| 7481 | procedure defined in [RFC2434]. |
| 7482 | |
| 7483 | Port numbers are divided into three ranges. The Well Known Ports are |
| 7484 | those from 0 through 1023, the Registered Ports are those from 1024 |
| 7485 | through 49151, and the Dynamic and/or Private Ports are those from |
| 7486 | 49152 through 65535. Well Known and Registered Ports are intended |
| 7487 | for use by server applications that desire a default contact point on |
| 7488 | a system. On most systems, Well Known Ports can only be used by |
| 7489 | system (or root) processes or by programs executed by privileged |
| 7490 | users, while Registered Ports can be used by ordinary user processes |
| 7491 | or programs executed by ordinary users. Dynamic and/or Private Ports |
| 7492 | are intended for temporary use, including client-side ports, out-of- |
| 7493 | band negotiated ports, and application testing prior to registration |
| 7494 | of a dedicated port; they MUST NOT be registered. |
| 7495 | |
| 7496 | The Port Numbers registry should accept registrations for SCTP ports |
| 7497 | in the Well Known Ports and Registered Ports ranges. Well Known and |
| 7498 | Registered Ports SHOULD NOT be used without registration. Although |
| 7499 | in some cases -- such as porting an application from TCP to SCTP -- |
| 7500 | it may seem natural to use an SCTP port before registration |
| 7501 | completes, we emphasize that IANA will not guarantee registration of |
| 7502 | |
| 7503 | |
| 7504 | |
| 7505 | |
| 7506 | Stewart Standards Track [Page 134] |
| 7507 | |
| 7508 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7509 | |
| 7510 | |
| 7511 | particular Well Known and Registered Ports. Registrations should be |
| 7512 | requested as early as possible. |
| 7513 | |
| 7514 | Each port registration SHALL include the following information: |
| 7515 | |
| 7516 | o A short port name, consisting entirely of letters (A-Z and a-z), |
| 7517 | digits (0-9), and punctuation characters from "-_+./*" (not |
| 7518 | including the quotes). |
| 7519 | |
| 7520 | o The port number that is requested for registration. |
| 7521 | |
| 7522 | o A short English phrase describing the port's purpose. |
| 7523 | |
| 7524 | o Name and contact information for the person or entity performing |
| 7525 | the registration, and possibly a reference to a document defining |
| 7526 | the port's use. Registrations coming from IETF working groups |
| 7527 | need only name the working group, but indicating a contact person |
| 7528 | is recommended. |
| 7529 | |
| 7530 | Registrants are encouraged to follow these guidelines when submitting |
| 7531 | a registration. |
| 7532 | |
| 7533 | o A port name SHOULD NOT be registered for more than one SCTP port |
| 7534 | number. |
| 7535 | |
| 7536 | o A port name registered for TCP MAY be registered for SCTP as well. |
| 7537 | Any such registration SHOULD use the same port number as the |
| 7538 | existing TCP registration. |
| 7539 | |
| 7540 | o Concrete intent to use a port SHOULD precede port registration. |
| 7541 | For example, existing TCP ports SHOULD NOT be registered in |
| 7542 | advance of any intent to use those ports for SCTP. |
| 7543 | |
| 7544 | This document registers the following ports. (These registrations |
| 7545 | should be considered models to follow for future allocation |
| 7546 | requests.) |
| 7547 | |
| 7548 | discard 9/sctp Discard # IETF TSVWG |
| 7549 | # Randall Stewart <rrs@cisco.com> |
| 7550 | # [RFC4960] |
| 7551 | |
| 7552 | The discard service, which accepts SCTP connections on port |
| 7553 | 9, discards all incoming application data and sends no data |
| 7554 | in response. Thus, SCTP's discard port is analogous to |
| 7555 | TCP's discard port, and might be used to check the health |
| 7556 | of an SCTP stack. |
| 7557 | |
| 7558 | |
| 7559 | |
| 7560 | |
| 7561 | |
| 7562 | Stewart Standards Track [Page 135] |
| 7563 | |
| 7564 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7565 | |
| 7566 | |
| 7567 | ftp-data 20/sctp FTP # IETF TSVWG |
| 7568 | # Randall Stewart <rrs@cisco.com> |
| 7569 | # [RFC4960] |
| 7570 | |
| 7571 | ftp 21/sctp FTP # IETF TSVWG |
| 7572 | # Randall Stewart <rrs@cisco.com> |
| 7573 | # [RFC4960] |
| 7574 | |
| 7575 | File Transfer Protocol (FTP) data (20) and control ports |
| 7576 | (21). |
| 7577 | |
| 7578 | ssh 22/sctp SSH # IETF TSVWG |
| 7579 | # Randall Stewart <rrs@cisco.com> |
| 7580 | # [RFC4960] |
| 7581 | |
| 7582 | The Secure Shell (SSH) remote login service, which allows |
| 7583 | secure shell logins to a host. |
| 7584 | |
| 7585 | http 80/sctp HTTP # IETF TSVWG |
| 7586 | # Randall Stewart <rrs@cisco.com> |
| 7587 | # [RFC4960] |
| 7588 | |
| 7589 | World Wide Web HTTP over SCTP. |
| 7590 | |
| 7591 | bgp 179/sctp BGP # IETF TSVWG |
| 7592 | # Randall Stewart <rrs@cisco.com> |
| 7593 | # [RFC4960] |
| 7594 | |
| 7595 | Border Gateway Protocol over SCTP. |
| 7596 | |
| 7597 | https 443/sctp HTTPS # IETF TSVWG |
| 7598 | # Randall Stewart <rrs@cisco.com> |
| 7599 | # [RFC4960] |
| 7600 | |
| 7601 | World Wide Web HTTP over TLS/SSL over SCTP. |
| 7602 | |
| 7603 | 15. Suggested SCTP Protocol Parameter Values |
| 7604 | |
| 7605 | The following protocol parameters are RECOMMENDED: |
| 7606 | |
| 7607 | RTO.Initial - 3 seconds |
| 7608 | RTO.Min - 1 second |
| 7609 | RTO.Max - 60 seconds |
| 7610 | Max.Burst - 4 |
| 7611 | RTO.Alpha - 1/8 |
| 7612 | RTO.Beta - 1/4 |
| 7613 | Valid.Cookie.Life - 60 seconds |
| 7614 | Association.Max.Retrans - 10 attempts |
| 7615 | |
| 7616 | |
| 7617 | |
| 7618 | Stewart Standards Track [Page 136] |
| 7619 | |
| 7620 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7621 | |
| 7622 | |
| 7623 | Path.Max.Retrans - 5 attempts (per destination address) |
| 7624 | Max.Init.Retransmits - 8 attempts |
| 7625 | HB.interval - 30 seconds |
| 7626 | HB.Max.Burst - 1 |
| 7627 | |
| 7628 | IMPLEMENTATION NOTE: The SCTP implementation may allow ULP to |
| 7629 | customize some of these protocol parameters (see Section 10). |
| 7630 | |
| 7631 | Note: RTO.Min SHOULD be set as recommended above. |
| 7632 | |
| 7633 | 16. Acknowledgements |
| 7634 | |
| 7635 | An undertaking represented by this updated document is not a small |
| 7636 | feat and represents the summation of the initial authors of RFC 2960: |
| 7637 | Q. Xie, K. Morneault, C. Sharp, H. Schwarzbauer, T. Taylor, I. |
| 7638 | Rytina, M. Kalla, L. Zhang, and V. Paxson. |
| 7639 | |
| 7640 | Add to that, the comments from everyone who contributed to the |
| 7641 | original RFC: |
| 7642 | |
| 7643 | Mark Allman, R.J. Atkinson, Richard Band, Scott Bradner, Steve |
| 7644 | Bellovin, Peter Butler, Ram Dantu, R. Ezhirpavai, Mike Fisk, Sally |
| 7645 | Floyd, Atsushi Fukumoto, Matt Holdrege, Henry Houh, Christian |
| 7646 | Huitema, Gary Lehecka, Jonathan Lee, David Lehmann, John Loughney, |
| 7647 | Daniel Luan, Barry Nagelberg, Thomas Narten, Erik Nordmark, Lyndon |
| 7648 | Ong, Shyamal Prasad, Kelvin Porter, Heinz Prantner, Jarno Rajahalme, |
| 7649 | Raymond E. Reeves, Renee Revis, Ivan Arias Rodriguez, A. Sankar, Greg |
| 7650 | Sidebottom, Brian Wyld, La Monte Yarroll, and many others for their |
| 7651 | invaluable comments. |
| 7652 | |
| 7653 | Then, add the authors of the SCTP implementor's guide, I. Arias- |
| 7654 | Rodriguez, K. Poon, A. Caro, and M. Tuexen. |
| 7655 | |
| 7656 | Then add to these the efforts of all the subsequent seven SCTP |
| 7657 | interoperability tests and those who commented on RFC 4460 as shown |
| 7658 | in its acknowledgements: |
| 7659 | |
| 7660 | Barry Zuckerman, La Monte Yarroll, Qiaobing Xie, Wang Xiaopeng, |
| 7661 | Jonathan Wood, Jeff Waskow, Mike Turner, John Townsend, Sabina |
| 7662 | Torrente, Cliff Thomas, Yuji Suzuki, Manoj Solanki, Sverre Slotte, |
| 7663 | Keyur Shah, Jan Rovins, Ben Robinson, Renee Revis, Ian Periam, RC |
| 7664 | Monee, Sanjay Rao, Sujith Radhakrishnan, Heinz Prantner, Biren Patel, |
| 7665 | Nathalie Mouellic, Mitch Miers, Bernward Meyknecht, Stan McClellan, |
| 7666 | Oliver Mayor, Tomas Orti Martin, Sandeep Mahajan, David Lehmann, |
| 7667 | Jonathan Lee, Philippe Langlois, Karl Knutson, Joe Keller, Gareth |
| 7668 | Keily, Andreas Jungmaier, Janardhan Iyengar, Mutsuya Irie, John |
| 7669 | Hebert, Kausar Hassan, Fred Hasle, Dan Harrison, Jon Grim, Laurent |
| 7670 | Glaude, Steven Furniss, Atsushi Fukumoto, Ken Fujita, Steve Dimig, |
| 7671 | |
| 7672 | |
| 7673 | |
| 7674 | Stewart Standards Track [Page 137] |
| 7675 | |
| 7676 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7677 | |
| 7678 | |
| 7679 | Thomas Curran, Serkan Cil, Melissa Campbell, Peter Butler, Rob |
| 7680 | Brennan, Harsh Bhondwe, Brian Bidulock, Caitlin Bestler, Jon Berger, |
| 7681 | Robby Benedyk, Stephen Baucke, Sandeep Balani, and Ronnie Sellar. |
| 7682 | |
| 7683 | A special thanks to Mark Allman, who should actually be a co-author |
| 7684 | for his work on the max-burst, but managed to wiggle out due to a |
| 7685 | technicality. Also, we would like to acknowledge Lyndon Ong and Phil |
| 7686 | Conrad for their valuable input and many contributions. |
| 7687 | |
| 7688 | And finally, you have this document, and those who have commented |
| 7689 | upon that including Alfred Hoenes and Ronnie Sellars. |
| 7690 | |
| 7691 | My thanks cannot be adequately expressed to all of you who have |
| 7692 | participated in the coding, testing, and updating process of this |
| 7693 | document. All I can say is, Thank You! |
| 7694 | |
| 7695 | Randall Stewart - Editor |
| 7696 | |
| 7697 | |
| 7698 | |
| 7699 | |
| 7700 | |
| 7701 | |
| 7702 | |
| 7703 | |
| 7704 | |
| 7705 | |
| 7706 | |
| 7707 | |
| 7708 | |
| 7709 | |
| 7710 | |
| 7711 | |
| 7712 | |
| 7713 | |
| 7714 | |
| 7715 | |
| 7716 | |
| 7717 | |
| 7718 | |
| 7719 | |
| 7720 | |
| 7721 | |
| 7722 | |
| 7723 | |
| 7724 | |
| 7725 | |
| 7726 | |
| 7727 | |
| 7728 | |
| 7729 | |
| 7730 | Stewart Standards Track [Page 138] |
| 7731 | |
| 7732 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7733 | |
| 7734 | |
| 7735 | Appendix A. Explicit Congestion Notification |
| 7736 | |
| 7737 | ECN [RFC3168] describes a proposed extension to IP that details a |
| 7738 | method to become aware of congestion outside of datagram loss. This |
| 7739 | is an optional feature that an implementation MAY choose to add to |
| 7740 | SCTP. This appendix details the minor differences implementers will |
| 7741 | need to be aware of if they choose to implement this feature. In |
| 7742 | general, [RFC3168] should be followed with the following exceptions. |
| 7743 | |
| 7744 | Negotiation: |
| 7745 | |
| 7746 | [RFC3168] details negotiation of ECN during the SYN and SYN-ACK |
| 7747 | stages of a TCP connection. The sender of the SYN sets 2 bits in the |
| 7748 | TCP flags, and the sender of the SYN-ACK sets only 1 bit. The |
| 7749 | reasoning behind this is to ensure that both sides are truly ECN |
| 7750 | capable. For SCTP, this is not necessary. To indicate that an |
| 7751 | endpoint is ECN capable, an endpoint SHOULD add to the INIT and or |
| 7752 | INIT ACK chunk the TLV reserved for ECN. This TLV contains no |
| 7753 | parameters, and thus has the following format: |
| 7754 | |
| 7755 | 0 1 2 3 |
| 7756 | 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 |
| 7757 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7758 | | Parameter Type = 32768 | Parameter Length = 4 | |
| 7759 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7760 | |
| 7761 | ECN-Echo: |
| 7762 | |
| 7763 | [RFC3168] details a specific bit for a receiver to send back in its |
| 7764 | TCP acknowledgements to notify the sender of the Congestion |
| 7765 | Experienced (CE) bit having arrived from the network. For SCTP, this |
| 7766 | same indication is made by including the ECNE chunk. This chunk |
| 7767 | contains one data element, i.e., the lowest TSN associated with the |
| 7768 | IP datagram marked with the CE bit, and looks as follows: |
| 7769 | |
| 7770 | 0 1 2 3 |
| 7771 | 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 |
| 7772 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7773 | | Chunk Type=12 | Flags=00000000| Chunk Length = 8 | |
| 7774 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7775 | | Lowest TSN Number | |
| 7776 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7777 | |
| 7778 | Note: The ECNE is considered a Control chunk. |
| 7779 | |
| 7780 | |
| 7781 | |
| 7782 | |
| 7783 | |
| 7784 | |
| 7785 | |
| 7786 | Stewart Standards Track [Page 139] |
| 7787 | |
| 7788 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7789 | |
| 7790 | |
| 7791 | CWR: |
| 7792 | |
| 7793 | [RFC3168] details a specific bit for a sender to send in the header |
| 7794 | of its next outbound TCP segment to indicate to its peer that it has |
| 7795 | reduced its congestion window. This is termed the CWR bit. For |
| 7796 | SCTP, the same indication is made by including the CWR chunk. This |
| 7797 | chunk contains one data element, i.e., the TSN number that was sent |
| 7798 | in the ECNE chunk. This element represents the lowest TSN number in |
| 7799 | the datagram that was originally marked with the CE bit. |
| 7800 | |
| 7801 | 0 1 2 3 |
| 7802 | 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 |
| 7803 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7804 | | Chunk Type=13 | Flags=00000000| Chunk Length = 8 | |
| 7805 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7806 | | Lowest TSN Number | |
| 7807 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 7808 | |
| 7809 | Note: The CWR is considered a Control chunk. |
| 7810 | |
| 7811 | Appendix B. CRC32c Checksum Calculation |
| 7812 | |
| 7813 | We define a 'reflected value' as one that is the opposite of the |
| 7814 | normal bit order of the machine. The 32-bit CRC (Cyclic Redundancy |
| 7815 | Check) is calculated as described for CRC32c and uses the polynomial |
| 7816 | code 0x11EDC6F41 (Castagnoli93) or x^32+x^28+x^27+x^26+x^25 |
| 7817 | +x^23+x^22+x^20+x^19+x^18+ x^14+x^13+x^11+x^10+x^9+x^8+x^6+x^0. The |
| 7818 | CRC is computed using a procedure similar to ETHERNET CRC [ITU32], |
| 7819 | modified to reflect transport-level usage. |
| 7820 | |
| 7821 | CRC computation uses polynomial division. A message bit-string M is |
| 7822 | transformed to a polynomial, M(X), and the CRC is calculated from |
| 7823 | M(X) using polynomial arithmetic. |
| 7824 | |
| 7825 | When CRCs are used at the link layer, the polynomial is derived from |
| 7826 | on-the-wire bit ordering: the first bit 'on the wire' is the high- |
| 7827 | order coefficient. Since SCTP is a transport-level protocol, it |
| 7828 | cannot know the actual serial-media bit ordering. Moreover, |
| 7829 | different links in the path between SCTP endpoints may use different |
| 7830 | link-level bit orders. |
| 7831 | |
| 7832 | A convention must therefore be established for mapping SCTP transport |
| 7833 | messages to polynomials for purposes of CRC computation. The bit- |
| 7834 | ordering for mapping SCTP messages to polynomials is that bytes are |
| 7835 | taken most-significant first, but within each byte, bits are taken |
| 7836 | least-significant first. The first byte of the message provides the |
| 7837 | eight highest coefficients. Within each byte, the least-significant |
| 7838 | SCTP bit gives the most-significant polynomial coefficient within |
| 7839 | |
| 7840 | |
| 7841 | |
| 7842 | Stewart Standards Track [Page 140] |
| 7843 | |
| 7844 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7845 | |
| 7846 | |
| 7847 | that byte, and the most-significant SCTP bit is the least-significant |
| 7848 | polynomial coefficient in that byte. (This bit ordering is sometimes |
| 7849 | called 'mirrored' or 'reflected' [WILLIAMS93].) CRC polynomials are |
| 7850 | to be transformed back into SCTP transport-level byte values, using a |
| 7851 | consistent mapping. |
| 7852 | |
| 7853 | The SCTP transport-level CRC value should be calculated as follows: |
| 7854 | |
| 7855 | - CRC input data are assigned to a byte stream, numbered from 0 to |
| 7856 | N-1. |
| 7857 | |
| 7858 | - The transport-level byte stream is mapped to a polynomial value. |
| 7859 | An N-byte PDU with j bytes numbered 0 to N-1 is considered as |
| 7860 | coefficients of a polynomial M(x) of order 8N-1, with bit 0 of |
| 7861 | byte j being coefficient x^(8(N-j)-8), and bit 7 of byte j being |
| 7862 | coefficient x^(8(N-j)-1). |
| 7863 | |
| 7864 | - The CRC remainder register is initialized with all 1s and the CRC |
| 7865 | is computed with an algorithm that simultaneously multiplies by |
| 7866 | x^32 and divides by the CRC polynomial. |
| 7867 | |
| 7868 | - The polynomial is multiplied by x^32 and divided by G(x), the |
| 7869 | generator polynomial, producing a remainder R(x) of degree less |
| 7870 | than or equal to 31. |
| 7871 | |
| 7872 | - The coefficients of R(x) are considered a 32-bit sequence. |
| 7873 | |
| 7874 | - The bit sequence is complemented. The result is the CRC |
| 7875 | polynomial. |
| 7876 | |
| 7877 | - The CRC polynomial is mapped back into SCTP transport-level bytes. |
| 7878 | The coefficient of x^31 gives the value of bit 7 of SCTP byte 0, |
| 7879 | and the coefficient of x^24 gives the value of bit 0 of byte 0. |
| 7880 | The coefficient of x^7 gives bit 7 of byte 3, and the coefficient |
| 7881 | of x^0 gives bit 0 of byte 3. The resulting 4-byte transport- |
| 7882 | level sequence is the 32-bit SCTP checksum value. |
| 7883 | |
| 7884 | IMPLEMENTATION NOTE: Standards documents, textbooks, and vendor |
| 7885 | literature on CRCs often follow an alternative formulation, in which |
| 7886 | the register used to hold the remainder of the long-division |
| 7887 | algorithm is initialized to zero rather than all-1s, and instead the |
| 7888 | first 32 bits of the message are complemented. The long-division |
| 7889 | algorithm used in our formulation is specified such that the initial |
| 7890 | multiplication by 2^32 and the long-division are combined into one |
| 7891 | simultaneous operation. For such algorithms, and for messages longer |
| 7892 | than 64 bits, the two specifications are precisely equivalent. That |
| 7893 | equivalence is the intent of this document. |
| 7894 | |
| 7895 | |
| 7896 | |
| 7897 | |
| 7898 | Stewart Standards Track [Page 141] |
| 7899 | |
| 7900 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7901 | |
| 7902 | |
| 7903 | Implementors of SCTP are warned that both specifications are to be |
| 7904 | found in the literature, sometimes with no restriction on the long- |
| 7905 | division algorithm. The choice of formulation in this document is to |
| 7906 | permit non-SCTP usage, where the same CRC algorithm may be used to |
| 7907 | protect messages shorter than 64 bits. |
| 7908 | |
| 7909 | There may be a computational advantage in validating the association |
| 7910 | against the Verification Tag, prior to performing a checksum, as |
| 7911 | invalid tags will result in the same action as a bad checksum in most |
| 7912 | cases. The exceptions for this technique would be INIT and some |
| 7913 | SHUTDOWN-COMPLETE exchanges, as well as a stale COOKIE ECHO. These |
| 7914 | special-case exchanges must represent small packets and will minimize |
| 7915 | the effect of the checksum calculation. |
| 7916 | |
| 7917 | Appendix C. ICMP Handling |
| 7918 | |
| 7919 | Whenever an ICMP message is received by an SCTP endpoint, the |
| 7920 | following procedures MUST be followed to ensure proper utilization of |
| 7921 | the information being provided by layer 3. |
| 7922 | |
| 7923 | ICMP1) An implementation MAY ignore all ICMPv4 messages where the |
| 7924 | type field is not set to "Destination Unreachable". |
| 7925 | |
| 7926 | ICMP2) An implementation MAY ignore all ICMPv6 messages where the |
| 7927 | type field is not "Destination Unreachable", "Parameter |
| 7928 | Problem",, or "Packet Too Big". |
| 7929 | |
| 7930 | ICMP3) An implementation MAY ignore any ICMPv4 messages where the |
| 7931 | code does not indicate "Protocol Unreachable" or |
| 7932 | "Fragmentation Needed". |
| 7933 | |
| 7934 | ICMP4) An implementation MAY ignore all ICMPv6 messages of type |
| 7935 | "Parameter Problem" if the code is not "Unrecognized Next |
| 7936 | Header Type Encountered". |
| 7937 | |
| 7938 | ICMP5) An implementation MUST use the payload of the ICMP message (v4 |
| 7939 | or v6) to locate the association that sent the message to |
| 7940 | which ICMP is responding. If the association cannot be found, |
| 7941 | an implementation SHOULD ignore the ICMP message. |
| 7942 | |
| 7943 | ICMP6) An implementation MUST validate that the Verification Tag |
| 7944 | contained in the ICMP message matches the Verification Tag of |
| 7945 | the peer. If the Verification Tag is not 0 and does NOT |
| 7946 | match, discard the ICMP message. If it is 0 and the ICMP |
| 7947 | message contains enough bytes to verify that the chunk type is |
| 7948 | an INIT chunk and that the Initiate Tag matches the tag of the |
| 7949 | |
| 7950 | |
| 7951 | |
| 7952 | |
| 7953 | |
| 7954 | Stewart Standards Track [Page 142] |
| 7955 | |
| 7956 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 7957 | |
| 7958 | |
| 7959 | peer, continue with ICMP7. If the ICMP message is too short |
| 7960 | or the chunk type or the Initiate Tag does not match, silently |
| 7961 | discard the packet. |
| 7962 | |
| 7963 | ICMP7) If the ICMP message is either a v6 "Packet Too Big" or a v4 |
| 7964 | "Fragmentation Needed", an implementation MAY process this |
| 7965 | information as defined for PATH MTU discovery. |
| 7966 | |
| 7967 | ICMP8) If the ICMP code is an "Unrecognized Next Header Type |
| 7968 | Encountered" or a "Protocol Unreachable", an implementation |
| 7969 | MUST treat this message as an abort with the T bit set if it |
| 7970 | does not contain an INIT chunk. If it does contain an INIT |
| 7971 | chunk and the association is in the COOKIE-WAIT state, handle |
| 7972 | the ICMP message like an ABORT. |
| 7973 | |
| 7974 | ICMP9) If the ICMPv6 code is "Destination Unreachable", the |
| 7975 | implementation MAY mark the destination into the unreachable |
| 7976 | state or alternatively increment the path error counter. |
| 7977 | |
| 7978 | Note that these procedures differ from [RFC1122] and from its |
| 7979 | requirements for processing of port-unreachable messages and the |
| 7980 | requirements that an implementation MUST abort associations in |
| 7981 | response to a "protocol unreachable" message. Port-unreachable |
| 7982 | messages are not processed, since an implementation will send an |
| 7983 | ABORT, not a port unreachable. The stricter handling of the |
| 7984 | "protocol unreachable" message is due to security concerns for hosts |
| 7985 | that do NOT support SCTP. |
| 7986 | |
| 7987 | The following non-normative sample code is taken from an open-source |
| 7988 | CRC generator [WILLIAMS93], using the "mirroring" technique and |
| 7989 | yielding a lookup table for SCTP CRC32c with 256 entries, each 32 |
| 7990 | bits wide. While neither especially slow nor especially fast, as |
| 7991 | software table-lookup CRCs go, it has the advantage of working on |
| 7992 | both big-endian and little-endian CPUs, using the same (host-order) |
| 7993 | lookup tables, and using only the predefined ntohl() and htonl() |
| 7994 | operations. The code is somewhat modified from [WILLIAMS93], to |
| 7995 | ensure portability between big-endian and little-endian |
| 7996 | architectures. (Note that if the byte endian-ness of the target |
| 7997 | architecture is known to be little-endian, the final bit-reversal and |
| 7998 | byte-reversal steps can be folded into a single operation.) |
| 7999 | |
| 8000 | /*************************************************************/ |
| 8001 | /* Note Definition for Ross Williams table generator would */ |
| 8002 | /* be: TB_WIDTH=4, TB_POLLY=0x1EDC6F41, TB_REVER=TRUE */ |
| 8003 | /* For Mr. Williams direct calculation code use the settings */ |
| 8004 | /* cm_width=32, cm_poly=0x1EDC6F41, cm_init=0xFFFFFFFF, */ |
| 8005 | /* cm_refin=TRUE, cm_refot=TRUE, cm_xorort=0x00000000 */ |
| 8006 | /*************************************************************/ |
| 8007 | |
| 8008 | |
| 8009 | |
| 8010 | Stewart Standards Track [Page 143] |
| 8011 | |
| 8012 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8013 | |
| 8014 | |
| 8015 | /* Example of the crc table file */ |
| 8016 | #ifndef __crc32cr_table_h__ |
| 8017 | #define __crc32cr_table_h__ |
| 8018 | |
| 8019 | #define CRC32C_POLY 0x1EDC6F41 |
| 8020 | #define CRC32C(c,d) (c=(c>>8)^crc_c[(c^(d))&0xFF]) |
| 8021 | |
| 8022 | unsigned long crc_c[256] = |
| 8023 | { |
| 8024 | 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, |
| 8025 | 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, |
| 8026 | 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, |
| 8027 | 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, |
| 8028 | 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, |
| 8029 | 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, |
| 8030 | 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, |
| 8031 | 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, |
| 8032 | 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, |
| 8033 | 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, |
| 8034 | 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, |
| 8035 | 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, |
| 8036 | 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, |
| 8037 | |
| 8038 | 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, |
| 8039 | 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, |
| 8040 | 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, |
| 8041 | 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, |
| 8042 | 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, |
| 8043 | 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, |
| 8044 | 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, |
| 8045 | 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, |
| 8046 | 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, |
| 8047 | 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, |
| 8048 | 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, |
| 8049 | 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, |
| 8050 | 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, |
| 8051 | 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, |
| 8052 | 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, |
| 8053 | 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, |
| 8054 | 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, |
| 8055 | 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, |
| 8056 | 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, |
| 8057 | 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, |
| 8058 | 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, |
| 8059 | 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, |
| 8060 | 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, |
| 8061 | 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, |
| 8062 | 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, |
| 8063 | |
| 8064 | |
| 8065 | |
| 8066 | Stewart Standards Track [Page 144] |
| 8067 | |
| 8068 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8069 | |
| 8070 | |
| 8071 | 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, |
| 8072 | 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, |
| 8073 | 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, |
| 8074 | 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, |
| 8075 | 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, |
| 8076 | 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, |
| 8077 | 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, |
| 8078 | 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, |
| 8079 | 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, |
| 8080 | 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, |
| 8081 | 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, |
| 8082 | 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, |
| 8083 | 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, |
| 8084 | 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, |
| 8085 | 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, |
| 8086 | 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, |
| 8087 | 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, |
| 8088 | 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, |
| 8089 | 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, |
| 8090 | 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, |
| 8091 | 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, |
| 8092 | 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, |
| 8093 | 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, |
| 8094 | |
| 8095 | 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, |
| 8096 | 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, |
| 8097 | 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L, |
| 8098 | }; |
| 8099 | |
| 8100 | #endif |
| 8101 | |
| 8102 | /* Example of table build routine */ |
| 8103 | |
| 8104 | #include <stdio.h> |
| 8105 | #include <stdlib.h> |
| 8106 | |
| 8107 | #define OUTPUT_FILE "crc32cr.h" |
| 8108 | #define CRC32C_POLY 0x1EDC6F41L |
| 8109 | FILE *tf; |
| 8110 | unsigned long |
| 8111 | reflect_32 (unsigned long b) |
| 8112 | { |
| 8113 | int i; |
| 8114 | unsigned long rw = 0L; |
| 8115 | |
| 8116 | for (i = 0; i < 32; i++){ |
| 8117 | if (b & 1) |
| 8118 | rw |= 1 << (31 - i); |
| 8119 | |
| 8120 | |
| 8121 | |
| 8122 | Stewart Standards Track [Page 145] |
| 8123 | |
| 8124 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8125 | |
| 8126 | |
| 8127 | b >>= 1; |
| 8128 | } |
| 8129 | return (rw); |
| 8130 | } |
| 8131 | |
| 8132 | unsigned long |
| 8133 | build_crc_table (int index) |
| 8134 | { |
| 8135 | int i; |
| 8136 | unsigned long rb; |
| 8137 | |
| 8138 | rb = reflect_32 (index); |
| 8139 | |
| 8140 | for (i = 0; i < 8; i++){ |
| 8141 | if (rb & 0x80000000L) |
| 8142 | rb = (rb << 1) ^ CRC32C_POLY; |
| 8143 | else |
| 8144 | rb <<= 1; |
| 8145 | } |
| 8146 | return (reflect_32 (rb)); |
| 8147 | } |
| 8148 | |
| 8149 | main () |
| 8150 | { |
| 8151 | int i; |
| 8152 | |
| 8153 | printf ("\nGenerating CRC-32c table file <%s>\n", |
| 8154 | OUTPUT_FILE); |
| 8155 | if ((tf = fopen (OUTPUT_FILE, "w")) == NULL){ |
| 8156 | printf ("Unable to open %s\n", OUTPUT_FILE); |
| 8157 | exit (1); |
| 8158 | } |
| 8159 | fprintf (tf, "#ifndef __crc32cr_table_h__\n"); |
| 8160 | fprintf (tf, "#define __crc32cr_table_h__\n\n"); |
| 8161 | fprintf (tf, "#define CRC32C_POLY 0x%08lX\n", |
| 8162 | CRC32C_POLY); |
| 8163 | fprintf (tf, |
| 8164 | "#define CRC32C(c,d) (c=(c>>8)^crc_c[(c^(d))&0xFF])\n"); |
| 8165 | fprintf (tf, "\nunsigned long crc_c[256] =\n{\n"); |
| 8166 | for (i = 0; i < 256; i++){ |
| 8167 | fprintf (tf, "0x%08lXL, ", build_crc_table (i)); |
| 8168 | if ((i & 3) == 3) |
| 8169 | fprintf (tf, "\n"); |
| 8170 | } |
| 8171 | fprintf (tf, "};\n\n#endif\n"); |
| 8172 | |
| 8173 | if (fclose (tf) != 0) |
| 8174 | printf ("Unable to close <%s>." OUTPUT_FILE); |
| 8175 | |
| 8176 | |
| 8177 | |
| 8178 | Stewart Standards Track [Page 146] |
| 8179 | |
| 8180 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8181 | |
| 8182 | |
| 8183 | else |
| 8184 | printf ("\nThe CRC-32c table has been written to <%s>.\n", |
| 8185 | OUTPUT_FILE); |
| 8186 | } |
| 8187 | |
| 8188 | /* Example of crc insertion */ |
| 8189 | |
| 8190 | #include "crc32cr.h" |
| 8191 | |
| 8192 | unsigned long |
| 8193 | generate_crc32c(unsigned char *buffer, unsigned int length) |
| 8194 | { |
| 8195 | unsigned int i; |
| 8196 | unsigned long crc32 = ~0L; |
| 8197 | unsigned long result; |
| 8198 | unsigned char byte0,byte1,byte2,byte3; |
| 8199 | |
| 8200 | for (i = 0; i < length; i++){ |
| 8201 | CRC32C(crc32, buffer[i]); |
| 8202 | } |
| 8203 | |
| 8204 | result = ~crc32; |
| 8205 | |
| 8206 | /* result now holds the negated polynomial remainder; |
| 8207 | * since the table and algorithm is "reflected" [williams95]. |
| 8208 | * That is, result has the same value as if we mapped the message |
| 8209 | * to a polynomial, computed the host-bit-order polynomial |
| 8210 | * remainder, performed final negation, then did an end-for-end |
| 8211 | * bit-reversal. |
| 8212 | * Note that a 32-bit bit-reversal is identical to four inplace |
| 8213 | * 8-bit reversals followed by an end-for-end byteswap. |
| 8214 | * In other words, the bytes of each bit are in the right order, |
| 8215 | * but the bytes have been byteswapped. So we now do an explicit |
| 8216 | * byteswap. On a little-endian machine, this byteswap and |
| 8217 | * the final ntohl cancel out and could be elided. |
| 8218 | */ |
| 8219 | |
| 8220 | byte0 = result & 0xff; |
| 8221 | byte1 = (result>>8) & 0xff; |
| 8222 | byte2 = (result>>16) & 0xff; |
| 8223 | byte3 = (result>>24) & 0xff; |
| 8224 | crc32 = ((byte0 << 24) | |
| 8225 | (byte1 << 16) | |
| 8226 | (byte2 << 8) | |
| 8227 | byte3); |
| 8228 | return ( crc32 ); |
| 8229 | } |
| 8230 | |
| 8231 | |
| 8232 | |
| 8233 | |
| 8234 | Stewart Standards Track [Page 147] |
| 8235 | |
| 8236 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8237 | |
| 8238 | |
| 8239 | int |
| 8240 | insert_crc32(unsigned char *buffer, unsigned int length) |
| 8241 | { |
| 8242 | SCTP_message *message; |
| 8243 | unsigned long crc32; |
| 8244 | message = (SCTP_message *) buffer; |
| 8245 | message->common_header.checksum = 0L; |
| 8246 | crc32 = generate_crc32c(buffer,length); |
| 8247 | /* and insert it into the message */ |
| 8248 | message->common_header.checksum = htonl(crc32); |
| 8249 | return 1; |
| 8250 | } |
| 8251 | |
| 8252 | int |
| 8253 | validate_crc32(unsigned char *buffer, unsigned int length) |
| 8254 | { |
| 8255 | SCTP_message *message; |
| 8256 | unsigned int i; |
| 8257 | unsigned long original_crc32; |
| 8258 | unsigned long crc32 = ~0L; |
| 8259 | |
| 8260 | /* save and zero checksum */ |
| 8261 | message = (SCTP_message *) buffer; |
| 8262 | original_crc32 = ntohl(message->common_header.checksum); |
| 8263 | message->common_header.checksum = 0L; |
| 8264 | crc32 = generate_crc32c(buffer,length); |
| 8265 | return ((original_crc32 == crc32)? 1 : -1); |
| 8266 | } |
| 8267 | |
| 8268 | |
| 8269 | |
| 8270 | |
| 8271 | |
| 8272 | |
| 8273 | |
| 8274 | |
| 8275 | |
| 8276 | |
| 8277 | |
| 8278 | |
| 8279 | |
| 8280 | |
| 8281 | |
| 8282 | |
| 8283 | |
| 8284 | |
| 8285 | |
| 8286 | |
| 8287 | |
| 8288 | |
| 8289 | |
| 8290 | Stewart Standards Track [Page 148] |
| 8291 | |
| 8292 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8293 | |
| 8294 | |
| 8295 | References |
| 8296 | |
| 8297 | Normative References |
| 8298 | |
| 8299 | [ITU32] "ITU-T Recommendation V.42, "Error-correcting procedures |
| 8300 | for DCEs using asynchronous-to-synchronous |
| 8301 | conversion".", ITU-T section 8.1.1.6.2. |
| 8302 | |
| 8303 | [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, |
| 8304 | August 1980. |
| 8305 | |
| 8306 | [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC |
| 8307 | 793, September 1981. |
| 8308 | |
| 8309 | [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - |
| 8310 | Communication Layers", STD 3, RFC 1122, October 1989. |
| 8311 | |
| 8312 | [RFC1123] Braden, R., Ed., "Requirements for Internet Hosts - |
| 8313 | Application and Support", STD 3, RFC 1123, October 1989. |
| 8314 | |
| 8315 | [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC |
| 8316 | 1191, November 1990. |
| 8317 | |
| 8318 | [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU |
| 8319 | Discovery for IP version 6", RFC 1981, August 1996. |
| 8320 | |
| 8321 | [RFC1982] Elz, R. and R. Bush, "Serial Number Arithmetic", RFC |
| 8322 | 1982, August 1996. |
| 8323 | |
| 8324 | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate |
| 8325 | Requirement Levels", BCP 14, RFC 2119, March 1997. |
| 8326 | |
| 8327 | [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an |
| 8328 | IANA Considerations Section in RFCs", BCP 26, RFC 2434, |
| 8329 | October 1998. |
| 8330 | |
| 8331 | [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 |
| 8332 | (IPv6) Specification", RFC 2460, December 1998. |
| 8333 | |
| 8334 | [RFC2581] Allman, M., Paxson, V., and W. Stevens, "TCP Congestion |
| 8335 | Control", RFC 2581, April 1999. |
| 8336 | |
| 8337 | [RFC3873] Pastor, J. and M. Belinchon, "Stream Control |
| 8338 | Transmission Protocol (SCTP) Management Information Base |
| 8339 | (MIB)", RFC 3873, September 2004. |
| 8340 | |
| 8341 | [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing |
| 8342 | Architecture", RFC 4291, February 2006. |
| 8343 | |
| 8344 | |
| 8345 | |
| 8346 | Stewart Standards Track [Page 149] |
| 8347 | |
| 8348 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8349 | |
| 8350 | |
| 8351 | [RFC4301] Kent, S. and K. Seo, "Security Architecture for the |
| 8352 | Internet Protocol", RFC 4301, December 2005. |
| 8353 | |
| 8354 | [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC |
| 8355 | 4303, December 2005. |
| 8356 | |
| 8357 | [RFC4306] Kaufman, C., Ed., "Internet Key Exchange (IKEv2) |
| 8358 | Protocol", RFC 4306, December 2005. |
| 8359 | |
| 8360 | [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU |
| 8361 | Discovery", RFC 4821, March 2007. |
| 8362 | |
| 8363 | Informative References |
| 8364 | |
| 8365 | [FALL96] Fall, K. and S. Floyd, "Simulation-based Comparisons of |
| 8366 | Tahoe, Reno, and SACK TCP", SIGCOMM'99 V. 26 N. 3 pp 5- |
| 8367 | 21, July 1996. |
| 8368 | |
| 8369 | [SAVAGE99] Savage, S., Cardwell, N., Wetherall, D., and T. |
| 8370 | Anderson, "TCP Congestion Control with a Misbehaving |
| 8371 | Receiver", ACM Computer Communications Review 29(5), |
| 8372 | October 1999. |
| 8373 | |
| 8374 | [ALLMAN99] Allman, M. and V. Paxson, "On Estimating End-to-End |
| 8375 | Network Path Properties", SIGCOMM'99 , 1999. |
| 8376 | |
| 8377 | [WILLIAMS93] Williams, R., "A PAINLESS GUIDE TO CRC ERROR DETECTION |
| 8378 | ALGORITHMS", Internet publication, |
| 8379 | http://www.geocities.com/SiliconValley/Pines/ |
| 8380 | 8659/crc.htm, August 1993. |
| 8381 | |
| 8382 | [RFC0813] Clark, D., "Window and Acknowledgement Strategy in TCP", |
| 8383 | RFC 813, July 1982. |
| 8384 | |
| 8385 | [RFC1858] Ziemba, G., Reed, D., and P. Traina, "Security |
| 8386 | Considerations for IP Fragment Filtering", RFC 1858, |
| 8387 | October 1995. |
| 8388 | |
| 8389 | [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: |
| 8390 | Keyed-Hashing for Message Authentication", RFC 2104, |
| 8391 | February 1997. |
| 8392 | |
| 8393 | [RFC2196] Fraser, B., "Site Security Handbook", FYI 8, RFC 2196, |
| 8394 | September 1997. |
| 8395 | |
| 8396 | [RFC2522] Karn, P. and W. Simpson, "Photuris: Session-Key |
| 8397 | Management Protocol", RFC 2522, March 1999. |
| 8398 | |
| 8399 | |
| 8400 | |
| 8401 | |
| 8402 | Stewart Standards Track [Page 150] |
| 8403 | |
| 8404 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8405 | |
| 8406 | |
| 8407 | [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C., |
| 8408 | Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M., |
| 8409 | Zhang, L., and V. Paxson, "Stream Control Transmission |
| 8410 | Protocol", RFC 2960, October 2000. |
| 8411 | |
| 8412 | [RFC3309] Stone, J., Stewart, R., and D. Otis, "Stream Control |
| 8413 | Transmission Protocol (SCTP) Checksum Change", RFC 3309, |
| 8414 | September 2002. |
| 8415 | |
| 8416 | [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition |
| 8417 | of Explicit Congestion Notification (ECN) to IP", RFC |
| 8418 | 3168, September 2001. |
| 8419 | |
| 8420 | [RFC4086] Eastlake, D., 3rd, Schiller, J., and S. Crocker, |
| 8421 | "Randomness Requirements for Security", BCP 106, RFC |
| 8422 | 4086, June 2005. |
| 8423 | |
| 8424 | [RFC4460] Stewart, R., Arias-Rodriguez, I., Poon, K., Caro, A., |
| 8425 | and M. Tuexen, "Stream Control Transmission Protocol |
| 8426 | (SCTP) Specification Errata and Issues", RFC 4460, April |
| 8427 | 2006. |
| 8428 | |
| 8429 | [RFC4895] Tuexen, M., Stewart, R., Lei, P., and E. Rescorla, |
| 8430 | "Authenticated Chunks for Stream Control Transmission |
| 8431 | Protocol (SCTP)", RFC 4895, August 2007. |
| 8432 | |
| 8433 | Editor's Address |
| 8434 | |
| 8435 | Randall R. Stewart |
| 8436 | 4875 Forest Drive |
| 8437 | Suite 200 |
| 8438 | Columbia, SC 29206 |
| 8439 | US |
| 8440 | |
| 8441 | EMail: rrs@cisco.com |
| 8442 | |
| 8443 | |
| 8444 | |
| 8445 | |
| 8446 | |
| 8447 | |
| 8448 | |
| 8449 | |
| 8450 | |
| 8451 | |
| 8452 | |
| 8453 | |
| 8454 | |
| 8455 | |
| 8456 | |
| 8457 | |
| 8458 | Stewart Standards Track [Page 151] |
| 8459 | |
| 8460 | RFC 4960 Stream Control Transmission Protocol September 2007 |
| 8461 | |
| 8462 | |
| 8463 | Full Copyright Statement |
| 8464 | |
| 8465 | Copyright (C) The IETF Trust (2007). |
| 8466 | |
| 8467 | This document is subject to the rights, licenses and restrictions |
| 8468 | contained in BCP 78, and except as set forth therein, the authors |
| 8469 | retain all their rights. |
| 8470 | |
| 8471 | This document and the information contained herein are provided on an |
| 8472 | "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS |
| 8473 | OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND |
| 8474 | THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS |
| 8475 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF |
| 8476 | THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED |
| 8477 | WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8478 | |
| 8479 | Intellectual Property |
| 8480 | |
| 8481 | The IETF takes no position regarding the validity or scope of any |
| 8482 | Intellectual Property Rights or other rights that might be claimed to |
| 8483 | pertain to the implementation or use of the technology described in |
| 8484 | this document or the extent to which any license under such rights |
| 8485 | might or might not be available; nor does it represent that it has |
| 8486 | made any independent effort to identify any such rights. Information |
| 8487 | on the procedures with respect to rights in RFC documents can be |
| 8488 | found in BCP 78 and BCP 79. |
| 8489 | |
| 8490 | Copies of IPR disclosures made to the IETF Secretariat and any |
| 8491 | assurances of licenses to be made available, or the result of an |
| 8492 | attempt made to obtain a general license or permission for the use of |
| 8493 | such proprietary rights by implementers or users of this |
| 8494 | specification can be obtained from the IETF on-line IPR repository at |
| 8495 | http://www.ietf.org/ipr. |
| 8496 | |
| 8497 | The IETF invites any interested party to bring to its attention any |
| 8498 | copyrights, patents or patent applications, or other proprietary |
| 8499 | rights that may cover technology that may be required to implement |
| 8500 | this standard. Please address the information to the IETF at |
| 8501 | ietf-ipr@ietf.org. |
| 8502 | |
| 8503 | |
| 8504 | |
| 8505 | |
| 8506 | |
| 8507 | |
| 8508 | |
| 8509 | |
| 8510 | |
| 8511 | |
| 8512 | |
| 8513 | |
| 8514 | Stewart Standards Track [Page 152] |
| 8515 | |