Tomasz Rzeźnik
"WebRTC: Overview" PL
2017-05-09
What is WebRTC
A set of JavaScript APIs in the browser to enable peer-to-peer, real-time media and data exchange.
What does WebRTC provide?
- Open Source, no royalties, license fees
- Real-time flexible voice, video and data framework in cross platform
- Standard Web APIs Interoperable between browsers, W3C, IETF
- No Proprietary plug-in
- Security
WebRTC across platforms
Supported browsers & platforms
Chrome
Firefox
Opera
Android
iOS
Not supported
IE
Safari
Supported in a different way
Edge
Adapter
Same code in all browsers adapter.js
- Remove vendor prefixes
- Abstracts Chrome/Firefox differences
- Minimizes effects of spec churn
Three main RTC components
- MediaStream
- RTCPeerConnection
- RTCDataChannel
RTCDataChannel
- Ultra-low latency
- Unreliable or reliable
- Secure - Stream Control Transmission Protocol (STCP) mandatory
Example: simpl.info/rtcdatachannel/
WebRTC need these servers
- Signaling Server
- ICE Servers
- Media Servers (optional)
Abstract Signaling
- Need to exchange "session descriptop" objects
- Can use any messaging mechanism
- Can use any messaging protocal
Signaling plane
- Session control messages used to open or close communication
- Error messages
- Media metadata such as codec settings, bandwidth and media types
- Key data, used to establish secure connections
- Network data, such as a host's IP address and port as seen by the outside world
Reality. Network Address Translation (NAT)
Port Address Translation (PAT)
Session Traversal Utilities for NAT (STUN)
- Tell me what my public IP address is
- Simple server, cheap to run
- Data flows peer-to-peer
Traversal Using Relays around NAT (TURN)
- Provide a cloud fallback if peer-to-peer communication fails
- Data is sent through server, uses server bandwidth
- Ensures the call works in almost all environments
Peer-to-Peer Mesh with a Few Parties
- Works for a few parties
- No server cost
- Lowest latency
Peer-to-Peer Mesh with Many Parties
- Doesn’t scale for many parties
- Heavy processing burden on all partiest
- Massive bandwidth
Multipoint Control Unit (MCU)
- Provides scalability
- Improves mobile performance
- Dynamic back-end control
- Least bandwidth & client processing MCU
Secure pathways
Mandatory encryption for media and data