Since the start of the Internet, the browser has been with us as our sail mate in the turbulent waters of the web.
First Netscape to the friendly fellows of Chrome, Opera, and Firefox to the not so neighborly Safari and Internet Explorer, the browser in its several forms is the key to our internet adventure.
To talk about the importance of the browser let me introduce the three APIs that make this possible:
- GetUserMedia (GUM)
- RTCPeerConnect
- DataChannel
These APIs are the core of WebRTC, and in order to enable it, the browser needs to implement them, as they are in charge of establishing communication.
getUserMedia is in charge of accessing the user video and audio devices, RTCPeerConnection securely connects the peers (a.k.a users) and DataChannel allows sending arbitrary data.
The results are magical, take a look at the following diagram to understand it clearly.
As you can see, WebRTC works using direct communication, browser to browser, no server is involved… at least not yet, but we’re going to talk about that later.
Before we go any further, let me give you a quick introduction regarding protocols.
Soon you will encounter a bunch of acronyms such as HTTPS, RTP, SRTP and other strange words ending with P.
Don’t be scared by this, these are just protocols, and they are very important on the internet and in networks in general.
Let’s just say that they provide communication. Right not you are using them without even knowing it, if you check your browser address bar, you’ll see that the address of this page begins with “https”.
Go ahead click on it, then come right back….
OK. You saw https: in the address bar, correct?
This means that this site is served though HTTPS, the secure variant of HTTP, which is the protocol used to serve webpages.
Just like this, there are other protocols working behind the scenes for several services, and WebRTC also use them.
Now with that cleared up, let’s explain in detail what each API does.
To begin with the process, the gUM API securely enables access to the video camera and microphone, this by kindly asking the user to allow permissions.
On Chrome browser, the API only works under pages served though HTTPS (like this one), and this will probably be the default behavior on the rest of the browsers in the near future. This is so in order to leverage security, as HTTPS has features like encryption and authentication that makes a connection secure.
After permissions are granted, the RTCPeerConnection API enables the communication between the peers.
The connection is made using the Secure Real-time Transport Protocol (SRTP), which is a secure variant of RTP (Real-time Transport Protocol), that features encryption, integrity, authentication and protection to the original RTP, just like HTTPS does it with HTTP.
RTP is the network protocol designed to deliver audio and video over IP networks.
Think of it as the mechanism that RTCPeerConnection uses so the other person can see you and hear you, and by using its secure variant you ensure that no one can intercept the communication.
Another protocol is used in conjunction with STRP, and this is RTCP )Real-time Transport Control Protocol) While SRTP is in charge of delivering the actual video, audio and data information, RTCP transport statistics, whose primary objective is to provide some feedback on the quality of service being provided by RTP.
Finally the DataChannel allows us to send any kind of information apart from audio and video. We can think of this channel as the “Chat and beyond” part of the WebRTC.
You can check out our post about 5 uses of WebRTC Data Channel to discover more cool information about this API.
Now, after introducing the browser and the lovely APIs, we are halfway to finishing out How Does WebRTC Work journey.
As we already know, it works natively on the browser, through open APIs and protocols designed with security in mind, enabling a peer-to-peer connection. But we have a final station, the one that actually allows us to get to where we want to go, or more properly how to get where we want to be.WebRTC truly is the future of communications. Don’t get left Behind!
WebRTC truly is the future of communications. Don’t get left Behind!
Want to learn if a webRTC app may be right for your business? Contact us today!
You can also learn more by signing up for our free WebRTC training & Tutorials eCourse.