WebRTC Bundling
LiveSwitch supports WebRTC Bundling as per the Negotiating Media Multiplexing Using the Session Description Protocol draft. Implementation covers SDP negotiation, stream multiplexing, and demultiplexing.
Bundle Policy
Bundling works out of the box and its behavior is governed by the BundlePolicy property of the Connection object. BundlePolicy values are:
- Disabled - Bundling is turned off. Each stream uses its own transport stack: socket, ICE connectivity checks, DTLS encryption.
- MaxCompatibility - Bundling can be negotiated if the other peer supports it. Otherwise, bundling is turned off. When a peer is in offering mode and its
BundlePolicyis set toMaxCompatibility, it builds its internal architecture in such a way that it supports non-bundling connections, starts gathering ICE candidates, and creates an offer. When an answer arrives, SDP is examined to identify bundling support by peers. If bundling is supported, the extra transports are shut down. Otherwise, the connection is established without bundling. SettingBundlePolicytoMaxCompatibilityallows flexibility for negotiating bundling with other peers and should be used when the application can't be sure whether the peer supports bundling. It comes at the expense of building transports that may be declared redundant only to be shut down if bundling is supported. If there is absolute certainty that bundling is supported by a remote peer prior to negotiation, useMaxBundle. - MaxBundle - Bundling is required. If the remote peer doesn't support bundling, then the connection isn't established. Use
MaxBundlewhen there is an absolute certainty that bundling is supported by all peers to avoid wastage of resource when a connection is established.
Rollout Procedure and Policy Defaults
There is a minor tradeoff between resource utilization efficiency and peer compatibility where bundling is concerned. Nevertheless, the default settings on a connection's BundlePolicy allow for the most efficient utilization of resources and compatibility, allowing bundling to work when needed out of the box without developer intervention.
- Server
- By default, LiveSwitch Sever connections' bundling policy is set to
MaxCompatibilityto allow for compatibility with software that doesn't support bundling. For example, web-wrapper for Microsoft Edge, SIP. Since LiveSwitch Server is always in the connection answering role, there is no downside to setting theBundlePolicytoMaxCompatibility.
- By default, LiveSwitch Sever connections' bundling policy is set to
- Client
- LiveSwitch clients for SFU and MCU mode connections, both native and browser wrappers with the exception of Microsoft Edge, have their connections'
BundlePolicyset toMaxBundle. This provides greater efficiency of resource usage at connection startup because there is a guarantee that LiveSwitch Media Servers, version 1.5 and above, support bundling by default. If this isn't the case (for example, bundling support has been turned off), setBundlePolicytoMaxCompatibility. - LiveSwitch clients for peer-to-peer connections, both native and browser wrappers with the exception of Microsoft Edge, have their connection
BundlePolicyset toMaxCompatibility. This allows for wider interoperability with third-party software including the web wrapper for Microsoft Edge. If there is an absolute certainty that the peer-to-peer connection peers also support bundling, you can setBundlePolicytoMaxBundle. - LiveSwitch's Microsoft Edge web-wrapper doesn't support bundling and the
BundlePolicysetting on the connection is ignored. For more information, refer to the Browser Interoperability section.
- LiveSwitch clients for SFU and MCU mode connections, both native and browser wrappers with the exception of Microsoft Edge, have their connections'
Unimplemented Features
WebRTC bundling features are implemented as per working draft v54 of the specification linked above with the following exceptions:
- Balanced BundlePolicy isn't supported. With this
BundlePolicy, the connection respects remote offers with multiple bundle groups per connection. For example, audio bundle group or video bundle group. Currently, the LiveSwitch API doesn't support multiple streams of the same type per connection. If this changes in the future, then adding support for this policy may be re-evaluated. - "Bundle-only" SDP attribute isn't sent for offers with
MaxBundlebundle policy set for interoperability reasons with Mozilla Firefox. Once support is available, this is going to be introduced.
Browser Interoperability
LiveSwitch's WebRTC Bundling has been tested with Mozilla Firefox, Google Chrome, and Safari for interoperability. These browsers support MaxCompatibility and MaxBundle bundle policies, but they don't support the Disabled bundle policy. At this point, LiveSwitch's Microsoft Edge web-wrapper doesn't support bundling and ignores BundlePolicy setting. If connectivity with Microsoft Edge is required, set Connection.BundlePolicy to MaxCompatibility for LiveSwitch Server and clients when peer-to-peer connectivity is required.