Employee Hunting

Since the industrial revolution, a job-hunting mentality has been established in every society. This mentality always preconize that someone will try to find a job allowing them to be independent…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




WebRTC Basics and Components

I want to explain WebRTC concept with an example. Let Client-A and Client-B are two pairs who want to communicate via WebRTC. Assume that Client-A starts the communication.

WebRTC is a set of technologies that enables peer to peer duplex real-time communication between browsers even behind NAT addresses.

In our example, WebRTC is the technology to establish communication between Client-A and Client-B.

SDP is a simple string based protocol and it is to share supported codecs between browsers.

In our example,

Signalling Server is responsible for these SDP transfer between peers.

Let assume Client-A may support H264, VP8 and VP9 codecs for video, Opus and PCM codecs for audio. Client-B may support only H264 for video and only Opus codec for audio. For this case, the Client-A and Client-B will use H264 and Opus for codecs. If there are no common codecs between peers, peer to peer communication cannot be established.

ICE is the magic that establishes WebRTC connection between peers even if they are behind NAT/Firewall devices.

Google provides a free STUN server (stun.l.google.com:19302).

Direct connection between peers

Sometimes, addresses got from STUN server cannot be used to establish for peer to peer connection between peers because of NAT/Firewall. In this case, data relays over TURN Server

Connection over TURN server between peers

In our example,

RTP is a mature protocol for transmitting real-time data on top of UDP. Audio and Video are transmitted with RTP in WebRTC. There is a sister protocol of RTP which name is RTCP(Real-time Control Protocol) which provides QoS in RTP communication. RTSP(Real-time Streaming Protocol) uses RTP protocol as well in data communication.

The last part is the Signalling Server which is not defined in WebRTC. As mentioned above, Signalling Server is used to send SDP strings and ICE Candidates between Client-A and Client-B. Signalling Server also decides which peers get connected to each other. WebSocket technology is the preferred way in Signalling Servers for communication.

Signaling message sequence

In this post, we have introduced the basic components and terms under WebRTC technology without coding details. We will continue to WebRTC blog post series with Peer-To-Peer connection establishment in details.

Add a comment

Related posts:

Sul fatto che tutti svolgano la loro funzione

Nella corrente attuale, ogni persona che ama veramente Dio ha la possibilità di essere perfezionata da Lui. A prescindere dal fatto che si sia giovani o vecchi, a patto che si serbi nel cuore…

The Dream

The Dream. I had a dream the last night, I saw you and it was bliss, You came to me and we had a kiss, We talked about that and this, Catching up to….

The Joy of Coloring For Kids

Coloring books have been a staple in many children’s lives for generations. From simple line drawings to intricate designs, coloring books offer endless hours of creative fun for kids of all ages…