Data Channel (RTCDataChannel) is the WebRTC API for sending arbitrary data between peers. It provides a bidirectional communication channel built on top of SCTP over DTLS, running through the same PeerConnection used for media.
Key features
- Configurable reliability: Unlike WebSocket which is always reliable and ordered, Data Channels can be configured as unreliable and/or unordered, reducing latency for real-time applications
- Low latency: Built on UDP (via SCTP), avoiding TCP‘s head-of-line blocking
- Encrypted: All data is encrypted via DTLS, same as WebRTC media
- Peer-to-peer: Data travels directly between browsers (or via TURN relay if needed)
- Multiple channels: Multiple Data Channels can be created on a single PeerConnection
Use cases
- Chat messaging in video conferencing applications
- File sharing directly between browsers
- Game state synchronization in multiplayer WebRTC games
- Remote control commands (e.g., PTZ camera control in surveillance)
- Telemetry and signaling as an in-band signaling channel
Data channels are quite common in Voice AI scenarios, where transcription and other events need to be relayed between the user and the LLM.
Data Channel vs WebSocket
| Feature | Data Channel | WebSocket |
|---|---|---|
| Topology | Peer-to-peer | Client-server |
| Transport | SCTP/UDP | TCP |
| Reliability | Configurable | Always reliable |
| Encryption | Mandatory (DTLS) | Optional (WSS) |
| Latency | Lower | Higher |


