Blog

...

WebRTC and Signaling: Things you need to know

We know that WebRTC allows web apps to create Peer-To-Peer communication. Your everyday web interactions -VoIP or video calls rely on this technology. In essence, WebRTC enables developers to send arbitrary data as well as build applications that encompass video or voice calls.

WebRTC solutions are powered by one of these servers –

  • Signaling servers
  • ICE and STUN/TURN
  • Media servers

In this article, we will be describing what is signaling, and how signaling server works with webRTC.


What happens during a P2P connection?

Image Source – addpipe

Web RTC is required to perform 5 steps to set up a P2P connection to connect two browsers.

  • Signal processing to remove ambient noise from the video or audio.
  • Codec handling to decompress and compress the video or audio.
  • Manage the network bandwidth.
  • Routing from one peer to another through (NATs), firewalls, and relays to create an Interactive Connectivity Establishment (ICE)
  • Encrypt the user data before transmitting across connections.

Signaling plays a pivotal part in establishing the connection and helping peers to find each other.

Signaling

Image Source – packtpub

A signal is a server that sits in the middle of both the peers and allows them to exchange information about themselves before initiating a call.

Information exchanged involves session keys, error messages, media metadata, codecs, bandwidth, and public IP addresses and ports that are shared between peers to create the connection.

The server signals to both peers to determine what each peer wants to send to the other and what media format to use.

Thus, before a peer-to-peer video call can begin, a connection between the two clients needs to be established. This is accomplished through signaling.

Although signaling falls outside the realm of the WebRTC specification but is the vital first step in establishing an audio/ video connection.

How Does WebRTC Signaling Work?

The receiver and sender RTCPeerConnections run in web pages on different devices in a real-world application, and you need a way for them to communicate metadata.

For this, you use a signaling server which runs messages between WebRTC clients (peers). For example, before two endpoints can start a video call, one side has to call the other, and the called side has to respond.

This call and response message flow (also popular as offer-answer message flow) contains critical details about the streaming that will take place. This includes information such as how the media will be encoded, types and number of streams, etc. It is often formatted using the SDP (Session Description Protocol), a standard format used by many real-world systems, including WebRTC and VoIP.


Project types for WebRTC signaling server

Software as a Service (SaaS)

Some organizations may wish to outsource certain modules of their WebRTC development to others.

They can be offered as a service, also known as a Software as a Service (SaaS). It is a cloud-based software solution that hosts applications and makes them available to customers over the internet.

It is possible to combine an open-source project or SDK with some SaaS offerings. Some examples of modules that may be purchased as a SaaS include signaling servers, NAT Traversal, and TURN servers.

Open Source

Building your application with the available open-source code can be a good option if you have a skilled team of WebRTC developers.

They also need to be well-versed with sourcing media and signaling servers. They have the time to devote to the application development and are in a position to navigate the uncertainties that come with any development project.

Ready-made Signaling servers

If you do not want to roll your own, there are several WebRTC signaling servers available that are integrated with WebRTC client JavaScript libraries:

Signalmaster: a signaling server for use with the SimpleWebRTC JavaScript client library.
easyRTC: a full-stack WebRTC package.
webRTC.io: one of the first abstraction libraries for WebRTC.

And if you don’t want to write any code at all, complete commercial WebRTC platforms are available from companies such as OpenTok and Asterisk.


About RTCWeb

Here is a great first step for those who are looking for a path forward for their WebRTC project and if you are unsure of what WebRTC option is right for you, contact us.

We develop reliable and robust RTC applications for both mobile and the web across several industry verticals.