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