videocalling
SCTP (Stream Control Transmission Protocol)

SCTP (Stream Control Transmission Protocol)

协议

The protocol used in WebRTC Data Channels for sending non-media data.

What is SCTP?

The Stream Control Transmission Protocol (SCTP) is a computer networking protocol that combines the reliability of TCP with the message-oriented nature of UDP. In WebRTC, it is exclusively used for Data Channels—allowing developers to send arbitrary data (like chat messages, file transfers, or gaming state) directly between peers.

Why SCTP for WebRTC?

WebRTC needed a way to send data that was more flexible than TCP or UDP alone. SCTP offers unique features perfect for peer-to-peer data:

  • Configurable Reliability: You can choose to make a data channel reliable (like TCP, retransmitting lost packets) or unreliable (like UDP, for real-time gaming) per channel.
  • Message-Oriented: Unlike TCP which is a stream of bytes, SCTP keeps individual messages distinct.
  • Multiplexing: You can have multiple distinct data channels over a single SCTP association. If one channel is blocked (head-of-line blocking), the others can still flow freely.

SCTP over DTLS

Because SCTP is not natively supported by most consumer routers (NATs), WebRTC encapsulates SCTP packets inside DTLS packets, which run over UDP. This allows SCTP to traverse firewalls securely while retaining all its powerful features.