rtci-sctp
Sans-I/O SCTP (RFC 9260) with partial reliability and stream reconfiguration, for WebRTC data channels. 1 public module, 39 items at 0.5.0.
cargo add [email protected] · crates.io · docs.rs · README on GitHub· MSRV 1.89
README
SCTP as WebRTC data channels use it: associations over DTLS, ordered and unordered streams, partial reliability, stream reconfiguration, stream schedulers, congestion and flow control, path MTU handling and the association lifecycle.
Specifications
- RFC 9260, Stream Control Transmission Protocol
- RFC 3758 and RFC 7496, partial reliability and its policies
- RFC 6525, stream reconfiguration
- RFC 8260, user message interleaving (I-DATA and I-FORWARD-TSN, negotiated when both sides announce it) and stream schedulers
- RFC 8261, SCTP over DTLS
Clause-by-clause status, with the test that proves each clause: rfc9260, rfc3758, rfc7496, rfc6525, rfc8260, rfc8261.
Use
Endpoint accepts and opens associations; an Association carries the streams. The root crate (rtci) runs one association per peer connection under its data channels (rtci-datachannel).
Sans-I/O
A deterministic state machine: feed it datagrams and time, poll it for datagrams, timeouts and events. The crate does no I/O and reads no clock: every call that depends on time takes an Instant from the caller.
Licence
Licensed under either of the MIT licence or the Apache License, Version 2.0, at your option.
This crate is part of the rtci workspace, which descends from webrtc-rs/rtc and is developed independently; FORK.md lists what it carries over upstream. Upstream's licence and copyright notices are retained.
rtci_sctp
SCTP for the Sans-I/O WebRTC stack.
- struct
Associationfromcrate::association::AssociationAssociation represents an SCTP association - struct
AssociationEventfromcrate::shared::AssociationEventEvents sent from an Endpoint to an Association - struct
AssociationHandlefromcrate::endpoint::AssociationHandleInternal identifier for anAssociationcurrently associated with an endpoint - struct
AssociationStatsfromcrate::association::stats::AssociationStatsAssociation statistics - struct
AssociationStatusfromcrate::association::AssociationStatusWhatAssociation::statusreports (RFC 9260 11.1.8). - struct
Chunkfromcrate::queue::reassembly_queue::ChunkA chunk of data from the stream - struct
ChunkPayloadDatafromcrate::chunk::chunk_payload_data::ChunkPayloadDataChunkPayloadData represents an SCTP Chunk of type DATA - struct
Chunksfromcrate::queue::reassembly_queue::ChunksChunks is a set of chunks that share the same SSN - struct
ClientConfigfromcrate::config::ClientConfigConfiguration for outgoing associations - struct
Endpointfromcrate::endpoint::EndpointThe main entry point to the library - struct
EndpointConfigfromcrate::config::EndpointConfigGlobal configuration for the endpoint, affecting all associations - struct
EndpointEventfromcrate::shared::EndpointEventEvents sent from an Association to an Endpoint - struct
ErrorCauseCodefromcrate::chunk::ErrorCauseCodeErrorCauseCode is a cause code that appears in either a ERROR or ABORT chunk - struct
MessagePartfromcrate::queue::reassembly_queue::MessagePartPart of a message, read withStream::read_part: the partial delivery API of RFC 9260 section 6.9 (the RECEIVE primitive's "partial flag", section 11.1.7;MSG_EORof RFC 6458 section 3.1.4). - struct
PathMtuDiscoveryConfigfromcrate::association::pmtud::PathMtuDiscoveryConfigSettings of the path MTU discovery (RFC 8899 sections 5.1.1 and 5.1.2), in SCTP packet bytes (common header and chunks). - struct
RtoConfigfromcrate::association::timer::RtoConfigRTO.Initial, RTO.Min and RTO.Max (RFC 9260 section 16), the bounds of the retransmission timeout.Defaultis the RFC's recommended values: 1, 1 and 60 seconds. - struct
ServerConfigfromcrate::config::ServerConfigParameters governing incoming associations - struct
Streamfromcrate::association::stream::StreamStream represents an SCTP stream - struct
StreamStatefromcrate::association::stream::StreamStateStreamState represents the state of an SCTP stream - struct
TimerConfigfromcrate::association::timer::TimerConfigRetransmission limits for the association's timers. - struct
TransportConfigfromcrate::config::TransportConfigConfig collects the arguments to create_association construction into a single structure - struct
UndeliveredMessagefromcrate::association::undelivered::UndeliveredMessageA user message an association did not deliver, handed back byAssociation::take_undelivered_messagesonce the association ended. - enum
AssociationErrorfromcrate::association::AssociationErrorReasons why an association might be lost - enum
ConnectErrorfromcrate::endpoint::ConnectErrorErrors in the parameters being used to create a new association - enum
DatagramEventfromcrate::endpoint::DatagramEventEvent resulting from processing a single datagram - enum
Eventfromcrate::association::EventEvents of interest to the application - enum
PathMtuStatefromcrate::association::pmtud::PathMtuStateThe phase of the discovery (RFC 8899 section 5.2). - enum
PayloadPayload in Incoming/outgoing Transmit - enum
PayloadProtocolIdentifierfromcrate::chunk::chunk_payload_data::PayloadProtocolIdentifierPayloadProtocolIdentifier is an enum for DataChannel payload types PayloadProtocolIdentifier enums <https://www.iana.org/assignments/sctp-parameters/sctp-parameters.xhtml#sctp-parameters-25> - enum
ReliabilityTypefromcrate::association::stream::ReliabilityTypeReliability type for stream - enum
SideWhether an endpoint was the initiator of an association - enum
StreamEventfromcrate::association::stream::StreamEventApplication events about streams - enum
StreamSchedulerfromcrate::config::StreamSchedulerHow an association picks the stream whose data it sends next: the stream schedulers of RFC 8260 section 3. - enum
UndeliveredModefromcrate::association::undelivered::UndeliveredModeWhether any of an undelivered message left this side (RFC 9260 11.2.2, "mode"). - fn
max_payload_size_for_mtufromcrate::config::max_payload_size_for_mtuDerive anEndpointConfig::max_payload_sizevalue from an outbound DATA-packet budget: the largest DATA packet (common header plus bundled DATA chunks) associations may emit, in bytes. Control packets (INIT, INIT ACK, SACK, RECONFIG, FORWARD TSN, shutdown) marshal without consulting this value. - type
AssociationIdfromcrate::shared::AssociationIdProtocol-level identifier for an Association. - type
StreamIdfromcrate::association::stream::StreamIdIdentifier for a stream within a particular association - const
MIN_DATA_PACKET_MTUfromcrate::config::MIN_DATA_PACKET_MTUFloor formax_payload_size_for_mtu: the smallest representable padded DATA packet — the 12-byte common header, the 16-byte DATA chunk header, and a 1..=4-byte payload padded to the 4-byte chunk boundary. - use
ReconfigEventfromcrate::association::ReconfigEventThe outcome of a stream re-configuration (RFC 6525 section 6.1 describes these as socket events).
Generated from the sources of rtci-sctp 0.5.0 at its release tag. Items made by macros and methods are on docs.rs.