1 introduction

I’ve been watching some things about live audio and video, including WebRTC. WebRTC is not a protocol. It is a real-time communication technology that uses many protocols. This article summarizes the various protocols in WebRTC. This article requires some knowledge of WebRTC.

2 Transport layer protocol

To get right to the point, WebRTC uses UDP as the transport layer protocol. If TCP is used as the transport layer protocol, if packets are lost in the middle, TCP will repeatedly ask for the lost packets from the sender to ensure the reliability of the transmission. The obtained packets are buffered. However, UDP does not guarantee the reliability of transmission, which is suitable for WebRTC’s requirement of real-time rather than reliability.

3 RTCPeerConnection Related protocols

In WebRTC, the RTCPeerConnetcion API is responsible for transferring the acquired media stream to another video player device, which involves a variety of protocols.

3.1 P2P Intranet Penetration

3.1.1 NAT protocol

The Network Address Translator, also known as Network masking or IP masquerading, maps an internal IP Address to an external IP Address. A technique for rewriting the source OR destination IP address of an IP packet as it passes through a router or firewall. This technique is commonly used in private networks where multiple hosts access the Internet through a single public IP address. NAT slows down the consumption of IPv4 addresses. It is worth mentioning that the function of THE NAT protocol is accomplished by several layers. It is generally believed that the NAT protocol works at the network layer but needs to be implemented together with the transport layer. I plan to write a separate blog post about the NAT protocol.

3.2 Streaming Media Protocol

WebRTC uses SRTP and SRTCP as its streaming media protocols to transmit audio and video, but SRTP and SRTCP are closely related to the other two protocols, RTP and RTCP, which are also described here.

3.2.1 RTP,

Real-time Transport Protocol is a Transport layer Protocol for multimedia data streams on the Internet. RTP details the standard packet format for transmitting audio and video over the Internet. RTP is based on the UDP protocol. RTP consists of two closely linked parts: RTP – transmits data with real-time properties; RTP Control Protocol (RTCP) – Monitors quality of service and transmits information about participants in ongoing sessions.

3.2.2 RTCP

Real-time Transport Control Protocol (RTP Control Protocol or RTCP) is a sister Protocol of RTP. RTCP provides out-of-channel control for RTP media streams. RTCP does not transmit data itself, but collaborates with RTP to package and send multimedia data. RTCP periodically transfers control data between session participants. The primary function of RTCP is to provide feedback on the quality of service provided by RTP. RTCP collects statistics about media connections, such as bytes transmitted, packets transmitted, lost packets, Jitter, unidirectional and bidirectional network latency, and so on. Network applications can take advantage of the information provided by RTCP to try to improve the quality of service, such as limiting information traffic or switching to a less compressed codec. RTCP itself does not provide data encryption or identity authentication. SRTCP can be used for this purpose.

3.2.3 SRTP

Secure Real-time Transport Protocol is a Protocol defined on the basis of real-time Transport Protocol (RTP). It is designed to provide encryption, message authentication, integrity assurance and replay protection for real-time transmission protocol data in unicast and multicast applications.

3.2.4 SRTCP

Secure Real-time Transmission Control protocol (SRTCP or RTCP) is similar to the relationship between RTP and RTCP. SRTP also has a companion protocol, SRTCP.

3.3 Data Protocol

3.3.1 DTLS

Datagram Transport Layer Security (UDP) is not secure, but WebRTC requires that all transmitted data (audio, video, and custom application data) be encrypted, so a DTLS protocol is introduced here. DTLS is an extension of the existing TLS protocol architecture to support UDP because TLS cannot guarantee the security of data transmitted over UDP.

3.3.2 rainfall distribution on 10-12 TLS

The Secure Transport Layer Protocol (TLS) is used to provide confidentiality and data integrity between two communication applications and is a successor to SSL 3.0.

4 DataChannel Related protocols

In addition to transmitting audio and video data, WebRTC also supports end-to-end transmission of arbitrary application data via the DataChannel API. DataChannel relies on SCTP, which runs on top of the DTLS channel established between the two ends.

4.1 STCP

Stream Control Transmission Protocol is a Protocol that transmits multiple data streams between two ends of a network connection at the same time. SCTP offers the best features of both TCP and UDP:

  • Message-oriented API
  • Configurable reliability and delivery semantics
  • Built-in traffic and congestion control mechanisms

The comparison between TCP and SCTP is as follows:

  • TCP is a single-stream ordered transmission, while SCTP is a multi-stream configurable transmission
  • TCP is single-path transmission, and SCTP is multi-path transmission
  • A connection between two ends of SCTP can be bound to multiple IP addresses. As long as one connection is connected, it is connected
  • A TCP connection is established using a three-way handshake, while a SCTP connection requires a four-way handshake
  • TCP is transmitted in bytes, while SCTP is transmitted in data blocks

5. References

WebRTC Real-time communication protocol Description Stream media protocol WebRTC: describes the data transmission protocol