What is WebRTC and how does it work?

WebRTC what it is: 🤓 get to know this video and audio communication system that you can use from your PC’s browser and without installing any app 💻​. We explain how it works below!

 

What is WebRTC?

Its meaning “Web Real-Time Communication” means “real-time communication via the web”. It is a free and open source communication system that works through the computer’s browser without the need to install plugins.

To use it, we only need to connect the microphone, the webcam and the speakers to the browser and make and carry out the appropriate point-to-point conference and videoconference connections in a much more accessible way than using a softphone.

Through this system you can exchange information (files, photos and videos) and voice calls, video and chat in real time between computer browsers and mobile applications.

With this system, communications are managed by a JavaScript API, without the need to install plugins or applications on your PC, all you have to do is have one of the browsers that supports this system: Google Chrome, Safari, Firefox, Mozilla, Opera or Microsoft Edge, among others.

how webrtc works

WebRTC, how does it work?

1. The user opens a WebRTC page.

2. The browser requests access to the computer’s camera and microphone and the user must grant it (to one of the two or both as desired).

3. The SDP (Session Description Protocol) is generated in the browser that initiates the connection.

4. A connection initiator transfers connection data to other participating users. Generally, a signaling server and WebSocket protocol are used for the purpose.

 

webrtc que es

 

5. On the receiving user’s side of the communication, a browser receives an SDP packet and then generates a similar one that also takes data from the first packet. The second packet is sent back to the initial side.

6. Depending on your implementation, the network connection status is analyzed at the same time as the previous steps. Users receive a STUN server address that is used to learn the external IP address of the device.

It is then compared to the internal IP address to determine if NAT is being used with the connection and, if so, how UDP packets are routed.

In some more complex cases, such as when using double NAT, developers use TURN servers. They are basically repeaters capable of converting a peer-to-peer (P2P) network into a client-server-client one.

7. Finally, after successfully completing the above steps, the connection will be established.

 

what is webrtc

 

 

WebRTC, what do I need to use it?

  • A device (computer, mobile or tablet)
  • Internet connection
  • Google Chrome, Safari, Firefox, Mozilla, Opera or Microsoft Edge browser
  • Headphones and microphone

 

WebRTC, what do I need to configure it?

To configure a communication system based on WebRTC, three main components are necessary:

1. WebRTC signaling server

To establish connections to this system, peers must contact a signaling server. This server will later be responsible for providing the address information needed to establish a peer-to-peer connection. Some examples of signaling servers are:

  • Signalmaster: lightweight server based on JavaScript
  • NextRTC: Java-based server
  • Kurento: comprehensive WebRTC framework
  • Janus: general purpose WebRTC Gateway

2. WebRTC client application

The client accesses WebRTC from a browser through a JavaScript API or uses a WebRTC library as part of a desktop or mobile application. To connect to a peer, the first client must connect to the signaling server.

3. STUN/TURN server

Session Traversal Utilities for NAT (STUN) allows clients to exchange address information even if they are behind routers that use Network Address Translation (NAT).

If network restrictions prevent peers from communicating directly, traffic will be routed through a Relay Use Server around the NAT (TURN) server.

 

WebRTC, what are its advantages?

Whether for private use or for professional use in a company or business, the WebRTC communication system can bring many advantages and benefits. Although we are sure that they are infinite, we detail below the most outstanding in our opinion:

  • No facilities:

For its use, it does not require the installation of any software, plugin or application.

  • Quality communications:

You can make video calls, voice calls, conferences and video conferences with multiple parties.

The quality of the audio and video is much higher than with any other technology and the speed of data transfer is also greater, mainly thanks to:

    • Modern video and audio codecs
    • Automatic quality adjustment
    • Integrated noise and echo cancellation
    • Automatic Gain Control (AGC)
  • Combination with VoIP:

It offers facilities for combining both systems, which are very useful especially in the business environment.

  • Multiplatform:

It works equally well with any operating system (desktop and mobile). They are compatible with most browsers and can also be used with any type of network.

  • Development:

It is an open source project that can be easily integrated into your product or service.

  • No phone number required:

You only need a browser to be able to communicate with anyone, without having to have an associated phone number.

  • Security:

Completely secure real-time communications can be carried out, as they are carried out using encryption.

The connections are protected and encrypted according to the DTLS and SRTP protocols. At the same time, this system operates only over the HTTPS protocol and if a website wants to use this technology, it must have a signed certificate.

 

WebRTC, what are its disadvantages?

  • Calls cannot be made from one WebRTC app to another.

This is because WebRTC solutions are not compatible with each other, as the standard only describes the procedures for transferring video and audio data.

This enables developers to decide on addressing methods, state tracking capabilities, message and file exchange, scheduling, etc.

  • In terms of security, it must be said that WebRTC detects users’ real IP addresses, and neither a proxy nor the Tor network will be able to keep it anonymous.

Only IP address can be hidden using various VPN services and TURN server. If necessary, WebRTC can be left disabled.

  • WebRTC does not allow remote desktop control. It is capable of transmitting what is happening on the device screen, but there is no possibility to interact.

This is for security reasons, as the Javascript code cannot control anything outside of the current browser window.

The desktop remote control option and others covered by Javascript code can be overcome using other client applications customized by videoconferencing providers.

 

WebRTC, what applications use it?

Some examples of applications that use this voice and video communication system are:

  • Google Meet and Google Hangouts
  • Facebook Messenger
  • Discord
  • Jitsi
  • Zoom
  • Apache OpenMeetings
  • Microsoft Teams

 

WebRTC, what codecs do you use?

For the proper functioning of this system, there are some codecs that are considered essential and others that are optional. We will explain below the mandatory and optional audio and video codecs.

 

WebRTC, what audio codecs does it use?

The codecs that we will explain below are used to compress the traffic:

1. Required audio codecs:

  • Opus:

It is a low latency (2.5 ms to 60 ms) audio codec with variable bitrate support and high compression. It is the main audio codec for this system and is perfect for streaming on variable bandwidth networks.

Opus is a hybrid solution that combines the best features of the SILK (speech compression and human speech enhancement) and CELT (audio coding) codecs.

In terms of the number of parameters, Opus outperforms the most popular low-bitrate codecs: MP3, Vorbis, and AAC LC.

  • G.711:

It is a 64 kbps legacy voice codec designed for use in traditional VoIP systems. The main advantage of G.711 is the minimal computational load thanks to the lightweight compression algorithms.

The codec has a low level of compression of audio signals and does not increase the audio delay in communication between users.

It is compatible with many devices and systems using this codec are easier to use than those based on other audio codecs.

2. Optional audio codecs:

  • G.722:

It can operate at 48, 56 and 64 kbps, providing audio quality equal to G.711. Like G.711, it is legacy, but is still supported by Chrome, Safari, and Firefox.

  • iLBC (Internet Low Bitrate Codec)

It is an open source narrowband speech codec compatible with Chrome and Safari. Your problem is that due to high stream compression, this codec increases CPU load.

  • iSAC (Internet Speech Audio Codec)

This is a proprietary wideband voice audio codec that has now been integrated into the WebRTC project. This codec is not required, but is supported by Chrome and Safari.

In the case of WebRTC, it uses an adaptive bitrate from 10 to 52 kbps with a sampling rate of 32 kHz.

 

WebRTC, what video codecs do you use?

1. Required video codecs:

  • VP8:

It is an open video codec with high video decoding speed and strong resistance to frame loss.

VP8 is easy to integrate into hardware platforms, which is why it is widely used by video conferencing providers.

VP8 is compatible with Chrome, Edge, Firefox, and Safari (12.1+).

  • H.264:

It offers a high compression ratio for video streams while maintaining high video quality.

It is widely used in videoconferencing hardware systems and perfect for this communication system.

H.264 is supported by Chrome (52+), Edge, Firefox (no longer supported on Android 68+ versions), and Safari.

 

webrtc chrome

 

2. Optional video codecs:

  • VP9:

It is a free and open video compression standard developed by Google in 2012. It was later expanded into AV1It, resulting from the ideas behind VP8.

It is compatible with Chrome (48+) and Firefox.

  • H.265:

It is a paid video codec that optimizes the options of H.264 and provides the same visual quality at half the bitrate. This is possible thanks to the fact that more efficient compression algorithms have been achieved. This codec is currently competing with AV1.

  • AV1:

It is an open source video compression codec designed for streaming video over the internet.

It is compatible with Chrome (70+) and Firefox (67+).

 

WebRTC, what browsers does it support?

  • Google Chrome
  • Mozilla
  • Firefox
  • Safari
  • Opera
  • Microsoft Edge

 

WebRTC Chrome, how to enable it?

1. Insert chrome://flags/#temporary-unexpire-flags-m85 in the browser and set it to enabled. This will allow chrome://flags/#enable-webrtc-hide-local-ips-with-mdns to be enabled.

2. Insert in browser chrome://flags/#enable-webrtc-hide-local-ips-with-mdns and disable (disabled).

 

WebRTC, how to disable it?

Next, we will explain how you can disable this system in different browsers: WebRTC Chrome, Firefox, Safari, Microsoft Edge. Follow the indicated steps.

 

WebRTC Chrome, how to disable it?

Through the following extensions:

uBlock Origin: multipurpose blocker for ads, trackers, malware and you also have an option to block this communication system.

WebRTC Network Limiter: Google’s official plugin, which stops IP leaks without totally blocking the communication system.

 

WebRTC Firefox, how to disable it?

1. Type in the address bar: about:config

2. Click on the button that will appear indicating “I accept the risk!”

3. Type in the search bar: media.peerconnection.enabled

4. Double click to change the value to ‘false’

This method should work on both the mobile and desktop versions of Firefox.

 

WebRTC Safari, how to disable it?

Currently you cannot completely disable this system in Safari. However, we must keep in mind that Safari’s permission granting model is stricter than those of other browsers.

In Safari there really would be no need to take any additional action to prevent leaks through this communication system.

 

WebRTC Microsoft Edge, how to disable it?

  1. Type the following in the address bar: about: flags
  2. Select the option checked Hide my local IP address on WebRTC connections

 

WebRTC, what is the consequence of disabling it?

Disabling this system in the browser will allow us to significantly improve privacy, because it will allow us to hide the real IP when we make connections through a VPN connection. At the same time, we will avoid disclosing sensitive information, such as the settings of our private IP addresses.

However, disabling this communication system can cause some apps and web tools that depend on it to stop working, such as:

– Applications that allow us to send files through our computer from point to point, without an intermediate server.

WhatsApp Web, which uses this system to connect with our smartphone and use it as a “bridge” to send the data through it. Without this protocol it will not be able to connect and therefore it will not work.

If we need to reuse an application that depends on this protocol, it is best to re-enable it (disabling extensions or reverting the change made in the configuration). In any case, we must not forget the privacy risks of using WebRTC.

 

WebRTC and VoIP, what do they have in common?

The two carry out real-time communications from any location in the world through the Internet network. In both cases, any device connected to the Internet can potentially be used as a terminal: computer, tablet, smartphone, etc.

 

WebRTC and VoIP, what is the difference?

Even though WebRTC is a technology based on VoIP, the real difference between them is the underlying technology itself. WebRTC only applies to web browsers (Chrome, Mozilla, Firefox, Safari…) without the need to use an application to make or receive calls over the internet.

Although VoIP is already a very cheap system, the fact that WebRTC does not even require the installation of an app for its use, has an even greater impact on the cost of ownership.

VoIP requires a dedicated network, architecture, and staff, but WebRTC is an on-demand service, most often billed per user, per month, and with no infrastructure cost.

 

WebRTC and SIP in VoIP, what is the difference?

WebRTC is an open source project developed by Google. Make voice and video communications using browser applications.

Unlike SIP, to communicate through this system it will not be necessary to use any additional device, since it can be used on the mobile or tablet by downloading an application, or on the PC using headphones.

 

WebRTC, how to know if it is enabled?

Insert into the browser address bar chrome://webrtc-internals/ to see all WebRTC connections. The site that tried to establish the WebRTC connection will appear at the top (in this case https://ip.voidsec.com/).

 

– – – – – –

 

Now that you know everything about WebRTC, what it is and how it works, it will be easier for you to start using it for your communications.

If you have any questions about this communication system or you want us to help you implement it in your company, contact us through our Form of Contact.

Si te ha gustado, vĂłtanos
Por: Nati CaballeroPublicado el: 16 de agosto de 2022