How Does WebRTC Work in Your Apps?

Abirami

Member
Jun 12, 2023
96
0
6
25
www.mirrorfly.com
WebRTC is the most modern and easiest way to establish peer-to-peer real-time communication between web browsers, without the need for a server. You can simply add voice, video, and arbitrary data to your browsers with a set of Javascript APIs.
However, the entire process is more interesting than it sounds. Let me give you a glimpse of each event that happens in WebRTC communication.

  1. Signaling: In this process, the WebRTC collects information about each peer using a plain text protocol namely Session Description Protocol (SDP) . This protocol gathers meta data like IP address, port number, count of audio/ video track, codecs, connection values and security values. Now, the sender will know all about the receiver agent to which the message data will be sent, and vice-versa.
  2. Connection: As both the peers now have sufficient information to connect with each other, the ICE (Interactive Connectivity Establishment) protocol starts connecting the peers. Interestingly, WebRTCs can establish single connection or multiple connection using NAT traversal.
  3. Security: Once the connection is established, WebRTCs starts securing the entire communication channel using the DTLS (Datagram Transport Layer Security) and SRTP (Secure Real-Time Transport Protocol) protocols.
  4. Communication: After securing the agents, the RTP (Real-time Transport Protocol) starts aiding the exchange of real-time audio and video data. On the other hand, SCTP (Stream Control Transmission Protocol) starts exchanging data in-sequence between end-points that have more than one IP address.