Chunks
Each SCTP packet consists, in addition to the common header, of chunks. Each chunk has a common format, but the contents can vary. One chunk appears in the diagram to the right with the green background.
- 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.
|
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 & length fields.
Read more about this topic: SCTP Packet Structure