mediasoup 3.20.0 released (and Rust crates) with new built-in SCTP stack

New releases

  • mediasoup Node 3.2.0
  • mediasoup Rust crate 0.22.0
  • mediasoup-sys Rust crate 0.12.0
  • mediasoup-types Rust crate 0.4.0

mediasoup now comes with a built-in SCTP stack that replaces usrsctp dependency. The new SCTP stack is heavily inspired by the dcsctp module of libwebrtc; however, many parts have been implemented from scratch, including packet parsing, factories, and other components.

The final PR completing the SCTP stack is this one: New built-in SCTP stack by ibc · Pull Request #1806 · versatica/mediasoup · GitHub, although there were many others before it (just look for “SCTP part XX” in mediasoup gitHub :slight_smile:).

In mediasoup Rust this is specially critical since the previous SCTP stack (based on usrsctp C dependency) was not thread safe so any Rust application that uses SCTP/DataChannels and runs many mediasoup workers (AKA native threads in mediasoup Rust) should update ASAP.

Breaking Changes

Due to requirements (and new possibilities) of the new SCTP stack, the public API of mediasoup Node and Rust has changed a bit. Here the list of changes:

In mediasoup Node (TypeScript):

  • Remove useBuiltInSctpStack option in WorkerSettngs.
  • Remove SctpCapabilities type. No longer needed.
  • WebRtcTransport, PlainTransport, PipeTransport: Add sctpNegotiatedCapabilities() getter.
  • WebRtcTransport, PlainTransport, PipeTransport options: Remove numSctpStreams and maxSctpMessageSize, and add maxSendMessageSize, maxReceiveMessageSize, sctpPerStreamSendQueueLimit and sctpMaxReceiverWindowBufferSize.
  • DirectTransport options: Remove maxMessageSize, and add maxSendMessageSize and maxReceiveMessageSize.
  • Change SctpParameters type from { port, OS, MIS, maxMessageSize } to { port, maxSendMessageSize, maxReceiveMessageSize, sendBufferSize, perStreamSendQueueLimit, maxReceiverWindowBufferSize, isDataChannel}.

In mediasoup Rust:

  • WebRtcTransport, PlainTransport, PipeTransport: Add sctp_negotiated_capabilities() getter.
  • WebRtcTransport, PlainTransport, PipeTransport options: Remove num_sctp_streams and max_sctp_message_size, and add max_send_message_size, max_receive_message_size, sctp_per_stream_send_queue_limit and sctp_max_receiver_window_buffer_size.
  • DirectTransport options: Remove max_message_size, and add max_send_message_size and max_receive_message_size.
  • Change SctpParameters type from { port, OS, MIS, maxMessageSize } to { port, max_send_message_size, max_receive_message_size, send_buffer_size, per_stream_send_queue_limit,max_receiver_window_buffer_size, is_data_channel}.

How to adapt your mediasoup application?

As a reference, you can check this PR that updates the mediasoup-demo project to work with mediasoup Node 3.20.0.

For now, no changes are required in mediasoup-client, however they will be done in future releases (see ticket).

2 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.