WebRTC Standards from Tim Panton

Preview:

DESCRIPTION

WebRTC Standards from Tim Panton

Citation preview

WEBRTC STANDARDS AND

UNDERPINNINGS

Tim Panton, Westhawk Ltd - @steely_glint

What is webRTC?

Haven’t used webRTC

Your laptop is on wifi

Have Chrome/firefox

Browse to:

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

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

WebRTC Definition

Realtime

voice / video /data

browser based

no plugins

secure

interoperable

Standards

IETF

W3C

Loosely based on pre-existing standards

$100s Millions of IPR - donated

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

Lucent etc.

HTTP(s) signaling via webserver

Peer to Peer media between Browsers

Big Picture

The IETF has responsibility for the wire protocols

in RTCWeb

Protocol standards (IETF)

Signaling Standards

None! It is up to the javascript in the browser

to do what ever is needed.

Media Standards (RIA 2.0)

Many! STUN

ICE

TURN

DTLS

SRTP

RTCP

OPUS

ULAW

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.

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

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

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

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

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.

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.

Standard Codecs

Audio OPUS

Wideband

Flexible, efficient, loss correcting

Expensive to transcode

ULAW

Narrowband PSTN codec

High bandwidth

Poor in lossy/variable networks

Codecs - No video standard yet.

Video VP8

H264

Differences are largely commercial and

legal rather than technical, either is plenty

good enough.

These are the API’s offered to the javascript

programmer – aka ‘JSEP’

Standard APIs (W3c)

Javascript : getUserMedia()

navigator.webkitGetUserMedia({

'audio':true,

'video':true

},

function(stream) {

var url =webkitURL.createObjectURL(stream);

createPeer(stream);

},

function(error) {

});

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);

HTML : <Video> tag

Extended to accept a webRTC stream as a source

Either a local or remote

See previous slides

Additional mute etc.

Javascript:RTCSessionDescription

function onMessageFromAlice(message){

var sd = new RTCSessionDescription(

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

pc.setRemoteDescription(sd,sessionOk,sessionFail);

}

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

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

Javascript libraries

Most web coders will use a library

JS Sip

ATT.js

Phono

OpenRTC

Demo – WebGL effects

Demo of WebGL doing realtime effects on a webRTC

video stream

Recommended