Bits 0–7 8–15 16–23 24–31+0 Source port Destination port 32 Verification tag 64 Checksum 96 Chunk 1 type Chunk 1 flags Chunk 1 length 128 Chunk 1 data......... Chunk N type Chunk N flagsChunk N length... Chunk N data
The Stream Control Transmission Protocol (SCTP) has a simpler basic packet structure than TCP. Each consists of two basic sections: The common header, which occupies the first 12 bytes. In the adjacent diagram, this header is highlighted in blue. The data chunks, which form the remaining portion of the packet. In the diagram, the first chunk is highlighted in green and the last of N chunks (Chunk N) is highlighted in red. There are several types, including payload data and different control messages.
Common header All SCTP packets require the common header section (shown with a blue background).
Source port This field identifies the sending port.
Destination port This field identifies the receiving port that hosts use to route the packet to the appropriate endpoint/application.
Verification tag A 32-bit random value created during initialization to distinguish stale packets from a previous connection.
Checksum SCTP's original design catered for Adler-32; but RFC 3309 changed the protocol to use the CRC32c algorithm.. Castagnoli's et al. work on algorithmic selection of CRC polynomials. Verification of Castagnoli's results by exhaustive search and some new good polynomials
Chunks Each SCTP packet consists, in addition to the common header, of chunks. Each chunk has a common format, but the contents can vary. The green bytes in the diagram above signify one chunk.
Chunk type An 8-bit value predefined by the IETF to identify the contents of the chunk value field.
Chunk flags Eight flag-bits whose definition varies with the chunk type. The default value is zero.
Chunk length A 16-bit unsigned value specifying the total length of the chunk in bytes (excludes any padding) that includes chunk type, flags, length, and value fields.
Chunk data General-purpose data field whose definition varies with the chunk type.
If the chunk length does not equate to a multiple of 4 bytes, then the protocol implicitly pads the chunk with trailing zeros.
+ Optional/variable-length parameter definition + Bits 0–15 16–31 0 Parameter type Parameter length 32 Parameter value
Additionally, each chunk type may define a set of parameters which it includes inside the chunk value field (and, consequently, their length in the chunk length).
Two types of parameter exist: fixed parameters — they must appear and in the order specified, variable-length or optional parameters — they appear after the fixed parameters and may appear in any order and in any number.
For optional/variable-length parameters, the parameter type, parameter length, and parameter value fields all behave just like their chunk counterparts. The minimum size of parameter is 4 bytes, and this occurs when the parameter value field is empty and the parameter consists only of the type and length fields.
List of chunk types RFC 2960 defines the following list of chunk types. More detailed information about each type is provided in the following subsections.
Following this table each chunk and its parameters are defined. Please note the following color scheme: gray: chunk fields, red: fixed parameters, green/blue: optional/variable-length parameters that alternate colors.
Value Abbreviation Description 0 DATA Payload data 1 INIT Initiation 2 INIT ACK Initiation acknowledgement 3 SACK Selective acknowledgement 4 HEARTBEAT Heartbeat request 5 HEARTBEAT ACK Heartbeat acknowledgement 6 ABORT Abort 7 SHUTDOWN Shutdown 8 SHUTDOWN ACK Shutdown acknowledgement 9 ERROR Operation error 10 COOKIE ECHO State cookie 11 COOKIE ACK Cookie acknowledgement 12 ECNE Explicit congestion notification echo (reserved) 13 CWR Congestion window reduced (reserved) 14 SHUTDOWN COMPLETE Shutdown complete 15 AUTH Authentication chunk 16–62 N/A Reserved by IETF 63 IETF-defined chunk extensions 64 I-DATA Payload data supporting packet interleaving 65–126 N/A Reserved by IETF 127 IETF-defined chunk extensions 128 ASCONF-ACK Address configuration change acknowledgement 129 N/A UnassignedSee https://www.iana.org/assignments/sctp-parameters/sctp-parameters.xhtml; possibly used in an internet draft. 130 RE-CONFIG Stream reconfiguration 131 N/A Unassigned 132 PAD Packet padding 133–190 N/A Reserved by IETF 191 IETF-defined chunk extensions 192 FORWARD-TSN Increment expected TSN 193 ASCONF Address configuration change 194 I-FORWARD-TSN Increment expected TSN, supporting packet interleaving 195–254 N/A Reserved by IETF 255 IETF-defined chunk extensions
DATA chunk + Bits 0–7 8–11 12 13 14 15 16–31 0 Chunk type = 0 Reserved I U B E Chunk length 32 TSN 64 Stream identifier Stream sequence number 96 Payload protocol identifier 128 Data
Chunk type always 0 for payload data (DATA)
Chunk flags There are only 4 flags used I — SACK chunk should be sent back without delay. U — If set, this indicates that this data is an unordered chunk and the stream sequence number is invalid. If an unordered chunk is fragmented, then each fragment has this flag set. B — If set, this marks the beginning fragment. An unfragmented chunk has this flag set. E — If set, this marks the end fragment. An unfragmented chunk has this flag set.
Chunk length The chunk length has a minimum value of 17 as data of size less than one byte is not allowed. Fixed parameters: Transmission sequence number (TSN) The sequence number for the entire DATA stream (used in fragmentation for reassembly). Stream identifier Identifier of the stream that this data chunk belongs to. Stream sequence number Identifier of the sequence number for the message in this stream. If a message is fragmented then this value is maintained for all fragments. Payload protocol identifier Application-specific protocol identifier.See https://www.iana.org/assignments/sctp-parameters/sctp-parameters.xhtml#sctp-parameters-25 for a list of assigned PPIDs. SCTP makes no use of this or modification of it. However, devices along the path or the endpoints may use it. A value of 0 indicates that no payload protocol is specified. Data Application-specific data.
Optional parameters: none.
INIT chunk + Bits 0–7 8–15 16–31 0 Chunk type = 1 Chunk flags Chunk length 32 Initiate tag 64 Advertised receiver window credit 96 # of outbound streams # of inbound streams 128 Initial TSN 160 Parameter type = 5 Parameter length = 8 192 IPv4 address of sending endpoint 224 Parameter type = 6 Parameter length = 20 256 IPv6 address of sending endpoint 288 320 352 384 Parameter type = 9 Parameter length = 8 416 Suggested cookie life-span increment (milliseconds) 448 Parameter type = 11 Parameter length 480 Null-terminated host name 512 Parameter type = 12 Parameter length 544 Address type #1 Address type #2 576 Address type #3 ... 608 Parameter type = 32768 Parameter length 640 Explicit congestion notification (reserved)
Chunk type always 1 for initiation (INIT). Chunk flags There are currently no flags used. Chunk length This is the chunk length which has a minimum value of 20 when chunk value is empty and no optional parameters are used.
Fixed parameters have identical meaning as INIT ACK: Initiate tag Unsigned 32-bit number that is used in every SCTP packet in the verification tag within the common header. Advertised receiver window credit (a_rwnd) Amount of dedicated buffer space for this association that should never be reduced. # of outbound streams Number of outbound streams (from the sender of the INIT) it wishes to use for this association. Zero is an invalid value, and the receiver should ABORT the association upon receiving a zero. # of inbound streams Identical to # of outbound streams but number of inbound streams. No negotiation takes place on the established number, but the minimum of requested and offered should be used. Initial TSN Initial transmission sequence number to be used and may be any value.
Optional parameters appear with alternating background colors of green and blue: Parameter type = 5 This parameter lists all the IPv4 addresses used at the sending endpoint. If it is a multihomed connection, then the IP address of each may be included. Parameter type = 6 This parameter lists all the IPv6 addresses used at the sending endpoint. If it is a multihomed connection, then the IP address of each may be included. Parameter type = 9 This parameter provides a suggested life-span increment the receiver should add to its default cookie life-span (in milliseconds). Parameter type = 11 This parameter is a hostname as defined in RFC 1123, section 2.1. Actual resolution of this name is outside the scope of SCTP. Additionally, a null terminating character must be included and must be included in the parameter length. Parameter type = 12 This parameter lists the address types the sender supports (e.g., IPv4 = 5, IPv6 = 6, hostname = 11). Parameter type = 32768 This parameter is reserved for explicit congestion notification support.
INIT ACK chunk The INIT ACK chunk replicates the INIT chunk except the chunk type is always 2.
Mandatory parameters, only in INIT ACK: Parameter type = 7 (state cookie) The state cookie holds the minimal information to recreate the transmission control block and is signed with the sender's private key. The format of the cookie is not specified.
SACK chunk + Bits 0–7 8–15 16–31 0 Chunk type = 3 Chunk flags Chunk length 32 Cumulative TSN ACK 64 Advertised receiver window credit 96 Number of gap ACK blocks = N Number of duplicate TSNs = X 128 Gap ACK block #1 start Gap ACK block #1 end ... ... ... 96 + N × 32 Gap ACK block #N start Gap ACK block #N end 128 + N × 32 Duplicate TSN #1 ... ... 96 + N × 32 + X × 32 Duplicate TSN #X
Chunk type Always 3 for selective acknowledgment (SACK). Chunk flags There are currently no flags used. Chunk length This is the chunk length, which has a minimum value of 16 when no gaps or duplicates are sent.
Fixed parameters:
Cumulative TSN ACK Acknowledges all sequence numbers up to and including this number. Chunks with TSNs above this number have not been received yet – except those included in the optional gap ACK blocks (see below). Advertised receiver window credit Amount of dedicated buffer space for this association that should never be reduced. Number of gap ACK blocks Indicates the number of gap ACK blocks (i.e. pairs of start and end TSNs) included in this chunk. Number of duplicate TSNs Indicates the number of duplicate TSNs reported in this chunk.
Optional parameters appear with alternating background colors of green and blue:
Gap ACK block #N start Indicates a positive offset (with reference to the cumulative TSN ACK value) to the first TSN of an additional block of TSNs that are acknowledged. Gap ACK block #N end Indicates a positive offset (with reference to the cumulative TSN ACK value) to the last TSN of an additional block of TSNs that are acknowledged. Duplicate TSN #X A TSN that was received more than once. A TSN will appear in this list for each time it is received after the first time.
HEARTBEAT chunk + Bits 0–7 8–15 16–31 0 Chunk type = 4 Chunk flags Chunk length 32 Parameter type = 1 Parameter length 64+ Heartbeat info
Chunk type For heartbeat (HEARTBEAT), this value is always 4. Chunk flags There are currently no flags used. Chunk length This is the chunk length which has a minimum value of 8 with no parameter value added.
Fixed parameters: None
Optional parameters are shown with alternating background colors of green and blue:
Parameter type = 1 This parameter contains the sender-specific heartbeat info
HEARTBEAT ACK chunk + Bits 0–7 8–15 16–31 0 Chunk type = 5 Chunk flags Chunk length 32 Parameter type = 1 Parameter length 64+ Heartbeat info
Chunk type For heartbeat acknowledgement (HEARTBEAT ACK), this value is always 5.