draft-ietf-sigtran-sctp-13.txt   rfc2960.txt 
Network Working Group R. R. Stewart
INTERNET-DRAFT Q. Xie
Motorola
K. Morneault
C. Sharp
Cisco
H. J. Schwarzbauer
Siemens
T. Taylor
Nortel Networks
I. Rytina
Ericsson
M. Kalla
Telcordia
L. Zhang
UCLA
V. Paxson
ACIRI
expires in six months July 11,2000 Network Working Group R. Stewart
Request for Comments: 2960 Q. Xie
Category: Standards Track Motorola
K. Morneault
C. Sharp
Cisco
H. Schwarzbauer
Siemens
T. Taylor
Nortel Networks
I. Rytina
Ericsson
M. Kalla
Telcordia
L. Zhang
UCLA
V. Paxson
ACIRI
October 2000
Stream Control Transmission Protocol Stream Control Transmission Protocol
<draft-ietf-sigtran-sctp-13.txt>
Status of This Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with all This document specifies an Internet standards track protocol for the
provisions of Section 10 of [RFC2026]. Internet-Drafts are working Internet community, and requests discussion and suggestions for
documents of the Internet Engineering Task Force (IETF), its areas, improvements. Please refer to the current edition of the "Internet
and its working groups. Note that other groups may also distribute Official Protocol Standards" (STD 1) for the standardization state
working documents as Internet-Drafts. and status of this protocol. Distribution of this memo is unlimited.
The list of current Internet-Drafts can be accessed at Copyright Notice
http://www.ietf.org/ietf/1id-abstracts.txt
The list of Internet-Draft Shadow Directories can be accessed at Copyright (C) The Internet Society (2000). All Rights Reserved.
http://www.ietf.org/shadow.html.
Abstract Abstract
This document describes the Stream Control Transmission Protocol This document describes the Stream Control Transmission Protocol
(SCTP). SCTP is designed to transport PSTN signaling messages over (SCTP). SCTP is designed to transport PSTN signaling messages over
IP networks, but is capable of broader applications. IP networks, but is capable of broader applications.
SCTP is a reliable transport protocol operating on top of a SCTP is a reliable transport protocol operating on top of a
connectionless packet network such as IP. It offers the following connectionless packet network such as IP. It offers the following
services to its users: services to its users:
-- acknowledged error-free non-duplicated transfer of user data, -- acknowledged error-free non-duplicated transfer of user data,
-- data fragmentation to conform to discovered path MTU size, -- data fragmentation to conform to discovered path MTU size,
-- sequenced delivery of user messages within multiple streams, -- sequenced delivery of user messages within multiple streams,
with an option for order-of-arrival delivery of individual with an option for order-of-arrival delivery of individual user
user messages, messages,
-- optional bundling of multiple user messages into a single SCTP -- optional bundling of multiple user messages into a single SCTP
packet, and packet, and
-- network-level fault tolerance through supporting of multi-homing -- network-level fault tolerance through supporting of multi-
at either or both ends of an association. homing at either or both ends of an association.
The design of SCTP includes appropriate congestion avoidance behavior The design of SCTP includes appropriate congestion avoidance behavior
and resistance to flooding and masquerade attacks. and resistance to flooding and masquerade attacks.
TABLE OF CONTENTS Table of Contents
1. Introduction.................................................. 5 1. Introduction.................................................. 5
1.1 Motivation.................................................. 5 1.1 Motivation.................................................. 6
1.2 Architectural View of SCTP.................................. 5 1.2 Architectural View of SCTP.................................. 6
1.3 Functional View of SCTP..................................... 6 1.3 Functional View of SCTP..................................... 7
1.3.1 Association Startup and Takedown........................ 7 1.3.1 Association Startup and Takedown........................ 8
1.3.2 Sequenced Delivery within Streams....................... 7 1.3.2 Sequenced Delivery within Streams....................... 9
1.3.3 User Data Fragmentation................................. 8 1.3.3 User Data Fragmentation................................. 9
1.3.4 Acknowledgement and Congestion Avoidance................ 8 1.3.4 Acknowledgement and Congestion Avoidance................ 9
1.3.5 Chunk Bundling ......................................... 8 1.3.5 Chunk Bundling ......................................... 10
1.3.6 Packet Validation....................................... 8 1.3.6 Packet Validation....................................... 10
1.3.7 Path Management......................................... 9 1.3.7 Path Management......................................... 11
1.4 Key Terms................................................... 9 1.4 Key Terms................................................... 11
1.5 Abbreviations............................................... 12 1.5 Abbreviations............................................... 15
1.6 Serial Number Arithmetic.................................... 13 1.6 Serial Number Arithmetic.................................... 15
2. Conventions.................................................... 13 2. Conventions.................................................... 16
3. SCTP packet Format............................................ 13 3. SCTP packet Format............................................ 16
3.1 SCTP Common Header Field Descriptions....................... 14 3.1 SCTP Common Header Field Descriptions....................... 17
3.2 Chunk Field Descriptions.................................... 15 3.2 Chunk Field Descriptions.................................... 18
3.2.1 Optional/Variable-length Parameter Format............... 17 3.2.1 Optional/Variable-length Parameter Format............... 20
3.3 SCTP Chunk Definitions...................................... 18 3.3 SCTP Chunk Definitions...................................... 21
3.3.1 Payload Data (DATA)..................................... 18 3.3.1 Payload Data (DATA)..................................... 22
3.3.2 Initiation (INIT)....................................... 20 3.3.2 Initiation (INIT)....................................... 24
3.3.2.1 Optional or Variable Length Parameters.............. 23 3.3.2.1 Optional or Variable Length Parameters.............. 26
3.3.3 Initiation Acknowledgement (INIT ACK)................... 25 3.3.3 Initiation Acknowledgement (INIT ACK)................... 30
3.3.3.1 Optional or Variable Length Parameters.............. 28 3.3.3.1 Optional or Variable Length Parameters.............. 33
3.3.4 Selective Acknowledgement (SACK)........................ 33
3.3.5 Heartbeat Request (HEARTBEAT)........................... 37
3.3.6 Heartbeat Acknowledgement (HEARTBEAT ACK)............... 38
3.3.7 Abort Association (ABORT)............................... 39
3.3.8 Shutdown Association (SHUTDOWN)......................... 40
3.3.9 Shutdown Acknowledgement (SHUTDOWN ACK)................. 40
3.3.10 Operation Error (ERROR)................................ 41
3.3.10.1 Invalid Stream Identifier.......................... 42
3.3.10.2 Missing Mandatory Parameter........................ 43
3.3.10.3 Stale Cookie Error................................. 43
3.3.10.4 Out of Resource.................................... 44
3.3.10.5 Unresolvable Address............................... 44
3.3.10.6 Unrecognized Chunk Type............................ 44
3.3.10.7 Invalid Mandatory Parameter........................ 45
3.3.10.8 Unrecognized Parameters............................ 45
3.3.10.9 No User Data....................................... 46
3.3.10.10 Cookie Received While Shutting Down............... 46
3.3.11 Cookie Echo (COOKIE ECHO).............................. 46
3.3.12 Cookie Acknowledgement (COOKIE ACK).................... 47
3.3.13 Shutdown Complete (SHUTDOWN COMPLETE).................. 48
4. SCTP Association State Diagram................................. 48
5. Association Initialization..................................... 52
5.1 Normal Establishment of an Association...................... 52
5.1.1 Handle Stream Parameters................................ 54
5.1.2 Handle Address Parameters............................... 54
5.1.3 Generating State Cookie................................. 56
5.1.4 State Cookie Processing................................. 57
5.1.5 State Cookie Authentication............................. 57
5.1.6 An Example of Normal Association Establishment.......... 58
5.2 Handle Duplicate or unexpected INIT, INIT ACK, COOKIE ECHO,
and COOKIE ACK.............................................. 60
5.2.1 Handle Duplicate INIT in COOKIE-WAIT
or COOKIE-ECHOED States................................. 60
5.2.2 Unexpected INIT in States Other than CLOSED,
COOKIE-ECHOED, COOKIE-WAIT and SHUTDOWN-ACK-SENT........ 61
5.2.3 Unexpected INIT ACK..................................... 61
5.2.4 Handle a COOKIE ECHO when a TCB exists.................. 62
5.2.4.1 An Example of a Association Restart................. 64
5.2.5 Handle Duplicate COOKIE ACK............................. 66
5.2.6 Handle Stale COOKIE Error............................... 66
5.3 Other Initialization Issues................................. 67
5.3.1 Selection of Tag Value.................................. 67
6. User Data Transfer............................................. 67
6.1 Transmission of DATA Chunks................................. 69
6.2 Acknowledgement on Reception of DATA Chunks................. 70
6.2.1 Tracking Peer's Receive Buffer Space.................... 73
6.3 Management Retransmission Timer............................. 75
6.3.1 RTO Calculation......................................... 75
6.3.2 Retransmission Timer Rules.............................. 76
6.3.3 Handle T3-rtx Expiration................................ 77
6.4 Multi-homed SCTP Endpoints.................................. 78
6.4.1 Failover from Inactive Destination Address.............. 79
6.5 Stream Identifier and Stream Sequence Number................ 80
6.6 Ordered and Unordered Delivery.............................. 80
6.7 Report Gaps in Received DATA TSNs........................... 81
6.8 Adler-32 Checksum Calculation............................... 82
6.9 Fragmentation............................................... 83
6.10 Bundling .................................................. 84
7. Congestion Control .......................................... 85
7.1 SCTP Differences from TCP Congestion Control................ 85
7.2 SCTP Slow-Start and Congestion Avoidance.................... 87
7.2.1 Slow-Start.............................................. 87
7.2.2 Congestion Avoidance.................................... 89
7.2.3 Congestion Control...................................... 89
7.2.4 Fast Retransmit on Gap Reports.......................... 90
7.3 Path MTU Discovery.......................................... 91
8. Fault Management.............................................. 92
8.1 Endpoint Failure Detection.................................. 92
8.2 Path Failure Detection...................................... 92
8.3 Path Heartbeat.............................................. 93
8.4 Handle "Out of the blue" Packets............................ 95
8.5 Verification Tag............................................ 96
8.5.1 Exceptions in Verification Tag Rules.................... 97
9. Termination of Association..................................... 98
9.1 Abort of an Association..................................... 98
9.2 Shutdown of an Association.................................. 98
10. Interface with Upper Layer....................................101
10.1 ULP-to-SCTP................................................101
10.2 SCTP-to-ULP................................................111
11. Security Considerations.......................................114
11.1 Security Objectives........................................114
11.2 SCTP Responses To Potential Threats........................115
11.2.1 Countering Insider Attacks.............................115
11.2.2 Protecting against Data Corruption in the Network......115
11.2.3 Protecting Confidentiality.............................115
11.2.4 Protecting against Blind Denial of Service Attacks.....116
11.2.4.1 Flooding...........................................116
11.2.4.2 Blind Masquerade...................................118
11.2.4.3 Improper Monopolization of Services................118
11.3 Protection against Fraud and Repudiation...................119
12. Recommended Transmission Control Block (TCB) Parameters.......120
12.1 Parameters necessary for the SCTP instance.................120
12.2 Parameters necessary per association (i.e. the TCB)........120
12.3 Per Transport Address Data.................................122
12.4 General Parameters Needed..................................123
13. IANA Considerations...........................................123
13.1 IETF-defined Chunk Extension...............................123
13.2 IETF-defined Chunk Parameter Extension.....................124
13.3 IETF-defined Additional Error Causes.......................124
13.4 Payload Protocol Identifiers...............................125
14. Suggested SCTP Protocol Parameter Values......................125
15. Acknowledgements..............................................126
16. Authors' Addresses............................................126
17. References....................................................128
18. Bibliography..................................................129
Appendix A .......................................................131
Appendix B .......................................................132
Full Copyright Statement .........................................134
3.3.4 Selective Acknowledgement (SACK)........................ 28
3.3.5 Heartbeat Request (HEARTBEAT)........................... 31
3.3.6 Heartbeat Acknowledgement (HEARTBEAT ACK)............... 32
3.3.7 Abort Association (ABORT)............................... 33
3.3.8 Shutdown Association (SHUTDOWN)......................... 34
3.3.9 Shutdown Acknowledgement (SHUTDOWN ACK)................. 34
3.3.10 Operation Error (ERROR)................................ 35
3.3.10.1 Invalid Stream Identifier.......................... 36
3.3.10.2 Missing Mandatory Parameter........................ 36
3.3.10.3 Stale Cookie Error................................. 37
3.3.10.4 Out of Resource.................................... 37
3.3.10.5 Unresolvable Address............................... 37
3.3.10.6 Unrecognized Chunk Type............................ 38
3.3.10.7 Invalid Mandatory Parameter........................ 38
3.3.10.8 Unrecognized Parameters............................ 38
3.3.10.9 No User Data....................................... 39
3.3.10.10 Cookie Received While Shutting Down............... 39
3.3.11 Cookie Echo (COOKIE ECHO).............................. 40
3.3.12 Cookie Acknowledgement (COOKIE ACK).................... 40
3.3.13 Shutdown Complete (SHUTDOWN COMPLETE).................. 41
4. SCTP Association State Diagram................................. 41
5. Association Initialization..................................... 44
5.1 Normal Establishment of an Association...................... 44
5.1.1 Handle Stream Parameters................................ 46
5.1.2 Handle Address Parameters............................... 46
5.1.3 Generating State Cookie................................. 48
5.1.4 State Cookie Processing................................. 49
5.1.5 State Cookie Authentication............................. 49
5.1.6 An Example of Normal Association Establishment.......... 50
5.2 Handle Duplicate or unexpected INIT, INIT ACK, COOKIE ECHO,
and COOKIE ACK.............................................. 51
5.2.1 Handle Duplicate INIT in COOKIE-WAIT
or COOKIE-ECHOED States................................. 52
5.2.2 Unexpected INIT in States Other than CLOSED,
COOKIE-ECHOED and COOKIE-WAIT........................... 52
5.2.3 Unexpected INIT ACK..................................... 52
5.2.4 Handle a COOKIE ECHO when a TCB exists.................. 52
5.2.4.1 An Example of a Association Restart................. 55
5.2.5 Handle Duplicate COOKIE ACK............................. 56
5.2.6 Handle Stale COOKIE Error............................... 56
5.3 Other Initialization Issues................................. 56
5.3.1 Selection of Tag Value.................................. 56
6. User Data Transfer............................................. 57
6.1 Transmission of DATA Chunks................................. 58
6.2 Acknowledgement on Reception of DATA Chunks................. 59
6.2.1 Tracking Peer's Receive Buffer Space.................... 62
6.3 Management Retransmission Timer............................. 63
6.3.1 RTO Calculation......................................... 63
6.3.2 Retransmission Timer Rules.............................. 65
6.3.3 Handle T3-rtx Expiration................................ 65
6.4 Multi-homed SCTP Endpoints.................................. 67
6.4.1 Failover from Inactive Destination Address.............. 67
6.5 Stream Identifier and Stream Sequence Number................ 68
6.6 Ordered and Unordered Delivery.............................. 68
6.7 Report Gaps in Received DATA TSNs........................... 69
6.8 Adler-32 Checksum Calculation............................... 70
6.9 Fragmentation............................................... 70
6.10 Bundling .................................................. 71
7. Congestion Control .......................................... 72
7.1 SCTP Differences from TCP Congestion Control................ 73
7.2 SCTP Slow-Start and Congestion Avoidance.................... 74
7.2.1 Slow-Start.............................................. 74
7.2.2 Congestion Avoidance.................................... 75
7.2.3 Congestion Control...................................... 76
7.2.4 Fast Retransmit on Gap Reports.......................... 76
7.3 Path MTU Discovery.......................................... 77
8. Fault Management.............................................. 78
8.1 Endpoint Failure Detection.................................. 78
8.2 Path Failure Detection...................................... 78
8.3 Path Heartbeat.............................................. 79
8.4 Handle "Out of the blue" Packets............................ 81
8.5 Verification Tag............................................ 82
8.5.1 Exceptions in Verification Tag Rules.................... 82
9. Termination of Association..................................... 83
9.1 Abort of an Association..................................... 83
9.2 Shutdown of an Association.................................. 84
10. Interface with Upper Layer.................................... 86
10.1 ULP-to-SCTP................................................ 86
10.2 SCTP-to-ULP................................................ 95
11. Security Considerations....................................... 98
11.1 Security Objectives........................................ 98
11.2 SCTP Responses To Potential Threats........................ 98
11.2.1 Countering Insider Attacks............................. 98
11.2.2 Protecting against Data Corruption in the Network...... 98
11.2.3 Protecting Confidentiality............................. 99
11.2.4 Protecting against Blind Denial of Service Attacks..... 99
11.2.4.1 Flooding........................................... 99
11.2.4.2 Blind Masquerade...................................100
11.2.4.3 Improper Monopolization of Services................101
11.3 Protection against Fraud and Repudiation...................101
12. Recommended Transmission Control Block (TCB) Parameters.......102
12.1 Parameters necessary for the SCTP instance.................102
12.2 Parameters necessary per association (i.e. the TCB)........103
12.3 Per Transport Address Data.................................104
12.4 General Parameters Needed..................................105
13. IANA Consideration............................................105
13.1 IETF-defined Chunk Extension...............................105
13.2 IETF-defined Additional Error Causes.......................106
13.3 Payload Protocol Identifiers...............................106
14. Suggested SCTP Protocol Parameter Values......................107
15. Acknowledgements..............................................107
16. Authors' Addresses............................................107
17. References....................................................109
18. Bibliography..................................................110
Appendix A .......................................................110
Appendix B .......................................................111
1. Introduction 1. Introduction
This section explains the reasoning behind the development of the This section explains the reasoning behind the development of the
Stream Control Transmission Protocol (SCTP), the services it offers, Stream Control Transmission Protocol (SCTP), the services it offers,
and the basic concepts needed to understand the detailed description and the basic concepts needed to understand the detailed description
of the protocol. of the protocol.
1.1 Motivation 1.1 Motivation
TCP [RFC793] has performed immense service as the primary means of TCP [RFC793] has performed immense service as the primary means of
reliable data transfer in IP networks. However, an increasing number of reliable data transfer in IP networks. However, an increasing number
recent applications have found TCP too limiting, and have incorporated of recent applications have found TCP too limiting, and have
their own reliable data transfer protocol on top of UDP [RFC768]. The incorporated their own reliable data transfer protocol on top of UDP
limitations which users have wished to bypass include the following: [RFC768]. The limitations which users have wished to bypass include
the following:
-- TCP provides both reliable data transfer and strict order- -- TCP provides both reliable data transfer and strict order-of-
of-transmission delivery of data. Some applications need reliable transmission delivery of data. Some applications need reliable
transfer without sequence maintenance, while others would be transfer without sequence maintenance, while others would be
satisfied with partial ordering of the data. In both of these satisfied with partial ordering of the data. In both of these
cases the head-of-line blocking offered by TCP causes cases the head-of-line blocking offered by TCP causes unnecessary
unnecessary delay. delay.
-- The stream-oriented nature of TCP is often an inconvenience. -- The stream-oriented nature of TCP is often an inconvenience.
Applications must add their own record marking to delineate Applications must add their own record marking to delineate their
their messages, and must make explicit use of the push facility messages, and must make explicit use of the push facility to
to ensure that a complete message is transferred in a ensure that a complete message is transferred in a reasonable
reasonable time. time.
-- The limited scope of TCP sockets complicates the task of -- The limited scope of TCP sockets complicates the task of
providing highly-available data transfer capability using providing highly-available data transfer capability using multi-
multi-homed hosts. homed hosts.
-- TCP is relatively vulnerable to denial of service attacks, -- TCP is relatively vulnerable to denial of service attacks, such
such as SYN attacks. as SYN attacks.
Transport of PSTN signaling across the IP network is an application Transport of PSTN signaling across the IP network is an application
for which all of these limitations of TCP are relevant. While this for which all of these limitations of TCP are relevant. While this
application directly motivated the development of SCTP, other application directly motivated the development of SCTP, other
applications may find SCTP a good match to their requirements. applications may find SCTP a good match to their requirements.
1.2 Architectural View of SCTP 1.2 Architectural View of SCTP
SCTP is viewed as a layer between the SCTP user application ("SCTP SCTP is viewed as a layer between the SCTP user application ("SCTP
user" for short) and a connectionless packet network service such user" for short) and a connectionless packet network service such as
as IP. The remainder of this document assumes SCTP runs on top of IP. IP. The remainder of this document assumes SCTP runs on top of IP.
The basic service offered by SCTP is the reliable transfer of The basic service offered by SCTP is the reliable transfer of user
user messages between peer SCTP users. It performs this service messages between peer SCTP users. It performs this service within
within the context of an association between two SCTP endpoints. the context of an association between two SCTP endpoints. Section 10
Section 10 of this document sketches the API which should exist at the of this document sketches the API which should exist at the boundary
boundary between the SCTP and the SCTP user layers. between the SCTP and the SCTP user layers.
SCTP is connection-oriented in nature, but the SCTP association is a SCTP is connection-oriented in nature, but the SCTP association is a
broader concept than the TCP connection. SCTP provides the means for broader concept than the TCP connection. SCTP provides the means for
each SCTP endpoint (Section 1.4) to provide the other endpoint (during each SCTP endpoint (Section 1.4) to provide the other endpoint
association startup) with a list of transport addresses (i.e., multiple (during association startup) with a list of transport addresses
IP addresses in combination with an SCTP port) through which that (i.e., multiple IP addresses in combination with an SCTP port)
endpoint can be reached and from which it will originate SCTP packets. through which that endpoint can be reached and from which it will
The association spans transfers over all of the possible originate SCTP packets. The association spans transfers over all of
source/destination combinations which may be generated from each the possible source/destination combinations which may be generated
endpoint's lists. from each endpoint's lists.
_____________ _____________ _____________ _____________
| SCTP User | | SCTP User | | SCTP User | | SCTP User |
| Application | | Application | | Application | | Application |
|-------------| |-------------| |-------------| |-------------|
| SCTP | | SCTP | | SCTP | | SCTP |
| Transport | | Transport | | Transport | | Transport |
| Service | | Service | | Service | | Service |
|-------------| |-------------| |-------------| |-------------|
| |One or more ---- One or more| | | |One or more ---- One or more| |
| IP Network |IP address \/ IP address| IP Network | | IP Network |IP address \/ IP address| IP Network |
| Service |appearances /\ appearances| Service | | Service |appearances /\ appearances| Service |
|_____________| ---- |_____________| |_____________| ---- |_____________|
SCTP Node A |<-------- Network transport ------->| SCTP Node B SCTP Node A |<-------- Network transport ------->| SCTP Node B
Figure 1: An SCTP Association Figure 1: An SCTP Association
1.3 Functional View of SCTP 1.3 Functional View of SCTP
The SCTP transport service can be decomposed into a number of The SCTP transport service can be decomposed into a number of
functions. These are depicted in Figure 2 and explained in the functions. These are depicted in Figure 2 and explained in the
remainder of this section. remainder of this section.
SCTP User Application SCTP User Application
..----------------------------------------------------- -----------------------------------------------------
.. _____________ ____________________ _____________ ____________________
| | | Sequenced delivery | | | | Sequenced delivery |
| Association | | within streams | | Association | | within streams |
| | |____________________| | | |____________________|
| startup | | startup |
..| | ____________________________ | | ____________________________
| and | | User Data Fragmentation | | and | | User Data Fragmentation |
| | |____________________________| | | |____________________________|
| takedown | | takedown |
..| | ____________________________ | | ____________________________
| | | Acknowledgement | | | | Acknowledgement |
| | | and | | | | and |
| | | Congestion Avoidance | | | | Congestion Avoidance |
..| | |____________________________| | | |____________________________|
| | | |
| | ____________________________ | | ____________________________
| | | Chunk Bundling | | | | Chunk Bundling |
| | |____________________________| | | |____________________________|
| | | |
| | ________________________________ | | ________________________________
| | | Packet Validation | | | | Packet Validation |
| | |________________________________| | | |________________________________|
| | | |
| | ________________________________ | | ________________________________
| | | Path Management | | | | Path Management |
|______________ |________________________________| |_____________| |________________________________|
Figure 2: Functional View of the SCTP Transport Service Figure 2: Functional View of the SCTP Transport Service
1.3.1 Association Startup and Takedown 1.3.1 Association Startup and Takedown
An association is initiated by a request from the SCTP user (see the An association is initiated by a request from the SCTP user (see the
description of the ASSOCIATE (or SEND) primitive in Section 10). description of the ASSOCIATE (or SEND) primitive in Section 10).
A cookie mechanism, similar to one described by Karn and Simpson in
[RFC2522], is employed during the initialization to provide protection
against security attacks. The cookie mechanism uses a four-way
handshake, the last two legs of which are allowed to carry user
data for fast setup. The startup sequence is described in Section 5 of
this document.
SCTP provides for graceful close (i.e., shutdown) of an active A cookie mechanism, similar to one described by Karn and Simpson in
association on request from the SCTP user. See the description of the [RFC2522], is employed during the initialization to provide
SHUTDOWN primitive in Section 10. SCTP also allows ungraceful close protection against security attacks. The cookie mechanism uses a
(i.e., abort), either on request from the user (ABORT primitive) or as four-way handshake, the last two legs of which are allowed to carry
a result of an error condition detected within the SCTP layer. Section user data for fast setup. The startup sequence is described in
9 describes both the graceful and the ungraceful close procedures. Section 5 of this document.
SCTP does not support a half-open state (like TCP) wherein one side SCTP provides for graceful close (i.e., shutdown) of an active
may continue sending data while the other end is closed. When either association on request from the SCTP user. See the description of
the SHUTDOWN primitive in Section 10. SCTP also allows ungraceful
close (i.e., abort), either on request from the user (ABORT
primitive) or as a result of an error condition detected within the
SCTP layer. Section 9 describes both the graceful and the ungraceful
close procedures.
endpoint performs a shutdown, the association on each peer will stop SCTP does not support a half-open state (like TCP) wherein one side
accepting new data from its user and only deliver data in queue at the may continue sending data while the other end is closed. When either
time of the graceful close (see Section 9). endpoint performs a shutdown, the association on each peer will stop
accepting new data from its user and only deliver data in queue at
the time of the graceful close (see Section 9).
1.3.2 Sequenced Delivery within Streams 1.3.2 Sequenced Delivery within Streams
The term "stream" is used in SCTP to refer to a sequence of user The term "stream" is used in SCTP to refer to a sequence of user
messages that are to be delivered to the upper-layer protocol in order messages that are to be delivered to the upper-layer protocol in
with respect to other messages within the same stream. This is in order with respect to other messages within the same stream. This is
contrast to its usage in TCP, where it refers to a sequence of bytes in contrast to its usage in TCP, where it refers to a sequence of
(in this document a byte is assumed to be eight bits). bytes (in this document a byte is assumed to be eight bits).
The SCTP user can specify at association startup time the number of The SCTP user can specify at association startup time the number of
streams to be supported by the association. This number is negotiated streams to be supported by the association. This number is
with the remote end (see Section 5.1.1). User messages are associated negotiated with the remote end (see Section 5.1.1). User messages
with stream numbers (SEND, RECEIVE primitives, Section 10). Internally, are associated with stream numbers (SEND, RECEIVE primitives, Section
SCTP assigns a stream sequence number to each message passed to it by 10). Internally, SCTP assigns a stream sequence number to each
the SCTP user. On the receiving side, SCTP ensures that messages are message passed to it by the SCTP user. On the receiving side, SCTP
delivered to the SCTP user in sequence within a given stream. However, ensures that messages are delivered to the SCTP user in sequence
while one stream may be blocked waiting for the next in-sequence user within a given stream. However, while one stream may be blocked
message, delivery from other streams may proceed. waiting for the next in-sequence user message, delivery from other
streams may proceed.
SCTP provides a mechanism for bypassing the sequenced delivery SCTP provides a mechanism for bypassing the sequenced delivery
service. User messages sent using this mechanism are delivered to the service. User messages sent using this mechanism are delivered to
SCTP user as soon as they are received. the SCTP user as soon as they are received.
1.3.3 User Data Fragmentation 1.3.3 User Data Fragmentation
When needed, SCTP fragments user messages to ensure that the SCTP When needed, SCTP fragments user messages to ensure that the SCTP
packet passed to the lower layer conforms to the path MTU. On receipt, packet passed to the lower layer conforms to the path MTU. On
fragments are reassembled into complete messages before being passed to receipt, fragments are reassembled into complete messages before
the SCTP user. being passed to the SCTP user.
1.3.4 Acknowledgement and Congestion Avoidance 1.3.4 Acknowledgement and Congestion Avoidance
SCTP assigns a Transmission Sequence Number (TSN) to each user data SCTP assigns a Transmission Sequence Number (TSN) to each user data
fragment or unfragmented message. The TSN is independent of any fragment or unfragmented message. The TSN is independent of any
stream sequence number assigned at the stream level. The receiving end stream sequence number assigned at the stream level. The receiving
acknowledges all TSNs received, even if there are gaps in the end acknowledges all TSNs received, even if there are gaps in the
sequence. In this way, reliable delivery is kept functionally separate sequence. In this way, reliable delivery is kept functionally
from sequenced stream delivery. separate from sequenced stream delivery.
The acknowledgement and congestion avoidance function is responsible The acknowledgement and congestion avoidance function is responsible
for packet retransmission when timely acknowledgement has not been for packet retransmission when timely acknowledgement has not been
received. Packet retransmission is conditioned by congestion received. Packet retransmission is conditioned by congestion
avoidance procedures similar to those used for TCP. See Sections 6 avoidance procedures similar to those used for TCP. See Sections 6
and 7 for a detailed description of the protocol procedures associated and 7 for a detailed description of the protocol procedures
with this function. associated with this function.
1.3.5 Chunk Bundling 1.3.5 Chunk Bundling
As described in Section 3, the SCTP packet as delivered to the lower As described in Section 3, the SCTP packet as delivered to the lower
layer consists of a common header followed by one or more chunks. Each layer consists of a common header followed by one or more chunks.
chunk may contain either user data or SCTP control information. The Each chunk may contain either user data or SCTP control information.
The SCTP user has the option to request bundling of more than one
SCTP user has the option to request bundling of more than one user user messages into a single SCTP packet. The chunk bundling function
messages into a single SCTP packet. The chunk bundling function of SCTP of SCTP is responsible for assembly of the complete SCTP packet and
is responsible for assembly of the complete SCTP packet and its its disassembly at the receiving end.
disassembly at the receiving end.
During times of congestion an SCTP implementation MAY still perform During times of congestion an SCTP implementation MAY still perform
bundling even if the user has requested that SCTP not bundle. The bundling even if the user has requested that SCTP not bundle. The
user's disabling of bundling only affects SCTP implementations that may user's disabling of bundling only affects SCTP implementations that
delay a small period of time before transmission (to attempt to may delay a small period of time before transmission (to attempt to
encourage bundling). When the user layer disables bundling, this small encourage bundling). When the user layer disables bundling, this
delay is prohibited but not bundling that is performed during small delay is prohibited but not bundling that is performed during
congestion or retransmission. congestion or retransmission.
1.3.6 Packet Validation 1.3.6 Packet Validation
A mandatory Verification Tag field and a 32 bit checksum field (see A mandatory Verification Tag field and a 32 bit checksum field (see
Appendix B for a description of the Adler-32 checksum) are included in Appendix B for a description of the Adler-32 checksum) are included
the SCTP common header. The Verification Tag value is chosen by each in the SCTP common header. The Verification Tag value is chosen by
end of the association during association startup. Packets received each end of the association during association startup. Packets
without the expected Verification Tag value are discarded, as a received without the expected Verification Tag value are discarded,
protection against blind masquerade attacks and against stale SCTP as a protection against blind masquerade attacks and against stale
packets from a previous association. The Adler-32 checksum should be SCTP packets from a previous association. The Adler-32 checksum
set by the sender of each SCTP packet to provide additional protection should be set by the sender of each SCTP packet to provide additional
against data corruption in the network. The receiver of an SCTP packet protection against data corruption in the network. The receiver of
with an invalid Adler-32 checksum silently discards the packet. an SCTP packet with an invalid Adler-32 checksum silently discards
the packet.
1.3.7 Path Management 1.3.7 Path Management
The sending SCTP user is able to manipulate the set of transport The sending SCTP user is able to manipulate the set of transport
addresses used as destinations for SCTP packets through the addresses used as destinations for SCTP packets through the
primitives described in Section 10. The SCTP path management function primitives described in Section 10. The SCTP path management
chooses the destination transport address for each outgoing SCTP function chooses the destination transport address for each outgoing
packet based on the SCTP user's instructions and the currently SCTP packet based on the SCTP user's instructions and the currently
perceived reachability status of the eligible destination set. perceived reachability status of the eligible destination set. The
The path management function monitors reachability through heartbeats path management function monitors reachability through heartbeats
when other packet traffic is inadequate to provide this information when other packet traffic is inadequate to provide this information
and advises the SCTP user when reachability of any far-end transport and advises the SCTP user when reachability of any far-end transport
address changes. The path management function is also responsible for address changes. The path management function is also responsible
reporting the eligible set of local transport addresses to the far end for reporting the eligible set of local transport addresses to the
during association startup, and for reporting the transport addresses far end during association startup, and for reporting the transport
returned from the far end to the SCTP user. addresses returned from the far end to the SCTP user.
At association start-up, a primary path is defined for each SCTP At association start-up, a primary path is defined for each SCTP
endpoint, and is used for normal sending of SCTP packets. endpoint, and is used for normal sending of SCTP packets.
On the receiving end, the path management is responsible for verifying On the receiving end, the path management is responsible for
the existence of a valid SCTP association to which the inbound SCTP verifying the existence of a valid SCTP association to which the
packet belongs before passing it for further processing. inbound SCTP packet belongs before passing it for further processing.
Note: Path Management and Packet Validation are done at the Note: Path Management and Packet Validation are done at the same
same time, so although described separately above, in reality they time, so although described separately above, in reality they cannot
cannot be performed as separate items. be performed as separate items.
1.4 Key Terms 1.4 Key Terms
Some of the language used to describe SCTP has been introduced in the Some of the language used to describe SCTP has been introduced in the
previous sections. This section provides a consolidated list of the key previous sections. This section provides a consolidated list of the
terms and their definitions. key terms and their definitions.
o Active destination transport address: A transport address on a peer o Active destination transport address: A transport address on a
endpoint which a transmitting endpoint considers available for peer endpoint which a transmitting endpoint considers available
receiving user messages. for receiving user messages.
o Bundling: An optional multiplexing operation, whereby more than one o Bundling: An optional multiplexing operation, whereby more than
user message may be carried in the same SCTP packet. Each user one user message may be carried in the same SCTP packet. Each
message occupies its own DATA chunk. user message occupies its own DATA chunk.
o Chunk: A unit of information within an SCTP packet, consisting of o Chunk: A unit of information within an SCTP packet, consisting of
a chunk header and chunk-specific content. a chunk header and chunk-specific content.
o Congestion Window (cwnd): An SCTP variable that limits the data, in o Congestion Window (cwnd): An SCTP variable that limits the data,
number of bytes, a sender can send to a particular destination in number of bytes, a sender can send to a particular destination
transport address before receiving an acknowledgement. transport address before receiving an acknowledgement.
o Cumulative TSN Ack Point: The TSN of the last DATA chunk o Cumulative TSN Ack Point: The TSN of the last DATA chunk
acknowledged via the Cumulative TSN Ack field of a SACK. acknowledged via the Cumulative TSN Ack field of a SACK.
o Idle destination address: An address that has not had user messages o Idle destination address: An address that has not had user
sent to it within some length of time, normally the HEARTBEAT messages sent to it within some length of time, normally the
interval or greater. HEARTBEAT interval or greater.
o Inactive destination transport address: An address which is o Inactive destination transport address: An address which is
considered inactive due to errors and unavailable to transport user considered inactive due to errors and unavailable to transport
messages. user messages.
o Message = user message: Data submitted to SCTP by the Upper Layer o Message = user message: Data submitted to SCTP by the Upper Layer
Protocol (ULP). Protocol (ULP).
o Message Authentication Code (MAC): An integrity check mechanism o Message Authentication Code (MAC): An integrity check mechanism
based on cryptographic hash functions using a secret key. based on cryptographic hash functions using a secret key.
Typically, message authentication codes are used between two Typically, message authentication codes are used between two
parties that share a secret key in order to validate information parties that share a secret key in order to validate information
transmitted between these parties. In SCTP it is used by an transmitted between these parties. In SCTP it is used by an
endpoint to validate the State Cookie information that is endpoint to validate the State Cookie information that is returned
returned from the peer in the COOKIE ECHO chunk. The term "MAC" from the peer in the COOKIE ECHO chunk. The term "MAC" has
has different meanings in different contexts. SCTP uses this different meanings in different contexts. SCTP uses this term
term with the same meaning as in [RFC2104]. with the same meaning as in [RFC2104].
o Network Byte Order: Most significant byte first, a.k.a., Big Endian. o Network Byte Order: Most significant byte first, a.k.a., Big
Endian.
o Ordered Message: A user message that is delivered in order with o Ordered Message: A user message that is delivered in order with
respect to all previous user messages sent within the stream the respect to all previous user messages sent within the stream the
message was sent on. message was sent on.
o Outstanding TSN (at an SCTP endpoint): A TSN (and the associated o Outstanding TSN (at an SCTP endpoint): A TSN (and the associated
DATA chunk) that has been sent by the endpoint but for which it has DATA chunk) that has been sent by the endpoint but for which it
not yet received an acknowledgement. has not yet received an acknowledgement.
o Path: The route taken by the SCTP packets sent by one SCTP o Path: The route taken by the SCTP packets sent by one SCTP
endpoint to a specific destination transport address of its peer endpoint to a specific destination transport address of its peer
SCTP endpoint. Sending to different destination transport SCTP endpoint. Sending to different destination transport
addresses does not necessarily guarantee getting separate paths. addresses does not necessarily guarantee getting separate paths.
o Primary Path: The primary path is the destination and o Primary Path: The primary path is the destination and source
source address that will be put into a packet outbound address that will be put into a packet outbound to the peer
to the peer endpoint by default. The definition includes endpoint by default. The definition includes the source address
the source address since an implementation MAY wish to since an implementation MAY wish to specify both destination and
specify both destination and source address to better source address to better control the return path taken by reply
control the return path taken by reply chunks and on which chunks and on which interface the packet is transmitted when the
interface the packet is transmitted when the data sender data sender is multi-homed.
is multi-homed.
o Receiver Window (rwnd): An SCTP variable a data sender uses to store o Receiver Window (rwnd): An SCTP variable a data sender uses to
the most recently calculated receiver window of its peer, in number store the most recently calculated receiver window of its peer, in
of bytes. This gives the sender an indication of the space available number of bytes. This gives the sender an indication of the space
in the receiver's inbound buffer. available in the receiver's inbound buffer.
o SCTP association: A protocol relationship between SCTP endpoints, o SCTP association: A protocol relationship between SCTP endpoints,
composed of the two SCTP endpoints and protocol state information composed of the two SCTP endpoints and protocol state information
including Verification Tags and the currently active set of including Verification Tags and the currently active set of
Transmission Sequence Numbers (TSNs), etc. An association can be Transmission Sequence Numbers (TSNs), etc. An association can be
uniquely identified by the transport addresses used by the endpoints uniquely identified by the transport addresses used by the
in the association. Two SCTP endpoints MUST NOT have more than one endpoints in the association. Two SCTP endpoints MUST NOT have
SCTP association between them at any given time. more than one SCTP association between them at any given time.
o SCTP endpoint: The logical sender/receiver of SCTP packets. On a o SCTP endpoint: The logical sender/receiver of SCTP packets. On a
multi-homed host, an SCTP endpoint is represented to its peers as a multi-homed host, an SCTP endpoint is represented to its peers as
combination of a set of eligible destination transport addresses to a combination of a set of eligible destination transport addresses
which SCTP packets can be sent and a set of eligible source to which SCTP packets can be sent and a set of eligible source
transport addresses from which SCTP packets can be received. transport addresses from which SCTP packets can be received. All
All transport addresses used by an SCTP endpoint must use the transport addresses used by an SCTP endpoint must use the same
same port number, but can use multiple IP addresses. A transport port number, but can use multiple IP addresses. A transport
address used by an SCTP endpoint must not be used by another address used by an SCTP endpoint must not be used by another SCTP
SCTP endpoint. In other words, a transport address is unique endpoint. In other words, a transport address is unique to an
to an SCTP endpoint. SCTP endpoint.
o SCTP packet (or packet): The unit of data delivery across the o SCTP packet (or packet): The unit of data delivery across the
interface between SCTP and the connectionless packet network (e.g., interface between SCTP and the connectionless packet network
IP). An SCTP packet includes the common SCTP header, possible SCTP (e.g., IP). An SCTP packet includes the common SCTP header,
control chunks, and user data encapsulated within SCTP DATA chunks. possible SCTP control chunks, and user data encapsulated within
SCTP DATA chunks.
o SCTP user application (SCTP user): The logical higher-layer o SCTP user application (SCTP user): The logical higher-layer
application entity which uses the services of SCTP, also called application entity which uses the services of SCTP, also called
the Upper-layer Protocol (ULP). the Upper-layer Protocol (ULP).
o Slow Start Threshold (ssthresh): An SCTP variable. This is the o Slow Start Threshold (ssthresh): An SCTP variable. This is the
threshold which the endpoint will use to determine whether to threshold which the endpoint will use to determine whether to
perform slow start or congestion avoidance on a particular perform slow start or congestion avoidance on a particular
destination transport address. Ssthresh is in number of bytes. destination transport address. Ssthresh is in number of bytes.
o Stream: A uni-directional logical channel established from one to o Stream: A uni-directional logical channel established from one to
another associated SCTP endpoint, within which all user messages another associated SCTP endpoint, within which all user messages
are delivered in sequence except for those submitted to the are delivered in sequence except for those submitted to the
unordered delivery service. unordered delivery service.
Note: The relationship between stream numbers in opposite Note: The relationship between stream numbers in opposite directions
directions is strictly a matter of how the applications use is strictly a matter of how the applications use them. It is the
them. It is the responsibility of the SCTP user to create and responsibility of the SCTP user to create and manage these
manage these correlations if they are so desired. correlations if they are so desired.
o Stream Sequence Number: A 16-bit sequence number used internally by o Stream Sequence Number: A 16-bit sequence number used internally
SCTP to assure sequenced delivery of the user messages within a by SCTP to assure sequenced delivery of the user messages within a
given stream. One stream sequence number is attached to each user given stream. One stream sequence number is attached to each user
message. message.
o Tie-Tags: Verification Tags from a previous association. These o Tie-Tags: Verification Tags from a previous association. These
Tags are used within a State Cookie so that the newly restarting Tags are used within a State Cookie so that the newly restarting
association can be linked to the original association within association can be linked to the original association within the
the endpoint that did NOT restart. endpoint that did not restart.
o Transmission Control Block (TCB): An internal data structure o Transmission Control Block (TCB): An internal data structure
created by an SCTP endpoint for each of its existing SCTP created by an SCTP endpoint for each of its existing SCTP
associations to other SCTP endpoints. TCB contains all the status associations to other SCTP endpoints. TCB contains all the status
and operational information for the endpoint to maintain and manage and operational information for the endpoint to maintain and
the corresponding association. manage the corresponding association.
o Transmission Sequence Number (TSN): A 32-bit sequence number used o Transmission Sequence Number (TSN): A 32-bit sequence number used
internally by SCTP. One TSN is attached to each chunk containing internally by SCTP. One TSN is attached to each chunk containing
user data to permit the receiving SCTP endpoint to acknowledge its user data to permit the receiving SCTP endpoint to acknowledge its
receipt and detect duplicate deliveries. receipt and detect duplicate deliveries.
o Transport address: A Transport Address is traditionally defined by o Transport address: A Transport Address is traditionally defined
Network Layer address, Transport Layer protocol and Transport Layer by Network Layer address, Transport Layer protocol and Transport
port number. In the case of SCTP running over IP, a transport Layer port number. In the case of SCTP running over IP, a
address is defined by the combination of an IP address and an SCTP transport address is defined by the combination of an IP address
port number (where SCTP is the Transport protocol). and an SCTP port number (where SCTP is the Transport protocol).
o Unacknowledged TSN (at an SCTP endpoint): A TSN (and the associated o Unacknowledged TSN (at an SCTP endpoint): A TSN (and the associated
DATA chunk) which has been received by the endpoint but for which an DATA chunk) which has been received by the endpoint but for which
acknowledgement has not yet been sent. Or in the opposite case, an acknowledgement has not yet been sent. Or in the opposite case,
for a packet that has been sent but no acknowledgement has for a packet that has been sent but no acknowledgement has been
been received. received.
o Unordered Message: Unordered messages are "unordered" with respect o Unordered Message: Unordered messages are "unordered" with respect
to any other message, this includes both other unordered messages to any other message, this includes both other unordered messages
as well as other ordered messages. Unordered message might be as well as other ordered messages. Unordered message might be
delivered prior to or later than ordered messages sent on the delivered prior to or later than ordered messages sent on the same
same stream. stream.
o User message: The unit of data delivery across the interface o User message: The unit of data delivery across the interface
between SCTP and its user. between SCTP and its user.
o Verification Tag: A 32 bit unsigned integer that is randomly o Verification Tag: A 32 bit unsigned integer that is randomly
generated. The Verification Tag provides a key that allows generated. The Verification Tag provides a key that allows a
a receiver to verify that the SCTP packet belongs to the receiver to verify that the SCTP packet belongs to the current
current association and is NOT an old or stale packet from association and is not an old or stale packet from a previous
a previous association. association.
1.5. Abbreviations 1.5. Abbreviations
MAC - Message Authentication Code [RFC2104] MAC - Message Authentication Code [RFC2104]
RTO - Retransmission Time-out RTO - Retransmission Time-out
RTT - Round-trip Time RTT - Round-trip Time
RTTVAR - Round-trip Time Variation RTTVAR - Round-trip Time Variation
SCTP - Stream Control Transmission Protocol SCTP - Stream Control Transmission Protocol
SRTT - Smoothed RTT SRTT - Smoothed RTT
TCB - Transmission Control Block TCB - Transmission Control Block
TLV - Type-Length-Value Coding Format TLV - Type-Length-Value Coding Format
TSN - Transmission Sequence Number
ULP - Upper-layer Protocol TSN - Transmission Sequence Number
ULP - Upper-layer Protocol
1.6 Serial Number Arithmetic 1.6 Serial Number Arithmetic
It is essential to remember that the actual Transmission Sequence It is essential to remember that the actual Transmission Sequence
Number space is finite, though very large. This space ranges from 0 to Number space is finite, though very large. This space ranges from 0
2**32 - 1. Since the space is finite, all arithmetic dealing with to 2**32 - 1. Since the space is finite, all arithmetic dealing with
Transmission Sequence Numbers must be performed modulo 2**32. This Transmission Sequence Numbers must be performed modulo 2**32. This
unsigned Arithmetic preserves the relationship of sequence numbers as unsigned arithmetic preserves the relationship of sequence numbers as
they cycle From 2**32 - 1 to 0 again. There are some subtleties to they cycle from 2**32 - 1 to 0 again. There are some subtleties to
computer modulo arithmetic, so great care should be taken in computer modulo arithmetic, so great care should be taken in
programming the comparison of such values. When referring to TSNs, the programming the comparison of such values. When referring to TSNs,
symbol "=<" means "less than or equal"(modulo 2**32). the symbol "=<" means "less than or equal"(modulo 2**32).
Comparisons and arithmetic on TSNs in this document SHOULD use Serial Comparisons and arithmetic on TSNs in this document SHOULD use Serial
Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 32. Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 32.
An endpoint SHOULD NOT transmit a DATA chunk with a TSN that is more An endpoint SHOULD NOT transmit a DATA chunk with a TSN that is more
than 2**31 - 1 above the beginning TSN of its current send window. than 2**31 - 1 above the beginning TSN of its current send window.
Doing so will cause problems in comparing TSNs. Doing so will cause problems in comparing TSNs.
Transmission Sequence Numbers wrap around when they reach 2**32 - 1. Transmission Sequence Numbers wrap around when they reach 2**32 - 1.
That is, the next TSN a DATA chunk MUST use after transmitting TSN = That is, the next TSN a DATA chunk MUST use after transmitting TSN =
2*32 - 1 is TSN = 0. 2*32 - 1 is TSN = 0.
Any arithmetic done on Stream Sequence Numbers SHOULD use Serial Number Any arithmetic done on Stream Sequence Numbers SHOULD use Serial
Arithmetic as defined in [RFC1982] where SERIAL_BITS = 16. Number Arithmetic as defined in [RFC1982] where SERIAL_BITS = 16.
All other arithmetic and comparisons in this document uses normal All other arithmetic and comparisons in this document uses normal
arithmetic. arithmetic.
2. Conventions 2. Conventions
The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY, and OPTIONAL, when SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY, and OPTIONAL, when
they appear in this document, are to be interpreted as described in they appear in this document, are to be interpreted as described in
[RFC2119]. [RFC2119].
3. SCTP packet Format 3. SCTP packet Format
An SCTP packet is composed of a common header and chunks. A chunk An SCTP packet is composed of a common header and chunks. A chunk
contains either control information or user data. contains either control information or user data.
The SCTP packet format is shown below: The SCTP packet format is shown below:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Common Header | | Common Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Chunk #1 | | Chunk #1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... | | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Chunk #n | | Chunk #n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Multiple chunks can be bundled into one SCTP packet up to Multiple chunks can be bundled into one SCTP packet up to the MTU
the MTU size, except for the INIT, INIT ACK, and SHUTDOWN COMPLETE size, except for the INIT, INIT ACK, and SHUTDOWN COMPLETE chunks.
chunks. These chunks MUST NOT be bundled with any other chunk in a These chunks MUST NOT be bundled with any other chunk in a packet.
packet. See Section 6.10 for more details on chunk bundling. See Section 6.10 for more details on chunk bundling.
If a user data message doesn't fit into one SCTP packet it can be If a user data message doesn't fit into one SCTP packet it can be
fragmented into multiple chunks using the procedure defined in fragmented into multiple chunks using the procedure defined in
Section 6.9. Section 6.9.
All integer fields in an SCTP packet MUST be transmitted in All integer fields in an SCTP packet MUST be transmitted in network
network byte order, unless otherwise stated. byte order, unless otherwise stated.
3.1 SCTP Common Header Field Descriptions 3.1 SCTP Common Header Field Descriptions
SCTP Common Header Format SCTP Common Header Format
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port Number | Destination Port Number | | Source Port Number | Destination Port Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Verification Tag | | Verification Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Source Port Number: 16 bits (unsigned integer) Source Port Number: 16 bits (unsigned integer)
This is the SCTP sender's port number. It can be used by the This is the SCTP sender's port number. It can be used by the
receiver in combination with the source IP address, the receiver in combination with the source IP address, the SCTP
SCTP destination port and possibly the destination IP address destination port and possibly the destination IP address to
to identify the association to which this packet belongs. identify the association to which this packet belongs.
Destination Port Number: 16 bits (unsigned integer) Destination Port Number: 16 bits (unsigned integer)
This is the SCTP port number to which this packet is destined. The This is the SCTP port number to which this packet is destined.
receiving host will use this port number to de-multiplex the The receiving host will use this port number to de-multiplex the
SCTP packet to the correct receiving endpoint/application. SCTP packet to the correct receiving endpoint/application.
Verification Tag: 32 bits (unsigned integer) Verification Tag: 32 bits (unsigned integer)
The receiver of this packet uses the Verification Tag to validate The receiver of this packet uses the Verification Tag to validate
the sender of this SCTP packet. On transmit, the value of this the sender of this SCTP packet. On transmit, the value of this
Verification Tag MUST be set to the value of the Initiate Tag Verification Tag MUST be set to the value of the Initiate Tag
received from the peer endpoint during the association received from the peer endpoint during the association
initialization, with the following exceptions: initialization, with the following exceptions:
- A packet containing an INIT chunk MUST have a zero - A packet containing an INIT chunk MUST have a zero Verification
Verification Tag. Tag.
- A packet containing a SHUTDOWN-COMPLETE chunk with the T-bit - A packet containing a SHUTDOWN-COMPLETE chunk with the T-bit
set MUST have the Verification Tag copied from the packet set MUST have the Verification Tag copied from the packet with
with the SHUTDOWN-ACK chunk. the SHUTDOWN-ACK chunk.
- A packet containing an ABORT chunk may have the verification - A packet containing an ABORT chunk may have the verification
tag copied from the packet which caused the ABORT to be sent. tag copied from the packet which caused the ABORT to be sent.
For details see Section 8.4 and 8.5. For details see Section 8.4 and 8.5.
An INIT chunk MUST be the only chunk in the SCTP packet carrying it. An INIT chunk MUST be the only chunk in the SCTP packet carrying it.
Checksum: 32 bits (unsigned integer) Checksum: 32 bits (unsigned integer)
This field contains the checksum of this SCTP packet. Its calculation This field contains the checksum of this SCTP packet. Its
is discussed in Section 6.8. SCTP uses the Adler-32 algorithm as calculation is discussed in Section 6.8. SCTP uses the Adler-
described in Appendix B for calculating the checksum 32 algorithm as described in Appendix B for calculating the
checksum
3.2 Chunk Field Descriptions 3.2 Chunk Field Descriptions
The figure below illustrates the field format for the chunks to be The figure below illustrates the field format for the chunks to be
transmitted in the SCTP packet. Each chunk is formatted with a Chunk transmitted in the SCTP packet. Each chunk is formatted with a Chunk
Type field, a chunk-specific Flag field, a Chunk Length field, and a Type field, a chunk-specific Flag field, a Chunk Length field, and a
Value field. Value field.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Chunk Type | Chunk Flags | Chunk Length | | Chunk Type | Chunk Flags | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ Chunk Value / / Chunk Value /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Type: 8 bits (unsigned integer) Chunk Type: 8 bits (unsigned integer)
This field identifies the type of information contained in the Chunk This field identifies the type of information contained in the
Value field. It takes a value from 0 to 254. The value of 255 is Chunk Value field. It takes a value from 0 to 254. The value of
reserved for future use as an extension field. 255 is reserved for future use as an extension field.
The values of Chunk Types are defined as follows: The values of Chunk Types are defined as follows:
ID Value Chunk Type ID Value Chunk Type
----- ---------- ----- ----------
0 - Payload Data (DATA) 0 - Payload Data (DATA)
1 - Initiation (INIT) 1 - Initiation (INIT)
2 - Initiation Acknowledgement (INIT ACK) 2 - Initiation Acknowledgement (INIT ACK)
3 - Selective Acknowledgement (SACK) 3 - Selective Acknowledgement (SACK)
4 - Heartbeat Request (HEARTBEAT) 4 - Heartbeat Request (HEARTBEAT)
5 - Heartbeat Acknowledgement (HEARTBEAT ACK) 5 - Heartbeat Acknowledgement (HEARTBEAT ACK)
6 - Abort (ABORT) 6 - Abort (ABORT)
7 - Shutdown (SHUTDOWN) 7 - Shutdown (SHUTDOWN)
8 - Shutdown Acknowledgement (SHUTDOWN ACK) 8 - Shutdown Acknowledgement (SHUTDOWN ACK)
9 - Operation Error (ERROR) 9 - Operation Error (ERROR)
10 - State Cookie (COOKIE ECHO) 10 - State Cookie (COOKIE ECHO)
11 - Cookie Acknowledgement (COOKIE ACK) 11 - Cookie Acknowledgement (COOKIE ACK)
12 - Reserved for Explicit Congestion Notification Echo (ECNE) 12 - Reserved for Explicit Congestion Notification Echo (ECNE)
13 - Reserved for Congestion Window Reduced (CWR) 13 - Reserved for Congestion Window Reduced (CWR)
14 - Shutdown Complete (SHUTDOWN COMPLETE) 14 - Shutdown Complete (SHUTDOWN COMPLETE)
15 to 62 - reserved by IETF 15 to 62 - reserved by IETF
63 - IETF-defined Chunk Extensions 63 - IETF-defined Chunk Extensions
64 to 126 - reserved by IETF 64 to 126 - reserved by IETF
127 - IETF-defined Chunk Extensions 127 - IETF-defined Chunk Extensions
128 to 190 - reserved by IETF 128 to 190 - reserved by IETF
191 - IETF-defined Chunk Extensions 191 - IETF-defined Chunk Extensions
192 to 254 - reserved by IETF 192 to 254 - reserved by IETF
255 - IETF-defined Chunk Extensions 255 - IETF-defined Chunk Extensions
Chunk Types are encoded such that the highest-order two bits Chunk Types are encoded such that the highest-order two bits specify
specify the action that must be taken if the processing the action that must be taken if the processing endpoint does not
endpoint does not recognize the Chunk Type. recognize the Chunk Type.
00 - Stop processing this SCTP packet and discard it, do NOT process any 00 - Stop processing this SCTP packet and discard it, do not process
further chunks within it. any further chunks within it.
01 - Stop processing this SCTP packet and discard it, do NOT process any 01 - Stop processing this SCTP packet and discard it, do not process
further chunks within it, and report in an Operation Error Chunk any further chunks within it, and report the unrecognized
using the 'Unrecognized Chunk Type' cause of error. parameter in an 'Unrecognized Parameter Type' (in either an
ERROR or in the INIT ACK).
10 - Skip this chunk and continue processing. 10 - Skip this chunk and continue processing.
11 - Skip this chunk and continue processing, but report in an 11 - Skip this chunk and continue processing, but report in an ERROR
Operation Error Chunk using the 'Unrecognized Chunk Type' Chunk using the 'Unrecognized Chunk Type' cause of error.
cause of error.
Note: The ECNE and CWR chunk types are reserved for future use of Note: The ECNE and CWR chunk types are reserved for future use of
Explicit Congestion Notification (ECN). Explicit Congestion Notification (ECN).
Chunk Flags: 8 bits Chunk Flags: 8 bits
The usage of these bits depends on the chunk type as given by the The usage of these bits depends on the chunk type as given by the
Chunk Type. Unless otherwise specified, they are set to zero on Chunk Type. Unless otherwise specified, they are set to zero on
transmit and are ignored on receipt. transmit and are ignored on receipt.
Chunk Length: 16 bits (unsigned integer) Chunk Length: 16 bits (unsigned integer)
This value represents the size of the chunk in bytes including the This value represents the size of the chunk in bytes including the
Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields. Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields.
Therefore, if the Chunk Value field is zero-length, the Length Therefore, if the Chunk Value field is zero-length, the Length
field will be set to 4. The Chunk Length field does not count field will be set to 4. The Chunk Length field does not count any
any padding. padding.
Chunk Value: variable length Chunk Value: variable length
The Chunk Value field contains the actual information to be
transferred in the chunk. The usage and format of this field is
dependent on the Chunk Type.
The total length of a chunk (including Type, Length and Value fields) The Chunk Value field contains the actual information to be
MUST be a multiple of 4 bytes. If the length of the chunk is not a transferred in the chunk. The usage and format of this field is
multiple of 4 bytes, the sender MUST pad the chunk with all zero bytes dependent on the Chunk Type.
and this padding is NOT included in the chunk length field. The sender
should never pad with more than 3 bytes. The receiver MUST ignore the
padding bytes.
SCTP defined chunks are described in detail in Section 3.3. The The total length of a chunk (including Type, Length and Value fields)
guidelines for IETF-defined chunk extensions can be found in Section MUST be a multiple of 4 bytes. If the length of the chunk is not a
13.1 of this document. multiple of 4 bytes, the sender MUST pad the chunk with all zero
bytes and this padding is not included in the chunk length field.
The sender should never pad with more than 3 bytes. The receiver
MUST ignore the padding bytes.
SCTP defined chunks are described in detail in Section 3.3. The
guidelines for IETF-defined chunk extensions can be found in Section
13.1 of this document.
3.2.1 Optional/Variable-length Parameter Format 3.2.1 Optional/Variable-length Parameter Format
Chunk values of SCTP control chunks consist of a chunk-type-specific Chunk values of SCTP control chunks consist of a chunk-type-specific
header of required fields, followed by zero or more parameters. The header of required fields, followed by zero or more parameters. The
optional and variable-length parameters contained in a chunk are optional and variable-length parameters contained in a chunk are
defined in a Type-Length-Value format as shown below. defined in a Type-Length-Value format as shown below.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Parameter Type | Parameter Length | | Parameter Type | Parameter Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ Parameter Value / / Parameter Value /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Parameter Type: 16 bits (unsigned integer) Chunk Parameter Type: 16 bits (unsigned integer)
The Type field is a 16 bit identifier of the type of parameter. It The Type field is a 16 bit identifier of the type of parameter.
takes a value of 0 to 65534. It takes a value of 0 to 65534.
The value of 65535 is reserved for IETF-defined extensions. The value of 65535 is reserved for IETF-defined extensions. Values
Values other than those defined in specific SCTP chunk other than those defined in specific SCTP chunk description are
description are reserved for use by IETF. reserved for use by IETF.
Chunk Parameter Length: 16 bits (unsigned integer) Chunk Parameter Length: 16 bits (unsigned integer)
The Parameter Length field contains the size of the parameter in bytes, The Parameter Length field contains the size of the parameter in
including the Parameter Type, Parameter Length, and Parameter bytes, including the Parameter Type, Parameter Length, and
Value fields. Thus, a parameter with a zero-length Parameter Parameter Value fields. Thus, a parameter with a zero-length
Value field would have a Length field of 4. The Parameter Length Parameter Value field would have a Length field of 4. The
does not include any padding bytes. Parameter Length does not include any padding bytes.
Chunk Parameter Value: variable-length. Chunk Parameter Value: variable-length.
The Parameter Value field contains the actual information to be The Parameter Value field contains the actual information to be
transferred in the parameter. transferred in the parameter.
The total length of a parameter (including Type, Parameter Length and The total length of a parameter (including Type, Parameter Length and
Value fields) MUST be a multiple of 4 bytes. If the length of the Value fields) MUST be a multiple of 4 bytes. If the length of the
parameter is not a multiple of 4 bytes, the sender pads the Parameter parameter is not a multiple of 4 bytes, the sender pads the Parameter
at the end (i.e., after the Parameter Value field) with all zero at the end (i.e., after the Parameter Value field) with all zero
bytes. The length of the padding is NOT included in the parameter bytes. The length of the padding is not included in the parameter
length field. A sender should NEVER pad with more than 3 bytes. The length field. A sender SHOULD NOT pad with more than 3 bytes. The
receiver MUST ignore the padding bytes. receiver MUST ignore the padding bytes.
The Parameter Types are encoded such that the highest-order two bits The Parameter Types are encoded such that the highest-order two bits
specify the action that must be taken if the processing specify the action that must be taken if the processing endpoint does
endpoint does not recognize the Parameter Type. not recognize the Parameter Type.
00 - Stop processing this SCTP packet and discard it, do NOT process any 00 - Stop processing this SCTP packet and discard it, do not process
further chunks within it. any further chunks within it.
01 - Stop processing this SCTP packet and discard it, do NOT process any 01 - Stop processing this SCTP packet and discard it, do not process
further chunks within it, and report the unrecognized parameter in any further chunks within it, and report the unrecognized
an 'Unrecognized Parameter Type' (in either a Operational Error or parameter in an 'Unrecognized Parameter Type' (in either an
in the INIT ACK). ERROR or in the INIT ACK).
10 - Skip this parameter and continue processing. 10 - Skip this parameter and continue processing.
11 - Skip this parameter and continue processing but report the 11 - Skip this parameter and continue processing but report the
the unrecognized parameter in an 'Unrecognized Parameter Type' unrecognized parameter in an 'Unrecognized Parameter Type' (in
(in either a Operational Error or in the INIT ACK). either an ERROR or in the INIT ACK).
The actual SCTP parameters are defined in the specific SCTP chunk The actual SCTP parameters are defined in the specific SCTP chunk
sections. The rules for IETF-defined parameter extensions are sections. The rules for IETF-defined parameter extensions are
defined in Section 13.2. defined in Section 13.2.
3.3 SCTP Chunk Definitions 3.3 SCTP Chunk Definitions
This section defines the format of the different SCTP chunk types. This section defines the format of the different SCTP chunk types.
3.3.1 Payload Data (DATA) (0) 3.3.1 Payload Data (DATA) (0)
The following format MUST be used for the DATA chunk: The following format MUST be used for the DATA chunk:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 0 | Reserved|U|B|E| Length | | Type = 0 | Reserved|U|B|E| Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TSN | | TSN |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream Identifier S | Stream Sequence Number n | | Stream Identifier S | Stream Sequence Number n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Protocol Identifier | | Payload Protocol Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ User Data (seq n of Stream S) / / User Data (seq n of Stream S) /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Reserved: 5 bits Reserved: 5 bits
Should be set to all '0's and ignored by the receiver.
U bit: 1 bit Should be set to all '0's and ignored by the receiver.
The (U)nordered bit, if set to '1', indicates that this is an
unordered DATA chunk, and there is no Stream Sequence Number assigned
to this DATA chunk. Therefore, the receiver MUST ignore the Stream
Sequence Number field.
After re-assembly (if necessary), unordered DATA chunks MUST be U bit: 1 bit
dispatched to the upper layer by the receiver without any attempt to
re-order.
If an unordered user message is fragmented, each fragment of the The (U)nordered bit, if set to '1', indicates that this is an
message MUST have its U bit set to '1'. unordered DATA chunk, and there is no Stream Sequence Number
assigned to this DATA chunk. Therefore, the receiver MUST ignore
the Stream Sequence Number field.
B bit: 1 bit After re-assembly (if necessary), unordered DATA chunks MUST be
dispatched to the upper layer by the receiver without any attempt
to re-order.
The (B)eginning fragment bit, if set, indicates the first fragment of If an unordered user message is fragmented, each fragment of the
a user message. message MUST have its U bit set to '1'.
E bit: 1 bit B bit: 1 bit
The (E)nding fragment bit, if set, indicates the last fragment of a
user message.
An unfragmented user message shall have both the B and E bits set The (B)eginning fragment bit, if set, indicates the first fragment
to '1'. Setting both B and E bits to '0' indicates a middle fragment of of a user message.
a multi-fragment user message, as summarized in the following table:
B E Description E bit: 1 bit
============================================================
| 1 0 | First piece of a fragmented user message |
+----------------------------------------------------------+
| 0 0 | Middle piece of a fragmented user message |
+----------------------------------------------------------+
| 0 1 | Last piece of a fragmented user message |
+----------------------------------------------------------+
| 1 1 | Unfragmented Message |
============================================================
| Table 1: Fragment Description Flags |
============================================================
When a user message is fragmented into multiple chunks, the TSNs are The (E)nding fragment bit, if set, indicates the last fragment of
used by the receiver to reassemble the message. This means that the a user message.
TSNs for each fragment of a fragmented user message MUST be strictly
sequential.
Length: 16 bits (unsigned integer) An unfragmented user message shall have both the B and E bits set to
'1'. Setting both B and E bits to '0' indicates a middle fragment of
a multi-fragment user message, as summarized in the following table:
This field indicates the length of the DATA chunk in bytes from the B E Description
beginning of the type field to the end of the user data field ============================================================
excluding any padding. A DATA chunk with no user data field will | 1 0 | First piece of a fragmented user message |
have Length set to 16 (indicating 16 bytes). +----------------------------------------------------------+
| 0 0 | Middle piece of a fragmented user message |
+----------------------------------------------------------+
| 0 1 | Last piece of a fragmented user message |
+----------------------------------------------------------+
| 1 1 | Unfragmented Message |
============================================================
| Table 1: Fragment Description Flags |
============================================================
TSN : 32 bits (unsigned integer) When a user message is fragmented into multiple chunks, the TSNs are
used by the receiver to reassemble the message. This means that the
TSNs for each fragment of a fragmented user message MUST be strictly
sequential.
This value represents the TSN for this DATA chunk. The valid range Length: 16 bits (unsigned integer)
of TSN is from 0 to 4294967295 (2**32 - 1). TSN wraps back to 0
after reaching 4294967295.
Stream Identifier S: 16 bits (unsigned integer) This field indicates the length of the DATA chunk in bytes from
the beginning of the type field to the end of the user data field
excluding any padding. A DATA chunk with no user data field will
have Length set to 16 (indicating 16 bytes).
Identifies the stream to which the following user data belongs. TSN : 32 bits (unsigned integer)
Stream Sequence Number n: 16 bits (unsigned integer) This value represents the TSN for this DATA chunk. The valid
range of TSN is from 0 to 4294967295 (2**32 - 1). TSN wraps back
to 0 after reaching 4294967295.
This value represents the stream sequence number of the following Stream Identifier S: 16 bits (unsigned integer)
user data within the stream S. Valid range is 0 to 65535.
When a user message is fragmented by SCTP for transport, the Identifies the stream to which the following user data belongs.
same stream sequence number MUST be carried in each of the fragments
of the message.
Payload Protocol Identifier: 32 bits (unsigned integer) Stream Sequence Number n: 16 bits (unsigned integer)
This value represents an application (or upper layer) specified This value represents the stream sequence number of the following
protocol identifier. This value is passed to SCTP by its upper layer user data within the stream S. Valid range is 0 to 65535.
and sent to its peer. This identifier is not used by SCTP but can be
used by certain network entities as well as the peer application to
identify the type of information being carried in this DATA chunk.
This field must be sent even in fragmented DATA chunks (to make
sure it is available for agents in the middle of the network).
The value 0 indicates no application identifier is specified by When a user message is fragmented by SCTP for transport, the same
the upper layer for this payload data. stream sequence number MUST be carried in each of the fragments of
the message.
User Data: variable length Payload Protocol Identifier: 32 bits (unsigned integer)
This is the payload user data. The implementation MUST pad the end This value represents an application (or upper layer) specified
of the data to a 4 byte boundary with all-zero bytes. Any padding protocol identifier. This value is passed to SCTP by its upper
MUST NOT be included in the length field. A sender MUST never add layer and sent to its peer. This identifier is not used by SCTP
more than 3 bytes of padding. but can be used by certain network entities as well as the peer
application to identify the type of information being carried in
this DATA chunk. This field must be sent even in fragmented DATA
chunks (to make sure it is available for agents in the middle of
the network).
The value 0 indicates no application identifier is specified by
the upper layer for this payload data.
User Data: variable length
This is the payload user data. The implementation MUST pad the
end of the data to a 4 byte boundary with all-zero bytes. Any
padding MUST NOT be included in the length field. A sender MUST
never add more than 3 bytes of padding.
3.3.2 Initiation (INIT) (1) 3.3.2 Initiation (INIT) (1)
This chunk is used to initiate a SCTP association between two This chunk is used to initiate a SCTP association between two
endpoints. The format of the INIT chunk is shown below: endpoints. The format of the INIT chunk is shown below:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 1 | Chunk Flags | Chunk Length | | Type = 1 | Chunk Flags | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initiate Tag | | Initiate Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertised Receiver Window Credit (a_rwnd) | | Advertised Receiver Window Credit (a_rwnd) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Outbound Streams | Number of Inbound Streams | | Number of Outbound Streams | Number of Inbound Streams |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initial TSN | | Initial TSN |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ Optional/Variable-Length Parameters / / Optional/Variable-Length Parameters /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The INIT chunk contains the following parameters. Unless otherwise The INIT chunk contains the following parameters. Unless otherwise
noted, each parameter MUST only be included once in the INIT chunk. noted, each parameter MUST only be included once in the INIT chunk.
Fixed Parameters Status Fixed Parameters Status
Initiate Tag Mandatory ----------------------------------------------
Advertised Receiver Window Credit Mandatory Initiate Tag Mandatory
Number of Outbound Streams Mandatory Advertised Receiver Window Credit Mandatory
Number of Inbound Streams Mandatory Number of Outbound Streams Mandatory
Initial TSN Mandatory Number of Inbound Streams Mandatory
Initial TSN Mandatory
Variable Parameters Status Type Value Variable Parameters Status Type Value
IPv4 Address (Note 1) Optional 5 -------------------------------------------------------------
IPv6 Address (Note 1) Optional 6 IPv4 Address (Note 1) Optional 5
Cookie Preservative Optional 9 IPv6 Address (Note 1) Optional 6
Reserved for ECN Capable (Note 2) Optional 32768 (0x8000) Cookie Preservative Optional 9
Host Name Address (Note 3) Optional 11 Reserved for ECN Capable (Note 2) Optional 32768 (0x8000)
Supported Address Types (Note 4) Optional 12 Host Name Address (Note 3) Optional 11
Supported Address Types (Note 4) Optional 12
Note 1: The INIT chunks can contain multiple addresses that can be Note 1: The INIT chunks can contain multiple addresses that can be
IPv4 and/or IPv6 in any combination. IPv4 and/or IPv6 in any combination.
Note 2: The ECN capable field is reserved for future use of Explicit Note 2: The ECN capable field is reserved for future use of Explicit
Congestion Notification. Congestion Notification.
Note 3: An INIT chunk MUST NOT contain more than one Host Name address Note 3: An INIT chunk MUST NOT contain more than one Host Name
parameter. Moreover, the sender of the INIT MUST NOT combine any other address parameter. Moreover, the sender of the INIT MUST NOT combine
address types with the Host Name address in the INIT. The receiver any other address types with the Host Name address in the INIT. The
of INIT MUST ignore any other address types if the Host Name address receiver of INIT MUST ignore any other address types if the Host Name
parameter is present in the received INIT chunk. address parameter is present in the received INIT chunk.
Note 4: This parameter, when present, specifies all the address types Note 4: This parameter, when present, specifies all the address types
the sending endpoint can support. The absence of this parameter the sending endpoint can support. The absence of this parameter
indicates that the sending endpoint can support any address type. indicates that the sending endpoint can support any address type.
The Chunk Flags field in INIT is reserved and all bits in it should be The Chunk Flags field in INIT is reserved and all bits in it should
set to 0 by the sender and ignored by the receiver. The sequence of be set to 0 by the sender and ignored by the receiver. The sequence
parameters within an INIT can be processed in any order. of parameters within an INIT can be processed in any order.
Initiate Tag: 32 bits (unsigned integer) Initiate Tag: 32 bits (unsigned integer)
The receiver of the INIT (the responding end) records the value of The receiver of the INIT (the responding end) records the value of
the Initiate Tag parameter. This value MUST be placed into the the Initiate Tag parameter. This value MUST be placed into the
Verification Tag field of every SCTP packet that the receiver of the Verification Tag field of every SCTP packet that the receiver of
INIT transmits within this association. the INIT transmits within this association.
The Initiate Tag is allowed to have any value except 0. See The Initiate Tag is allowed to have any value except 0. See
Section 5.3.1 for more on the selection of the tag value. Section 5.3.1 for more on the selection of the tag value.
If the value of the Initiate Tag in a received INIT chunk is found If the value of the Initiate Tag in a received INIT chunk is found
to be 0, the receiver MUST treat it as an error and close to be 0, the receiver MUST treat it as an error and close the
the association by transmitting an ABORT. association by transmitting an ABORT.
Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned integer) Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned
integer)
This value represents the dedicated buffer space, in number of This value represents the dedicated buffer space, in number of
bytes, the sender of the INIT has reserved in association with this bytes, the sender of the INIT has reserved in association with
window. During the life of the association this buffer space SHOULD this window. During the life of the association this buffer space
not be lessened (i.e. dedicated buffers taken away from this SHOULD not be lessened (i.e. dedicated buffers taken away from
association); however, an endpoint MAY change the value of a_rwnd this association); however, an endpoint MAY change the value of
it sends in SACK chunks. a_rwnd it sends in SACK chunks.
Number of Outbound Streams (OS): 16 bits (unsigned integer) Number of Outbound Streams (OS): 16 bits (unsigned integer)
Defines the number of outbound streams the sender of this INIT chunk Defines the number of outbound streams the sender of this INIT
wishes to create in this association. The value of 0 MUST NOT be chunk wishes to create in this association. The value of 0 MUST
used. NOT be used.
Note: A receiver of an INIT with the OS value set to 0 SHOULD abort Note: A receiver of an INIT with the OS value set to 0 SHOULD
the association. abort the association.
Number of Inbound Streams (MIS) : 16 bits (unsigned integer) Number of Inbound Streams (MIS) : 16 bits (unsigned integer)
Defines the maximum number of streams the sender of this INIT chunk Defines the maximum number of streams the sender of this INIT
allows the peer end to create in this association. The value 0 MUST chunk allows the peer end to create in this association. The
NOT be used. value 0 MUST NOT be used.
Note: There is no negotiation of the actual number of streams Note: There is no negotiation of the actual number of streams but
but instead the two endpoints will use the min(requested, instead the two endpoints will use the min(requested, offered).
offered). See Section 5.1.1 for details. See Section 5.1.1 for details.
Note: A receiver of an INIT with the MIS value of 0 SHOULD abort Note: A receiver of an INIT with the MIS value of 0 SHOULD abort
the association. the association.
Initial TSN (I-TSN) : 32 bits (unsigned integer) Initial TSN (I-TSN) : 32 bits (unsigned integer)
Defines the initial TSN that the sender will use. The valid range is Defines the initial TSN that the sender will use. The valid range
from 0 to 4294967295. This field MAY be set to the value of the is from 0 to 4294967295. This field MAY be set to the value of
Initiate Tag field. the Initiate Tag field.
3.3.2.1 Optional/Variable Length Parameters in INIT 3.3.2.1 Optional/Variable Length Parameters in INIT
The following parameters follow the Type-Length-Value format as The following parameters follow the Type-Length-Value format as
defined in Section 3.2.1. Any Type-Length-Value fields MUST come defined in Section 3.2.1. Any Type-Length-Value fields MUST come
after the fixed-length fields defined in the previous section. after the fixed-length fields defined in the previous section.
IPv4 Address Parameter (5)
0 1 2 3 IPv4 Address Parameter (5)
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 5 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv4 Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IPv4 Address: 32 bits (unsigned integer) 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 5 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv4 Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Contains an IPv4 address of the sending endpoint. It is binary IPv4 Address: 32 bits (unsigned integer)
encoded.
IPv6 Address Parameter (6) Contains an IPv4 address of the sending endpoint. It is binary
encoded.
0 1 2 3 IPv6 Address Parameter (6)
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 6 | Length = 20 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| IPv6 Address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IPv6 Address: 128 bit (unsigned integer) 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 6 | Length = 20 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| IPv6 Address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Contains an IPv6 address of the sending endpoint. It is binary IPv6 Address: 128 bit (unsigned integer)
encoded.
Note: A sender MUST NOT use an IPv4-mapped IPv6 address [RFC2373] Contains an IPv6 address of the sending endpoint. It is binary
but should instead use an IPv4 Address Parameter for an IPv4 address. encoded.
Combined with the Source Port Number in the SCTP common header, the Note: A sender MUST NOT use an IPv4-mapped IPv6 address [RFC2373]
value passed in an IPv4 or IPv6 Address parameter indicates a but should instead use an IPv4 Address Parameter for an IPv4
transport address the sender of the INIT will support for the address.
association being initiated. That is, during the lifetime of this
association, this IP address can appear in the source address field
of an IP datagram sent from the sender of the INIT, and can be used
as a destination address of an IP datagram sent from the receiver of
the INIT.
More than one IP Address parameter can be included in an INIT Combined with the Source Port Number in the SCTP common header,
chunk when the INIT sender is multi-homed. Moreover, a multi-homed the value passed in an IPv4 or IPv6 Address parameter indicates a
endpoint may have access to different types of network, thus more transport address the sender of the INIT will support for the
than one address type can be present in one INIT chunk, i.e., IPv4 association being initiated. That is, during the lifetime of this
and IPv6 addresses are allowed in the same INIT chunk. association, this IP address can appear in the source address
field of an IP datagram sent from the sender of the INIT, and can
be used as a destination address of an IP datagram sent from the
receiver of the INIT.
If the INIT contains at least one IP Address parameter, then the More than one IP Address parameter can be included in an INIT
source address of the IP datagram containing the INIT chunk and any chunk when the INIT sender is multi-homed. Moreover, a multi-
additional address(es) provided within the INIT can be used as homed endpoint may have access to different types of network, thus
destinations by the endpoint receiving the INIT. If the INIT does more than one address type can be present in one INIT chunk, i.e.,
not contain any IP Address parameters, the endpoint receiving the IPv4 and IPv6 addresses are allowed in the same INIT chunk.
INIT MUST use the source address associated with the received IP
datagram as its sole destination address for the association.
Note that not using any IP address parameters in the INIT and INIT-ACK If the INIT contains at least one IP Address parameter, then the
is an alternative to make an association more likely to work across source address of the IP datagram containing the INIT chunk and
a NAT box. any additional address(es) provided within the INIT can be used as
destinations by the endpoint receiving the INIT. If the INIT does
not contain any IP Address parameters, the endpoint receiving the
INIT MUST use the source address associated with the received IP
datagram as its sole destination address for the association.
Cookie Preservative (9) Note that not using any IP address parameters in the INIT and
INIT-ACK is an alternative to make an association more likely to
work across a NAT box.
The sender of the INIT shall use this parameter to suggest to the Cookie Preservative (9)
receiver of the INIT for a longer life-span of the State Cookie.
0 1 2 3 The sender of the INIT shall use this parameter to suggest to the
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 receiver of the INIT for a longer life-span of the State Cookie.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 9 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Suggested Cookie Life-span Increment (msec.) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Suggested Cookie Life-span Increment: 32 bits (unsigned integer) 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 9 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Suggested Cookie Life-span Increment (msec.) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This parameter indicates to the receiver how much increment in Suggested Cookie Life-span Increment: 32 bits (unsigned integer)
milliseconds the sender wishes the receiver to add to its default
cookie life-span.
This optional parameter should be added to the INIT chunk by the This parameter indicates to the receiver how much increment in
sender when it re-attempts establishing an association with a peer milliseconds the sender wishes the receiver to add to its default
to which its previous attempt of establishing the association failed cookie life-span.
due to a stale cookie operation error. The receiver MAY choose to
ignore the suggested cookie life-span increase for its own security
reasons.
Host Name Address (11) This optional parameter should be added to the INIT chunk by the
sender when it re-attempts establishing an association with a peer
to which its previous attempt of establishing the association failed
due to a stale cookie operation error. The receiver MAY choose to
ignore the suggested cookie life-span increase for its own security
reasons.
The sender of INIT uses this parameter to pass its Host Name (in Host Name Address (11)
place of its IP addresses) to its peer. The peer is responsible for
resolving the name. Using this parameter might make it more likely
for the association to work across a NAT box.
0 1 2 3 The sender of INIT uses this parameter to pass its Host Name (in
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 place of its IP addresses) to its peer. The peer is responsible
for resolving the name. Using this parameter might make it more
likely for the association to work across a NAT box.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0 1 2 3
| Type = 11 | Length | 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Host Name / | Type = 11 | Length |
\ \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Host Name /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Host Name: variable length Host Name: variable length
This field contains a host name in "host name syntax" per RFC1123 This field contains a host name in "host name syntax" per RFC1123
Section 2.1 [RFC1123]. The method for resolving the host name is Section 2.1 [RFC1123]. The method for resolving the host name is
out of scope of SCTP. out of scope of SCTP.
Note: At least one null terminator is included in the Host Name Note: At least one null terminator is included in the Host Name
string and must be included in the length. string and must be included in the length.
Supported Address Types (12) Supported Address Types (12)
The sender of INIT uses this parameter to list all the address types The sender of INIT uses this parameter to list all the address
it can support. types it can support.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 12 | Length | | Type = 12 | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address Type #1 | Address Type #2 | | Address Type #1 | Address Type #2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...... | ......
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Address Type: 16 bits (unsigned integer) Address Type: 16 bits (unsigned integer)
This is filled with the type value of the corresponding address This is filled with the type value of the corresponding address
TLV (e.g., IPv4 = 5, IPv6 = 6, Hostname = 11). TLV (e.g., IPv4 = 5, IPv6 = 6, Hostname = 11).
3.3.3 Initiation Acknowledgement (INIT ACK) (2): 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
The INIT ACK chunk is used to acknowledge the initiation of an SCTP The INIT ACK chunk is used to acknowledge the initiation of an SCTP
association. association.
The parameter part of INIT ACK is formatted similarly to the INIT
chunk. It uses two extra variable parameters: The State Cookie
and the Unrecognized Parameter:
The format of the INIT ACK chunk is shown below: The parameter part of INIT ACK is formatted similarly to the INIT
chunk. It uses two extra variable parameters: The State Cookie and
the Unrecognized Parameter:
0 1 2 3 The format of the INIT ACK chunk is shown below:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 2 | Chunk Flags | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initiate Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertised Receiver Window Credit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Outbound Streams | Number of Inbound Streams |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initial TSN |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \
/ Optional/Variable-Length Parameters /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Initiate Tag: 32 bits (unsigned integer) 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 2 | Chunk Flags | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initiate Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertised Receiver Window Credit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Outbound Streams | Number of Inbound Streams |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initial TSN |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \
/ Optional/Variable-Length Parameters /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The receiver of the INIT ACK records the value of the Initiate Tag Initiate Tag: 32 bits (unsigned integer)
parameter. This value MUST be placed into the Verification Tag
field of every SCTP packet that the INIT ACK receiver transmits
within this association.
The Initiate Tag MUST NOT take the value 0. See Section 5.3.1 for The receiver of the INIT ACK records the value of the Initiate Tag
more on the selection of the Initiate Tag value. parameter. This value MUST be placed into the Verification Tag
field of every SCTP packet that the INIT ACK receiver transmits
within this association.
If the value of the Initiate Tag in a received INIT ACK chunk is The Initiate Tag MUST NOT take the value 0. See Section 5.3.1 for
found to be 0, the receiver MUST treat it as an error and close the more on the selection of the Initiate Tag value.
association by transmitting an ABORT.
Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned integer) If the value of the Initiate Tag in a received INIT ACK chunk is
found to be 0, the receiver MUST treat it as an error and close
the association by transmitting an ABORT.
This value represents the dedicated buffer space, in number of Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned
bytes, the sender of the INIT ACK has reserved in association with integer)
this window. During the life of the association this buffer space
SHOULD not be lessened (i.e. dedicated buffers taken away from this
association).
Number of Outbound Streams (OS): 16 bits (unsigned integer) This value represents the dedicated buffer space, in number of
bytes, the sender of the INIT ACK has reserved in association with
this window. During the life of the association this buffer space
SHOULD not be lessened (i.e. dedicated buffers taken away from
this association).
Defines the number of outbound streams the sender of this INIT ACK Number of Outbound Streams (OS): 16 bits (unsigned integer)
chunk wishes to create in this association. The value of 0 MUST NOT
be used.
Note: A receiver of an INIT ACK with the OS value set to 0 SHOULD destroy Defines the number of outbound streams the sender of this INIT ACK
the association discarding its TCB. chunk wishes to create in this association. The value of 0 MUST
NOT be used.
Number of Inbound Streams (MIS) : 16 bits (unsigned integer) Note: A receiver of an INIT ACK with the OS value set to 0 SHOULD
destroy the association discarding its TCB.
Defines the maximum number of streams the sender of this INIT ACK Number of Inbound Streams (MIS) : 16 bits (unsigned integer)
chunk allows the peer end to create in this association. The value 0
MUST NOT be used.
Note: There is no negotiation of the actual number of streams but Defines the maximum number of streams the sender of this INIT ACK
instead the two endpoints will use the min(requested, chunk allows the peer end to create in this association. The
offered). See Section 5.1.1 for details. value 0 MUST NOT be used.
Note: A receiver of an INIT ACK with the MIS value set to 0 SHOULD destroy Note: There is no negotiation of the actual number of streams but
the association discarding its TCB. instead the two endpoints will use the min(requested, offered).
See Section 5.1.1 for details.
Initial TSN (I-TSN) : 32 bits (unsigned integer) Note: A receiver of an INIT ACK with the MIS value set to 0
SHOULD destroy the association discarding its TCB.
Defines the initial TSN that the INIT-ACK sender will use. The valid Initial TSN (I-TSN) : 32 bits (unsigned integer)
range is from 0 to 4294967295. This field MAY be set to the value
of the Initiate Tag field.
Fixed Parameters Status Defines the initial TSN that the INIT-ACK sender will use. The
Initiate Tag Mandatory valid range is from 0 to 4294967295. This field MAY be set to the
Advertised Receiver Window Credit Mandatory value of the Initiate Tag field.
Number of Outbound Streams Mandatory
Number of Inbound Streams Mandatory
Initial TSN Mandatory
Variable Parameters Status Type Value Fixed Parameters Status
State Cookie Mandatory 7 ----------------------------------------------
IPv4 Address (Note 1) Optional 5 Initiate Tag Mandatory
IPv6 Address (Note 1) Optional 6 Advertised Receiver Window Credit Mandatory
Unrecognized Parameters Optional 8 Number of Outbound Streams Mandatory
Reserved for ECN Capable (Note 2) Optional 32768 (0x8000) Number of Inbound Streams Mandatory
Host Name Address (Note 3) Optional 11 Initial TSN Mandatory
Variable Parameters Status Type Value
-------------------------------------------------------------
State Cookie Mandatory 7
IPv4 Address (Note 1) Optional 5
IPv6 Address (Note 1) Optional 6
Unrecognized Parameters Optional 8
Reserved for ECN Capable (Note 2) Optional 32768 (0x8000)
Host Name Address (Note 3) Optional 11
Note 1: The INIT ACK chunks can contain any number of IP address Note 1: The INIT ACK chunks can contain any number of IP address
parameters that can be IPv4 and/or IPv6 in any combination. parameters that can be IPv4 and/or IPv6 in any combination.
Note 2: The ECN capable field is reserved for future use of Explicit Note 2: The ECN capable field is reserved for future use of Explicit
Congestion Notification. Congestion Notification.
Note 3: The INIT ACK chunks MUST NOT contain more than one Host Name Note 3: The INIT ACK chunks MUST NOT contain more than one Host Name
address parameter. Moreover, the sender of the INIT ACK MUST NOT address parameter. Moreover, the sender of the INIT ACK MUST NOT
combine any other address types with the Host Name address in the combine any other address types with the Host Name address in the
INIT ACK. The receiver of the INIT ACK MUST ignore any other INIT ACK. The receiver of the INIT ACK MUST ignore any other address
address types if the Host Name address parameter is present. types if the Host Name address parameter is present.
IMPLEMENTATION NOTE: An implementation MUST be prepared to receive IMPLEMENTATION NOTE: An implementation MUST be prepared to receive a
a INIT ACK that is quite large (more than 1500 bytes) due to INIT ACK that is quite large (more than 1500 bytes) due to the
the variable size of the state cookie AND the variable address variable size of the state cookie AND the variable address list. For
list. For example if a responder to the INIT has 1000 IPv4 example if a responder to the INIT has 1000 IPv4 addresses it wishes
addresses it wishes to send, it would need at least 8,000 bytes to send, it would need at least 8,000 bytes to encode this in the
to encode this in the INIT ACK. INIT ACK.
In combination with the Source Port carried in the SCTP common header, In combination with the Source Port carried in the SCTP common
each IP Address parameter in the INIT ACK indicates to the receiver of header, each IP Address parameter in the INIT ACK indicates to the
the INIT ACK a valid transport address supported by the sender of the receiver of the INIT ACK a valid transport address supported by the
INIT ACK for the lifetime of the association being initiated. sender of the INIT ACK for the lifetime of the association being
initiated.
If the INIT ACK contains at least one IP Address parameter, then the If the INIT ACK contains at least one IP Address parameter, then the
source address of the IP datagram containing the INIT ACK and any source address of the IP datagram containing the INIT ACK and any
additional address(es) provided within the INIT ACK may be used as additional address(es) provided within the INIT ACK may be used as
destinations by the receiver of the INIT-ACK. If the INIT ACK does not destinations by the receiver of the INIT-ACK. If the INIT ACK does
contain any IP Address parameters, the receiver of the INIT-ACK MUST not contain any IP Address parameters, the receiver of the INIT-ACK
use the source address associated with the received IP datagram as its MUST use the source address associated with the received IP datagram
sole destination address for the association. as its sole destination address for the association.
The State Cookie and Unrecognized Parameters use the Type-Length- The State Cookie and Unrecognized Parameters use the Type-Length-
Value format as defined in Section 3.2.1 and are described below. The Value format as defined in Section 3.2.1 and are described below.
other fields are defined the same as their counterparts in the INIT The other fields are defined the same as their counterparts in the
chunk. INIT chunk.
3.3.3.1 Optional or Variable Length Parameters 3.3.3.1 Optional or Variable Length Parameters
State Cookie State Cookie
Parameter Type Value: 7
Parameter Length: variable size, depending on Size of Cookie Parameter Type Value: 7
Parameter Value: Parameter Length: variable size, depending on Size of Cookie
This parameter value MUST contain all the necessary state and
parameter information required for the sender of this INIT ACK to
create the association, along with a Message Authentication Code
(MAC). See Section 5.1.3 for details on State Cookie definition.
Unrecognized Parameters: Parameter Value:
Parameter Type Value: 8
Parameter Length: Variable Size. This parameter value MUST contain all the necessary state and
parameter information required for the sender of this INIT ACK
to create the association, along with a Message Authentication
Code (MAC). See Section 5.1.3 for details on State Cookie
definition.
Parameter Value: Unrecognized Parameters:
This parameter is returned to the originator of the INIT chunk
when the INIT contains an unrecognized parameter which has a value Parameter Type Value: 8
that indicates that it should be reported to the sender. This parameter
value field will contain unrecognized parameters copied from Parameter Length: Variable Size.
the INIT chunk complete with Parameter Type, Length and Value fields.
Parameter Value:
This parameter is returned to the originator of the INIT chunk
when the INIT contains an unrecognized parameter which has a
value that indicates that it should be reported to the sender.
This parameter value field will contain unrecognized parameters
copied from the INIT chunk complete with Parameter Type, Length
and Value fields.
3.3.4 Selective Acknowledgement (SACK) (3): 3.3.4 Selective Acknowledgement (SACK) (3):
This chunk is sent to the peer endpoint to acknowledge received DATA This chunk is sent to the peer endpoint to acknowledge received DATA
chunks and to inform the peer endpoint of gaps in the received chunks and to inform the peer endpoint of gaps in the received
subsequences of DATA chunks as represented by their TSNs. subsequences of DATA chunks as represented by their TSNs.
The SACK MUST contain the Cumulative TSN Ack and Advertised Receiver The SACK MUST contain the Cumulative TSN Ack and Advertised Receiver
Window Credit (a_rwnd) parameters. Window Credit (a_rwnd) parameters.
By definition, the value of the Cumulative TSN Ack parameter is the By definition, the value of the Cumulative TSN Ack parameter is the
last TSN received before a break in the sequence of received TSNs last TSN received before a break in the sequence of received TSNs
occurs; the next TSN value following this one has not yet been received occurs; the next TSN value following this one has not yet been
at the endpoint sending the SACK. This parameter therefore acknowledges received at the endpoint sending the SACK. This parameter therefore
receipt of all TSNs less than or equal to its value. acknowledges receipt of all TSNs less than or equal to its value.
The handling of a_rwnd by the receiver of the SACK is discussed in The handling of a_rwnd by the receiver of the SACK is discussed in
detail in Section 6.2.1. detail in Section 6.2.1.
The SACK also contains zero or more Gap Ack Blocks. Each The SACK also contains zero or more Gap Ack Blocks. Each Gap Ack
Gap Ack Block acknowledges a subsequence of TSNs received following Block acknowledges a subsequence of TSNs received following a break
a break in the sequence of received TSNs. By definition, all TSNs in the sequence of received TSNs. By definition, all TSNs
acknowledged by Gap Ack Blocks are greater than the value of the acknowledged by Gap Ack Blocks are greater than the value of the
Cumulative TSN Ack. Cumulative TSN Ack.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 3 |Chunk Flags | Chunk Length | | Type = 3 |Chunk Flags | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cumulative TSN Ack | | Cumulative TSN Ack |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertised Receiver Window Credit (a_rwnd) | | Advertised Receiver Window Credit (a_rwnd) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Gap Ack Blocks = N | Number of Duplicate TSNs = X | | Number of Gap Ack Blocks = N | Number of Duplicate TSNs = X |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Gap Ack Block #1 Start | Gap Ack Block #1 End | | Gap Ack Block #1 Start | Gap Ack Block #1 End |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ / / /
\ ... \ \ ... \
/ / / /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Gap Ack Block #N Start | Gap Ack Block #N End | | Gap Ack Block #N Start | Gap Ack Block #N End |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Duplicate TSN 1 | | Duplicate TSN 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ / / /
\ ... \ \ ... \
/ / / /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Duplicate TSN X | | Duplicate TSN X |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Set to all zeros on transmit and ignored on receipt. Set to all zeros on transmit and ignored on receipt.
Cumulative TSN Ack: 32 bits (unsigned integer) Cumulative TSN Ack: 32 bits (unsigned integer)
This parameter contains the TSN of the last DATA chunk received in This parameter contains the TSN of the last DATA chunk received in
sequence before a gap. sequence before a gap.
Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned integer) Advertised Receiver Window Credit (a_rwnd): 32 bits (unsigned
integer)
This field indicates the updated receive buffer space in bytes of This field indicates the updated receive buffer space in bytes of
the sender of this SACK, see Section 6.2.1 for details. the sender of this SACK, see Section 6.2.1 for details.
Number of Gap Ack Blocks: 16 bits (unsigned integer) Number of Gap Ack Blocks: 16 bits (unsigned integer)
Indicates the number of Gap Ack Blocks included in this SACK.
Number of Duplicate TSNs: 16 bit Indicates the number of Gap Ack Blocks included in this SACK.
This field contains the number of duplicate TSNs the endpoint Number of Duplicate TSNs: 16 bit
has received. Each duplicate TSN is listed following the Gap Ack
Block list.
Gap Ack Blocks: This field contains the number of duplicate TSNs the endpoint has
received. Each duplicate TSN is listed following the Gap Ack
Block list.
These fields contain the Gap Ack Blocks. They are repeated for each Gap Ack Blocks:
Gap Ack Block up to the number of Gap Ack Blocks defined in the
Number of Gap Ack Blocks field. All DATA chunks with TSNs greater
than or equal to (Cumulative TSN Ack + Gap Ack Block Start) and less
than or equal to (Cumulative TSN Ack + Gap Ack Block End) of each Gap
Ack Block are assumed to have been received correctly.
Gap Ack Block Start: 16 bits (unsigned integer) These fields contain the Gap Ack Blocks. They are repeated for
each Gap Ack Block up to the number of Gap Ack Blocks defined in
the Number of Gap Ack Blocks field. All DATA chunks with TSNs
greater than or equal to (Cumulative TSN Ack + Gap Ack Block
Start) and less than or equal to (Cumulative TSN Ack + Gap Ack
Block End) of each Gap Ack Block are assumed to have been received
correctly.
Indicates the Start offset TSN for this Gap Ack Block. To calculate Gap Ack Block Start: 16 bits (unsigned integer)
the actual TSN number the Cumulative TSN Ack is added to this
offset number. This calculated TSN identifies the first TSN in this
Gap Ack Block that has been received.
Gap Ack Block End: 16 bits (unsigned integer) Indicates the Start offset TSN for this Gap Ack Block. To
calculate the actual TSN number the Cumulative TSN Ack is added to
this offset number. This calculated TSN identifies the first TSN
in this Gap Ack Block that has been received.
Indicates the End offset TSN for this Gap Ack Block. To calculate the Gap Ack Block End: 16 bits (unsigned integer)
actual TSN number the Cumulative TSN Ack is added to this
offset number. This calculated TSN identifies the TSN of the last
DATA chunk received in this Gap Ack Block.
For example, assume the receiver has the following DATA chunks newly Indicates the End offset TSN for this Gap Ack Block. To calculate
arrived at the time when it decides to send a Selective ACK, the actual TSN number the Cumulative TSN Ack is added to this
offset number. This calculated TSN identifies the TSN of the last
DATA chunk received in this Gap Ack Block.
---------- For example, assume the receiver has the following DATA chunks newly
| TSN=17 | arrived at the time when it decides to send a Selective ACK,
---------- ----------
| | <- still missing | TSN=17 |
---------- ----------
| TSN=15 | | | <- still missing
---------- ----------
| TSN=14 | | TSN=15 |
---------- ----------
| | <- still missing | TSN=14 |
---------- ----------
| TSN=12 | | | <- still missing
---------- ----------
| TSN=11 | | TSN=12 |
---------- ----------
| TSN=10 | | TSN=11 |
---------- ----------
| TSN=10 |
----------
then, the parameter part of the SACK MUST be constructed as then, the parameter part of the SACK MUST be constructed as follows
follows (assuming the new a_rwnd is set to 4660 by the sender): (assuming the new a_rwnd is set to 4660 by the sender):
+--------------------------------+ +--------------------------------+
| Cumulative TSN Ack = 12 | | Cumulative TSN Ack = 12 |
+--------------------------------+ +--------------------------------+
| a_rwnd = 4660 | | a_rwnd = 4660 |
+----------------+---------------+ +----------------+---------------+
| num of block=2 | num of dup=0 | | num of block=2 | num of dup=0 |
+----------------+---------------+ +----------------+---------------+
|block #1 strt=2 |block #1 end=3 | |block #1 strt=2 |block #1 end=3 |
+----------------+---------------+ +----------------+---------------+
|block #2 strt=5 |block #2 end=5 | |block #2 strt=5 |block #2 end=5 |
+----------------+---------------+ +----------------+---------------+
Duplicate TSN: 32 bits (unsigned integer) Duplicate TSN: 32 bits (unsigned integer)
Indicates the number of times a TSN was received in duplicate since Indicates the number of times a TSN was received in duplicate
the last SACK was sent. Every time a receiver gets a duplicate TSN since the last SACK was sent. Every time a receiver gets a
(before sending the SACK) it adds it to the list of duplicates. The duplicate TSN (before sending the SACK) it adds it to the list of
duplicate count is re-initialized to zero after sending each SACK. duplicates. The duplicate count is re-initialized to zero after
sending each SACK.
For example, if a receiver were to get the TSN 19 three times For example, if a receiver were to get the TSN 19 three times it
it would list 19 twice in the outbound SACK. After sending the would list 19 twice in the outbound SACK. After sending the SACK
SACK if it received yet one more TSN 19 it would list 19 as a if it received yet one more TSN 19 it would list 19 as a duplicate
duplicate once in the next outgoing SACK. once in the next outgoing SACK.
3.3.5 Heartbeat Request (HEARTBEAT) (4): 3.3.5 Heartbeat Request (HEARTBEAT) (4):
An endpoint should send this chunk to its peer endpoint to probe the An endpoint should send this chunk to its peer endpoint to probe the
reachability of a particular destination transport address defined in reachability of a particular destination transport address defined in
the present association. the present association.
The parameter field contains the Heartbeat Information which is a
variable length opaque data structure understood only by the sender.
0 1 2 3 The parameter field contains the Heartbeat Information which is a
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 variable length opaque data structure understood only by the sender.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 4 | Chunk Flags | Heartbeat Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \
/ Heartbeat Information TLV (Variable-Length) /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 4 | Chunk Flags | Heartbeat Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \
/ Heartbeat Information TLV (Variable-Length) /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Set to zero on transmit and ignored on receipt. Chunk Flags: 8 bits
Heartbeat Length: 16 bits (unsigned integer) Set to zero on transmit and ignored on receipt.
Set to the size of the chunk in bytes, including the chunk header Heartbeat Length: 16 bits (unsigned integer)
and the Heartbeat Information field.
Heartbeat Information: variable length Set to the size of the chunk in bytes, including the chunk header
and the Heartbeat Information field.
Defined as a variable-length parameter using the format described in Heartbeat Information: variable length
Section 3.2.1, i.e.:
Variable Parameters Status Type Value Defined as a variable-length parameter using the format described
------------------------------------------------------------- in Section 3.2.1, i.e.:
Heartbeat Info Mandatory 1
0 1 2 3 Variable Parameters Status Type Value
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 -------------------------------------------------------------
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Heartbeat Info Mandatory 1
| Heartbeat Info Type=1 | HB Info Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Sender-specific Heartbeat Info /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Sender-specific Heartbeat Info field should normally include 0 1 2 3
information about the sender's current time when this HEARTBEAT 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
chunk is sent and the destination transport address to which this +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
HEARTBEAT is sent (see Section 8.3). | Heartbeat Info Type=1 | HB Info Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Sender-specific Heartbeat Info /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Sender-specific Heartbeat Info field should normally include
information about the sender's current time when this HEARTBEAT
chunk is sent and the destination transport address to which this
HEARTBEAT is sent (see Section 8.3).
3.3.6 Heartbeat Acknowledgement (HEARTBEAT ACK) (5): 3.3.6 Heartbeat Acknowledgement (HEARTBEAT ACK) (5):
An endpoint should send this chunk to its peer endpoint as a response An endpoint should send this chunk to its peer endpoint as a response
to a HEARTBEAT chunk (see Section 8.3). A HEARTBEAT ACK is always to a HEARTBEAT chunk (see Section 8.3). A HEARTBEAT ACK is always
sent to the source IP address of the IP datagram containing the sent to the source IP address of the IP datagram containing the
HEARTBEAT chunk to which this ack is responding. HEARTBEAT chunk to which this ack is responding.
The parameter field contains a variable length opaque data structure. The parameter field contains a variable length opaque data structure.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 5 | Chunk Flags | Heartbeat Ack Length | | Type = 5 | Chunk Flags | Heartbeat Ack Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ Heartbeat Information TLV (Variable-Length) / / Heartbeat Information TLV (Variable-Length) /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Set to zero on transmit and ignored on receipt. Set to zero on transmit and ignored on receipt.
Heartbeat Ack Length: 16 bits (unsigned integer) Heartbeat Ack Length: 16 bits (unsigned integer)
Set to the size of the chunk in bytes, including the chunk header Set to the size of the chunk in bytes, including the chunk header
and the Heartbeat Information field. and the Heartbeat Information field.
Heartbeat Information: variable length Heartbeat Information: variable length
This field MUST contain the Heartbeat Information parameter of This field MUST contain the Heartbeat Information parameter of
the Heartbeat Request to which this Heartbeat Acknowledgement is the Heartbeat Request to which this Heartbeat Acknowledgement is
responding. responding.
Variable Parameters Status Type Value Variable Parameters Status Type Value
------------------------------------------------------------- -------------------------------------------------------------
Heartbeat Info Mandatory 1 Heartbeat Info Mandatory 1
3.3.7 Abort Association (ABORT) (6): 3.3.7 Abort Association (ABORT) (6):
The ABORT chunk is sent to the peer of an association to close the The ABORT chunk is sent to the peer of an association to close the
association. The ABORT chunk may contain Cause Parameters to inform association. The ABORT chunk may contain Cause Parameters to inform
the receiver the reason of the abort. DATA chunks MUST NOT be bundled the receiver the reason of the abort. DATA chunks MUST NOT be
with ABORT. Control chunks (except for INIT, INIT ACK and SHUTDOWN bundled with ABORT. Control chunks (except for INIT, INIT ACK and
COMPLETE) MAY be bundled with an ABORT but they MUST be placed before SHUTDOWN COMPLETE) MAY be bundled with an ABORT but they MUST be
the ABORT in the SCTP packet, or they will be ignored by the receiver. placed before the ABORT in the SCTP packet, or they will be ignored
by the receiver.
If an endpoint receives an ABORT with a format error or for an If an endpoint receives an ABORT with a format error or for an
association that doesn't exist, it MUST silently discard it. association that doesn't exist, it MUST silently discard it.
Moreover, under any circumstances, an endpoint that receives an ABORT Moreover, under any circumstances, an endpoint that receives an ABORT
MUST NOT respond to that ABORT by sending an ABORT of its own. MUST NOT respond to that ABORT by sending an ABORT of its own.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 6 |Reserved |T| Length | | Type = 6 |Reserved |T| Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ zero or more Error Causes / / zero or more Error Causes /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Reserved: 7 bits Reserved: 7 bits
Set to 0 on transmit and ignored on receipt.
T bit: 1 bit Set to 0 on transmit and ignored on receipt.
The T bit is set to 0 if the sender had a TCB that it destroyed. If
the sender did NOT have a TCB it should set this bit to 1.
Note: Special rules apply to this chunk for verification, please T bit: 1 bit
see Section 8.5.1 for details.
Length: 16 bits (unsigned integer) The T bit is set to 0 if the sender had a TCB that it destroyed.
If the sender did not have a TCB it should set this bit to 1.
Set to the size of the chunk in bytes, including the chunk header Note: Special rules apply to this chunk for verification, please see
and all the Error Cause fields present. Section 8.5.1 for details.
See Section 3.3.10 for Error Cause definitions. Length: 16 bits (unsigned integer)
Set to the size of the chunk in bytes, including the chunk header
and all the Error Cause fields present.
See Section 3.3.10 for Error Cause definitions.
3.3.8 Shutdown Association (SHUTDOWN) (7): 3.3.8 Shutdown Association (SHUTDOWN) (7):
An endpoint in an association MUST use this chunk to initiate a An endpoint in an association MUST use this chunk to initiate a
graceful close of the association with its peer. This chunk has graceful close of the association with its peer. This chunk has the
the following format. following format.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 7 | Chunk Flags | Length = 8 | | Type = 7 | Chunk Flags | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cumulative TSN Ack | | Cumulative TSN Ack |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Set to zero on transmit and ignored on receipt. Set to zero on transmit and ignored on receipt.
Length: 16 bits (unsigned integer) Length: 16 bits (unsigned integer)
Indicates the length of the parameter. Set to 8.
Cumulative TSN Ack: 32 bits (unsigned integer) Indicates the length of the parameter. Set to 8.
This parameter contains the TSN of the last chunk received in Cumulative TSN Ack: 32 bits (unsigned integer)
sequence before any gaps.
Note: Since the SHUTDOWN message does not contain Gap Ack Blocks, it This parameter contains the TSN of the last chunk received in
cannot be used to acknowledge TSNs received out of order. In a SACK, sequence before any gaps.
lack of Gap Ack Blocks that were previously included indicates that
the data receiver reneged on the associated DATA chunks. Since Note: Since the SHUTDOWN message does not contain Gap Ack Blocks,
SHUTDOWN does not contain Gap Ack Blocks, the receiver of the it cannot be used to acknowledge TSNs received out of order. In a
SHUTDOWN shouldn't interpret the lack of a Gap Ack Block as a renege. SACK, lack of Gap Ack Blocks that were previously included
(see Section 6.2 for information on reneging) indicates that the data receiver reneged on the associated DATA
chunks. Since SHUTDOWN does not contain Gap Ack Blocks, the
receiver of the SHUTDOWN shouldn't interpret the lack of a Gap Ack
Block as a renege. (see Section 6.2 for information on reneging)
3.3.9 Shutdown Acknowledgement (SHUTDOWN ACK) (8): 3.3.9 Shutdown Acknowledgement (SHUTDOWN ACK) (8):
This chunk MUST be used to acknowledge the receipt of the SHUTDOWN This chunk MUST be used to acknowledge the receipt of the SHUTDOWN
chunk at the completion of the shutdown process, see Section 9.2 for chunk at the completion of the shutdown process, see Section 9.2 for
details. details.
The SHUTDOWN ACK chunk has no parameters. The SHUTDOWN ACK chunk has no parameters.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 8 |Chunk Flags | Length = 4 | | Type = 8 |Chunk Flags | Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Set to zero on transmit and ignored on receipt. Set to zero on transmit and ignored on receipt.
3.3.10 Operation Error (ERROR) (9): 3.3.10 Operation Error (ERROR) (9):
An endpoint sends this chunk to its peer endpoint to notify it of An endpoint sends this chunk to its peer endpoint to notify it of
certain error conditions. It contains one or more error causes. An certain error conditions. It contains one or more error causes. An
Operation Error is not considered fatal in and of itself, but may be Operation Error is not considered fatal in and of itself, but may be
used with an ABORT chunk to report a fatal condition. It has the used with an ABORT chunk to report a fatal condition. It has the
following parameters: following parameters:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 9 | Chunk Flags | Length | | Type = 9 | Chunk Flags | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \ \ \
/ one or more Error Causes / / one or more Error Causes /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Set to zero on transmit and ignored on receipt. Set to zero on transmit and ignored on receipt.
Length: 16 bits (unsigned integer) Length: 16 bits (unsigned integer)
Set to the size of the chunk in bytes, including the chunk header Set to the size of the chunk in bytes, including the chunk header
and all the Error Cause fields present. and all the Error Cause fields present.
Error causes are defined as variable-length parameters using the Error causes are defined as variable-length parameters using the
format described in 3.2.1, i.e.: format described in 3.2.1, i.e.:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code | Cause Length | | Cause Code | Cause Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Cause-specific Information / / Cause-specific Information /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Cause Code: 16 bits (unsigned integer) Cause Code: 16 bits (unsigned integer)
Defines the type of error conditions being reported. Defines the type of error conditions being reported.
Cause Code Cause Code
Value Cause Code Value Cause Code
--------- ---------------- --------- ----------------
1 Invalid Stream Identifier 1 Invalid Stream Identifier
2 Missing Mandatory Parameter 2 Missing Mandatory Parameter
3 Stale Cookie Error 3 Stale Cookie Error
4 Out of Resource 4 Out of Resource
5 Unresolvable Address 5 Unresolvable Address
6 Unrecognized Chunk Type 6 Unrecognized Chunk Type
7 Invalid Mandatory Parameter 7 Invalid Mandatory Parameter
8 Unrecognized Parameters 8 Unrecognized Parameters
9 No User Data 9 No User Data
10 Cookie Received While Shutting Down 10 Cookie Received While Shutting Down
Cause Length: 16 bits (unsigned integer) Cause Length: 16 bits (unsigned integer)
Set to the size of the parameter in bytes, including the Cause Code, Set to the size of the parameter in bytes, including the Cause
Cause Length, and Cause-Specific Information fields Code, Cause Length, and Cause-Specific Information fields
Cause-specific Information: variable length Cause-specific Information: variable length
This field carries the details of the error condition. This field carries the details of the error condition.
Sections 3.3.10.1 - 3.3.10.8 define error causes for SCTP. Guidelines Sections 3.3.10.1 - 3.3.10.10 define error causes for SCTP.
for the IETF to define new error cause values are discussed in Section Guidelines for the IETF to define new error cause values are
13.3. discussed in Section 13.3.
3.3.10.1 Invalid Stream Identifier (1) 3.3.10.1 Invalid Stream Identifier (1)
Cause of error Cause of error
--------------- ---------------
Invalid Stream Identifier: Indicates endpoint received a DATA chunk Invalid Stream Identifier: Indicates endpoint received a DATA chunk
sent to a nonexistent stream. sent to a nonexistent stream.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=1 | Cause Length=8 | | Cause Code=1 | Cause Length=8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream Identifier | (Reserved) | | Stream Identifier | (Reserved) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Stream Identifier: 16 bits (unsigned integer) Stream Identifier: 16 bits (unsigned integer)
Contains the Stream Identifier of the DATA chunk received in
error. Contains the Stream Identifier of the DATA chunk received in
error.
Reserved: 16 bits Reserved: 16 bits
This field is reserved. It is set to all 0's on transmit and
Ignored on receipt. This field is reserved. It is set to all 0's on transmit and
Ignored on receipt.
3.3.10.2 Missing Mandatory Parameter (2) 3.3.10.2 Missing Mandatory Parameter (2)
Cause of error Cause of error
--------------- ---------------
Missing Mandatory Parameter: Indicates that one or more Missing Mandatory Parameter: Indicates that one or more mandatory
mandatory TLV parameters are missing in a received INIT or INIT ACK. TLV parameters are missing in a received INIT or INIT ACK.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=2 | Cause Length=8+N*2 | | Cause Code=2 | Cause Length=8+N*2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of missing params=N | | Number of missing params=N |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Missing Param Type #1 | Missing Param Type #2 | | Missing Param Type #1 | Missing Param Type #2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Missing Param Type #N-1 | Missing Param Type #N | | Missing Param Type #N-1 | Missing Param Type #N |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Number of Missing params: 32 bits (unsigned integer) Number of Missing params: 32 bits (unsigned integer)
This field contains the number of parameters contained in the This field contains the number of parameters contained in the
Cause-specific Information field. Cause-specific Information field.
Missing Param Type: 16 bits (unsigned integer) Missing Param Type: 16 bits (unsigned integer)
Each field will contain the missing mandatory parameter number. Each field will contain the missing mandatory parameter number.
3.3.10.3 Stale Cookie Error (3) 3.3.10.3 Stale Cookie Error (3)
Cause of error Cause of error
-------------- --------------
Stale Cookie Error: Indicates the receipt of a valid State Cookie Stale Cookie Error: Indicates the receipt of a valid State Cookie
that has expired. that has expired.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=3 | Cause Length=8 | | Cause Code=3 | Cause Length=8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Measure of Staleness (usec.) | | Measure of Staleness (usec.) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Measure of Staleness: 32 bits (unsigned integer) Measure of Staleness: 32 bits (unsigned integer)
This field contains the difference, in microseconds, between
The current time and the time the State Cookie expired.
The sender of this error cause MAY choose to report how long past This field contains the difference, in microseconds, between the
expiration the State Cookie is by including a non-zero value in the current time and the time the State Cookie expired.
Measure of Staleness field. If the sender does not wish to provide
this information it should set the Measure of Staleness field to the The sender of this error cause MAY choose to report how long past
value of zero. expiration the State Cookie is by including a non-zero value in
the Measure of Staleness field. If the sender does not wish to
provide this information it should set the Measure of Staleness
field to the value of zero.
3.3.10.4 Out of Resource (4) 3.3.10.4 Out of Resource (4)
Cause of error Cause of error
--------------- ---------------
Out of Resource: Indicates that the sender is out of resource. This Out of Resource: Indicates that the sender is out of resource. This
is usually sent in combination with or within an ABORT. is usually sent in combination with or within an ABORT.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=4 | Cause Length=4 | | Cause Code=4 | Cause Length=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3.3.10.5 Unresolvable Address (5) 3.3.10.5 Unresolvable Address (5)
Cause of error Cause of error
--------------- ---------------
Unresolvable Address: Indicates that the sender is not able to Unresolvable Address: Indicates that the sender is not able to
resolve the specified address parameter (e.g., type of address is resolve the specified address parameter (e.g., type of address is not
not supported by the sender). This is usually sent in combination supported by the sender). This is usually sent in combination with
with or within an ABORT. or within an ABORT.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=5 | Cause Length | | Cause Code=5 | Cause Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Unresolvable Address / / Unresolvable Address /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Unresolvable Address: variable length Unresolvable Address: variable length
The unresolvable address field contains the complete Type, Length
and Value of the address parameter (or Host Name parameter) that The unresolvable address field contains the complete Type, Length
contains the unresolvable address or host name. and Value of the address parameter (or Host Name parameter) that
contains the unresolvable address or host name.
3.3.10.6 Unrecognized Chunk Type (6) 3.3.10.6 Unrecognized Chunk Type (6)
Cause of error Cause of error
--------------- ---------------
Unrecognized Chunk Type: This error cause is returned to the Unrecognized Chunk Type: This error cause is returned to the
originator of the chunk if the receiver does not understand originator of the chunk if the receiver does not understand the chunk
the chunk and the upper bit of the 'Chunk Type' is set to one. and the upper bits of the 'Chunk Type' are set to 01 or 11.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=6 | Cause Length | | Cause Code=6 | Cause Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Unrecognized Chunk / / Unrecognized Chunk /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Unrecognized Chunk: variable length Unrecognized Chunk: variable length
The Unrecognized Chunk field contains the unrecognized The Unrecognized Chunk field contains the unrecognized Chunk from
Chunk from the SCTP packet complete with Chunk Type, the SCTP packet complete with Chunk Type, Chunk Flags and Chunk
Chunk Flags and Chunk Length. Length.
3.3.10.7 Invalid Mandatory Parameter (7) 3.3.10.7 Invalid Mandatory Parameter (7)
Cause of error Cause of error
--------------- ---------------
Invalid Mandatory Parameter: This error cause is returned to the Invalid Mandatory Parameter: This error cause is returned to the
originator of an INIT or INIT ACK chunk when one of the mandatory originator of an INIT or INIT ACK chunk when one of the mandatory
parameters is set to a invalid value. parameters is set to a invalid value.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=7 | Cause Length=4 | | Cause Code=7 | Cause Length=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3.3.10.8 Unrecognized Parameters (8) 3.3.10.8 Unrecognized Parameters (8)
Cause of error Cause of error
--------------- ---------------
Unrecognized Parameters: This error cause is returned to the Unrecognized Parameters: This error cause is returned to the
originator of the INIT ACK chunk if the receiver does not originator of the INIT ACK chunk if the receiver does not recognize
recognize one or more Optional TLV parameters in the INIT ACK chunk. one or more Optional TLV parameters in the INIT ACK chunk.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=8 | Cause Length | | Cause Code=8 | Cause Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Unrecognized Parameters / / Unrecognized Parameters /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Unrecognized Parameters: variable length Unrecognized Parameters: variable length
The Unrecognized Parameters field contains the unrecognized
parameters copied from the INIT ACK chunk complete with TLV. This The Unrecognized Parameters field contains the unrecognized
error cause is normally contained in an ERROR chunk bundled with parameters copied from the INIT ACK chunk complete with TLV. This
the COOKIE ECHO chunk when responding to the INIT ACK, when the error cause is normally contained in an ERROR chunk bundled with
sender of the COOKIE ECHO chunk wishes to report unrecognized the COOKIE ECHO chunk when responding to the INIT ACK, when the
parameters. sender of the COOKIE ECHO chunk wishes to report unrecognized
parameters.
3.3.10.9 No User Data (9) 3.3.10.9 No User Data (9)
Cause of error Cause of error
--------------- ---------------
No User Data: This error cause is returned to the No User Data: This error cause is returned to the originator of a
originator of a DATA chunk if a received DATA chunk has no user data. DATA chunk if a received DATA chunk has no user data.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=9 | Cause Length=8 | | Cause Code=9 | Cause Length=8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ TSN value / / TSN value /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
TSN value: 32 bits (+unsigned integer) TSN value: 32 bits (+unsigned integer)
The TSN value field contains the TSN of the DATA chunk received
with no user data field.
This cause code is normally returned in an ABORT chunk The TSN value field contains the TSN of the DATA chunk received
(see Section 6.2) with no user data field.
This cause code is normally returned in an ABORT chunk (see
Section 6.2)
3.3.10.10 Cookie Received While Shutting Down (10) 3.3.10.10 Cookie Received While Shutting Down (10)
Cause of error Cause of error
--------------- ---------------
Cookie Received While Shutting Down: A COOKIE ECHO was received Cookie Received While Shutting Down: A COOKIE ECHO was received
While the endpoint was in SHUTDOWN-ACK-SENT state. This error is While the endpoint was in SHUTDOWN-ACK-SENT state. This error is
usually returned in an ERROR chunk bundled with the retransmitted usually returned in an ERROR chunk bundled with the retransmitted
SHUTDOWN ACK. SHUTDOWN ACK.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=10 | Cause Length=4 | | Cause Code=10 | Cause Length=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3.3.11 Cookie Echo (COOKIE ECHO) (10): 3.3.11 Cookie Echo (COOKIE ECHO) (10):
This chunk is used only during the initialization of an association. This chunk is used only during the initialization of an association.
It is sent by the initiator of an association to its peer to complete It is sent by the initiator of an association to its peer to complete
the initialization process. This chunk MUST precede any DATA chunk the initialization process. This chunk MUST precede any DATA chunk
sent within the association, but MAY be bundled with one or more DATA sent within the association, but MAY be bundled with one or more DATA
chunks in the same packet. chunks in the same packet.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 10 |Chunk Flags | Length | | Type = 10 |Chunk Flags | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Cookie / / Cookie /
\ \ \ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bit Chunk Flags: 8 bit
Set to zero on transmit and ignored on receipt. Set to zero on transmit and ignored on receipt.
Length: 16 bits (unsigned integer) Length: 16 bits (unsigned integer)
Set to the size of the chunk in bytes, including the 4 bytes of Set to the size of the chunk in bytes, including the 4 bytes of
the chunk header and the size of the Cookie. the chunk header and the size of the Cookie.
Cookie: variable size Cookie: variable size
This field must contain the exact cookie received in the This field must contain the exact cookie received in the State
State Cookie parameter from the previous INIT ACK. Cookie parameter from the previous INIT ACK.
An implementation SHOULD make the cookie as small as possible An implementation SHOULD make the cookie as small as possible to
to insure interoperability. insure interoperability.
3.3.12 Cookie Acknowledgement (COOKIE ACK) (11): 3.3.12 Cookie Acknowledgement (COOKIE ACK) (11):
This chunk is used only during the initialization of an association. This chunk is used only during the initialization of an association.
It is used to acknowledge the receipt of a COOKIE ECHO chunk. This It is used to acknowledge the receipt of a COOKIE ECHO chunk. This
chunk MUST precede any DATA or SACK chunk sent within the association, chunk MUST precede any DATA or SACK chunk sent within the
but MAY be bundled with one or more DATA chunks or SACK chunk in the association, but MAY be bundled with one or more DATA chunks or SACK
same SCTP packet. chunk in the same SCTP packet.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 11 |Chunk Flags | Length = 4 | | Type = 11 |Chunk Flags | Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Set to zero on transmit and ignored on receipt.
Set to zero on transmit and ignored on receipt.
3.3.13 Shutdown Complete (SHUTDOWN COMPLETE) (14): 3.3.13 Shutdown Complete (SHUTDOWN COMPLETE) (14):
This chunk MUST be used to acknowledge the receipt of the SHUTDOWN ACK This chunk MUST be used to acknowledge the receipt of the SHUTDOWN
chunk at the completion of the shutdown process, see Section 9.2 for ACK chunk at the completion of the shutdown process, see Section 9.2
details. for details.
The SHUTDOWN COMPLETE chunk has no parameters. The SHUTDOWN COMPLETE chunk has no parameters.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 14 |Reserved |T| Length = 4 | | Type = 14 |Reserved |T| Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Chunk Flags: 8 bits Chunk Flags: 8 bits
Reserved: 7 bits Reserved: 7 bits
Set to 0 on transmit and ignored on receipt.
T bit: 1 bit Set to 0 on transmit and ignored on receipt.
The T bit is set to 0 if the sender had a TCB that it destroyed. If
the sender did NOT have a TCB it should set this bit to 1.
Note: Special rules apply to this chunk for verification, please T bit: 1 bit
see Section 8.5.1 for details.
The T bit is set to 0 if the sender had a TCB that it destroyed.
If the sender did not have a TCB it should set this bit to 1.
Note: Special rules apply to this chunk for verification, please see
Section 8.5.1 for details.
4. SCTP Association State Diagram 4. SCTP Association State Diagram
During the lifetime of an SCTP association, the SCTP endpoint's association During the lifetime of an SCTP association, the SCTP endpoint's
progress from one state to another in response to various events. The association progress from one state to another in response to various
events that may potentially advance an association's state include: events. The events that may potentially advance an association's
state include:
o SCTP user primitive calls, e.g., [ASSOCIATE], [SHUTDOWN], [ABORT], o SCTP user primitive calls, e.g., [ASSOCIATE], [SHUTDOWN], [ABORT],
o Reception of INIT, COOKIE ECHO, ABORT, SHUTDOWN, etc. control o Reception of INIT, COOKIE ECHO, ABORT, SHUTDOWN, etc., control
chunks, or chunks, or
o Some timeout events. o Some timeout events.
The state diagram in the figures below illustrates state changes, The state diagram in the figures below illustrates state changes,
together with the causing events and resulting actions. Note that some together with the causing events and resulting actions. Note that
of the error conditions are not shown in the state diagram. Full some of the error conditions are not shown in the state diagram.
description of all special cases should be found in the text. Full description of all special cases should be found in the text.
Note: Chunk names are given in all capital letters, while parameter Note: Chunk names are given in all capital letters, while parameter
names have the first letter capitalized, e.g., COOKIE ECHO chunk type names have the first letter capitalized, e.g., COOKIE ECHO chunk type
vs. State Cookie parameter. If more than one event/message can occur vs. State Cookie parameter. If more than one event/message can occur
which causes a state transition it is labeled (A), (B) etc. which causes a state transition it is labeled (A), (B) etc.
----- -------- (frm any state) ----- -------- (frm any state)
/ \ / rcv ABORT [ABORT] / \ / rcv ABORT [ABORT]
rcv INIT | | | ---------- or ---------- rcv INIT | | | ---------- or ----------
--------------- | v v delete TCB snd ABORT --------------- | v v delete TCB snd ABORT
generate Cookie \ +---------+ delete TCB generate Cookie \ +---------+ delete TCB
snd INIT ACK ---| CLOSED | snd INIT ACK ---| CLOSED |
+---------+ +---------+
/ \ [ASSOCIATE] / \ [ASSOCIATE]
/ \ --------------- / \ ---------------
| | create TCB | | create TCB
| | snd INIT | | snd INIT
| | strt init timer | | strt init timer
rcv valid | | rcv valid | |
COOKIE ECHO | v COOKIE ECHO | v
(1) ---------------- | +------------+ (1) ---------------- | +------------+
create TCB | | COOKIE-WAIT| (2) create TCB | | COOKIE-WAIT| (2)
snd COOKIE ACK | +------------+ snd COOKIE ACK | +------------+
| | | |
| | rcv INIT ACK | | rcv INIT ACK
| | ----------------- | | -----------------
| | snd COOKIE ECHO | | snd COOKIE ECHO
| | stop init timer | | stop init timer
| | strt cookie timer | | strt cookie timer
| v | v
| +--------------+ | +--------------+
| | COOKIE-ECHOED| (3) | | COOKIE-ECHOED| (3)
| +--------------+ | +--------------+
| | | |
| | rcv COOKIE ACK | | rcv COOKIE ACK
| | ----------------- | | -----------------
| | stop cookie timer | | stop cookie timer
v v v v
+---------------+ +---------------+
| ESTABLISHED | | ESTABLISHED |
+---------------+ +---------------+
(from the ESTABLISHED state only) (from the ESTABLISHED state only)
| |
| |
/--------+--------\ /--------+--------\
[SHUTDOWN] / \ [SHUTDOWN] / \
-------------------| | -------------------| |
check outstanding | | check outstanding | |
DATA chunks | | DATA chunks | |
v | v |
+---------+ | +---------+ |
|SHUTDOWN-| | rcv SHUTDOWN/check |SHUTDOWN-| | rcv SHUTDOWN/check
|PENDING | | outstanding DATA |PENDING | | outstanding DATA
+---------+ | chunks +---------+ | chunks
| |------------------ | |------------------
No more outstanding | | No more outstanding | |
---------------------| | ---------------------| |
snd SHUTDOWN | | snd SHUTDOWN | |
strt shutdown timer | | strt shutdown timer | |
v v v v
+---------+ +-----------+ +---------+ +-----------+
(4) |SHUTDOWN-| | SHUTDOWN- | (5,6) (4) |SHUTDOWN-| | SHUTDOWN- | (5,6)
|SENT | | RECEIVED | |SENT | | RECEIVED |
+---------+ +-----------+ +---------+ +-----------+
| \ | | \ |
(A) rcv SHUTDOWN ACK | \ | (A) rcv SHUTDOWN ACK | \ |
----------------------| \ | ----------------------| \ |
stop shutdown timer | \rcv:SHUTDOWN | stop shutdown timer | \rcv:SHUTDOWN |
send SHUTDOWN COMPLETE| \ (B) | send SHUTDOWN COMPLETE| \ (B) |
delete TCB | \ | delete TCB | \ |
| \ | No more outstanding | \ | No more outstanding
| \ |----------------- | \ |-----------------
| \ | send SHUTDOWN ACK | \ | send SHUTDOWN ACK
(B)rcv SHUTDOWN | \ | strt shutdown timer (B)rcv SHUTDOWN | \ | strt shutdown timer
----------------------| \ | ----------------------| \ |
send SHUTDOWN ACK | \ | send SHUTDOWN ACK | \ |
start shutdown timer | \ | start shutdown timer | \ |
move to SHUTDOWN- | \ | move to SHUTDOWN- | \ |
ACK-SENT | | | ACK-SENT | | |
| v | | v |
| +-----------+ | +-----------+
| | SHUTDOWN- | (7) | | SHUTDOWN- | (7)
| | ACK-SENT | | | ACK-SENT |
| +-----------+ | +----------+-
| | (C)rcv SHUTDOWN COMPLETE | | (C)rcv SHUTDOWN COMPLETE
| |----------------- | |-----------------
| | stop shutdown timer | | stop shutdown timer
| | delete TCB | | delete TCB
| | | |
| | (D)rcv SHUTDOWN ACK | | (D)rcv SHUTDOWN ACK
| |-------------- | |--------------
| | stop shutdown timer | | stop shutdown timer
| | send SHUTDOWN COMPLETE | | send SHUTDOWN COMPLETE
| | delete TCB | | delete TCB
| | | |
\ +---------+ / \ +---------+ /
\-->| CLOSED |<--/ \-->| CLOSED |<--/
+---------+ +---------+
Figure 3: State Transition Diagram of SCTP Figure 3: State Transition Diagram of SCTP
Notes: Notes:
(1) If the State Cookie in the received COOKIE ECHO is invalid (i.e.,
failed to pass the integrity check), the receiver MUST silently
discard the packet. Or, if the received State Cookie is expired
(see Section 5.1.5), the receiver MUST send back an ERROR chunk.
In either case, the receiver stays in the CLOSED state.
(2) If the T1-init timer expires, the endpoint MUST retransmit INIT 1) If the State Cookie in the received COOKIE ECHO is invalid (i.e.,
and re-start the T1-init timer without changing state. This MUST be failed to pass the integrity check), the receiver MUST silently
repeated up to 'Max.Init.Retransmits' times. After that, the discard the packet. Or, if the received State Cookie is expired
endpoint MUST abort the initialization process and report the (see Section 5.1.5), the receiver MUST send back an ERROR chunk.
error to SCTP user. In either case, the receiver stays in the CLOSED state.
(3) If the T1-cookie timer expires, the endpoint MUST retransmit 2) If the T1-init timer expires, the endpoint MUST retransmit INIT
COOKIE ECHO and re-start the T1-cookie timer without changing and re-start the T1-init timer without changing state. This MUST
state. This MUST be repeated up to 'Max.Init.Retransmits' be repeated up to 'Max.Init.Retransmits' times. After that, the
times. After that, the endpoint MUST abort the initialization endpoint MUST abort the initialization process and report the
process and report the error to SCTP user. error to SCTP user.
(4) In SHUTDOWN-SENT state the endpoint MUST acknowledge any received 3) If the T1-cookie timer expires, the endpoint MUST retransmit
DATA chunks without delay. COOKIE ECHO and re-start the T1-cookie timer without changing
state. This MUST be repeated up to 'Max.Init.Retransmits' times.
After that, the endpoint MUST abort the initialization process and
report the error to SCTP user.
(5) In SHUTDOWN-RECEIVED state, the endpoint MUST NOT accept any new 4) In SHUTDOWN-SENT state the endpoint MUST acknowledge any received
send request from its SCTP user. DATA chunks without delay.
(6) In SHUTDOWN-RECEIVED state, the endpoint MUST transmit or retransmit 5) In SHUTDOWN-RECEIVED state, the endpoint MUST NOT accept any new
data and leave this state when all data inqueue is transmitted. send request from its SCTP user.
(7) In SHUTDOWN-ACK-SENT state, the endpoint MUST NOT accept any new 6) In SHUTDOWN-RECEIVED state, the endpoint MUST transmit or
send request from its SCTP user. retransmit data and leave this state when all data in queue is
transmitted.
The CLOSED state is used to indicate that an association is not 7) In SHUTDOWN-ACK-SENT state, the endpoint MUST NOT accept any new
created (i.e., doesn't exist). send request from its SCTP user.
The CLOSED state is used to indicate that an association is not
created (i.e., doesn't exist).
5. Association Initialization 5. Association Initialization
Before the first data transmission can take place from one SCTP Before the first data transmission can take place from one SCTP
endpoint ("A") to another SCTP endpoint ("Z"), the two endpoints must endpoint ("A") to another SCTP endpoint ("Z"), the two endpoints must
complete an initialization process in order to set up an SCTP complete an initialization process in order to set up an SCTP
association between them. association between them.
The SCTP user at an endpoint should use the ASSOCIATE primitive to The SCTP user at an endpoint should use the ASSOCIATE primitive to
initialize an SCTP association to another SCTP endpoint. initialize an SCTP association to another SCTP endpoint.
IMPLEMENTATION NOTE: From an SCTP-user's point of view, an IMPLEMENTATION NOTE: From an SCTP-user's point of view, an
association may be implicitly opened, without an ASSOCIATE primitive association may be implicitly opened, without an ASSOCIATE primitive
(see 10.1 B) being invoked, by the initiating endpoint's sending of (see 10.1 B) being invoked, by the initiating endpoint's sending of
the first user data to the destination endpoint. The initiating SCTP the first user data to the destination endpoint. The initiating SCTP
will assume default values for all mandatory and optional parameters will assume default values for all mandatory and optional parameters
for the INIT/INIT ACK. for the INIT/INIT ACK.
Once the association is established, unidirectional streams are Once the association is established, unidirectional streams are open
open for data transfer on both ends (see Section 5.1.1). for data transfer on both ends (see Section 5.1.1).
5.1 Normal Establishment of an Association 5.1 Normal Establishment of an Association
The initialization process consists of the following steps (assuming The initialization process consists of the following steps (assuming
that SCTP endpoint "A" tries to set up an association with SCTP that SCTP endpoint "A" tries to set up an association with SCTP
endpoint "Z" and "Z" accepts the new association): endpoint "Z" and "Z" accepts the new association):
A) "A" first sends an INIT chunk to "Z". In the INIT, "A" must
provide its Verification Tag (Tag_A) in the Initiate Tag field.
Tag_A SHOULD be a random number in the range of 1 to 4294967295
(see 5.3.1 for Tag value selection). After sending the INIT, "A"
starts the T1-init timer and enters the COOKIE-WAIT state.
B) "Z" shall respond immediately with an INIT ACK chunk. The A) "A" first sends an INIT chunk to "Z". In the INIT, "A" must
destination IP address of the INIT ACK MUST be set to the source provide its Verification Tag (Tag_A) in the Initiate Tag field.
IP address of the INIT to which this INIT ACK is responding. In Tag_A SHOULD be a random number in the range of 1 to 4294967295
the response, besides filling in other parameters, "Z" must set the (see 5.3.1 for Tag value selection). After sending the INIT, "A"
Verification Tag field to Tag_A, and also provide its own starts the T1-init timer and enters the COOKIE-WAIT state.
Verification Tag (Tag_Z) in the Initiate Tag field.
Moreover, "Z" MUST generate and send along with the INIT ACK a B) "Z" shall respond immediately with an INIT ACK chunk. The
State Cookie. See Section 5.1.3 for State Cookie generation. destination IP address of the INIT ACK MUST be set to the source
IP address of the INIT to which this INIT ACK is responding. In
the response, besides filling in other parameters, "Z" must set
the Verification Tag field to Tag_A, and also provide its own
Verification Tag (Tag_Z) in the Initiate Tag field.
Note: After sending out INIT ACK with the State Cookie parameter, Moreover, "Z" MUST generate and send along with the INIT ACK a
"Z" MUST NOT allocate any resources, nor keep any states for the new State Cookie. See Section 5.1.3 for State Cookie generation.
association. Otherwise, "Z" will be vulnerable to resource attacks.
C) Upon reception of the INIT ACK from "Z", "A" shall stop the T1-init Note: After sending out INIT ACK with the State Cookie parameter,
timer and leave COOKIE-WAIT state. "A" shall then send the State "Z" MUST NOT allocate any resources, nor keep any states for the
Cookie received in the INIT ACK chunk in a COOKIE ECHO chunk, start new association. Otherwise, "Z" will be vulnerable to resource
the T1-cookie timer, and enter the COOKIE-ECHOED state. attacks.
Note: The COOKIE ECHO chunk can be bundled with any pending outbound C) Upon reception of the INIT ACK from "Z", "A" shall stop the T1-
DATA chunks, but it MUST be the first chunk in the packet and init timer and leave COOKIE-WAIT state. "A" shall then send the
until the COOKIE ACK is returned the sender MUST NOT send any State Cookie received in the INIT ACK chunk in a COOKIE ECHO
other packets to the peer. chunk, start the T1-cookie timer, and enter the COOKIE-ECHOED
state.
D) Upon reception of the COOKIE ECHO chunk, Endpoint "Z" will reply Note: The COOKIE ECHO chunk can be bundled with any pending
with a COOKIE ACK chunk after building a TCB and moving to outbound DATA chunks, but it MUST be the first chunk in the packet
the ESTABLISHED state. A COOKIE ACK chunk may be bundled with and until the COOKIE ACK is returned the sender MUST NOT send any
any pending DATA chunks (and/or SACK chunks), but the COOKIE ACK other packets to the peer.
chunk MUST be the first chunk in the packet.
IMPLEMENTATION NOTE: An implementation may choose to send the D) Upon reception of the COOKIE ECHO chunk, Endpoint "Z" will reply
Communication Up notification to the SCTP user upon reception with a COOKIE ACK chunk after building a TCB and moving to the
of a valid COOKIE ECHO chunk. ESTABLISHED state. A COOKIE ACK chunk may be bundled with any
pending DATA chunks (and/or SACK chunks), but the COOKIE ACK chunk
MUST be the first chunk in the packet.
E) Upon reception of the COOKIE ACK, endpoint "A" will move from the IMPLEMENTATION NOTE: An implementation may choose to send the
COOKIE-ECHOED state to the ESTABLISHED state, stopping the T1-cookie Communication Up notification to the SCTP user upon reception of a
timer. It may also notify its ULP about the successful valid COOKIE ECHO chunk.
establishment of the association with a Communication Up
notification (see Section 10).
An INIT or INIT ACK chunk MUST NOT be bundled with any other chunk. E) Upon reception of the COOKIE ACK, endpoint "A" will move from the
COOKIE-ECHOED state to the ESTABLISHED state, stopping the T1-
cookie timer. It may also notify its ULP about the successful
establishment of the association with a Communication Up
notification (see Section 10).
They MUST be the only chunks present in the SCTP packets that carry An INIT or INIT ACK chunk MUST NOT be bundled with any other chunk.
them. They MUST be the only chunks present in the SCTP packets that carry
them.
An endpoint MUST send the INIT ACK to the IP address from which it An endpoint MUST send the INIT ACK to the IP address from which it
received the INIT. received the INIT.
Note: T1-init timer and T1-cookie timer shall follow the same rules Note: T1-init timer and T1-cookie timer shall follow the same rules
given in Section 6.3. given in Section 6.3.
If an endpoint receives an INIT, INIT ACK, or COOKIE ECHO chunk but If an endpoint receives an INIT, INIT ACK, or COOKIE ECHO chunk but
decides not to establish the new association due to missing mandatory decides not to establish the new association due to missing mandatory
parameters in the received INIT or INIT ACK, invalid parameter values, parameters in the received INIT or INIT ACK, invalid parameter
or lack of local resources, it MUST respond with an ABORT chunk. It values, or lack of local resources, it MUST respond with an ABORT
SHOULD also specify the cause of abort, such as the type of the chunk. It SHOULD also specify the cause of abort, such as the type
missing mandatory parameters, etc., by including the error cause of the missing mandatory parameters, etc., by including the error
parameters with the ABORT chunk. The Verification Tag field in the cause parameters with the ABORT chunk. The Verification Tag field in
common header of the outbound SCTP packet containing the ABORT chunk the common header of the outbound SCTP packet containing the ABORT
MUST be set to the Initiate Tag value of the peer. chunk MUST be set to the Initiate Tag value of the peer.
After the reception of the first DATA chunk in an association After the reception of the first DATA chunk in an association the
the endpoint MUST immediately respond with a SACK to acknowledge endpoint MUST immediately respond with a SACK to acknowledge the DATA
the DATA chunk. Subsequent acknowledgements should be done as chunk. Subsequent acknowledgements should be done as described in
described in Section 6.2. Section 6.2.
When the TCB is created, each endpoint MUST set its internal Cumulative When the TCB is created, each endpoint MUST set its internal
TSN Ack Point to the value of its transmitted Initial TSN minus one. Cumulative TSN Ack Point to the value of its transmitted Initial TSN
minus one.
IMPLEMENTATION NOTE: The IP addresses and SCTP port are generally IMPLEMENTATION NOTE: The IP addresses and SCTP port are generally
used as the key to find the TCB within an SCTP instance. used as the key to find the TCB within an SCTP instance.
5.1.1 Handle Stream Parameters 5.1.1 Handle Stream Parameters
In the INIT and INIT ACK chunks, the sender of the chunk shall In the INIT and INIT ACK chunks, the sender of the chunk shall
indicate the number of outbound streams (OS) it wishes to have in the indicate the number of outbound streams (OS) it wishes to have in the
association, as well as the maximum inbound streams (MIS) it will association, as well as the maximum inbound streams (MIS) it will
accept from the other endpoint. accept from the other endpoint.
After receiving the stream configuration information from the other After receiving the stream configuration information from the other
side, each endpoint shall perform the following check: If the peer's side, each endpoint shall perform the following check: If the peer's
MIS is less than the endpoint's OS, meaning that the peer is incapable MIS is less than the endpoint's OS, meaning that the peer is
of supporting all the outbound streams the endpoint wants to incapable of supporting all the outbound streams the endpoint wants
configure, the endpoint MUST either use MIS outbound streams, to configure, the endpoint MUST either use MIS outbound streams, or
or abort the association and report to its upper layer the resources abort the association and report to its upper layer the resources
shortage at its peer. shortage at its peer.
After the association is initialized, the valid outbound stream After the association is initialized, the valid outbound stream
identifier range for either endpoint shall be 0 to identifier range for either endpoint shall be 0 to min(local OS,
min(local OS, remote MIS)-1. remote MIS)-1.
5.1.2 Handle Address Parameters 5.1.2 Handle Address Parameters
During the association initialization, an endpoint shall use the During the association initialization, an endpoint shall use the
following rules to discover and collect the destination transport following rules to discover and collect the destination transport
address(es) of its peer. address(es) of its peer.
A) If there are no address parameters present in the received INIT A) If there are no address parameters present in the received INIT or
or INIT ACK chunk, the endpoint shall take the source IP address INIT ACK chunk, the endpoint shall take the source IP address from
from which the chunk arrives and record it, in combination with which the chunk arrives and record it, in combination with the
the SCTP source port number, as the only destination transport SCTP source port number, as the only destination transport address
address for this peer. for this peer.
B) If there is a Host Name parameter present in the received INIT or B) If there is a Host Name parameter present in the received INIT or
INIT ACK chunk, the endpoint shall resolve that host name to a INIT ACK chunk, the endpoint shall resolve that host name to a
list of IP address(es) and derive the transport address(es) of this list of IP address(es) and derive the transport address(es) of
peer by combining the resolved IP address(es) with the SCTP source this peer by combining the resolved IP address(es) with the SCTP
port. source port.
The endpoint MUST ignore any other IP address parameters if The endpoint MUST ignore any other IP address parameters if they
they are also present in the received INIT or INIT ACK chunk. are also present in the received INIT or INIT ACK chunk.
The time at which the receiver of an INIT resolves the host The time at which the receiver of an INIT resolves the host name
name has potential security implications to SCTP. If the receiver of has potential security implications to SCTP. If the receiver of
an INIT resolves the host name upon the reception of the chunk, and an INIT resolves the host name upon the reception of the chunk,
the mechanism the receiver uses to resolve the host name involves and the mechanism the receiver uses to resolve the host name
potential long delay (e.g. DNS query), the receiver may open itself involves potential long delay (e.g. DNS query), the receiver may
up to resource attacks for the period of time while it is waiting for open itself up to resource attacks for the period of time while it
the name resolution results before it can build the State Cookie and is waiting for the name resolution results before it can build the
release local resources. State Cookie and release local resources.
Therefore, in cases where the name translation involves potential Therefore, in cases where the name translation involves potential
long delay, the receiver of the INIT MUST postpone the name long delay, the receiver of the INIT MUST postpone the name
resolution till the reception of the COOKIE ECHO chunk from the resolution till the reception of the COOKIE ECHO chunk from the
peer. In such a case, the receiver of the INIT SHOULD build the peer. In such a case, the receiver of the INIT SHOULD build the
State Cookie using the received Host Name (instead of destination State Cookie using the received Host Name (instead of destination
transport addresses) and send the INIT ACK to the source IP transport addresses) and send the INIT ACK to the source IP
address from which the INIT was received. address from which the INIT was received.
The receiver of an INIT ACK shall always immediately attempt to The receiver of an INIT ACK shall always immediately attempt to
resolve the name upon the reception of the chunk. resolve the name upon the reception of the chunk.
The receiver of the INIT or INIT ACK MUST NOT send user data The receiver of the INIT or INIT ACK MUST NOT send user data
(piggy-backed or stand-alone) to its peer until the host name is (piggy-backed or stand-alone) to its peer until the host name is
successfully resolved. successfully resolved.
If the name resolution is not successful, the endpoint MUST If the name resolution is not successful, the endpoint MUST
immediately send an ABORT with "Unresolvable Address" error cause to immediately send an ABORT with "Unresolvable Address" error cause
its peer. The ABORT shall be sent to the source IP address from which to its peer. The ABORT shall be sent to the source IP address
the last peer packet was received. from which the last peer packet was received.
C) If there are only IPv4/IPv6 addresses present in the received C) If there are only IPv4/IPv6 addresses present in the received INIT
INIT or INIT ACK chunk, the receiver shall derive and record all or INIT ACK chunk, the receiver shall derive and record all the
the transport address(es) from the received chunk AND the transport address(es) from the received chunk AND the source IP
source IP address that sent the INIT or INIT ACK. The transport address that sent the INIT or INIT ACK. The transport address(es)
address(es) are derived by the combination of SCTP source port (from are derived by the combination of SCTP source port (from the
the common header) and the IP address parameter(s) carried in the common header) and the IP address parameter(s) carried in the INIT
INIT or INIT ACK chunk and the source IP address of the IP datagram. or INIT ACK chunk and the source IP address of the IP datagram.
The receiver should use only these transport addresses as The receiver should use only these transport addresses as
destination transport addresses when sending subsequent packets destination transport addresses when sending subsequent packets to
to its peer. its peer.
IMPLEMENTATION NOTE: In some cases (e.g., when the implementation IMPLEMENTATION NOTE: In some cases (e.g., when the implementation
doesn't control the source IP address that is used for transmitting), doesn't control the source IP address that is used for
an endpoint might need to include in its INIT or INIT ACK all possible transmitting), an endpoint might need to include in its INIT or
IP addresses from which packets to the peer could be transmitted. INIT ACK all possible IP addresses from which packets to the peer
could be transmitted.
After all transport addresses are derived from the INIT or INIT ACK After all transport addresses are derived from the INIT or INIT ACK
chunk using the above rules, the endpoint shall select one of the chunk using the above rules, the endpoint shall select one of the
transport addresses as the initial primary path. transport addresses as the initial primary path.
Note: The INIT-ACK MUST be sent to the source address of the INIT. Note: The INIT-ACK MUST be sent to the source address of the INIT.
The sender of INIT may include a 'Supported Address Types' The sender of INIT may include a 'Supported Address Types' parameter
parameter in the INIT to indicate what types of address are in the INIT to indicate what types of address are acceptable. When
acceptable. When this parameter is present, the receiver of INIT this parameter is present, the receiver of INIT (initiatee) MUST
(initiatee) MUST either use one of the address types indicated in the either use one of the address types indicated in the Supported
Supported Address Types parameter when responding to the INIT, or Address Types parameter when responding to the INIT, or abort the
abort the association with an "Unresolvable Address" error cause if it association with an "Unresolvable Address" error cause if it is
is unwilling or incapable of using any of the address types indicated unwilling or incapable of using any of the address types indicated by
by its peer. its peer.
IMPLEMENTATION NOTE: In the case that the receiver of an INIT ACK IMPLEMENTATION NOTE: In the case that the receiver of an INIT ACK
fails to resolve the address parameter due to an unsupported type, fails to resolve the address parameter due to an unsupported type, it
it can abort the initiation process and then attempt a re-initiation can abort the initiation process and then attempt a re-initiation by
by using a 'Supported Address Types' parameter in the new INIT to using a 'Supported Address Types' parameter in the new INIT to
indicate what types of address it prefers. indicate what types of address it prefers.
5.1.3 Generating State Cookie 5.1.3 Generating State Cookie
When sending an INIT ACK as a response to an INIT chunk, the sender When sending an INIT ACK as a response to an INIT chunk, the sender
of INIT ACK creates a State Cookie and sends it in the State Cookie of INIT ACK creates a State Cookie and sends it in the State Cookie
parameter of the INIT ACK. Inside this State Cookie, the sender should parameter of the INIT ACK. Inside this State Cookie, the sender
include a MAC (see [RFC2104] for an example), a time stamp on when the should include a MAC (see [RFC2104] for an example), a time stamp on
State Cookie is created, and the lifespan of the State Cookie, along when the State Cookie is created, and the lifespan of the State
with all the information necessary for it to establish the association. Cookie, along with all the information necessary for it to establish
the association.
The following steps SHOULD be taken to generate the State Cookie: The following steps SHOULD be taken to generate the State Cookie:
1) Create an association TCB using information from both the received 1) Create an association TCB using information from both the received
INIT and the outgoing INIT ACK chunk, INIT and the outgoing INIT ACK chunk,
2) In the TCB, set the creation time to the current time of day, and 2) In the TCB, set the creation time to the current time of day, and
the lifespan to the protocol parameter 'Valid.Cookie.Life', the lifespan to the protocol parameter 'Valid.Cookie.Life',
3) From the TCB, identify and collect the minimal subset of 3) From the TCB, identify and collect the minimal subset of
information needed to re-create the TCB, and generate a MAC using information needed to re-create the TCB, and generate a MAC using
this subset of information and a secret key (see [RFC2104] for an this subset of information and a secret key (see [RFC2104] for an
example of generating a MAC), and example of generating a MAC), and
4) Generate the State Cookie by combining this subset of information 4) Generate the State Cookie by combining this subset of information
and the resultant MAC. and the resultant MAC.
After sending the INIT ACK with the State Cookie parameter, the sender After sending the INIT ACK with the State Cookie parameter, the
SHOULD delete the TCB and any other local resource related to the new sender SHOULD delete the TCB and any other local resource related to
association, so as to prevent resource attacks. the new association, so as to prevent resource attacks.
The hashing method used to generate the MAC is strictly a The hashing method used to generate the MAC is strictly a private
private matter for the receiver of the INIT chunk. The use of a MAC matter for the receiver of the INIT chunk. The use of a MAC is
is mandatory to prevent denial of service attacks. The secret key mandatory to prevent denial of service attacks. The secret key
SHOULD be random ([RFC1750] provides some information on randomness SHOULD be random ([RFC1750] provides some information on randomness
guidelines); it SHOULD be changed reasonably frequently, and the guidelines); it SHOULD be changed reasonably frequently, and the
timestamp in the State Cookie MAY be used to determine which key should timestamp in the State Cookie MAY be used to determine which key
be used to verify the MAC. should be used to verify the MAC.
An implementation SHOULD make the cookie as small as possible to An implementation SHOULD make the cookie as small as possible to
insure interoperability. insure interoperability.
5.1.4 State Cookie Processing 5.1.4 State Cookie Processing
When an endpoint receives an INIT ACK chunk with a State Cookie When an endpoint (in the COOKIE WAIT state) receives an INIT ACK
parameter, it MUST immediately send a COOKIE ECHO chunk to its peer chunk with a State Cookie parameter, it MUST immediately send a
with the received State Cookie. The sender MAY also add any pending COOKIE ECHO chunk to its peer with the received State Cookie. The
DATA chunks to the packet after the COOKIE ECHO chunk. sender MAY also add any pending DATA chunks to the packet after the
COOKIE ECHO chunk.
The endpoint shall also start the T1-cookie timer after sending out the The endpoint shall also start the T1-cookie timer after sending out
COOKIE ECHO chunk. If the timer expires, the endpoint shall retransmit the COOKIE ECHO chunk. If the timer expires, the endpoint shall
the COOKIE ECHO chunk and restart the T1-cookie timer. This is repeated retransmit the COOKIE ECHO chunk and restart the T1-cookie timer.
until either a COOKIE ACK is received or 'Max.Init.Retransmits' is This is repeated until either a COOKIE ACK is received or '
reached causing the peer endpoint to be marked unreachable (and thus Max.Init.Retransmits' is reached causing the peer endpoint to be
the association enters the CLOSED state). marked unreachable (and thus the association enters the CLOSED
state).
5.1.5 State Cookie Authentication 5.1.5 State Cookie Authentication
When an endpoint receives a COOKIE ECHO chunk from another endpoint When an endpoint receives a COOKIE ECHO chunk from another endpoint
with which it has no association, it shall take the following actions: with which it has no association, it shall take the following
actions:
1) Compute a MAC using the TCB data carried in the State 1) Compute a MAC using the TCB data carried in the State Cookie and
Cookie and the secret key (note the timestamp in the State Cookie the secret key (note the timestamp in the State Cookie MAY be used
MAY be used to determine which secret key to use). Reference to determine which secret key to use). Reference [RFC2104] can be
[RFC2104] can be used as a guideline for generating the MAC, used as a guideline for generating the MAC,
2) Authenticate the State Cookie as one that it previously generated by 2) Authenticate the State Cookie as one that it previously generated
comparing the computed MAC against the one carried in the by comparing the computed MAC against the one carried in the State
State Cookie. If this comparison fails, the SCTP packet, including Cookie. If this comparison fails, the SCTP packet, including the
the COOKIE ECHO and any DATA chunks, should be silently discarded, COOKIE ECHO and any DATA chunks, should be silently discarded,
3) Compare the creation timestamp in the State Cookie to the current 3) Compare the creation timestamp in the State Cookie to the current
local time. If the elapsed time is longer than the lifespan carried local time. If the elapsed time is longer than the lifespan
in the State Cookie, then the packet, including the COOKIE ECHO and carried in the State Cookie, then the packet, including the COOKIE
any attached DATA chunks, SHOULD be discarded and the endpoint MUST ECHO and any attached DATA chunks, SHOULD be discarded and the
transmit an ERROR chunk with a "Stale Cookie" error cause to the endpoint MUST transmit an ERROR chunk with a "Stale Cookie" error
peer endpoint, cause to the peer endpoint,
4) If the State Cookie is valid, create an association to the sender of 4) If the State Cookie is valid, create an association to the sender
the COOKIE ECHO chunk with the information in the TCB data carried of the COOKIE ECHO chunk with the information in the TCB data
in the COOKIE ECHO, and enter the ESTABLISHED state, carried in the COOKIE ECHO, and enter the ESTABLISHED state,
5) Send a COOKIE ACK chunk to the peer acknowledging reception of 5) Send a COOKIE ACK chunk to the peer acknowledging reception of the
the COOKIE ECHO. The COOKIE ACK MAY be bundled with an outbound COOKIE ECHO. The COOKIE ACK MAY be bundled with an outbound DATA
DATA chunk or SACK chunk; however, the COOKIE ACK MUST be the first chunk or SACK chunk; however, the COOKIE ACK MUST be the first
chunk in the SCTP packet. chunk in the SCTP packet.
6) Immediately acknowledge any DATA chunk bundled with the COOKIE ECHO 6) Immediately acknowledge any DATA chunk bundled with the COOKIE
with a SACK (subsequent DATA chunk acknowledgement should follow the ECHO with a SACK (subsequent DATA chunk acknowledgement should
rules defined in Section 6.2). As mentioned in step 5), if the SACK follow the rules defined in Section 6.2). As mentioned in step
is bundled with the COOKIE ACK, the COOKIE ACK MUST appear first in 5), if the SACK is bundled with the COOKIE ACK, the COOKIE ACK
the SCTP packet. MUST appear first in the SCTP packet.
If a COOKIE ECHO is received from an endpoint with which the If a COOKIE ECHO is received from an endpoint with which the receiver
receiver of the COOKIE ECHO has an existing association, the procedures of the COOKIE ECHO has an existing association, the procedures in
in Section 5.2 should be followed. Section 5.2 should be followed.
5.1.6 An Example of Normal Association Establishment 5.1.6 An Example of Normal Association Establishment
In the following example, "A" initiates the association and then sends In the following example, "A" initiates the association and then
a user message to "Z", then "Z" sends two user messages to "A" later sends a user message to "Z", then "Z" sends two user messages to "A"
(assuming no bundling or fragmentation occurs): later (assuming no bundling or fragmentation occurs):
Endpoint A Endpoint Z Endpoint A Endpoint Z
{app sets association with Z} {app sets association with Z}
(build TCB) (build TCB)
INIT [I-Tag=Tag_A INIT [I-Tag=Tag_A
& other info] --------\ & other info] --------\
(Start T1-init timer) \ (Start T1-init timer) \
(Enter COOKIE-WAIT state) \---> (compose temp TCB and Cookie_Z) (Enter COOKIE-WAIT state) \---> (compose temp TCB and Cookie_Z)
/--- INIT ACK [Veri Tag=Tag_A, /--- INIT ACK [Veri Tag=Tag_A,
/ I-Tag=Tag_Z, / I-Tag=Tag_Z,
(Cancel T1-init timer) <------/ Cookie_Z, & other info] (Cancel T1-init timer) <------/ Cookie_Z, & other info]
(destroy temp TCB) (destroy temp TCB)
COOKIE ECHO [Cookie_Z] ------\ COOKIE ECHO [Cookie_Z] ------\
(Start T1-init timer) \ (Start T1-init timer) \
(Enter COOKIE-ECHOED state) \---> (build TCB enter ESTABLISHED (Enter COOKIE-ECHOED state) \---> (build TCB enter ESTABLISHED
state) state)
/---- COOKIE-ACK /---- COOKIE-ACK
/ /
(Cancel T1-init timer, <-----/ (Cancel T1-init timer, <-----/
Enter ESTABLISHED state) Enter ESTABLISHED state)
... {app sends 1st user data; strm 0}
{app sends 1st user data; strm 0} DATA [TSN=initial TSN_A
DATA [TSN=initial TSN_A Strm=0,Seq=1 & user data]--\
Strm=0,Seq=1 & user data]--\ (Start T3-rtx timer) \
(Start T3-rtx timer) \ \->
\-> /----- SACK [TSN Ack=init
/----- SACK [TSN Ack=init TSN_A,Block=0] TSN_A,Block=0]
(Cancel T3-rtx timer) <------/ (Cancel T3-rtx timer) <------/
...
... ...
{app sends 2 messages;strm 0} {app sends 2 messages;strm 0}
/---- DATA /---- DATA
/ [TSN=init TSN_Z / [TSN=init TSN_Z
<--/ Strm=0,Seq=1 & user data 1] <--/ Strm=0,Seq=1 & user data 1]
SACK [TSN Ack=init TSN_Z, /---- DATA SACK [TSN Ack=init TSN_Z, /---- DATA
Block=0] --------\ / [TSN=init TSN_Z +1, Block=0] --------\ / [TSN=init TSN_Z +1,
\/ Strm=0,Seq=2 & user data 2] \/ Strm=0,Seq=2 & user data 2]
<------/\ <------/\
\ \
\------> \------>
Figure 4: INITiation Example Figure 4: INITiation Example
If the T1-init timer expires at "A" after the INIT or COOKIE ECHO If the T1-init timer expires at "A" after the INIT or COOKIE ECHO
chunks are sent, the same INIT or COOKIE ECHO chunk with the same chunks are sent, the same INIT or COOKIE ECHO chunk with the same
Initiate Tag (i.e., Tag_A) or State Cookie shall be retransmitted and Initiate Tag (i.e., Tag_A) or State Cookie shall be retransmitted and
the timer restarted. This shall be repeated Max.Init.Retransmits times the timer restarted. This shall be repeated Max.Init.Retransmits
before "A" considers "Z" unreachable and reports the failure to its times before "A" considers "Z" unreachable and reports the failure to
upper layer (and thus the association enters the CLOSED state). When its upper layer (and thus the association enters the CLOSED state).
retransmitting the INIT, the endpoint MUST follow the rules When retransmitting the INIT, the endpoint MUST follow the rules
defined in 6.3 to determine the proper timer value. defined in 6.3 to determine the proper timer value.
5.2 Handle Duplicate or Unexpected INIT, INIT ACK, COOKIE ECHO, and 5.2 Handle Duplicate or Unexpected INIT, INIT ACK, COOKIE ECHO, and
COOKIE ACK COOKIE ACK
During the lifetime of an association (in one of the possible During the lifetime of an association (in one of the possible
states), an endpoint may receive from its peer endpoint one of the states), an endpoint may receive from its peer endpoint one of the
setup chunks (INIT, INIT ACK, COOKIE ECHO, and COOKIE ACK). The setup chunks (INIT, INIT ACK, COOKIE ECHO, and COOKIE ACK). The
receiver shall treat such a setup chunk as a duplicate and process it receiver shall treat such a setup chunk as a duplicate and process it
as described in this section. as described in this section.
Note: An endpoint will not receive the chunk unless the chunk was
sent to a SCTP transport address and is from a SCTP transport address
associated with this endpoint. Therefore, the endpoint processes
such a chunk as part of its current association.
The following scenarios can cause duplicated or unexpected chunks: Note: An endpoint will not receive the chunk unless the chunk was
sent to a SCTP transport address and is from a SCTP transport address
associated with this endpoint. Therefore, the endpoint processes
such a chunk as part of its current association.
A) The peer has crashed without being detected, re-started The following scenarios can cause duplicated or unexpected chunks:
itself and sent out a new INIT chunk trying to restore the
association,
B) Both sides are trying to initialize the association at about the A) The peer has crashed without being detected, re-started itself and
same time, sent out a new INIT chunk trying to restore the association,
C) The chunk is from a stale packet that was used to establish B) Both sides are trying to initialize the association at about the
the present association or a past association that is no same time,
longer in existence,
D) The chunk is a false packet generated by an attacker, or C) The chunk is from a stale packet that was used to establish the
present association or a past association that is no longer in
existence,
E) The peer never received the COOKIE ACK and is retransmitting its D) The chunk is a false packet generated by an attacker, or
COOKIE ECHO.
The rules in the following sections shall be applied in order to E) The peer never received the COOKIE ACK and is retransmitting its
identify and correctly handle these cases. COOKIE ECHO.
The rules in the following sections shall be applied in order to
identify and correctly handle these cases.
5.2.1 INIT received in COOKIE-WAIT or COOKIE-ECHOED State (Item B) 5.2.1 INIT received in COOKIE-WAIT or COOKIE-ECHOED State (Item B)
This usually indicates an initialization collision, i.e., each
endpoint is attempting, at about the same time, to establish an
association with the other endpoint.
Upon receipt of an INIT in the COOKIE-WAIT or COOKIE-ECHOED state, an This usually indicates an initialization collision, i.e., each
endpoint MUST respond with an INIT ACK using the same parameters it endpoint is attempting, at about the same time, to establish an
sent in its original INIT chunk (including its Verification Tag, association with the other endpoint.
unchanged). These original parameters are combined with those from the
newly received INIT chunk. The endpoint shall also generate a State
Cookie with the INIT ACK. The endpoint uses the parameters sent in its
INIT to calculate the State Cookie.
After that, the endpoint MUST NOT change its state, the T1-init Upon receipt of an INIT in the COOKIE-WAIT or COOKIE-ECHOED state, an
timer shall be left running and the corresponding TCB MUST NOT be endpoint MUST respond with an INIT ACK using the same parameters it
destroyed. The normal procedures for handling State Cookies when sent in its original INIT chunk (including its Initiation Tag,
a TCB exists will resolve the duplicate INITs to a single association. unchanged). These original parameters are combined with those from
the newly received INIT chunk. The endpoint shall also generate a
State Cookie with the INIT ACK. The endpoint uses the parameters
sent in its INIT to calculate the State Cookie.
For an endpoint that is in the COOKIE-ECHOED state it MUST populate After that, the endpoint MUST NOT change its state, the T1-init timer
its Tie-Tags with the Tag information of itself and its peer (see shall be left running and the corresponding TCB MUST NOT be
section 5.2.2 for a description of the Tie-Tags). destroyed. The normal procedures for handling State Cookies when a
TCB exists will resolve the duplicate INITs to a single association.
5.2.2 Unexpected INIT in States Other than CLOSED, COOKIE-ECHOED and For an endpoint that is in the COOKIE-ECHOED state it MUST populate
COOKIE-WAIT its Tie-Tags with the Tag information of itself and its peer (see
section 5.2.2 for a description of the Tie-Tags).
Unless otherwise stated, upon reception of an unexpected INIT for this 5.2.2 Unexpected INIT in States Other than CLOSED, COOKIE-ECHOED,
association, the endpoint shall generate an INIT ACK with a State COOKIE-WAIT and SHUTDOWN-ACK-SENT
Cookie. In the outbound INIT ACK the endpoint MUST copy its current
Verification Tag and Peers Verification tag into a reserved place
within the state cookie. We shall refer to these locations as the
Peers-Tie-Tag and the Local-Tie-Tag. The INIT ACK MUST contain a new
Verification Tag (randomly generated see Section 5.3.1). Other
parameters for the endpoint SHOULD be copied from the existing
parameters of the association (e.g. number of outbound streams) into
the INIT ACK and cookie.
After sending out the INIT ACK, the endpoint shall take no further Unless otherwise stated, upon reception of an unexpected INIT for
actions, i.e., the existing association, including its current state, this association, the endpoint shall generate an INIT ACK with a
and the corresponding TCB MUST NOT be changed. State Cookie. In the outbound INIT ACK the endpoint MUST copy its
current Verification Tag and peer's Verification Tag into a reserved
place within the state cookie. We shall refer to these locations as
the Peer's-Tie-Tag and the Local-Tie-Tag. The outbound SCTP packet
containing this INIT ACK MUST carry a Verification Tag value equal to
the Initiation Tag found in the unexpected INIT. And the INIT ACK
MUST contain a new Initiation Tag (randomly generated see Section
5.3.1). Other parameters for the endpoint SHOULD be copied from the
existing parameters of the association (e.g. number of outbound
streams) into the INIT ACK and cookie.
Note: Only when a TCB exists and the association is NOT in a After sending out the INIT ACK, the endpoint shall take no further
COOKIE-WAIT state are the Tie-Tags populated. For a normal association actions, i.e., the existing association, including its current state,
INIT (i.e. the endpoint is in a COOKIE-WAIT state), the Tie-Tags MUST and the corresponding TCB MUST NOT be changed.
be set to 0 (indicating that no previous TCB existed). The INIT ACK
and State Cookie are populated as specified in section 5.2.1. Note: Only when a TCB exists and the association is not in a COOKIE-
WAIT state are the Tie-Tags populated. For a normal association INIT
(i.e. the endpoint is in a COOKIE-WAIT state), the Tie-Tags MUST be
set to 0 (indicating that no previous TCB existed). The INIT ACK and
State Cookie are populated as specified in section 5.2.1.
5.2.3 Unexpected INIT ACK 5.2.3 Unexpected INIT ACK
If an INIT ACK is received by an endpoint in any state If an INIT ACK is received by an endpoint in any state other than the
other than the COOKIE-WAIT state, the endpoint should discard COOKIE-WAIT state, the endpoint should discard the INIT ACK chunk.
the INIT ACK chunk. An unexpected INIT ACK usually indicates the An unexpected INIT ACK usually indicates the processing of an old or
processing of an old or duplicated INIT chunk. duplicated INIT chunk.
5.2.4 Handle a COOKIE ECHO when a TCB exists 5.2.4 Handle a COOKIE ECHO when a TCB exists
When a COOKIE ECHO chunk is received by an endpoint in any state for an
existing association (i.e., not in the CLOSED state) the following
rules shall be applied:
1) Compute a MAC as described in Step 1 of Section 5.1.5, When a COOKIE ECHO chunk is received by an endpoint in any state for
an existing association (i.e., not in the CLOSED state) the following
rules shall be applied:
2) Authenticate the State Cookie as described in Step 2 of Section 1) Compute a MAC as described in Step 1 of Section 5.1.5,
5.1.5 (this is case C or D above).
3) Compare the timestamp in the State Cookie to the current time. If 2) Authenticate the State Cookie as described in Step 2 of Section
the State Cookie is older than the lifespan carried in the State 5.1.5 (this is case C or D above).
Cookie and the Verification Tags contained in the State Cookie do
not match the current association's Verification Tags, the packet,
including the COOKIE ECHO and any DATA chunks, should be discarded.
The endpoint also MUST transmit an ERROR chunk with a "Stale Cookie"
error cause to the peer endpoint (this is case C or D above).
If both Verification Tags in the State Cookie match the Verification 3) Compare the timestamp in the State Cookie to the current time. If
Tags of the current association, consider the State Cookie valid the State Cookie is older than the lifespan carried in the State
(this is case E) even if the lifespan is exceeded. Cookie and the Verification Tags contained in the State Cookie do
not match the current association's Verification Tags, the packet,
including the COOKIE ECHO and any DATA chunks, should be
discarded. The endpoint also MUST transmit an ERROR chunk with a
"Stale Cookie" error cause to the peer endpoint (this is case C or
D in section 5.2).
4) If the State Cookie proves to be valid, unpack the TCB into a If both Verification Tags in the State Cookie match the
temporary TCB. Verification Tags of the current association, consider the State
Cookie valid (this is case E of section 5.2) even if the lifespan
is exceeded.
5) Refer to Table 2 to determine the correct action to be taken. 4) If the State Cookie proves to be valid, unpack the TCB into a
temporary TCB.
+------------+------------+---------------+--------------+-------------+ 5) Refer to Table 2 to determine the correct action to be taken.
| Local Tag | Peers Tag | Local-Tie-Tag | Peers-Tie-Tag| Action/ |
| | | | | Description |
+------------+------------+---------------+--------------+-------------+
| X | X | M | M | (A) |
+------------+------------+---------------+--------------+-------------+
| M | A | A | A | (B) |
+------------+------------+---------------+--------------+-------------+
| X | M | 0 | 0 | (C) |
+------------+------------+---------------+--------------+-------------+
| M | M | A | A | (D) |
+======================================================================+
| Table 2: Handling of a Cookie when a TCB exists |
+======================================================================+
Legend: +------------+------------+---------------+--------------+-------------+
| Local Tag | Peer's Tag | Local-Tie-Tag |Peer's-Tie-Tag| Action/ |
| | | | | Description |
+------------+------------+---------------+--------------+-------------+
| X | X | M | M | (A) |
+------------+------------+---------------+--------------+-------------+
| M | X | A | A | (B) |
+------------+------------+---------------+--------------+-------------+
| M | 0 | A | A | (B) |
+------------+------------+---------------+--------------+-------------+
| X | M | 0 | 0 | (C) |
+------------+------------+---------------+--------------+-------------+
| M | M | A | A | (D) |
+======================================================================+
| Table 2: Handling of a COOKIE ECHO when a TCB exists |
+======================================================================+
X - Tag does not match the existing TCB Legend:
M - Tag matches the existing TCB.
0 - No Tie-Tag in Cookie (unknown).
A - All cases, i.e. M, X or 0.
Note: For any case not shown in Table 2, the cookie should be X - Tag does not match the existing TCB
silently discarded. M - Tag matches the existing TCB.
0 - No Tie-Tag in Cookie (unknown).
A - All cases, i.e. M, X or 0.
Action Note: For any case not shown in Table 2, the cookie should be
silently discarded.
(A)In this case, the peer may have restarted. When the endpoint Action
recognizes this potential 'restart', the existing session is
treated the same as if it received an ABORT followed by a new
Cookie Echo with the following exceptions:
- Any SCTP Data Chunks MAY be retained (this is an implementation A) In this case, the peer may have restarted. When the endpoint
specific option). recognizes this potential 'restart', the existing session is
treated the same as if it received an ABORT followed by a new
COOKIE ECHO with the following exceptions:
- A notification of RESTART SHOULD be sent to the ULP instead - Any SCTP DATA Chunks MAY be retained (this is an implementation
of a "COMMUNICATION LOST" notification. specific option).
All the congestion control parameters (e.g., cwnd, ssthresh) related - A notification of RESTART SHOULD be sent to the ULP instead of
to this peer MUST be reset to their initial values (see Section a "COMMUNICATION LOST" notification.
6.2.1).
After this the endpoint shall enter the ESTABLISHED state. All the congestion control parameters (e.g., cwnd, ssthresh)
related to this peer MUST be reset to their initial values (see
Section 6.2.1).
If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes After this the endpoint shall enter the ESTABLISHED state.
the peer has restarted (Action A), it MUST NOT setup a new
association but instead resend the SHUTDOWN ACK and send an ERROR
chunk with a "Cookie Received while Shutting Down" error cause to
its peer.
(B)In this case, both sides may be attempting to start an If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes
association at about the same time but the peer endpoint the peer has restarted (Action A), it MUST NOT setup a new
started its INIT after responding to the local endpoints association but instead resend the SHUTDOWN ACK and send an ERROR
INIT. Thus it may have picked a new Verification Tag not being aware chunk with a "Cookie Received while Shutting Down" error cause to
of the previous Tag it had sent this endpoint. The endpoint its peer.
should stay in or enter the Established state but it MUST update
its peers Verification Tag from the Cookie, stop any init
or cookie timers that may running and send a Cookie Ack.
(C)In this case, the local endpoints cookie has arrived B) In this case, both sides may be attempting to start an association
late. Before it arrived the local endpoint, sent at about the same time but the peer endpoint started its INIT
a INIT and received a INIT-ACK and finally sent a after responding to the local endpoint's INIT. Thus it may have
Cookie with the peers same tag but a new tag of picked a new Verification Tag not being aware of the previous Tag
its own. The cookie should be silently discarded. it had sent this endpoint. The endpoint should stay in or enter
The endpoint should NOT change states and should the ESTABLISHED state but it MUST update its peer's Verification
leave any timers running. Tag from the State Cookie, stop any init or cookie timers that may
running and send a COOKIE ACK.
(D)When both local and remote tags match the endpoint should C) In this case, the local endpoint's cookie has arrived late.
always enter the Established state. It should stop any init Before it arrived, the local endpoint sent an INIT and received an
or cookie timers that may running and send a Cookie Ack. INIT-ACK and finally sent a COOKIE ECHO with the peer's same tag
but a new tag of its own. The cookie should be silently
discarded. The endpoint SHOULD NOT change states and should leave
any timers running.
Note: The "peer's Verification Tag" is the tag received in the D) When both local and remote tags match the endpoint should always
Initiate Tag field of the INIT or INIT ACK chunk. enter the ESTABLISHED state, if it has not already done so. It
should stop any init or cookie timers that may be running and send
a COOKIE ACK.
Note: The "peer's Verification Tag" is the tag received in the
Initiate Tag field of the INIT or INIT ACK chunk.
5.2.4.1 An Example of a Association Restart 5.2.4.1 An Example of a Association Restart
In the following example, "A" initiates the association after a restart In the following example, "A" initiates the association after a
has occured. Endpoint "Z" had no knowledge of the restart until the restart has occurred. Endpoint "Z" had no knowledge of the restart
exchange (i.e. Heartbeats had not yet detected the failure of "A"). until the exchange (i.e. Heartbeats had not yet detected the failure
(assuming no bundling or fragmentation occurs): of "A"). (assuming no bundling or fragmentation occurs):
Endpoint A Endpoint Z Endpoint A Endpoint Z
<-------------- Association is established----------------------> <-------------- Association is established---------------------->
Tag=Tag_A Tag=Tag_Z Tag=Tag_A Tag=Tag_Z
<---------------------------------------------------------------> <--------------------------------------------------------------->
{A crashes and restarts} {A crashes and restarts}
{app sets up a association with Z} {app sets up a association with Z}
(build TCB) (build TCB)
INIT [I-Tag=Tag_A' INIT [I-Tag=Tag_A'
& other info] --------\ & other info] --------\
(Start T1-init timer) \ (Start T1-init timer) \
(Enter COOKIE-WAIT state) \---> (find a existing TCB (Enter COOKIE-WAIT state) \---> (find a existing TCB
compose temp TCB and Cookie_Z compose temp TCB and Cookie_Z
with Tie-Tags to previous with Tie-Tags to previous
association) association)
/--- INIT ACK [Veri Tag=Tag_A', /--- INIT ACK [Veri Tag=Tag_A',
/ I-Tag=Tag_Z', / I-Tag=Tag_Z',
(Cancel T1-init timer) <------/ Cookie_Z[TieTags=Tag_A,Tag_Z (Cancel T1-init timer) <------/ Cookie_Z[TieTags=
Tag_A,Tag_Z
& other info] & other info]
(destroy temp TCB,leave original in place) (destroy temp TCB,leave original
in place)
COOKIE ECHO [Veri=Tag_Z', COOKIE ECHO [Veri=Tag_Z',
Cookie_Z Cookie_Z
Tie=Tag_A, Tie=Tag_A,
Tag_Z]----------\ Tag_Z]----------\
(Start T1-init timer) \ (Start T1-init timer) \
(Enter COOKIE-ECHOED state) \---> (Find existing association, (Enter COOKIE-ECHOED state) \---> (Find existing association,
Tie-Tags match old tags, Tie-Tags match old tags,
Tags do not match i.e. Tags do not match i.e.
case X X M M above, case X X M M above,
Announce Restart to ULP Announce Restart to ULP
and reset association). and reset association).
/---- COOKIE-ACK /---- COOKIE-ACK
/ /
(Cancel T1-init timer, <-----/ (Cancel T1-init timer, <-----/
Enter ESTABLISHED state) Enter ESTABLISHED state)
...
{app sends 1st user data; strm 0} {app sends 1st user data; strm 0}
DATA [TSN=initial TSN_A DATA [TSN=initial TSN_A
Strm=0,Seq=1 & user data]--\ Strm=0,Seq=1 & user data]--\
(Start T3-rtx timer) \ (Start T3-rtx timer) \
\-> \->
/----- SACK [TSN Ack=init TSN_A,Block=0] /----- SACK [TSN Ack=init TSN_A,Block=0]
(Cancel T3-rtx timer) <------/ (Cancel T3-rtx timer) <------/
Figure 5: A Restart Example Figure 5: A Restart Example
5.2.5 Handle Duplicate COOKIE-ACK. 5.2.5 Handle Duplicate COOKIE-ACK.
At any state other than COOKIE-ECHOED, an endpoint should silently At any state other than COOKIE-ECHOED, an endpoint should silently
discard a received COOKIE ACK chunk. discard a received COOKIE ACK chunk.
5.2.6 Handle Stale COOKIE Error 5.2.6 Handle Stale COOKIE Error
Receipt of an Operational ERROR chunk with a "Stale Cookie" error Receipt of an ERROR chunk with a "Stale Cookie" error cause indicates
cause indicates one of a number of possible events: one of a number of possible events:
A) That the association failed to completely setup before the A) That the association failed to completely setup before the State
State Cookie issued by the sender was processed. Cookie issued by the sender was processed.
B) An old State Cookie was processed after setup completed. B) An old State Cookie was processed after setup completed.
C) An old State Cookie is received from someone that the receiver is C) An old State Cookie is received from someone that the receiver is
not interested in having an association with and the ABORT not interested in having an association with and the ABORT chunk
chunk was lost. was lost.
When processing an Operational ERROR chunk with a "Stale Cookie" error cause an When processing an ERROR chunk with a "Stale Cookie" error cause an
endpoint should first examine if an association is in the process of endpoint should first examine if an association is in the process of
being setup, i.e. the association is in the COOKIE-ECHOED state. In all being setup, i.e. the association is in the COOKIE-ECHOED state. In
cases if the association is NOT in the COOKIE-ECHOED state, the ERROR all cases if the association is not in the COOKIE-ECHOED state, the
chunk should be silently discarded. ERROR chunk should be silently discarded.
If the association is in the COOKIE-ECHOED state, the endpoint may elect If the association is in the COOKIE-ECHOED state, the endpoint may
one of the following three alternatives. elect one of the following three alternatives.
1) Send a new INIT chunk to the endpoint to generate a new State 1) Send a new INIT chunk to the endpoint to generate a new State
Cookie and re-attempt the setup procedure. Cookie and re-attempt the setup procedure.
2) Discard the TCB and report to the upper layer the inability to 2) Discard the TCB and report to the upper layer the inability to
setup the association. setup the association.
3) Send a new INIT chunk to the endpoint, adding a Cookie 3) Send a new INIT chunk to the endpoint, adding a Cookie
Preservative parameter requesting an extension to the lifetime of Preservative parameter requesting an extension to the lifetime of
the State Cookie. When calculating the time extension, an the State Cookie. When calculating the time extension, an
implementation SHOULD use the RTT information measured based on the implementation SHOULD use the RTT information measured based on
previous COOKIE ECHO / ERROR exchange, and should add no more the previous COOKIE ECHO / ERROR exchange, and should add no more
than 1 second beyond the measured RTT, due to long State Cookie than 1 second beyond the measured RTT, due to long State Cookie
lifetimes making the endpoint more subject to a replay attack. lifetimes making the endpoint more subject to a replay attack.
5.3 Other Initialization Issues 5.3 Other Initialization Issues
5.3.1 Selection of Tag Value 5.3.1 Selection of Tag Value
Initiate Tag values should be selected from the range of 1 to Initiate Tag values should be selected from the range of 1 to 2**32 -
2**32 - 1. It is very important that the Initiate Tag value be 1. It is very important that the Initiate Tag value be randomized to
randomized to help protect against "man in the middle" and "sequence help protect against "man in the middle" and "sequence number"
number" attacks. The methods described in [RFC1750] can be used for attacks. The methods described in [RFC1750] can be used for the
the Initiate Tag randomization. Careful selection of Initiate Tags is Initiate Tag randomization. Careful selection of Initiate Tags is
also necessary to prevent old duplicate packets from previous also necessary to prevent old duplicate packets from previous
associations being mistakenly processed as belonging to the current associations being mistakenly processed as belonging to the current
association. association.
Moreover, the Verification Tag value used by either endpoint in a given Moreover, the Verification Tag value used by either endpoint in a
association MUST NOT change during the lifetime of an given association MUST NOT change during the lifetime of an
association. A new Verification Tag value MUST be used each association. A new Verification Tag value MUST be used each time the
time the endpoint tears-down and then re-establishes an association to endpoint tears-down and then re-establishes an association to the
the same peer. same peer.
6. User Data Transfer 6. User Data Transfer
Data transmission MUST only happen in the ESTABLISHED, Data transmission MUST only happen in the ESTABLISHED, SHUTDOWN-
SHUTDOWN-PENDING, and SHUTDOWN-RECEIVED states. The only PENDING, and SHUTDOWN-RECEIVED states. The only exception to this is
exception to this is that DATA chunks are allowed to be that DATA chunks are allowed to be bundled with an outbound COOKIE
bundled with an outbound COOKIE ECHO chunk when in COOKIE-WAIT ECHO chunk when in COOKIE-WAIT state.
state.
DATA chunks MUST only be received according to the rules below DATA chunks MUST only be received according to the rules below in
in ESTABLISHED, SHUTDOWN-PENDING, SHUTDOWN-SENT. A DATA chunk ESTABLISHED, SHUTDOWN-PENDING, SHUTDOWN-SENT. A DATA chunk received
received in CLOSED is out of the blue and SHOULD be handled in CLOSED is out of the blue and SHOULD be handled per 8.4. A DATA
per 8.4. A DATA chunk received in any other state SHOULD be chunk received in any other state SHOULD be discarded.
discarded.
A SACK MUST be processed in ESTABLISHED, SHUTDOWN-PENDING, and A SACK MUST be processed in ESTABLISHED, SHUTDOWN-PENDING, and
SHUTDOWN-RECEIVED. An incoming SACK MAY be processed in SHUTDOWN-RECEIVED. An incoming SACK MAY be processed in COOKIE-
COOKIE-ECHOED. A SACK in the CLOSED state is out of the blue ECHOED. A SACK in the CLOSED state is out of the blue and SHOULD be
and SHOULD be processed according to the rules in 8.4. A SACK processed according to the rules in 8.4. A SACK chunk received in
chunk received in any other state SHOULD be discarded. any other state SHOULD be discarded.
A SCTP receiver MUST be able to receive a minimum of 1500 bytes A SCTP receiver MUST be able to receive a minimum of 1500 bytes in
in one SCTP packet. This means that a SCTP endpoint MUST NOT one SCTP packet. This means that a SCTP endpoint MUST NOT indicate
indicate less than 1500 bytes in its Initial a_rwnd sent in the less than 1500 bytes in its Initial a_rwnd sent in the INIT or INIT
INIT or INIT ACK. ACK.
For transmission efficiency, SCTP defines mechanisms for bundling of For transmission efficiency, SCTP defines mechanisms for bundling of
small user messages and fragmentation of large user messages. small user messages and fragmentation of large user messages. The
The following diagram depicts the flow of user messages through SCTP. following diagram depicts the flow of user messages through SCTP.
In this section the term "data sender" refers to the endpoint that In this section the term "data sender" refers to the endpoint that
transmits a DATA chunk and the term "data receiver" refers to the transmits a DATA chunk and the term "data receiver" refers to the
endpoint that receives a DATA chunk. A data receiver will transmit endpoint that receives a DATA chunk. A data receiver will transmit
SACK chunks. SACK chunks.
+--------------------------+ +--------------------------+
| User Messages | | User Messages |
+--------------------------+ +--------------------------+
SCTP user ^ | SCTP user ^ |
==================|==|======================================= ==================|==|=======================================
| v (1) | v (1)
+------------------+ +--------------------+ +------------------+ +--------------------+
| SCTP DATA Chunks | |SCTP Control Chunks | | SCTP DATA Chunks | |SCTP Control Chunks |
+------------------+ +--------------------+ +------------------+ +--------------------+
^ | ^ | ^ | ^ |
| v (2) | v (2) | v (2) | v (2)
+--------------------------+ +--------------------------+
| SCTP packets | | SCTP packets |
+--------------------------+ +--------------------------+
SCTP ^ | SCTP ^ |
===========================|==|=========================== ===========================|==|===========================
| v | v
Connectionless Packet Transfer Service (e.g., IP) Connectionless Packet Transfer Service (e.g., IP)
Notes: Notes:
(1) When converting user messages into DATA chunks, an endpoint
will fragment user messages larger than the current association
path MTU into multiple DATA chunks. The data receiver will
normally reassemble the fragmented message from DATA chunks
before delivery to the user (see Section 6.9 for details).
(2) Multiple DATA and control chunks may be bundled by the 1) When converting user messages into DATA chunks, an endpoint
sender into a single SCTP packet for transmission, as long as will fragment user messages larger than the current association
the final size of the packet does not exceed the current path path MTU into multiple DATA chunks. The data receiver will
MTU. The receiver will unbundle the packet back into normally reassemble the fragmented message from DATA chunks
the original chunks. Control chunks MUST come before before delivery to the user (see Section 6.9 for details).
DATA chunks in the packet.
Figure 6: Illustration of User Data Transfer 2) Multiple DATA and control chunks may be bundled by the sender
into a single SCTP packet for transmission, as long as the
final size of the packet does not exceed the current path MTU.
The receiver will unbundle the packet back into the original
chunks. Control chunks MUST come before DATA chunks in the
packet.
The fragmentation and bundling mechanisms, as detailed in Sections 6.9 Figure 6: Illustration of User Data Transfer
and 6.10, are OPTIONAL to implement by the data sender, but they MUST
be implemented by the data receiver, i.e., an endpoint MUST The fragmentation and bundling mechanisms, as detailed in Sections
properly receive and process bundled or fragmented data. 6.9 and 6.10, are OPTIONAL to implement by the data sender, but they
MUST be implemented by the data receiver, i.e., an endpoint MUST
properly receive and process bundled or fragmented data.
6.1 Transmission of DATA Chunks 6.1 Transmission of DATA Chunks
This document is specified as if there is a single retransmission This document is specified as if there is a single retransmission
timer per destination transport address, but implementations MAY have timer per destination transport address, but implementations MAY have
a retransmission timer for each DATA chunk. a retransmission timer for each DATA chunk.
The following general rules MUST be applied by the data sender for The following general rules MUST be applied by the data sender for
transmission and/or retransmission of outbound DATA chunks: transmission and/or retransmission of outbound DATA chunks:
A) At any given time, the data sender MUST NOT transmit new data to any A) At any given time, the data sender MUST NOT transmit new data to
destination transport address if its peer's rwnd indicates that the any destination transport address if its peer's rwnd indicates
peer has no buffer space (i.e. rwnd is 0, see Section 6.2.1). that the peer has no buffer space (i.e. rwnd is 0, see Section
However, regardless of the value of rwnd (including if it is 0), 6.2.1). However, regardless of the value of rwnd (including if it
the data sender can always have one DATA chunk in flight to the is 0), the data sender can always have one DATA chunk in flight to
receiver if allowed by cwnd (see rule B below). This rule the receiver if allowed by cwnd (see rule B below). This rule
allows the sender to probe for a change in rwnd that the sender allows the sender to probe for a change in rwnd that the sender
missed due to the SACK having been lost in transit from missed due to the SACK having been lost in transit from the data
the data receiver to the data sender. receiver to the data sender.
B) At any given time, the sender MUST NOT transmit new data to a B) At any given time, the sender MUST NOT transmit new data to a
given transport address if it has cwnd or more bytes of data given transport address if it has cwnd or more bytes of data
outstanding to that transport address. outstanding to that transport address.
C) When the time comes for the sender to transmit, before sending C) When the time comes for the sender to transmit, before sending new
new DATA chunks, the sender MUST first transmit any outstanding DATA chunks, the sender MUST first transmit any outstanding DATA
DATA chunks which are marked for retransmission (limited by the chunks which are marked for retransmission (limited by the current
current cwnd). cwnd).
D) Then, the sender can send out as many new DATA chunks as Rule A and D) Then, the sender can send out as many new DATA chunks as Rule A
Rule B above allow. and Rule B above allow.
Multiple DATA chunks committed for transmission MAY be Multiple DATA chunks committed for transmission MAY be bundled in a
bundled in a single packet. Furthermore, DATA chunks being single packet. Furthermore, DATA chunks being retransmitted MAY be
retransmitted MAY be bundled with new DATA chunks, as long as the bundled with new DATA chunks, as long as the resulting packet size
resulting packet size does not exceed the path MTU. A ULP does not exceed the path MTU. A ULP may request that no bundling is
may request that no bundling is performed but this should only turn off performed but this should only turn off any delays that a SCTP
any delays that a SCTP implementation may be using to increase implementation may be using to increase bundling efficiency. It does
bundling efficiency. It does not in itself stop all bundling not in itself stop all bundling from occurring (i.e. in case of
from occurring (i.e. in case of congestion or retransmission). congestion or retransmission).
Before an endpoint transmits a DATA chunk, if any received DATA Before an endpoint transmits a DATA chunk, if any received DATA
chunks have not been acknowledged (e.g., due to delayed ack), the chunks have not been acknowledged (e.g., due to delayed ack), the
sender should create a SACK and bundle it with the outbound DATA sender should create a SACK and bundle it with the outbound DATA
chunk, as long as the size of the final SCTP packet does not exceed chunk, as long as the size of the final SCTP packet does not exceed
the current MTU. See Section 6.2. the current MTU. See Section 6.2.
IMPLEMENTATION NOTE: When the window is full (i.e., transmission is IMPLEMENTATION NOTE: When the window is full (i.e., transmission is
disallowed by Rule A and/or Rule B), the sender MAY still accept disallowed by Rule A and/or Rule B), the sender MAY still accept send
send requests from its upper layer, but MUST transmit no more DATA requests from its upper layer, but MUST transmit no more DATA chunks
chunks until some or all of the outstanding DATA chunks are until some or all of the outstanding DATA chunks are acknowledged and
acknowledged and transmission is allowed by Rule A and Rule B transmission is allowed by Rule A and Rule B again.
again.
Whenever a transmission or retransmission is made to any address, if Whenever a transmission or retransmission is made to any address, if
the T3-rtx timer of that address is not currently running, the sender the T3-rtx timer of that address is not currently running, the sender
MUST start that timer. If the timer for that address is already MUST start that timer. If the timer for that address is already
running, the sender MUST restart the timer if the earliest running, the sender MUST restart the timer if the earliest (i.e.,
(i.e., lowest TSN) outstanding DATA chunk sent to that address is being lowest TSN) outstanding DATA chunk sent to that address is being
retransmitted. Otherwise, the data sender MUST NOT restart the timer. retransmitted. Otherwise, the data sender MUST NOT restart the
timer.
When starting or restarting the T3-rtx timer, the timer value must be When starting or restarting the T3-rtx timer, the timer value must be
adjusted according to the timer rules defined in Sections 6.3.2, adjusted according to the timer rules defined in Sections 6.3.2, and
and 6.3.3. 6.3.3.
Note: The data sender SHOULD NOT use a TSN that is more than Note: The data sender SHOULD NOT use a TSN that is more than 2**31 -
2**31 - 1 above the beginning TSN of the current send window. 1 above the beginning TSN of the current send window.
6.2 Acknowledgement on Reception of DATA Chunks 6.2 Acknowledgement on Reception of DATA Chunks
The SCTP endpoint MUST always acknowledge the reception of each valid The SCTP endpoint MUST always acknowledge the reception of each valid
DATA chunk. DATA chunk.
The guidelines on delayed acknowledgement algorithm specified in The guidelines on delayed acknowledgement algorithm specified in
Section 4.2 of [RFC2581] SHOULD be followed. Specifically, an Section 4.2 of [RFC2581] SHOULD be followed. Specifically, an
acknowledgement SHOULD be generated for at least every second packet acknowledgement SHOULD be generated for at least every second packet
(not every second DATA chunk) received, and SHOULD be generated within (not every second DATA chunk) received, and SHOULD be generated
200 ms of the arrival of any unacknowledged DATA chunk. In some within 200 ms of the arrival of any unacknowledged DATA chunk. In
situations it may be beneficial for an SCTP transmitter to be more some situations it may be beneficial for an SCTP transmitter to be
conservative than the algorithms detailed in this document allow. more conservative than the algorithms detailed in this document
However, an SCTP transmitter MUST NOT be more aggressive than the allow. However, an SCTP transmitter MUST NOT be more aggressive than
following algorithms allow. the following algorithms allow.
A SCTP receiver MUST NOT generate more than one SACK for every A SCTP receiver MUST NOT generate more than one SACK for every
incoming packet, other than to update the offered window as the incoming packet, other than to update the offered window as the
receiving application consumes new data. receiving application consumes new data.
IMPLEMENTATION NOTE: The maximum delay for generating an IMPLEMENTATION NOTE: The maximum delay for generating an
acknowledgement may be configured by the SCTP administrator, either acknowledgement may be configured by the SCTP administrator, either
statically or dynamically, in order to meet the specific statically or dynamically, in order to meet the specific timing
timing requirement of the protocol being carried. requirement of the protocol being carried.
An implementation MUST NOT allow the maximum delay to be configured to An implementation MUST NOT allow the maximum delay to be configured
be more than 500 ms. In other words an implementation MAY lower this to be more than 500 ms. In other words an implementation MAY lower
value below 500ms but MUST NOT raise it above 500ms. this value below 500ms but MUST NOT raise it above 500ms.
Acknowledgements MUST be sent in SACK chunks unless shutdown was Acknowledgements MUST be sent in SACK chunks unless shutdown was
requested by the ULP in which case an endpoint MAY send an requested by the ULP in which case an endpoint MAY send an
acknowledgement in the SHUTDOWN chunk. A SACK chunk can acknowledge the acknowledgement in the SHUTDOWN chunk. A SACK chunk can acknowledge
reception of multiple DATA chunks. See Section 3.3.4 for SACK chunk the reception of multiple DATA chunks. See Section 3.3.4 for SACK
format. In particular, the SCTP endpoint MUST fill in the Cumulative chunk format. In particular, the SCTP endpoint MUST fill in the
TSN Ack field to indicate the latest sequential TSN (of a valid DATA Cumulative TSN Ack field to indicate the latest sequential TSN (of a
chunk) it has received. Any received DATA chunks with TSN greater than valid DATA chunk) it has received. Any received DATA chunks with TSN
the value in the Cumulative TSN Ack field SHOULD also be reported in greater than the value in the Cumulative TSN Ack field SHOULD also be
the Gap Ack Block fields. reported in the Gap Ack Block fields.
Note: The SHUTDOWN chunk does not contain Gap Ack Block fields. Note: The SHUTDOWN chunk does not contain Gap Ack Block fields.
Therefore, the endpoint should use a SACK instead of the SHUTDOWN Therefore, the endpoint should use a SACK instead of the SHUTDOWN
chunk to acknowledge DATA chunks received out of order . chunk to acknowledge DATA chunks received out of order .
When a packet arrives with duplicate DATA chunk(s) and with no new When a packet arrives with duplicate DATA chunk(s) and with no new
DATA chunk(s), the endpoint MUST immediately send a SACK with no DATA chunk(s), the endpoint MUST immediately send a SACK with no
delay. If a packet arrives with duplicate DATA chunk(s) bundled with delay. If a packet arrives with duplicate DATA chunk(s) bundled with
new DATA chunks, the endpoint MAY immediately send a SACK. Normally new DATA chunks, the endpoint MAY immediately send a SACK. Normally
receipt of duplicate DATA chunks will occur when the original SACK receipt of duplicate DATA chunks will occur when the original SACK
chunk was lost and the peer's RTO has expired. The duplicate TSN chunk was lost and the peer's RTO has expired. The duplicate TSN
number(s) SHOULD be reported in the SACK as duplicate. number(s) SHOULD be reported in the SACK as duplicate.
When an endpoint receives a SACK, it MAY use the Duplicate TSN When an endpoint receives a SACK, it MAY use the Duplicate TSN
information to determine if SACK loss is occurring. Further use of information to determine if SACK loss is occurring. Further use of
this data is for future study. this data is for future study.
The data receiver is responsible for maintaining its receive buffers. The data receiver is responsible for maintaining its receive buffers.
The data receiver SHOULD notify the data sender in a timely manner of The data receiver SHOULD notify the data sender in a timely manner of
changes in its ability to receive data. How an implementation manages changes in its ability to receive data. How an implementation
its receive buffers is dependent on many factors (e.g., Operating manages its receive buffers is dependent on many factors (e.g.,
System, memory management system, amount of memory, etc.). However, Operating System, memory management system, amount of memory, etc.).
the data sender strategy defined in Section 6.2.1 is based on the However, the data sender strategy defined in Section 6.2.1 is based
assumption of receiver operation similar to the following: on the assumption of receiver operation similar to the following:
A) At initialization of the association, the endpoint tells the A) At initialization of the association, the endpoint tells the
peer how much receive buffer space it has allocated to the peer how much receive buffer space it has allocated to the
association in the INIT or INIT ACK. The endpoint sets a_rwnd association in the INIT or INIT ACK. The endpoint sets a_rwnd
to this value. to this value.
B) As DATA chunks are received and buffered, decrement a_rwnd by B) As DATA chunks are received and buffered, decrement a_rwnd by
the number of bytes received and buffered. This is, in effect, the number of bytes received and buffered. This is, in effect,
closing rwnd at the data sender and restricting the amount of closing rwnd at the data sender and restricting the amount of
data it can transmit. data it can transmit.
C) As DATA chunks are delivered to the ULP and released from the C) As DATA chunks are delivered to the ULP and released from the
receive buffers, increment a_rwnd by the number of bytes receive buffers, increment a_rwnd by the number of bytes
delivered to the upper layer. This is, in effect, opening up delivered to the upper layer. This is, in effect, opening up
rwnd on the data sender and allowing it to send more data. The rwnd on the data sender and allowing it to send more data. The
data receiver SHOULD NOT increment a_rwnd unless it has released data receiver SHOULD NOT increment a_rwnd unless it has
bytes from its receive buffer. For example, if the receiver is released bytes from its receive buffer. For example, if the
holding fragmented DATA chunks in a reassembly queue, it should receiver is holding fragmented DATA chunks in a reassembly
not increment a_rwnd. queue, it should not increment a_rwnd.
D) When sending a SACK, the data receiver SHOULD place the D) When sending a SACK, the data receiver SHOULD place the current
current value of a_rwnd into the a_rwnd field. The data value of a_rwnd into the a_rwnd field. The data receiver
receiver SHOULD take into account that the data sender will not SHOULD take into account that the data sender will not
retransmit DATA chunks that are acked via the Cumulative TSN Ack retransmit DATA chunks that are acked via the Cumulative TSN
(i.e., will drop from its retransmit queue). Ack (i.e., will drop from its retransmit queue).
Under certain circumstances, the data receiver may need to drop Under certain circumstances, the data receiver may need to drop DATA
DATA chunks that it has received but hasn't released from its receive chunks that it has received but hasn't released from its receive
buffers (i.e., delivered to the ULP). These DATA chunks may have buffers (i.e., delivered to the ULP). These DATA chunks may have
been acked in Gap Ack Blocks. For example, the data receiver may be been acked in Gap Ack Blocks. For example, the data receiver may be
holding data in its receive buffers while reassembling a fragmented holding data in its receive buffers while reassembling a fragmented
user message from its peer when it runs out of receive buffer space. user message from its peer when it runs out of receive buffer space.
It may drop these DATA chunks even though it has acknowledged them in It may drop these DATA chunks even though it has acknowledged them in
Gap Ack Blocks. If a data receiver drops DATA chunks, it MUST NOT include Gap Ack Blocks. If a data receiver drops DATA chunks, it MUST NOT
them in Gap Ack Blocks in subsequent SACKs until they are received again include them in Gap Ack Blocks in subsequent SACKs until they are
via retransmission. In addition, the endpoint should take into account the received again via retransmission. In addition, the endpoint should
dropped data when calculating its a_rwnd. take into account the dropped data when calculating its a_rwnd.
An endpoint SHOULD NOT revoke a SACK and discard data. Only in extreme An endpoint SHOULD NOT revoke a SACK and discard data. Only in
circumstance should an endpoint use this procedure (such as out of buffer extreme circumstance should an endpoint use this procedure (such as
space). The data receiver should take into account that dropping data that out of buffer space). The data receiver should take into account
has been acked in Gap Ack Blocks can result in suboptimal retransmission that dropping data that has been acked in Gap Ack Blocks can result
strategies in the data sender and thus in suboptimal performance. in suboptimal retransmission strategies in the data sender and thus
in suboptimal performance.
The following example illustrates the use of delayed acknowledgements: The following example illustrates the use of delayed
acknowledgements:
Endpoint A Endpoint Z Endpoint A Endpoint Z
{App sends 3 messages; strm 0} {App sends 3 messages; strm 0}
DATA [TSN=7,Strm=0,Seq=3] ------------> (ack delayed) DATA [TSN=7,Strm=0,Seq=3] ------------> (ack delayed)
(Start T3-rtx timer) (Start T3-rtx timer)
DATA [TSN=8,Strm=0,Seq=4] ------------> (send ack)
/------- SACK [TSN Ack=8,block=0]
(cancel T3-rtx timer) <-----/
...
...
DATA [TSN=9,Strm=0,Seq=5] ------------> (ack delayed) DATA [TSN=8,Strm=0,Seq=4] ------------> (send ack)
(Start T3-rtx timer) /------- SACK [TSN Ack=8,block=0]
... (cancel T3-rtx timer) <-----/
{App sends 1 message; strm 1}
(bundle SACK with DATA)
/----- SACK [TSN Ack=9,block=0] \
/ DATA [TSN=6,Strm=1,Seq=2]
(cancel T3-rtx timer) <------/ (Start T3-rtx timer)
(ack delayed) DATA [TSN=9,Strm=0,Seq=5] ------------> (ack delayed)
... (Start T3-rtx timer)
(send ack) ...
SACK [TSN Ack=6,block=0] -------------> (cancel T3-rtx timer) {App sends 1 message; strm 1}
(bundle SACK with DATA)
/----- SACK [TSN Ack=9,block=0] \
/ DATA [TSN=6,Strm=1,Seq=2]
(cancel T3-rtx timer) <------/ (Start T3-rtx timer)
Figure 7: Delayed Acknowledgment Example (ack delayed)
(send ack)
SACK [TSN Ack=6,block=0] -------------> (cancel T3-rtx timer)
If an endpoint receives a DATA chunk with no user data (i.e., the Figure 7: Delayed Acknowledgment Example
Length field is set to 16) it MUST send an ABORT with error cause set
to "No User Data".
An endpoint SHOULD NOT send a DATA chunk with no user data part. If an endpoint receives a DATA chunk with no user data (i.e., the
Length field is set to 16) it MUST send an ABORT with error cause set
to "No User Data".
An endpoint SHOULD NOT send a DATA chunk with no user data part.
6.2.1 Processing a Received SACK 6.2.1 Processing a Received SACK
Each SACK an endpoint receives contains an a_rwnd value. This value Each SACK an endpoint receives contains an a_rwnd value. This value
represents the amount of buffer space the data receiver, at the time represents the amount of buffer space the data receiver, at the time
of transmitting the SACK, has left of its total receive buffer space (as of transmitting the SACK, has left of its total receive buffer space
specified in the INIT/INIT ACK). Using a_rwnd, Cumulative TSN Ack and Gap (as specified in the INIT/INIT ACK). Using a_rwnd, Cumulative TSN
Ack Blocks, the data sender can develop a representation of the peer's Ack and Gap Ack Blocks, the data sender can develop a representation
receive buffer space. of the peer's receive buffer space.
One of the problems the data sender must take into account when processing One of the problems the data sender must take into account when
a SACK is that a SACK can be received out of order. That is, a SACK sent processing a SACK is that a SACK can be received out of order. That
by the data receiver can pass an earlier SACK and be received first by the is, a SACK sent by the data receiver can pass an earlier SACK and be
data sender. If a SACK is received out of order, the data sender can received first by the data sender. If a SACK is received out of
develop an incorrect view of the peer's receive buffer space. order, the data sender can develop an incorrect view of the peer's
receive buffer space.
Since there is no explicit identifier that can be used to detect Since there is no explicit identifier that can be used to detect
out-of-order SACKs, the data sender must use heuristics to determine if a out-of-order SACKs, the data sender must use heuristics to determine
SACK is new. if a SACK is new.
An endpoint SHOULD use the following rules to calculate the rwnd, using the An endpoint SHOULD use the following rules to calculate the rwnd,
a_rwnd value, the Cumulative TSN Ack and Gap Ack Blocks in a received SACK. using the a_rwnd value, the Cumulative TSN Ack and Gap Ack Blocks in
a received SACK.
A) At the establishment of the association, the endpoint A) At the establishment of the association, the endpoint initializes
initializes the rwnd to the Advertised Receiver Window the rwnd to the Advertised Receiver Window Credit (a_rwnd) the
Credit (a_rwnd) the peer specified in the INIT or INIT ACK. peer specified in the INIT or INIT ACK.
B) Any time a DATA chunk is transmitted (or retransmitted) B) Any time a DATA chunk is transmitted (or retransmitted) to a peer,
to a peer, the endpoint subtracts the data size of the the endpoint subtracts the data size of the chunk from the rwnd of
chunk from the rwnd of that peer. that peer.
C) Any time a DATA chunk is marked for retransmission (via C) Any time a DATA chunk is marked for retransmission (via either
either T3-rtx timer expiration (Section 6.3.3)or via fast T3-rtx timer expiration (Section 6.3.3)or via fast retransmit
retransmit (Section 7.2.4)), add the data size of (Section 7.2.4)), add the data size of those chunks to the rwnd.
those chunks to the rwnd.
Note: If the implementation is maintaining a timer on each Note: If the implementation is maintaining a timer on each DATA
DATA chunk then only DATA chunks whose timer expired would chunk then only DATA chunks whose timer expired would be marked
be marked for retransmission. for retransmission.
D) Any time a SACK arrives, the endpoint performs the following: D) Any time a SACK arrives, the endpoint performs the following:
i) If Cumulative TSN Ack is less than the Cumulative TSN Ack Point, i) If Cumulative TSN Ack is less than the Cumulative TSN Ack
then drop the SACK. Since Cumulative TSN Ack is monotonically Point, then drop the SACK. Since Cumulative TSN Ack is
increasing, a SACK whose Cumulative TSN Ack is less than the monotonically increasing, a SACK whose Cumulative TSN Ack is
Cumulative TSN Ack Point indicates an out-of-order SACK. less than the Cumulative TSN Ack Point indicates an out-of-
order SACK.
ii) Set rwnd equal to the newly received a_rwnd minus the number ii) Set rwnd equal to the newly received a_rwnd minus the
of bytes still outstanding after processing the Cumulative TSN Ack number of bytes still outstanding after processing the
and the Gap Ack Blocks. Cumulative TSN Ack and the Gap Ack Blocks.
iii) If the SACK is missing a TSN that was previously iii) If the SACK is missing a TSN that was previously
acknowledged via a Gap Ack Block (e.g., the data receiver acknowledged via a Gap Ack Block (e.g., the data receiver
reneged on the data), then mark the corresponding DATA chunk reneged on the data), then mark the corresponding DATA chunk as
as available for retransmit: Mark it as missing for fast available for retransmit: Mark it as missing for fast
retransmit as described in Section 7.2.4 and if no retransmit retransmit as described in Section 7.2.4 and if no retransmit
timer is running for the destination address to which the DATA timer is running for the destination address to which the DATA
chunk was originally transmitted, then T3-rtx is started for chunk was originally transmitted, then T3-rtx is started for
that destination address. that destination address.
6.3 Management of Retransmission Timer 6.3 Management of Retransmission Timer
An SCTP endpoint uses a retransmission timer T3-rtx to ensure data An SCTP endpoint uses a retransmission timer T3-rtx to ensure data
delivery in the absence of any feedback from its peer. The duration of delivery in the absence of any feedback from its peer. The duration
this timer is referred to as RTO (retransmission timeout). of this timer is referred to as RTO (retransmission timeout).
When an endpoint's peer is multi-homed, the endpoint will calculate a When an endpoint's peer is multi-homed, the endpoint will calculate a
separate RTO for each different destination transport address of its separate RTO for each different destination transport address of its
peer endpoint. peer endpoint.
The computation and management of RTO in SCTP follows closely how The computation and management of RTO in SCTP follows closely how TCP
TCP manages its retransmission timer. To compute the current RTO, an manages its retransmission timer. To compute the current RTO, an
endpoint maintains two state variables per destination transport endpoint maintains two state variables per destination transport
address: SRTT (smoothed round-trip time) and RTTVAR (round-trip time address: SRTT (smoothed round-trip time) and RTTVAR (round-trip time
variation). variation).
6.3.1 RTO Calculation 6.3.1 RTO Calculation
The rules governing the computation of SRTT, RTTVAR, and RTO are
as follows:
C1) Until an RTT measurement has been made for a packet sent The rules governing the computation of SRTT, RTTVAR, and RTO are as
to the given destination transport address, set RTO to the follows:
protocol parameter 'RTO.Initial'.
C2) When the first RTT measurement R is made, set SRTT <- R, C1) Until an RTT measurement has been made for a packet sent to the
RTTVAR <- R/2, and RTO <- SRTT + 4 * RTTVAR. given destination transport address, set RTO to the protocol
parameter 'RTO.Initial'.
C3) When a new RTT measurement R' is made, set C2) When the first RTT measurement R is made, set SRTT <- R, RTTVAR
<- R/2, and RTO <- SRTT + 4 * RTTVAR.
RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| C3) When a new RTT measurement R' is made, set
SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'
Note: The value of SRTT used in the update to RTTVAR is its value RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| SRTT
before updating SRTT itself using the second assignment. <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'
After the computation, update RTO <- SRTT + 4 * RTTVAR. Note: The value of SRTT used in the update to RTTVAR is its value
before updating SRTT itself using the second assignment.
C4) When data is in flight and when allowed by rule C5 below, a new After the computation, update RTO <- SRTT + 4 * RTTVAR.
RTT measurement MUST be made each round trip. Furthermore, new RTT
measurements SHOULD be made no more than once per round-trip for a
given destination transport address. There are two reasons for this
recommendation: First, it appears that measuring more frequently
often does not in practice yield any significant benefit
[ALLMAN99]; second, if measurements are made more often, then the
values of RTO.Alpha and RTO.Beta in rule C3 above should be
adjusted so that SRTT and RTTVAR still adjust to changes at roughly
the same rate (in terms of how many round trips it takes them to
reflect new values) as they would if making only one measurement
per round-trip and using RTO.Alpha and RTO.Beta as given in rule
C3. However, the exact nature of these adjustments remains a
research issue.
C5) Karn's algorithm: RTT measurements MUST NOT be made using C4) When data is in flight and when allowed by rule C5 below, a new
packets that were retransmitted (and thus for which it is RTT measurement MUST be made each round trip. Furthermore, new
ambiguous whether the reply was for the first instance of the RTT measurements SHOULD be made no more than once per round-trip
packet or a later instance). for a given destination transport address. There are two reasons
for this recommendation: First, it appears that measuring more
frequently often does not in practice yield any significant
benefit [ALLMAN99]; second, if measurements are made more often,
then the values of RTO.Alpha and RTO.Beta in rule C3 above should
be adjusted so that SRTT and RTTVAR still adjust to changes at
roughly the same rate (in terms of how many round trips it takes
them to reflect new values) as they would if making only one
measurement per round-trip and using RTO.Alpha and RTO.Beta as
given in rule C3. However, the exact nature of these adjustments
remains a research issue.
C6) Whenever RTO is computed, if it is less than RTO.Min seconds C5) Karn's algorithm: RTT measurements MUST NOT be made using packets
then it is rounded up to RTO.Min seconds. The reason for this that were retransmitted (and thus for which it is ambiguous
rule is that RTOs that do not have a high minimum value are whether the reply was for the first instance of the packet or a
susceptible to unnecessary timeouts [ALLMAN99]. later instance).
C7) A maximum value may be placed on RTO provided it is at least C6) Whenever RTO is computed, if it is less than RTO.Min seconds then
RTO.max seconds. it is rounded up to RTO.Min seconds. The reason for this rule is
that RTOs that do not have a high minimum value are susceptible
to unnecessary timeouts [ALLMAN99].
There is no requirement for the clock granularity G used for computing C7) A maximum value may be placed on RTO provided it is at least
RTT measurements and the different state variables, other than: RTO.max seconds.
G1) Whenever RTTVAR is computed, if RTTVAR = 0, then adjust There is no requirement for the clock granularity G used for
RTTVAR <- G. computing RTT measurements and the different state variables, other
than:
Experience [ALLMAN99] has shown that finer clock granularities G1) Whenever RTTVAR is computed, if RTTVAR = 0, then adjust RTTVAR <-
(<= 100 msec) perform somewhat better than more coarse granularities. G.
Experience [ALLMAN99] has shown that finer clock granularities (<=
100 msec) perform somewhat better than more coarse granularities.
6.3.2 Retransmission Timer Rules 6.3.2 Retransmission Timer Rules
The rules for managing the retransmission timer are as follows: The rules for managing the retransmission timer are as follows:
R1) Every time a DATA chunk is sent to any address (including R1) Every time a DATA chunk is sent to any address (including a
a retransmission), if the T3-rtx timer of that address is not retransmission), if the T3-rtx timer of that address is not
running, start it running so that it will expire after the RTO of running, start it running so that it will expire after the RTO of
that address. The RTO used here is that obtained after any doubling that address. The RTO used here is that obtained after any
due to previous T3-rtx timer expirations on the corresponding doubling due to previous T3-rtx timer expirations on the
destination address as discussed in rule E2 below. corresponding destination address as discussed in rule E2 below.
R2) Whenever all outstanding data sent to an address have been R2) Whenever all outstanding data sent to an address have been
acknowledged, turn off the T3-rtx timer of that address. acknowledged, turn off the T3-rtx timer of that address.
R3) Whenever a SACK is received that acknowledges the DATA chunk with R3) Whenever a SACK is received that acknowledges the DATA chunk with
the earliest outstanding TSN for that address, restart T3-rtx timer the earliest outstanding TSN for that address, restart T3-rtx
for that address with its current RTO. timer for that address with its current RTO (if there is still
outstanding data on that address).
(R4) Whenever a SACK is received missing a TSN that was previously acknowledged R4) Whenever a SACK is received missing a TSN that was previously
via a Gap Ack Block, start T3-rtx for the destination address to which acknowledged via a Gap Ack Block, start T3-rtx for the
the DATA chunk was originally transmitted if it is not already running. destination address to which the DATA chunk was originally
transmitted if it is not already running.
The following example shows the use of various timer rules (assuming The following example shows the use of various timer rules (assuming
the receiver uses delayed acks). the receiver uses delayed acks).
Endpoint A Endpoint Z Endpoint A Endpoint Z
{App begins to send} {App begins to send}
Data [TSN=7,Strm=0,Seq=3] ------------> (ack delayed) Data [TSN=7,Strm=0,Seq=3] ------------> (ack delayed)
(Start T3-rtx timer) (Start T3-rtx timer)
{App sends 1 message; strm 1} {App sends 1 message; strm 1}
(bundle ack with data) (bundle ack with data)
DATA [TSN=8,Strm=0,Seq=4] ----\ /-- SACK [TSN Ack=7,Block=0] \ DATA [TSN=8,Strm=0,Seq=4] ----\ /-- SACK [TSN Ack=7,Block=0]
\ / DATA [TSN=6,Strm=1,Seq=2] \ / DATA [TSN=6,Strm=1,Seq=2]
\ / (Start T3-rtx timer) \ / (Start T3-rtx timer)
\ \
/ \ / \
(Re-start T3-rtx timer) <------/ \--> (ack delayed) (Re-start T3-rtx timer) <------/ \--> (ack delayed)
(ack delayed) (ack delayed)
... {send ack}
{send ack} SACK [TSN Ack=6,Block=0] --------------> (Cancel T3-rtx timer)
SACK [TSN Ack=6,Block=0] --------------> (Cancel T3-rtx timer) ..
.. (send ack)
(send ack) (Cancel T3-rtx timer) <-------------- SACK [TSN Ack=8,Block=0]
(Cancel T3-rtx timer) <-------------- SACK [TSN Ack=8,Block=0]
Figure 8 - Timer Rule Examples Figure 8 - Timer Rule Examples
6.3.3 Handle T3-rtx Expiration 6.3.3 Handle T3-rtx Expiration
Whenever the retransmission timer T3-rtx expires for a destination
address, do the following:
E1) For the destination address for which the timer expires, adjust its Whenever the retransmission timer T3-rtx expires for a destination
ssthresh with rules defined in Section 7.2.3 and set the address, do the following:
cwnd <- MTU.
E2) For the destination address for which the timer expires, set E1) For the destination address for which the timer expires, adjust
RTO <- RTO * 2 ("back off the timer"). The maximum value discussed its ssthresh with rules defined in Section 7.2.3 and set the cwnd
in rule C7 above (RTO.max) may be used to provide an upper bound <- MTU.
to this doubling operation.
E3) Determine how many of the earliest (i.e., lowest TSN) outstanding E2) For the destination address for which the timer expires, set RTO
DATA chunks for the address for which the T3-rtx has expired will <- RTO * 2 ("back off the timer"). The maximum value discussed
fit into a single packet, subject to the MTU constraint for the in rule C7 above (RTO.max) may be used to provide an upper bound
path corresponding to the destination transport address to which to this doubling operation.
the retransmission is being sent (this may be different from the
address for which the timer expires [see Section 6.4]). Call this
value K. Bundle and retransmit those K DATA chunks in a single
packet to the destination endpoint.
E4) Start the retransmission timer T3-rtx on the destination address E3) Determine how many of the earliest (i.e., lowest TSN) outstanding
to which the retransmission is sent, if rule R1 above indicates to DATA chunks for the address for which the T3-rtx has expired will
do so. The RTO to be used for starting T3-rtx should be the fit into a single packet, subject to the MTU constraint for the
one for the destination address to which the retransmission is path corresponding to the destination transport address to which
sent, which, when the receiver is multi-homed, may be different the retransmission is being sent (this may be different from the
from the destination address for which the timer expired (see address for which the timer expires [see Section 6.4]). Call
Section 6.4 below). this value K. Bundle and retransmit those K DATA chunks in a
single packet to the destination endpoint.
After retransmitting, once a new RTT measurement is obtained E4) Start the retransmission timer T3-rtx on the destination address
(which can happen only when new data has been sent and acknowledged, to which the retransmission is sent, if rule R1 above indicates
per rule C5, or for a measurement made from a HEARTBEAT [see Section to do so. The RTO to be used for starting T3-rtx should be the
8.3]), the computation in rule C3 is performed, including the one for the destination address to which the retransmission is
computation of RTO, which may result in "collapsing" RTO back down sent, which, when the receiver is multi-homed, may be different
after it has been subject to doubling (rule E2). from the destination address for which the timer expired (see
Section 6.4 below).
Note: Any DATA chunks that were sent to the address for which the After retransmitting, once a new RTT measurement is obtained (which
T3-rtx timer expired but did not fit in one MTU (rule E3 above), can happen only when new data has been sent and acknowledged, per
should be marked for retransmission and sent as soon as cwnd allows rule C5, or for a measurement made from a HEARTBEAT [see Section
(normally when a SACK arrives). 8.3]), the computation in rule C3 is performed, including the
computation of RTO, which may result in "collapsing" RTO back down
after it has been subject to doubling (rule E2).
The final rule for managing the retransmission timer concerns failover Note: Any DATA chunks that were sent to the address for which the
(see Section 6.4.1): T3-rtx timer expired but did not fit in one MTU (rule E3 above),
should be marked for retransmission and sent as soon as cwnd allows
(normally when a SACK arrives).
F1) Whenever an endpoint switches from the current destination The final rule for managing the retransmission timer concerns
transport address to a different one, the current retransmission failover (see Section 6.4.1):
timers are left running. As soon as the endpoint transmits a packet
containing DATA chunk(s) to the new transport address, start the F1) Whenever an endpoint switches from the current destination
timer on that transport address, using the RTO value of the transport address to a different one, the current retransmission
destination address to which the data is being sent, if rule R1 timers are left running. As soon as the endpoint transmits a
indicates to do so. packet containing DATA chunk(s) to the new transport address,
start the timer on that transport address, using the RTO value of
the destination address to which the data is being sent, if rule
R1 indicates to do so.
6.4 Multi-homed SCTP Endpoints 6.4 Multi-homed SCTP Endpoints
An SCTP endpoint is considered multi-homed if there are more than one An SCTP endpoint is considered multi-homed if there are more than one
transport address that can be used as a destination address to reach transport address that can be used as a destination address to reach
that endpoint. that endpoint.
Moreover, the ULP of an endpoint shall select one of the multiple Moreover, the ULP of an endpoint shall select one of the multiple
destination addresses of a multi-homed peer endpoint as the primary destination addresses of a multi-homed peer endpoint as the primary
path (see Sections 5.1.2 and 10.1 for details). path (see Sections 5.1.2 and 10.1 for details).
By default, an endpoint SHOULD always transmit to the primary By default, an endpoint SHOULD always transmit to the primary path,
path, unless the SCTP user explicitly specifies the destination unless the SCTP user explicitly specifies the destination transport
transport address (and possibly source transport address) to use. address (and possibly source transport address) to use.
An endpoint SHOULD transmit reply chunks (e.g., SACK, HEARTBEAT ACK, An endpoint SHOULD transmit reply chunks (e.g., SACK, HEARTBEAT ACK,
etc.) to the same destination transport address from which it received etc.) to the same destination transport address from which it
the DATA or control chunk to which it is replying. This rule should received the DATA or control chunk to which it is replying. This
also be followed if the endpoint is bundling DATA chunks together rule should also be followed if the endpoint is bundling DATA chunks
with the reply chunk. together with the reply chunk.
However, when acknowledging multiple DATA chunks received in packets However, when acknowledging multiple DATA chunks received in packets
from different source addresses in a single SACK, the SACK chunk may be from different source addresses in a single SACK, the SACK chunk may
transmitted to one of the destination transport addresses from which be transmitted to one of the destination transport addresses from
the DATA or control chunks being acknowledged were received. which the DATA or control chunks being acknowledged were received.
When a receiver of a duplicate DATA chunk sends a SACK to a multi-homed When a receiver of a duplicate DATA chunk sends a SACK to a multi-
endpoint it MAY be beneficial to vary the destination address and not homed endpoint it MAY be beneficial to vary the destination address
use the source address of the DATA chunk. The reason being that and not use the source address of the DATA chunk. The reason being
receiving a duplicate from a multi-homed endpoint might indicate that that receiving a duplicate from a multi-homed endpoint might indicate
the return path (as specified in the source address of the DATA chunk) that the return path (as specified in the source address of the DATA
for the SACK is broken. chunk) for the SACK is broken.
Furthermore, when its peer is multi-homed, an endpoint SHOULD try to Furthermore, when its peer is multi-homed, an endpoint SHOULD try to
retransmit a chunk to an active destination transport address that is retransmit a chunk to an active destination transport address that is
different from the last destination address to which the DATA chunk was different from the last destination address to which the DATA chunk
sent. was sent.
Retransmissions do not affect the total outstanding data Retransmissions do not affect the total outstanding data count.
count. However, if the DATA chunk is retransmitted onto a different However, if the DATA chunk is retransmitted onto a different
destination address, both the outstanding data counts on the new destination address, both the outstanding data counts on the new
destination address and the old destination address to which the data destination address and the old destination address to which the data
chunk was last sent shall be adjusted accordingly. chunk was last sent shall be adjusted accordingly.
6.4.1 Failover from Inactive Destination Address 6.4.1 Failover from Inactive Destination Address
Some of the transport addresses of a multi-homed SCTP endpoint may Some of the transport addresses of a multi-homed SCTP endpoint may
become inactive due to either the occurrence of certain error become inactive due to either the occurrence of certain error
conditions (see Section 8.2) or adjustments from SCTP user. conditions (see Section 8.2) or adjustments from SCTP user.
When there is outbound data to send and the primary path becomes When there is outbound data to send and the primary path becomes
inactive (e.g., due to failures), or where the SCTP user explicitly inactive (e.g., due to failures), or where the SCTP user explicitly
requests to send data to an inactive destination transport address, requests to send data to an inactive destination transport address,
before reporting an error to its ULP, the SCTP endpoint should try to before reporting an error to its ULP, the SCTP endpoint should try to
send the data to an alternate active destination transport address if send the data to an alternate active destination transport address if
one exists. one exists.
When retransmitting data, if the endpoint is multi-homed, it should When retransmitting data, if the endpoint is multi-homed, it should
consider each source-destination address pair in its retransmission consider each source-destination address pair in its retransmission
selection policy. When retransmitting the endpoint should attempt to selection policy. When retransmitting the endpoint should attempt to
pick the most divergent source-destination pair from the original pick the most divergent source-destination pair from the original
source-destination pair to which the packet was transmitted. source-destination pair to which the packet was transmitted.
Note: Rules for picking the most divergent source-destination pair Note: Rules for picking the most divergent source-destination pair
are an implementation decision and is not specified within this are an implementation decision and is not specified within this
document. document.
6.5 Stream Identifier and Stream Sequence Number 6.5 Stream Identifier and Stream Sequence Number
Every DATA chunk MUST carry a valid stream identifier. If an endpoint Every DATA chunk MUST carry a valid stream identifier. If an
receives a DATA chunk with an invalid stream identifier, it shall endpoint receives a DATA chunk with an invalid stream identifier, it
acknowledge the reception of the DATA chunk following the normal shall acknowledge the reception of the DATA chunk following the
procedure, immediately send an ERROR chunk with cause set to "Invalid normal procedure, immediately send an ERROR chunk with cause set to
Stream Identifier" (see Section 3.3.10) and discard the DATA chunk. "Invalid Stream Identifier" (see Section 3.3.10) and discard the DATA
The endpoint may bundle the ERROR chunk in the same packet as the SACK chunk. The endpoint may bundle the ERROR chunk in the same packet as
as long as the ERROR follows the SACK. the SACK as long as the ERROR follows the SACK.
The stream sequence number in all the streams shall start from 0 The stream sequence number in all the streams shall start from 0 when
when the association is established. Also, when the stream sequence the association is established. Also, when the stream sequence
number reaches the value 65535 the next stream sequence number shall number reaches the value 65535 the next stream sequence number shall
be set to 0. be set to 0.
6.6 Ordered and Unordered Delivery 6.6 Ordered and Unordered Delivery
Within a stream, an endpoint MUST deliver DATA chunks received with the Within a stream, an endpoint MUST deliver DATA chunks received with
U flag set to 0 to the upper layer according to the order of their the U flag set to 0 to the upper layer according to the order of
stream sequence number. If DATA chunks arrive out of order of their their stream sequence number. If DATA chunks arrive out of order of
stream sequence number, the endpoint MUST hold the received DATA chunks their stream sequence number, the endpoint MUST hold the received
from delivery to the ULP until they are re-ordered. DATA chunks from delivery to the ULP until they are re-ordered.
However, an SCTP endpoint can indicate that no ordered delivery is However, an SCTP endpoint can indicate that no ordered delivery is
required for a particular DATA chunk transmitted within the stream by required for a particular DATA chunk transmitted within the stream by
setting the U flag of the DATA chunk to 1. setting the U flag of the DATA chunk to 1.
When an endpoint receives a DATA chunk with the U flag set to 1, it When an endpoint receives a DATA chunk with the U flag set to 1, it
must bypass the ordering mechanism and immediately deliver the data to must bypass the ordering mechanism and immediately deliver the data
the upper layer (after re-assembly if the user data is fragmented by to the upper layer (after re-assembly if the user data is fragmented
the data sender). by the data sender).
This provides an effective way of transmitting "out-of-band" data in a This provides an effective way of transmitting "out-of-band" data in
given stream. Also, a stream can be used as an "unordered" stream by a given stream. Also, a stream can be used as an "unordered" stream
simply setting the U flag to 1 in all DATA chunks sent through that by simply setting the U flag to 1 in all DATA chunks sent through
stream. that stream.
IMPLEMENTATION NOTE: When sending an unordered DATA chunk, an IMPLEMENTATION NOTE: When sending an unordered DATA chunk, an
implementation may choose to place the DATA chunk in an outbound implementation may choose to place the DATA chunk in an outbound
packet that is at the head of the outbound transmission queue if packet that is at the head of the outbound transmission queue if
possible. possible.
The 'Stream Sequence Number' field in a DATA chunk with U flag set to 1 The 'Stream Sequence Number' field in a DATA chunk with U flag set to
has no significance. The sender can fill it with arbitrary value, but 1 has no significance. The sender can fill it with arbitrary value,
the receiver MUST ignore the field. but the receiver MUST ignore the field.
Note: When transmitting ordered and unordered data, an endpoint does Note: When transmitting ordered and unordered data, an endpoint does
not increment its Stream Sequence Number when transmitting a DATA not increment its Stream Sequence Number when transmitting a DATA
chunk with U flag set to 1. chunk with U flag set to 1.
6.7 Report Gaps in Received DATA TSNs 6.7 Report Gaps in Received DATA TSNs
Upon the reception of a new DATA chunk, an endpoint shall examine Upon the reception of a new DATA chunk, an endpoint shall examine the
the continuity of the TSNs received. If the endpoint detects a gap continuity of the TSNs received. If the endpoint detects a gap in
in the received DATA chunk sequence, it SHOULD send a SACK with Gap Ack the received DATA chunk sequence, it SHOULD send a SACK with Gap Ack
Blocks immediately. The data receiver continues sending a SACK after Blocks immediately. The data receiver continues sending a SACK after
receipt of each SCTP packet that doesn't fill the gap. receipt of each SCTP packet that doesn't fill the gap.
Based on the Gap Ack Block from the received SACK, the endpoint Based on the Gap Ack Block from the received SACK, the endpoint can
can calculate the missing DATA chunks and make decisions on whether to calculate the missing DATA chunks and make decisions on whether to
retransmit them (see Section 6.2.1 for details). retransmit them (see Section 6.2.1 for details).
Multiple gaps can be reported in one single SACK (see Section 3.3.4). Multiple gaps can be reported in one single SACK (see Section 3.3.4).
When its peer is multi-homed, the SCTP endpoint SHOULD always When its peer is multi-homed, the SCTP endpoint SHOULD always try to
try to send the SACK to the same destination address from which the send the SACK to the same destination address from which the last
last DATA chunk was received. DATA chunk was received.
Upon the reception of a SACK, the endpoint MUST remove all DATA Upon the reception of a SACK, the endpoint MUST remove all DATA
chunks which have been acknowledged by the SACK's Cumulative TSN Ack chunks which have been acknowledged by the SACK's Cumulative TSN Ack
from its transmit queue. The endpoint MUST also treat all the DATA from its transmit queue. The endpoint MUST also treat all the DATA
chunks with TSNs not included in the Gap Ack Blocks reported by the chunks with TSNs not included in the Gap Ack Blocks reported by the
SACK as "missing". The number of "missing" reports for each outstanding SACK as "missing". The number of "missing" reports for each
DATA chunk MUST be recorded by the data sender in order to make outstanding DATA chunk MUST be recorded by the data sender in order
retransmission decisions. See Section 7.2.4 for details. to make retransmission decisions. See Section 7.2.4 for details.
The following example shows the use of SACK to report a gap. The following example shows the use of SACK to report a gap.
Endpoint A Endpoint Z Endpoint A Endpoint Z
{App sends 3 messages; strm 0} {App sends 3 messages; strm 0}
DATA [TSN=6,Strm=0,Seq=2] ---------------> (ack delayed) DATA [TSN=6,Strm=0,Seq=2] ---------------> (ack delayed)
(Start T3-rtx timer) (Start T3-rtx timer)
DATA [TSN=7,Strm=0,Seq=3] --------> X (lost) DATA [TSN=7,Strm=0,Seq=3] --------> X (lost)
DATA [TSN=8,Strm=0,Seq=4] ---------------> (gap detected, DATA [TSN=8,Strm=0,Seq=4] ---------------> (gap detected,
immediately send ack) immediately send ack)
/----- SACK [TSN Ack=6,Block=1, /----- SACK [TSN Ack=6,Block=1,
/ Strt=2,End=2] / Strt=2,End=2]
<-----/ <-----/
(remove 6 from out-queue, (remove 6 from out-queue,
and mark 7 as "1" missing report) and mark 7 as "1" missing report)
Figure 9 - Reporting a Gap using SACK
The maximum number of Gap Ack Blocks that can be reported within a Figure 9 - Reporting a Gap using SACK
single SACK chunk is limited by the current path MTU. When a single
SACK can not cover all the Gap Ack Blocks needed to be reported due to
the MTU limitation, the endpoint MUST send only one SACK, reporting the
Gap Ack Blocks from the lowest to highest TSNs, within the size limit
set by the MTU, and leave the remaining highest TSN numbers
unacknowledged.
6.8 Adler-32 Checksum Calculation The maximum number of Gap Ack Blocks that can be reported within a
single SACK chunk is limited by the current path MTU. When a single
SACK can not cover all the Gap Ack Blocks needed to be reported due
to the MTU limitation, the endpoint MUST send only one SACK,
reporting the Gap Ack Blocks from the lowest to highest TSNs, within
the size limit set by the MTU, and leave the remaining highest TSN
numbers unacknowledged.
When sending an SCTP packet, the endpoint MUST strengthen the data 6.8 Adler-32 Checksum Calculation
integrity of the transmission by including the Adler-32 checksum
value calculated on the packet, as described below.
After the packet is constructed (containing the SCTP common header When sending an SCTP packet, the endpoint MUST strengthen the data
and one or more control or DATA chunks), the transmitter shall: integrity of the transmission by including the Adler-32 checksum
value calculated on the packet, as described below.
1) Fill in the proper Verification Tag in the SCTP common header and After the packet is constructed (containing the SCTP common header
initialize the checksum field to 0's. and one or more control or DATA chunks), the transmitter shall:
2) Calculate the Adler-32 checksum of the whole packet, including the 1) Fill in the proper Verification Tag in the SCTP common header and
SCTP common header and all the chunks. Refer to appendix B initialize the checksum field to 0's.
for details of the Adler-32 algorithm. And,
3) Put the resultant value into the checksum field in the 2) Calculate the Adler-32 checksum of the whole packet, including the
common header, and leave the rest of the bits unchanged. SCTP common header and all the chunks. Refer to appendix B for
details of the Adler-32 algorithm. And,
When an SCTP packet is received, the receiver MUST first check the 3) Put the resultant value into the checksum field in the common
Adler-32 checksum: header, and leave the rest of the bits unchanged.
1) Store the received Adler-32 checksum value aside, When an SCTP packet is received, the receiver MUST first check the
Adler-32 checksum:
2) Replace the 32 bits of the checksum field in the received 1) Store the received Adler-32 checksum value aside,
SCTP packet with all '0's and calculate an Adler-32 checksum 2) Replace the 32 bits of the checksum field in the received SCTP
value of the whole received packet. And, packet with all '0's and calculate an Adler-32 checksum value of
the whole received packet. And,
3) Verify that the calculated Adler-32 checksum is the same as the 3) Verify that the calculated Adler-32 checksum is the same as the
received Adler-32 checksum, If not, the receiver MUST treat the received Adler-32 checksum. If not, the receiver MUST tre