I hope you can recollect the memory of signaling server in WebRTC through my last post . WebRTC can be implemented on any device, it’s just a protocol; it’s not tied exclusively to browsers. WebRTC knows how to talk directly to another peer user without a signalling server, but it doesn’t know how to discover peer user . WebRTC doesn’t solve discovery (nor should it).
Welcome back ! This is one of the another post in webRTC series . I have already shared a post about what is a signaling server and what is it’s importance .
If you are a beginner in the engineering semester community , you can go through the previous post of webRTC
Introduction of WebRTC – Introduction of WebRTC
WebRTC protocol’s – What are the webRTC protocols
Consider a situation :
I am trying to call another user (Peer). I don’t know who he is and I don’t have any information about that user . Then how can I start to call him ? How will he know when I am going to call . If you have some information about that user , then you can easily contact him . isn’t ?
This is the same problem happening in WebRTC also. Consider WebRTC have some information about that user who you are trying to call ( In WebRTC that piece of information is called as a SDP offer request and for answer it is called as a SDP answer request . consider it is a piece of text information ) , then WebRTC doesn’t need any signalling server . Shortly we can say that , If you have both SDP offer and SDP answer information, you can directly connect to that peer without any signalling server in WebRTC.
You can also check the previous post about what is SDP offer and request .
You can also watch the video tutorial for the webRTC signaling process
The idea is very simple . when you send a request to another user (peer), WebRTC send a SDP offer request to that peer. If the user accept the request , WebRTC send SDP answer request back to you . These process are going to done by signalling server in WebRTC . Interesting concept . Is it ?
How Signalling server works in WebRTC ?
You can create a signalling server with web sockets or secure web sockets using Node.js .WebSocket allows users to exchange their information via messages. Following are the simple steps to understand how signalling server mechanism works .
- User 1 connect to the signalling server and request an address
- User 2 connect to the signalling server and shares the address request by the user 1 via message
- Using WebRTC’s ICE mechanism ,User 1 and user 2 exchange their information including IP address , ports etc .
- Now WebRTC will use these information’s to connect each other with P2P communication.
What is the advantage of WebRTC over any other streaming application ?
The traditional way streaming from one browser to another browser via a server . The server will act as a middle man in this case . All the data and request will come to server first and server will redirect those request to the user . It will cost lot of CPU and bandwidth problems .
When you are going to use WebRTC, the light weight middle man server will only use for getting the information about the connected users . After that WebRTC will create P2P connection between the users without any middle man server .
Leave a Reply