Company Confidential: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED.
Server-side WebRTC Infrastructure
Chad Hart
Director, Product Marketing
WebRTC Japan Conference5 Feb 2015
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 2
About Me
Sr. Director, Product Marketing Blogger & Chief Editor
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 3
Dialogic Overview
ExperiencedOver 25 years connecting and adding value to Enterprise and Service Provider Networks
Global presenceUS HQ (New Jersey) / 20+ Regional offices
StrengthsProducts are widely deployed
Impacting 4+ billion mobile subscribers
15+ Billion VoIP minutes / month
Excellent Support
Customers include 48 of top 50 mobile carriers and 80% of the Fortune 1000
Approximately 200 patents issued or pending
Key Product & ServicesRich Media Processing
PowerMedia: Media Server / IMS MRF / SR140
Class 4 Softswitch / IMS MGCF and VoIP Gateways
Mobile Signaling / Diameter Signaling Controllers
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 4
WebRTC Server Considerations
SignalingNAT
TraversalMedia Gateway
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 5
WebRTC is not 100% Peer-to-Peer
Server
client client
media
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 6
WebRTC Signaling Servers Relay SDP between Clients
Real WebRTC Session Description
Protocol (SDP) example (partial)
Source: webrtchacks.com/sdp-anatomy
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 7
Signaling Considerations Outside of WebRTC
User authenticationSecurity & access
controlsMobile push services
FederationThe rest of your
application
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 8
The NAT Traversal Problem
Image source: webrtcHacks - https://webrtchacks.com/stun-helps-webrtc-traverse-nats/
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 9
How does WebRTC Traverse Firewalls & NATs?
media
FW & NAT
FW & NAT
client client10.10.1.1 192.168.10.1200.2.20.2
2100.1.10.1
1
Signaling Server
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 10
Interactive Connectivity Establishment (ICE)
A protocol for establishing a peer-to-peer media connection between peers behind NAT and firewall devices.
ICE requires 2 kinds of servers: 1. STUN 2. TURN
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 11
STUN – What is my external IP address?
Signaling Server
media
client10.10.1.1 200.2.20.2
2
What is my external IP address?
FW & NAT
STUN Server
Your IP address is 200.2.20.22
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 12
TURN will relay your media
media
client
Signaling Server
TURN Server
STUN Server
client
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 13
Comparing STUN vs. TURN
STUN Server TURN Server
What it does?Returns an external IP
addressRelays media
When is it needed? Almost always Rarely
How much does it cost to operate?
Inexpensive Expensive
Does it affect voice quality?
No Possible
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 14
Peer-to-Peer vs. Peer-to-Server
Server
client client
media
Peer-to-Peer
client client
Media Server
Signaling Server
Peer-to-Server
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 15
Many Reasons for a Media Server
Conferencing InterworkingTranscoding
Stream processingRecording Person-to-machine
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 16
Who do You Care About More?
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 17
Bandwidth is not Always Ubiquitous or Free
Client-side Server-side
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 18
CPU & Processing Power is Expensive
Client view Provider View
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 19
Multi-PARTY! Video Conferencing
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 20
Easy & Cheap Approach to Multi-party: Mesh
20
Full Mesh
Works for a few parties
No server cost
Lowest latency
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 21
Mesh does not Scale for Many Video Conferees
21
Full Mesh
Clients get overloadedEncode costs more than decode
Limited uplink bandwidth
Inconsistent performance across participants
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 22
Traditional Telephony Approach: MCU
22
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 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 23
Traditional MCU Resource Usage
23
Worst-case process:1. Each stream decoded
at the MCU
2. MCU mixes each conferee
3. MCU encodes individual mix for each conferee
MCU
1
1 22
3
3
445
5
6
6
Ingress streams 6
Egress streams 6
MCU decodes 6
MCU encodes 6
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 24
Efficient MCU Resource Usage
24
Efficient process:1. Each stream decoded
at the MCU
2. MCU mixes each conferee
3. MCU shares same encoder for all conferees
MCU
12
3
45
6
Ingress streams 6
Egress streams 6
MCU decodes 6
MCU encodes 1
1
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 25
Resource Efficient MCU with Encoder Sharing
30%-50% reduction in compute resources
0%
20%
40%
60%
80%
100%
1 2 3 4 5 6 7 8 9 10 11 15 17 20
Syst
em
CP
U U
tiliz
atio
n
Conferees
Encoder sharing vs. multi-encode
Traditional MCU Dialogic Evolved MCU
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 26
Newer Approach: SFU
26
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 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 27
Newer Approach: SFU
27
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 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 28
New WebRTC Approach: Simulcast
28
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 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 29
A look at Google Hangouts with Simulcast
http://webrtchacks.com/hangout-analysis-philipp-hancke/
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 30
Future Approach with VP9 – SVC?
30
SFU
MediumHigh LowLayered bitrates:
Selective Forwarding Unit (SFU) with Scalable Video Coding (SVC)
Clients send layered stream to SFU
Layers have varying bitrates –time, size, quality
SFU directs who gets what
Coming to WebRTC eventually
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 31
Multi-party video summary comparison
http://networkfuel.dialogic.com/webrtc-whitepaper
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 32
Many Reasons for a Media Server
Conferencing InterworkingTranscoding
Stream processing Person-to-machineRecording
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 33
Case Study: Video Recording Service
Application highlightsRecord live events – E.g. Kids soccer gameShare event recording with family/friends – Multi-party stream
Many Recording Formats.3GP.mp4.wav
Many CodecsG.711, Opus, AMR-NB and AMR-WB (voice)VP8, H.264 (video)
Message StorageLocal storageRemote message deposit via MSRP
HTTP/MSRP
REST (HTTP)
Application Server
Media Server
Message Storage
RTP (media)
Solution HighlightsSoftware-based Media Server
Virtualized (VM) and COTS deployment
High Availability and Geographical Redundancy
Scalability via Media Resource Broker
Architected to support 3.5M Subscriber Network
Recording
Remote Message Deposit
Key Functions
Transcoding
WebRTC Signaling
WAN
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 34
Core WebRTC Gateway & Peripheral Functions
HTTP-to-SIP(H2S)
Media GW
Transcoder
Web SIP
SBCSTUN Server
TURN Server
API Gateway
Regulates API calls
Provides media anchoring for NAT Traversal
Tells a client what its IP address is
Converts non-standard web
signaling to SIP
Web SDK/ Widget
Mobile SDK/ Widget
Kit for adding Calls to
webpage
Kit for adding Calls to native applications
Converts one codec to another, trans-rates/sizing
Encryption & transport interworking
SIP interworking, media binding, and
security
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 35
WebRTC Gateways Come in Many Packages
API Gateway H2S
Media GW SBC
Transcoder
STUN Server
TURN Server
API Gateway H2S
Media GW SBC
Transcoder
STUN Server
TURN Server
H2S
Media GW
Transcoder
SBC
API Gateway
STUN Server
TURN Server
API Gateway H2S
SBCMedia GW
Transcoder
STUN Server
TURN Server
API Gateway H2S
SBCMedia GW
Transcoder
STUN Server
TURN Server
API Gateway H2S
Media GW SBC
Transcoder
STUN Server
TURN Server
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 36
Example: Large, Web-Centric Network Architecture
Web server
SIP/IMS Network
SIP
Web Media
GatewayFirewall
AP
I Man
ager
API Calls
H2S Server
Identity Server
App Server
App Server
WSS server
STUN/ TURN
Internal REST APIs
WebRTCBrowser
COMPANY CONFIDENTIAL: © COPYRIGHT 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 37
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 2015 DIALOGIC INC. ALL RIGHTS RESERVED. 38
Questions?