Skip to content

Scale Interactivity with LiveSwitch's WebRTC-Based Data Channels

Anton Venema Jul 20, 2021 12:00:00 PM
WebRTC Data Channels 2021

The way data is communicated between WebRTC clients has changed, namely owing to the changing scale and type of data that is communicated in a WebRTC-powered application. Historically, data channels have been used for peer-to-peer video conferencing platforms in very exact and limiting applications. Over the years, as demand for large-scale massive streaming grew, data channels have undergone significant transformation to ensure that it can be leveraged by platforms using more complex, scalable video architectures including SFU (Selective Forwarding Units) and MCUs (Multipoint Control Units).

This blog post will discuss WebRTC Data Channels and how to use LiveSwitch’s enhanced Data Channel properties for SFU and MCU connections.Live video scaling

What are WebRTC Data Channels?

In the WebRTC world, audio and video get a lot of fanfare, but there is another form of communication that is equally important - data transfer. Just like with audio and video, parties need to securely and easily transfer binary or text data from peer to peer in real-time. This data could take on many forms, from simple chat text strings to file sharing, spatial data, coordinates and more.

The WebRTC DataChannel API was set up to allow bi-directional data transfer directly between peers. It was designed to mimic the WebSocket API, but rather than relying on a TCP connection which although reliable is high in latency and prone to bottlenecks, data channels use UDP-based streams with the configurability of the Stream Control Transmission Protocol (SCTP) protocol. This design allows the best of both worlds: reliable delivery like in TCP but with reduced congestion on the network like in UDP

The following chart from html5rocks provides a great overview of each of the protocols:

datachannels broadcast diagram-04-1

Encrypting Data Channels with DTLS

Encryption is mandatory for all WebRTC Data Channel components. With RTCDataChannels, all data is secured with Datagram Transport Layer Security (DTLS). DTLS supports the majority of TLS cipher suites, meaning your data will be as secure as using any standard SSL based connection. DTLS is standardized and built into all browsers that support WebRTC.

Scale Data Channels with LiveSwitch SFU and MCU Connections

While the data channels WebRTC specification makes it easy to securely and reliably transfer data from one peer to another, it is by itself restrictive when developers are creating applications that use SFU and MCU connections.

As part of the suite of enterprise-grade capabilities in the LiveSwitch API, Server, Cloud, and Private Cloud customers are able to broadcast data channels over SFU and MCU connections. You can send data to any number of participants without taking on the additional upload bandwidth that is normally incurred in a simple peer-to-peer mesh network. 

Let’s break this down: say you have 12 people participating in a conference, and one of those participants wants to send everyone 2 Mbps of data. On a traditional peer-to-peer network that participant would need to upload 2 Mbps 11 times (for a total of 22 Mbps) in order to successfully transfer the data to everyone in the conversation. This would seriously affect bandwidth and latency.

However, by broadcasting the data channel with LiveSwitch, that person would only need to upload 2 Mbps of data one time to the server. The server then forwards the data to everyone on the same channel allowing the sender to only send 2 Mbps of data total. This number is unchanged if there are 100 or even 1000 in a session.



data channel peer-to-peerData Channel Peer-to-Peer:
A participant sends 2 Mbps of data to 11 other participants. This would require the participant to upload 22 Mbps of data. This significantly increases bandwidth. A Participant sends 2 Mbps of data to the LiveSwitch server. The server forwards that data to the 11 other participants. This would require the participant to upload only 2 Mbps of data.


data channel broadcastingData Channel Broadcasting: A Participant sends 2 Mbps of data to the LiveSwitch Media Server. The server forwards that data to the 11 other participants. This would require the participant to upload only 2 Mbps of data.


Applications of Data Channels

As you can see, the real-world benefits of data channel broadcasting are huge especially as it relates to multi-party use cases that require a large amount of data transfer. Some popular use cases include integrated telehealth for hospital systems, live video workflows for entire financial service organizations, large-scale bi-directional broadcasting, and modern video-based edtech and learning systems.

Real-Time Interactivity Like Never Before

As your organization grows, it’s time to reimagine what live video can do for your employees and clients. Transferring large amounts of data can be completed cost-effectively while delivering real-time interactivity commonly missed by under-resourced platforms. 

Contact Us to book a demo of LiveSwitch, the live video platform and API engineered with robust, scalable foundations. 

Reimagine your live video platform