Expand description
Low-level protocol logic for the SCTP protocol
sctp-proto contains a fully deterministic implementation of SCTP protocol logic. It contains no networking code and does not get any relevant timestamps from the operating system. Most users may want to use the futures-based sctp-async API instead.
The main entry point is Endpoint, which manages associations for a single socket. Use Endpoint::connect to initiate outgoing associations, or provide a ServerConfig to accept incoming ones. Incoming UDP datagrams are fed to Endpoint::handle, which either creates a new Association or returns an event to pass to an existing one.
Association holds the protocol state for a single SCTP association. It produces Events and outgoing packets via polling methods (Association::poll, Association::poll_transmit). Each association contains multiple Streams for reading and writing data.
§Status
This crate is maintained by the str0m project, which has been using it since January 2023. Other consumers include ex_sctp for Elixir WebRTC. The crate is kept in sync with rtc-sctp where possible to share bug fixes.
Originally written by Rain Liu as a Sans-IO implementation of SCTP for the
webrtc-rs ecosystem, this crate predates rtc-sctp in the webrtc-rs/rtc
monorepo, which was later derived from this work. Maintenance was transferred
to the str0m maintainers in January 2026.
Structs§
- Association
- Association represents an SCTP association
- Association
Event - Events sent from an Endpoint to an Association
- Association
Handle - Internal identifier for an
Associationcurrently associated with an endpoint - Association
Stats - Association statistics
- Chunk
- A chunk of data from the stream
- Chunk
Payload Data - ChunkPayloadData represents an SCTP Chunk of type DATA
- Chunks
- Chunks is a set of chunks that share the same SSN
- Client
Config - Configuration for outgoing associations
- Endpoint
- The main entry point to the library
- Endpoint
Config - Global configuration for the endpoint, affecting all associations
- Endpoint
Event - Events sent from an Association to an Endpoint
- Error
Cause Code - ErrorCauseCode is a cause code that appears in either a ERROR or ABORT chunk
- Server
Config - Parameters governing incoming associations
- Stream
- Stream represents an SCTP stream
- Stream
State - StreamState represents the state of an SCTP stream
- Transmit
- Incoming/outgoing Transmit
- Transport
Config - Config collects the arguments to create_association construction into a single structure
Enums§
- Association
Error - Reasons why an association might be lost
- Connect
Error - Errors in the parameters being used to create a new association
- Datagram
Event - Event resulting from processing a single datagram
- EcnCodepoint
- Explicit congestion notification codepoint
- Error
- Errors triggered during SCTP association operation
- Event
- Events of interest to the application
- Payload
- Payload in Incoming/outgoing Transmit
- Payload
Protocol Identifier - PayloadProtocolIdentifier is an enum for DataChannel payload types
- Reliability
Type - Reliability type for stream
- Side
- Whether an endpoint was the initiator of an association
- Stream
Event - Application events about streams
Type Aliases§
- Association
Id - Protocol-level identifier for an Association.
- Stream
Id - Identifier for a stream within a particular association