BT

Wrangling WebRTC: Challenges and Opportunities for Real-Time Communication

by Zef Hemel on Jun 12, 2013 | NOTICE: The next QCon is in San Francisco Nov 3-7, Join us!

At QCon New York 2013, Gustavo Garcia gave a talk on WebRTC, the new real-time communication component of HTML5. WebRTC is a set of technologies that enable real-time, low-latency communication between peers, for instance to used for video and audio conferencing as well as gaming. While real-time communication is typically implemented using websockets, WebRTC lowers latency dramatically by attempting to establish direct peer-to-peer connections, only using hops in between (tunnels) if a direct connection cannot be established, for instance due to NAT or firewalls.

Garcia described the various components one would need to build a video or audio conference system using web technologies. Establishing one-on-one calls is perhaps the simplest use case. This would require support in the browser for:

  1. The ability to decode and show streaming video and audio
  2. The ability to capture streaming video and audio from a (web) camera
  3. Protocols to negotiate the call (such as signalling)
  4. Codecs for doing efficient audio and video encoding and decoding
  5. Algorithms for handle echo cancellation, noise surpression, bitrate adaption (adapting the stream to changes in bandwidth) and many other aspects.

Many of these are now part of HTML5, including streaming video and audio and capturing video and audio via getUserMedia. The getUserMedia API can be used to capture audio and video, but there are also experimental extensions, currently implementing in newer builds of Chrome, to capture the screen, or individual browser tabs or parts of web pages.

One notable omission in WebRTC is direct support for signaling. Signaling, handles setting up of the call: who's trying to call who, does the person accept the call etc. This signaling has to be implemented by the developer himself, for instance using websockets or HTTP long polling. Another piece of infrastructure that the developer has to deploy himself are tunnel servers that act as an intermediary for users requiring NAT traversal and users with restrictive firewalls. According to Garcia, 8% of all calls require such intermediate tunnel servers.

Garcia described various use cases for WebRTC:

  • one-on-one video and audio calls are the simplest to implement using WebRTC.
  • multi-participant calls are more difficult to implement. One option is a full mesh network where each participant connects to all other participants, but due to high CPU and bandwidth usage, this approach does not scale beyond 5-6 participants. An alternative is using an intermediate server that aggregates all streams and broadcasts them to all other participant either separately or merged into a single stream.
  • Telephony allows WebRTC to be connected to the landline phone network and make calls to regular landlines via the web browser.
  • Gaming enables real-time multi-player gaming in combination with other HTML5 technologies such as WebGL
  • File transfers, since WebRTC supports the peer-to-peer transfer of arbitrary data, the technology can be used to transfer files between users. For instance, one could imagine building bittorrent-like applications in this manner.

While WebRTC support is still young in browsers today (currently only newer versions of Chrome and Firefox support it), there many use cases. To learn more about the technology, check out webrtc.org or the related W3C standards.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Skype and WebRTC by Andrey Sergienko

www.oslikas.com - a good example of how WebRTC could be an alternative to Skype

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT