WebRTC (Web Real Time Communication) enables peer-to-peer communications between browsers or the applications. In other words, WebRTC allows user to exchange their media (audio, video and data) through the web without any plugin or framework.
Application which are using WebRTC:
FB messenger etc.
2. What is signaling?
A WebRTC peer connection or simply a connection between two user is established through discovery and negotiation process called Signaling.
3. What’s a signaling server?
To perform signaling, a Signaling Server is used. Through this signaling server, the two peers (users) can locate one another, and exchange necessary information which are required to establish direct connection.
4. What technologies are used for making a signaling server?
Websockets or XMLHttpRequest can be used for signaling server to share info between to users.
5. What kind of necessary data are shared by the users/peers?
Generally a signaling server requires 5 kinds of data:
– ICE Candidate
– Caller (Host) name
– Offer-type (or req. type)
– Target user (Calle)
But its not limited to only these five kinds of data. Signaling server can ask for any kind of data it requires but these five data are must required in order to set up a connection.
6. What is SDP?
SDP stands for Session Description Protocol which is a standard for describing a peer-to-peer connection. SDP contains the codec, source address, and timing information of audio and video.
7. From where to get SDP data of users or How to create a SDP data?
Calle or reporter will respond to this offer with RTCPeerConnection.createAnswer().
8. What is ICE Candidate?
ICE (Interactive Connectivity Establishment) allows the users/peers to discover enough information about their topologies to potentially find one or more paths by which they can establish a data session. Its a techniques used in NAT( network address translator ) for establishing communication for VoIP, peer-peer, instant messaging and other kind of interactive media. Typically ice candidate provides the information about the IP-address and port from where the data is going to be exchanged.
Some routers using NAT employ a restriction called ‘Symmetric NAT’. This means the router will only accept connections from peers you’ve previously connected to. Traversal Using Relays around NAT (TURN) is meant to bypass the Symmetric NAT restriction by opening a connection with a TURN server and relaying all information through that server.
11. When to use stun server and when to use turn server?
Most of the time stun server will be used to get ICE candidates but some times when stun server will fail to get ICE Candidates then Turn server is used.
12. How WebRTC works?
Caller will create an WebRTC offer which will contain his name, target user, offer type and his SDP. Then he sends it to signaling server. Signaling server will get that offer and sends it to Calle or target user. Until a response is received from Calle, Caller will get ICE candidate from stun or turn server and sends it to signaling server.
Calle will respond to the offer with an answer which will contain her SDP, name, Caller who called, and answer type. After sending data calle also starts to send her ICE candidates to signaling server.
After getting each others ICE candidates video and audio can be shared.