Author: WebRTC team

preface

In recent years, real-time audio and video communication applications have shown a trend of explosion. Behind these real-time communication technologies, there is a technology that has to be mentioned – WebRTC.

In January of this year, WebRTC was published as an official standard by the W3C and IETF. According to a report by research firm GrandViewReseach, the global WebRTC market is expected to reach $21.023 billion by 2025, representing a five-year cagr of 43.6% compared to $2.3 billion in 2019.

In this series, we’ll look at why WebRTC is popular with developers and companies. How will WebRTC develop in the future? How is Agora based on WebRTC secondary development, and how will it support WebRTC NV version?


Online meeting, online education, online interview, online social networking, online medical care, online account opening for financial securities, smart home and so on have become a very familiar part of modern people’s life. By transferring the common offline scenes to online, people can experience the above scenes without leaving home. These real-time interactions have changed the way we live our lives to a large extent.

If we rewind 10 years ago, when 4G was about to become commercially available, almost every media and technology focused on high-definition video, but most focused on how easy it would be to watch video on your phone. No one predicted the explosion of short video. Most people know that 4G upload speed can be used for live video, but at that time, the idea was more for professional news field, did not think of the advent of the era of universal broadcast; Much of the vision of videoconferencing was based on the need for multinational offices, but in the last year, working online has become a daily routine for almost every office worker.

How has this decade brought real-time interactive scenarios to life?

From around 2010, real-time communication can only be done in real time using proprietary software, plug-ins, or Adobe Flash; In 2013, Chrome and Firefox made their first cross-browser video call; In 2014, the first cross-browser data transfer was made possible, opening an emerging trend for real-time communication via clients…… Today, it’s called WebRTC, and we use it every day in real-time interactive scenarios for Chrome, Mozilla Firefox, Opera, Safari, Edge, iOS, and Android.

What is the WebRTC

WebRTC is an open source project initiated by Google, Mozilla, Opera and others. The name comes from the abbreviation of Web Real-time Communication. So it’s not hard to see how the technology’s initial goal was to prepare for the freedom of real-time audio and video streaming on the browser.

“In fact, WebRTC has different meanings in different scenarios. It can represent both Google’s open source WebRTC project and the WebRTC standard developed by the World Wide Web Consortium (W3C). It also stands for the WebRTC interface in the browser, which we call the WebRTC technology.” [1] Most of the time, for developers, WebRTC is a set of W3C Javascript API that supports real-time audio and video dialogue in web browsers. It includes audio and video collection, codec, network transmission, display and other functions.

Since almost all major browsers support the WebRTC standard API, it makes it possible for browsers to communicate with each other without plug-ins. This greatly reduces the threshold of audio and video development. Developers can quickly build audio and video applications by simply invoking the WebRTC API.

Why do developers like using WebRTC

“WebRTC’s mission is to enable rich, high-quality RTC applications to be developed for browsers, mobile platforms and IoT devices, and to allow everyone to communicate over a common set of protocols.”

What problem does WebRTC solve?

Before WebRTC, RTC communication difficulties for developers mainly came from the complexity of Internet networks, time-delay sensitivity, low real-time audio and video fluency and clarity, and high operating costs. However, these problems were solved after WebRTC appeared:

1. The Internet is complex

Different NAT and firewall bring great challenges to the establishment of media P2P. With the advent of WebRTC, the browser provides direct end-to-end communication, making it easy for developers to make this connection. At the same time, WebRTC has P2P holes in the open source project libjingle, support STUN, TURN and other protocols.

2, delay sensitive

In the early RTC technology, TCP (Transmission Control Protocol) can only use UDP Transmission due to its own mechanism defects, but this requires developers to solve the retransmission, out-of-order and other problems. WebRTC offers NACK, FEC technology that eliminates the need for routing through servers, reducing latency and bandwidth consumption. Direct communication speeds up data transfer and file sharing.

3. Fluency

The Internet network is unstable, especially some small operators, during the peak traffic usage often can not ensure enough bandwidth. A set of adaptive algorithms is needed to deal with network congestion, smooth transmission and other problems. The WebRTC provides TCC + SVC + PACER + JitterBuffer technical support.

4. Clear speech

Due to the complex terminal equipment and environment, there will be noise and echo interference. At this time, WebRTC provides 3A algorithm + NetEQ, which greatly improves the sound processing and interactive experience in the real-time environment.

For developers or enterprises, the process of using WebRTC simply requires the download of a WebrTC-compatible browser and use, no additional software, plug-ins, or continuous server participation can be easily embedded in any website, and connected over the Internet. Greatly saves development time and cost.

Currently, major browsers such as Microsoft Edge, Google Chrome, Mozilla Firefox, Safari, Safari, Opera, Vivaldi and so on all support WebRTC.

Is WebRTC safe to use?

As an open source technology, WebRTC is free to use in any Web browser and is free of plug-in restrictions. So, at this point, one might ask, is it safe to use WebRTC? Will there be malicious access to my user data or private network using WebRTC?

Rest assured, when it comes to security, WebRTC is also optimized: all WebRTC media data must be encrypted.

Since WebRTC is not a plug-in and no other plug-ins need to be installed, all applications can run in the sandbox of the browser without creating new processes. Because of this, WebRTC effectively prevents malware from getting into users’ systems. In any real-time communication application, the process of transferring data can potentially increase security risks, so encryption is a mandatory feature of WebRTC and is enforced on all media data. 【 2 】

WebRTC uses two standardized encryption protocols:

  • Datagram Transport Layer Security (DTLS)

  • Standardized protocols built into the browser. Is based on transport Layer protocol (TLP) data stream encryption;

  • Because DTLS uses the User Data Protocol (UDP), the semantics of the transmission are preserved;

  • It is an extension of secure Socket Layer (SSL), and any SSL protocol can be used to secure WebRTC data, thus allowing end-to-end encryption.

Secure Real-time Transport Protocol (SRTP)

  • For media stream encryption;

  • It is an extension of the Real Time Transport Protocol (RTP), which does not have any built-in security mechanisms;

  • Provides encryption, integrity assurance, and message authentication for the Real-time Transport Protocol (RTP).

(* But SRTP does have some disadvantages, such as the fact that while it provides encryption for RTP packets, it does not encrypt the headers.)

Every day when we use the Internet to download an application, a movie, or send a message/file via email, there is a risk of malicious intrusion. However, WebRTC technology through the above standards, can effectively protect the transmission of sensitive data, to provide a secure real-time communication environment.

Is WebRTC edible?

WebRTC is one of the Internet industry’s most far-reaching efforts in real-time communication, dramatically lowering the threshold for developers to implement real-time audio and video communication capabilities. Do I have a good idea that I can use WebRTC directly for development and commercial use? (Rub hands 😄…) Unfortunately, the answer is no.

Since the transmission of WebRTC is based on the public Internet, which is not designed for real-time communication, the development of WebRTC will be hindered in the aspects of network protocol, cross-regional bandwidth, cross-carrier, user equipment, network architecture, document support and so on. As a result, real-time audio and video transmission quality can not be effectively guaranteed.

For details on the advantages and disadvantages of WebRTC, please refer to:WebRTC status and advantages and disadvantages, audio and video communication must see the open source project

Therefore, it can be said that if WebRTC is directly taken over for commercial use, it is almost impossible. At present, the common solution is self-research, according to their own business scenarios for secondary customized development, or it is simpler to use third-party SDK. Agora WebSDK is based on a collection of Apis encapsulated in WebRTC. It is extremely simple and more developer friendly. You can get a simple demo up and running in less than ten lines. Click [for details])

We’ll share with you how WebRTC does secondary customization and WebRTC best practices later in this series.

Stay tuned ~

References:

[1] MAO YUjie. 2018. Aggressive WebRTC: Why do we need it? -InfoQ. [online] infoq.cn. Available at: www.infoq.cn/article/why… [Accessed 28 April 2021].

[2] Grandviewresearch.2021. Web Real-time Communication Market Report, 2020-2027. [online] Available at: www.grandviewresearch.com/industry-an… [Accessed 18 May 2021].