27
WEBRTC STANDARDS AND UNDERPINNINGS Tim Panton, Westhawk Ltd - @steely_glint

WebRTC Standards from Tim Panton

Embed Size (px)

DESCRIPTION

WebRTC Standards from Tim Panton

Citation preview

Page 1: WebRTC Standards from Tim Panton

WEBRTC STANDARDS AND

UNDERPINNINGS

Tim Panton, Westhawk Ltd - @steely_glint

Page 2: WebRTC Standards from Tim Panton

What is webRTC?

Haven’t used webRTC

Your laptop is on wifi

Have Chrome/firefox

Browse to:

http://phono.com – click ‘call’

Page 3: WebRTC Standards from Tim Panton

What did we just do?

Placed a video call with no plugins

zero config

just by browsing to a site

encrypted

free

over local wifi

Page 4: WebRTC Standards from Tim Panton

WebRTC Definition

Realtime

voice / video /data

browser based

no plugins

secure

interoperable

Page 5: WebRTC Standards from Tim Panton

Standards

IETF

W3C

Loosely based on pre-existing standards

$100s Millions of IPR - donated

Google, Cisco, Mozilla, Skype, Tropo, ATT, E///,

Lucent etc.

Page 6: WebRTC Standards from Tim Panton

HTTP(s) signaling via webserver

Peer to Peer media between Browsers

Big Picture

Page 7: WebRTC Standards from Tim Panton

The IETF has responsibility for the wire protocols

in RTCWeb

Protocol standards (IETF)

Page 8: WebRTC Standards from Tim Panton

Signaling Standards

None! It is up to the javascript in the browser

to do what ever is needed.

Page 9: WebRTC Standards from Tim Panton

Media Standards (RIA 2.0)

Many! STUN

ICE

TURN

DTLS

SRTP

RTCP

OPUS

ULAW

Page 10: WebRTC Standards from Tim Panton

Why so many?

The network environment of a web browser is not the same as a desk phone.

Security – hostile lans (coffee shops/hotels)

Variablity – home networks, wifi/3g

Programability – Javascript is dynamically loadable

This stack of media standards addresses the differences.

Page 11: WebRTC Standards from Tim Panton

ICE sends multiple STUN packets down all possible interfaces to try and find a

path. First Bi-directional route found is used.

STUN and ICE address NAT

NAT NAT

Page 12: WebRTC Standards from Tim Panton

A TURN server in the cloud acts as a packet reflector

Many Telco 3g networks isolate users from each other.

TURN is for when ICE fails to find a viable path

NAT NAT

TURN

Page 13: WebRTC Standards from Tim Panton

If additional services are required – recording, conferences, PSTN interop etc. then

bridging via a media server may be required.

Bridging via a media server.

NAT NAT

MS

Page 14: WebRTC Standards from Tim Panton

DTLS

DTLS is the UDP version of TLS (as used in https etc)

It serves 2 purposes in the WebRTC

Exchange keys used by the SRTP media encryption

Carry the data channel streams

Page 15: WebRTC Standards from Tim Panton

Demo – sharefest.me

Data channel provides Peer 2 Peer data between browsers.

It can be used for file transfer, game moves etc.

It may also become important in M2M or IOT as a secure NAT friendly P2P protocol.

Demo show file transfer between 2 browsers by sharing a URL, but not through that server.

Page 16: WebRTC Standards from Tim Panton

SRTP + RTCP

Encrypted version of the classic RTP protocol, with the

RTCP reporting mechanism.

Multiple media streams may be multiplexed over the

same pair of ports – still under discussion.

Page 17: WebRTC Standards from Tim Panton

Standard Codecs

Audio OPUS

Wideband

Flexible, efficient, loss correcting

Expensive to transcode

ULAW

Narrowband PSTN codec

High bandwidth

Poor in lossy/variable networks

Page 18: WebRTC Standards from Tim Panton

Codecs - No video standard yet.

Video VP8

H264

Differences are largely commercial and

legal rather than technical, either is plenty

good enough.

Page 19: WebRTC Standards from Tim Panton

These are the API’s offered to the javascript

programmer – aka ‘JSEP’

Standard APIs (W3c)

Page 20: WebRTC Standards from Tim Panton

Javascript : getUserMedia()

navigator.webkitGetUserMedia({

'audio':true,

'video':true

},

function(stream) {

var url =webkitURL.createObjectURL(stream);

createPeer(stream);

},

function(error) {

});

Page 21: WebRTC Standards from Tim Panton

Javascript : RTCPeerConnection

pc = new RTCPeerConnection(configuration,constraints);

pc.onicecandidate = function(evt) {

sendCandyToAlice(evt.candidate);

};

pc.onaddstream = function (event) {

var remotePlay = document.getElementById(”videoTag");

remotePlay.src = webkitURL.createObjectURL(event.stream);

};

pc.addStream(localStream);

pc.createOffer(

function(offer) {

pc.setLocalDescription(offer);

sendOfferToAlice(pc.localDescription.sdp);

},

null, constraints);

Page 22: WebRTC Standards from Tim Panton

HTML : <Video> tag

Extended to accept a webRTC stream as a source

Either a local or remote

See previous slides

Additional mute etc.

Page 23: WebRTC Standards from Tim Panton

Javascript:RTCSessionDescription

function onMessageFromAlice(message){

var sd = new RTCSessionDescription(

{'sdp':message,'type':"answer”} );

pc.setRemoteDescription(sd,sessionOk,sessionFail);

}

Page 24: WebRTC Standards from Tim Panton

Dissention with SDP as an API

SDP is emitted by pc.createOffer()

Complex SDP

May be manipulated to select codecs/candidates…

Source of much complaint

Currently ill defined

May be replaced in 2.0 std

Page 25: WebRTC Standards from Tim Panton

Other co-operating W3C APIs

WebGL

Can be used to apply effects to video

WebAudio

Can be used to apply effects to audio

Both will be able to be applied to local or remote

streams

Page 26: WebRTC Standards from Tim Panton

Javascript libraries

Most web coders will use a library

JS Sip

ATT.js

Phono

OpenRTC

Page 27: WebRTC Standards from Tim Panton

Demo – WebGL effects

Demo of WebGL doing realtime effects on a webRTC

video stream