“The King of Goods” on Taobao: What Is Behind the Low Latency of Live Streaming?

Background of Taobao Live Streaming

  1. Powerful Interaction: Compared with traditional TV shopping, the anchor and the audience can interact in various ways during the broadcast, including commenting, giving likes, and following the anchor through social media. As reflected in practice, commenting is an important way for the audience to interact with the anchor and is crucial to reaching a deal.

Low-Latency Technology Selection

The Latency of Current Live Streaming Technology

  • Inaccurate Determination of Congestion: The congestion control algorithm based on packet loss cannot accurately determine the congestion situation, because packet loss is not equivalent to congestion. As a result, this causes bufferbloat in the sending process, increases the round-trip time (RTT) of the link, and finally increases the latency.
  • Poor Flexibility: This is the biggest disadvantage of TCP. The TCP congestion control algorithm is implemented at the kernel layer of the operating system, which requires high optimization costs. Therefore, mobile terminals can only use the existing optimization methods of the system.

Selection of Low-latency Live Streaming Technologies

  1. Complexity: Quic has low complexity, so you can easily transform the TCP interface to the Quic interface. Conversely, the RTC solution is very complex and involves a set of protocol designs and quality-of-service (QoS) protection mechanisms.
  2. Audio and Video Friendliness: Quic does not differentiate the transmitted content and is transparent to the transmission of audio and video data. RTC is friendlier to audio and video data and can be customized and optimized for the data.
  3. Completeness: In terms of solution completeness, Quic is optimized for the transport layer, whereas WebRTC can provide end-to-end optimization solutions.
  4. Theoretical Latency: According to our lab tests and online data analysis results, the WebRTC latency can be less than 1 second.

Alibaba Cloud RTS

  • Downlink Distribution: provides two types of low-latency distribution, standard WebRTC distribution, and extended private protocols based on WebRTC. Currently, the most widely used method for Taobao live streaming is private protocol-based distribution.

Low-latency Live Streaming Technologies

  • How to connect to a native terminal for a better user experience
  • How to design a low-latency live streaming solution based on WebRTC
  • How to modify the player to support low-latency live streaming

Standard WebRTC Connection Process

  • After receiving the AccessRequest, RTS records the offerSDP and URL and then creates an answerSDP. Next, RTS generates a session token, sets it in the ufrag field of SDP, and sends the response to the client through HTTP.
  • The client sets an answerSDP and sends a Binding Request in which the USERNAME field carries the ufrag (the token issued by RTS) value in the answerSDP.
  • After receiving the Binding Request, RTS retrieves the information of the previously sent HTTP request based on the token in USERNAME and records the user’s IP address and port.

Private Protocol Connection Process

The playback process (four-way handshake) is:

  1. After receiving the PlayRequest, RTS immediately returns a provisional response and starts back-to-origin.
  2. After the back-to-origin succeeds, RTS sends the final response with relevant media descriptions, such as encoding and decoding information.
  3. The client sends the final acknowledgment (ACK) message to notify the server of the successful information reception.
  • In the UDP protocol, signals and media are transmitted in the same UDP channel.

Design of the Private Protocol State Machine

Design of Private Protocol Signaling

  1. By using this protocol, the existing packet analysis tools can be directly used to parse and capture certain packets.
  2. RTCP-related definitions, such as the payload type, subtype, and ssrc, can be reused.

RTCP-APP Messages

Design of Private Protocol Media

Comparison of Two Connection Methods

  • Standard terminals can be easily integrated.
  • Rapid prototyping is supported.
  • The media must be encrypted for transmission.
  • The transmission of audio and video is subject to certain rules, and therefore they must be transcoded on the server.
  • The connection speed is fast and the one second above the fold (ATF) experience is good.
  • The live streaming technology stack is supported, which enhances media compatibility and reduces server-end transcoding costs.

Principles of Process Protocol Design

  1. Prioritize user experience if standards and user experience conflict.
  2. Extend based on standard protocols and use standard extension methods when the extension is required.

Terminal Connection Plan

Connection Solution Based on the Complete Set of WebRTC Modules

Connection Solution Based on the WebRTC Transport Layer

Modifications of the Player for Low-latency Live Streaming

Business Value of Low-Latency Live Streaming

Future Prospects

We are looking for three prospects for the low-latency live streaming technologies:

  1. With the advent of 5G, the network condition will get better, and low-latency live streaming technologies will become a new future trend in the live streaming industry.
  2. Most low-latency live streaming protocols that different vendors are using are private. For users, the cost of moving from one vendor to another is high. So, it is important to unify and standardize low-latency live streaming protocols for the live streaming industry. With the popularization of low-latency live streaming technologies, I believe that low-latency live streaming protocols will become more unified and standardized in the future. I also hope that technology vendors in China can make their own voices heard and contribute their own efforts to the process of promoting the standardization of low-latency live streaming.

Original Source:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store