DeveloperWeek 2015 - WebRTC - Where to start and how to scale
-
Upload
dialogic-inc -
Category
Technology
-
view
301 -
download
2
Transcript of DeveloperWeek 2015 - WebRTC - Where to start and how to scale
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED.
DeveloperWeek 2015WebRTC – Where to
start and how to scale
Vince Puglia
Developer Advocate
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 2
Agenda
Looking into the WebRTC API
Adding WebRTC to your first app
Considerations for scaling WebRTC
Dealing (and not dealing) with WebRTC media
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 3
Looking into the WebRTC API
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 4
WebRTC is world-class VoIP engine for free
OPUS
On2
Global IP Solutions
.org
Video CodecGoogle acquires On2 for $133
million
VoIP Media EngineGoogle acquires Global IP
Solutions for $68.2M
Audio codecOpus - open, royalty-free, highly
versatile standardized audio codec
Open Source Community
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 5
WebRTC is a Web and Internet Standard
draft-ietf-rtcweb-audio-05
draft-ietf-rtcweb-data-channel-07
draft-ietf-rtcweb-data-protocol-03
draft-ietf-rtcweb-jsep-06
draft-ietf-rtcweb-overview-09
draft-ietf-rtcweb-rtp-usage-12
draft-ietf-rtcweb-security-06
draft-ietf-rtcweb-security-arch-09
draft-ietf-rtcweb-stun-consent-freshness-01
draft-ietf-rtcweb-transports-03
draft-ietf-rtcweb-use-cases-and-requirements-14
WebRTC 1.0:Real-time Communication Between Browsers•Editors draft
•First Public Working Draft: 27 October 2011
•Feb 9 2012 Working Draft
•Aug 21 2012 Working Draft
•Last Call Working Draft: re-scheduled for Q1 2014
•Candidate Recommendation: initially scheduled for
Q4 2012, but delayed probably until Q2 2014
webrtc rtcweb
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 6
WebRTC Technologies
NAT Traversal• ICE• STUN• TURN
Audio Codecs• Opus• G.711
Video Codecs• VP8• H.264
Encryption• DTLS
Port reduction• RTCP Multiplex• RTP Bundle
Signaling• Session Description Protocol
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 7
WebRTC is 3 JavaScript APIs (& Java)
getUserMedia
CreatePeerConnection
Data Channel
Creates a media connection (RTP) between 2 peers
Grants access to local microphone, camera, or screen
Allows the user to send arbitrary data between peers
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 8
WebRTC API Examples
http://dialogic.github.io/webrtc_samples/samples/web/content/getusermedia/gum/
http://dialogic.github.io/webrtc_samples/samples/web/content/peerconnection/pc1/
http://dialogic.github.io/webrtc_samples/samples/web/content/datachannel/index.html
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 9
Adding WebRTC to your first app
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 10
Many ways to work with WebRTC
Level of effort
Low-level source
Frameworks, Tools, and
SDKsCloud API’s
Amount of control
Website Plug-ins & widgets
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 11
Website Plug-ins & widgets – super simple but limited
AdvantagesEasy for a web-admin to use
Often integrated with your CMS
DisadvantagesOnly works on your website/CMS
Limited functionality
Limited control
Does not have your branding
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 12
Cloud-API’s – easy but can be inflexible
AdvantagesRapid setup / Often very easy prototyping
Good platforms - have most of you need
Often easy to swap with other Cloud-API vendors for basic calling
DisadvantagesUsage based cost
Vendor dependency
Feature evolution risk – may not always have what you need
Platform lock-in on advanced features
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 13
Low-level source - not for the faint of heart
AdvantagesFull control
Many application-specific optimization opportunities
Native mobile support
Ability to incorporate select components
Active community support
DisadvantagesSteep learning curve
Big on-going commitment to maintain
Standards not done & codebase continually in flux
Project was not designed for your application
Abiding by license terms
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 14
Frameworks, Tools, and SDKs – many, many options
AdvantagesMany options to choose from
Ability to choose best-of-breed components
Optimized selections based on application needs & team skills
DisadvantagesFiguring out which option is best
Interworking various toolsets
Inconsistent feature evolution
Potential platform lock-in
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 15
Considerations for scaling WebRTC
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 16
What do you care more about?
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 17
CPU & processing power is expensive
Client view Provider View
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 18
What about Signaling?
Image source: Flickr user Tuomo Tammenpää – http://www.flickr.com/photos/misuser/5846728262/
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 19
NAT - Deploying STUN & TURN servers
Network Address Translation (NAT)
Interactive Connectivity Establishment (ICE)
Session Traversal Utilities for NAT (STUN)
Traversal Using Relay NAT (TURN)
Almost every WebRTC deployment should have a TURN server
The open source ones are very goodrfc-5766-turn-server
Coturn
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 20
Networking: Points of presence & latency
Inherent VoIP latency: 100-150 ms
÷ 2 for one-way
AWS round-trip latencies
Transcoding latency:0-200 ms
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 22
Dealing (and not dealing) with WebRTC
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 23
Traditional WebRTC is P2P
P2P
Minimal server cost
Lowest latency
Server
Alice Bob
media
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 24
Easy & cheap approach to multi-party: Mesh
Full Mesh
Works for a few parties
Minimal server cost
Lowest latency
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 25
Mesh does not scale for many video conferees
Full Mesh
Clients get overloadedEncode costs more than decode
Limited uplink bandwidth
Inconsistent performance across participants
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 26
Challenge: Multi-party topology
Desktop SIP video client
Video stream
Android tablet with SIP client
WebRTC browser
iPad with SIP client
Android smartphone with SIP client
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 27
PowerMedia XMS
Virtualized
Cloud-ready
Audio
Video
WebRTC
IMS & VoLTE Compliant
Superior Performance & Scalability Robust Developer APIs Standardized Production
Interfaces
Software-based real-time media processing platform
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 28
PowerMedia XMS
Multi-party mixing InterworkingTranscoding
Stream processing Person-to-machineRecording
PowerMedia™ XMS Media Platform for Developers
RESTful
Java (JSR 309)
VXML
MSML
NETANN
Javascript
Powerful Media APIs
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 29
Selective Forwarding Unit
SFU
Selective Forwarding Unit (SFU) routing
Clients send one & receive many
Client can instruct SFU which streams to send
High throughput
Can be lots of downlink bandwidth
Low latency
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 30
Selective Forwarding Unit w/ Simulcast
SFU
High bitrate
Low bitrate
Selective Forwarding Unit (SFU) with Simulcast
Clients send multiple streams to SFU
one high-bit rate
one or more lower-bit
Client directs SFU which streams to receive
Reduces bandwidth vs. SFU
Simulcast in WebRTC coming
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 31
Multipoint Control Unit
Multipoint Control Unit (MCU)Good at manipulating all media
Transcoding
Transizing
Transrating
Interworking
Server-side CPU intensive
Client can request different conference mixes
Usually client friendly
Downsizing & mixing can reduce bandwidth
Fewer client streams to process
MCU
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 32
Multi-party video summary comparison
http://networkfuel.dialogic.com/webrtc-whitepaper
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 33
WebRTC Servers Summary
Server Type Why/when you need it
Signaling Server Required to setup a WebRTC session
STUN Server Provides NAT traversal as part of ICE protocol
TURN ServerRelays media when direct connection cannot be established
Media ServerProvides conferencing, recording, media interworking, transcoding, stream processing
WebRTC GatewayInterworks signaling and media with existing VoIP networks
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 34
PowerMedia XMS: Available Resources
PowerMedia XMS trial software download and 4-port evaluation license (registration required)
PowerMedia XMS 2.3 documentation - Release Notes, Quick-start Guides and API User Guides
PowerMedia XMS GitHub – JSR309, RESTFul (Java, C#, C++), VXML, MSML and HTML/JS demo code
Dialogic YouTube Channel - PowerMedia XMS on-demand training and A Journey to Media Server Enlightenment
PowerMedia XMS Community Forums
DEN Developer’s Blog
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 35
My contact info
http://www.slideshare.net/Dialogic
linkedin.com/in/vincentpuglia
@vfpuglia
12/10/2014
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 36
Dialogic and Network Fuel among others as well as related logos, are either registered trademarks or trademarks of Dialogic Inc. and all companies controlling, controlled by, or under common control with Dialogic Inc. (“Dialogic”). The names of actual companies and products mentioned herein are the trademarks of their respective owners.
This document discusses one or more open source products, systems and/or releases. Dialogic is not responsible for your decision to use open source in connection with Dialogic products (including without limitation those referred to herein), nor is Dialogic responsible for any present or future effects such usage might have, including
without limitation effects on your products, your business, or your intellectual property rights.
01/15
dialogic.com