Skip to content

Choosing a protocol to transfer media data within CDN

Choosing a media transport protocol within CDN

By default, media data within CDN are transferred by WebRTC using UDP at transport level. In WCS builds before 5.2.1103 the transport protocol can be changed to TCP by setting the following parameter on all the CDN servers

ice_tcp_transport=true

In this case, clients will also connect via TCP to Origin and Edge servers by default. This helps to reduce packet loss and UDP bandwidth problems, but may give additional delays.

Since build 5.2.1103 it is possible to switch transport protocol within CDN regardless of the transport used by publishing and playing clients

cdn_transport=udp

To switch to TCP transport, use the following parameter on all the CDN servers

cdn_transport=tcp

The modern Secure Reliable Transport (SRT) protocol based on UDP with additional data transerf reliability features is also supported. This protocol is more packe loss resistant than UDP and provides a less delays than TCP. Set the following parameter on al the CDN servers to use SRT

cdn_transport=srt

If a server trying to get a stream does not support SRT yet (older build), or SRT is disabled on it, default UDP transport will be used.

Choosing a media transport protocol within CDN using a different server settings

If media transport settings are different on servers in one CDN, then the protocol will be chosen by the server pulling the stream.

For example, if Origin server has

cdn_transport=udp

but Transcoder and Edge both have

cdn_transport=tcp

then both Transcoder and Edge will pull the stream from Origin server using TCP transport protocol.

Choosing a media connection protocol within CDN

Since build 5.3.302, RTMP protocol may be used to establish a media connection between CDN nodes

cdn_agent=rtmp

A node establishing the connection has a priority: if Origin server has

cdn_agent=webrtc

but Edge has

cdn_agent=rtmp

then RTMP protocol will be used to pull a stream from Origin to Edge.

WebRTC protocol is enabled by default to keep backward compatibility.

Opus codec support for RTMP connection

Since build 5.3.367 Opus audio may be passed via RTMP connection between CDN nodes. No additional transcoding from Opus to AAC and vice versa is needed when publishing WebRTC stream to Origin node and playing it in browser from Edge node with cdn_agent=rtmp enabled.

Attention

Opus still is not supported for RTMP publishing and playing