SCTP packet structure


The Stream Control Transmission Protocol has a simpler basic packet structure than TCP. Each consists of two basic sections:
  1. The common header, which occupies the first 12 bytes. In the adjacent diagram, this header is highlighted in blue.
  2. 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 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.
; 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.

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 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.
Additionally, each chunk type may define a set of parameters which it includes inside the chunk value field.
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.
ValueAbbreviationDescription
0DATAPayload data
1INITInitiation
2INIT ACKInitiation acknowledgement
3SACKSelective acknowledgement
4HEARTBEATHeartbeat request
5HEARTBEAT ACKHeartbeat acknowledgement
6ABORTAbort
7SHUTDOWNShutdown
8SHUTDOWN ACKShutdown acknowledgement
9ERROROperation error
10COOKIE ECHOState cookie
11COOKIE ACKCookie acknowledgement
12ECNEExplicit congestion notification echo
13CWRCongestion window reduced
14SHUTDOWN COMPLETEShutdown complete
15AUTHAuthentication chunk
16–62N/AReserved by IETF
63N/AIETF-defined chunk extensions
64I-DATAPayload data supporting packet interleaving
65–126N/AReserved by IETF
127N/AIETF-defined chunk extensions
128ASCONF-ACKAddress configuration change acknowledgement
129N/AUnassigned
130RE-CONFIGStream reconfiguration
131N/AUnassigned
132PADPacket padding
133–190N/AReserved by IETF
191N/AIETF-defined chunk extensions
192FORWARD-TSNIncrement expected TSN
193ASCONFAddress configuration change
194I-FORWARD-TSNIncrement expected TSN, supporting packet interleaving
195–254N/AReserved by IETF
255N/AIETF-defined chunk extensions

INIT ACK chunk

The INIT ACK chunk replicates the INIT chunk except the chunk type is always 2.

COOKIE ECHO chunk

ECNE chunk

Not defined yet.

CWR chunk

Not defined yet.

RE-CONFIG chunk

At most two re-configuration parameters from those mentioned below may appear in this chunk. Not all combinations are valid, see RFC 6525 for details.

Outgoing SSN reset request parameter

This parameter is used by a sender to inform the receiver that it wishes to reset the sequence numbers for its outgoing streams.

Incoming SSN reset request parameter

This parameter is used by a sender to request that the receiver resets the sequence numbers for its outgoing streams.

SSN/TSN reset request parameter

This parameter is used by a sender to inform the receiver that it wishes to reset all TSNs and all SSNs/MIDs for all streams.

Re-configuration response parameter

This parameter is used as a response to a re-configuration request, except possibly for an incoming SSN reset request, which elicits an outgoing SSN reset request parameter if granted.

Add outgoing streams request parameter

This parameter is used by a sender to request that additional outgoing streams be added to the association.

Add incoming streams request parameter

This parameter is used by a sender to request that additional incoming streams be added to the association.

PAD chunk

The PAD chunk was introduced to facilitate path MTU discovery, by enabling a sender to arbitrarily increase the size of an SCTP packet.

I-DATA chunk

The I-DATA chunk was introduced to avoid a large message in one stream blocking messages in all other streams from being transmitted: SCTP primarily uses the TSN to achieve reliability. In some cases, the TSN is also needed to distinguish different DATA chunks.
When a message is fragmented, the DATA TSN additionally doubles as a fragment sequence number. This means that all fragments in a message must be sent using consecutive TSNs, effectively blocking all other data. The I-DATA chunk disentangles the different uses of the TSN in DATA chunks.
As DATA and I-DATA chunks are not compatible, they may not both be used in the same association.

FORWARD-TSN chunk

The FORWARD-TSN chunk was introduced to support selective unreliability: it allows the sender to tell the receiver that it will not retransmit some number of chunks, and requests that the receiver consider all these chunks as received.

I-FORWARD-TSN chunk

The I-FORWARD-TSN chunk was introduced to be used instead of FORWARD-TSN when I-DATA is used instead of DATA.