Top Banner
22

WebRTC – Challenges and Best Practices

Jan 06, 2016

Download

Documents

Alder

WebRTC – Challenges and Best Practices. Sumit Amar Director of Engineering Electronic Arts. Agenda. Brief Introduction to Web RTC WebRTC Challenges and Support Matrix Best practices Future WebRTC ideas Q/A. WebRTC Introduction. Plugin-free RTC communication via browser - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: WebRTC  – Challenges and Best Practices
Page 2: WebRTC  – Challenges and Best Practices

WebRTC – Challenges and Best Practices

Sumit AmarDirector of EngineeringElectronic Arts

Page 3: WebRTC  – Challenges and Best Practices

Agenda• Brief Introduction to Web RTC• WebRTC Challenges and Support Matrix• Best practices• Future WebRTC ideas• Q/A

Page 4: WebRTC  – Challenges and Best Practices

WebRTC Introduction• Plugin-free RTC communication via browser– Audio, Video, and Data

• P2P channeling aided by a signaling server• Encoding and decoding of media streams• Allows bypassing of interceptors (SBC) • Only supported in a handful of browsers

Page 5: WebRTC  – Challenges and Best Practices

WebRTC Introduction• WebRTC is being designed by:– IETF (for overall WebRTC design, Media plane, and

security framework)– W3C (HTML5/JavaScript APIs)– 3GPP (to integrate WebRTC into IP Management

Subsystem) to interoperate with Telecom infrastructure

Page 6: WebRTC  – Challenges and Best Practices

WebRTC Introduction

Loreto, S.; Romano, Simon Pietro, "Real-Time Communications in the Web: Issues, Achievements, and Ongoing Standardization Efforts,“ Internet Computing, IEEE , vol.16, no.5, pp.68,73, Sept.-Oct. 2012

Page 7: WebRTC  – Challenges and Best Practices

WebRTC Introduction

Page 8: WebRTC  – Challenges and Best Practices

Key API components• MediaStream– Stream representing audio or video

• PeerConnection– Direct peer to peer connection to exchange data

• DataChannel– API to exchange data from peer to peer

Page 9: WebRTC  – Challenges and Best Practices

Challenges• Browser support• Telecommunication Infrastructure vs WebRTC• Performance and congestion control• Security• End to end RTC feature support• Competing school of thoughts

Page 10: WebRTC  – Challenges and Best Practices

Browser Support

Source: http://iswebrtcreadyyet.com/

Page 11: WebRTC  – Challenges and Best Practices

Telecom Infrastructure vs WebRTC

TelecomAMR, AMR-WBH.264SBCsSRTP/SDESManaged

• Media plane– Audio Codecs:– Video Codecs:– Relay– Encryption– Quality

WebRTCG.711, OPUSVP8Not requiredDTLS/RTPAdaptive

Page 12: WebRTC  – Challenges and Best Practices

Telecom Infrastructure vs WebRTC• Signaling plane– Codec negotiation with SDP (Session

Description Protocol) aka Offer/Response– Sender, Receiver, and Transport with ‘Tracks’

and ‘data channels’ in case of ORTC (Object RTC)

Page 13: WebRTC  – Challenges and Best Practices

Performance and Congestion ControlMesh vs Star topologies for communication

Mesh• Increases load on the client machines, and

network• May not scale for more than 4-5 users

Page 14: WebRTC  – Challenges and Best Practices

Performance and Congestion ControlStar (aka MCU / Media Router):• Reduced CPU load on client machines, but

increased load on the server and network• Scalable solution, router servers can be

scaled out• Might be a regulatory requirement• Addresses firewall/NAT issues in one place

Page 15: WebRTC  – Challenges and Best Practices

Performance and Congestion Control• Congestion in mobile networks:– VideoAdapter can reduce encoding resolution if

the CPU is overloaded– Remote Bitrate Estimator notified the other

party to reduce bitrate if decoder is slower to react

• Problems:– VideoAdapter is reactive than proactive– Encoder and Decoder are both CPU intensive– Have to modify SDP ‘blob’ to update the bitrate

Page 16: WebRTC  – Challenges and Best Practices

Security Considerations• Direct browser-to-browser P2P

connections are susceptible are protected by the realm of sandbox (browser)

• Signaling handshake without SSL could be susceptible to several attacks

• Interoperability with IMS (IP Multimedia System) could be challenged by SIP security requirements

Page 17: WebRTC  – Challenges and Best Practices

End to end feature support• RTC features not supported by WebRTC– Push notifications– Address / ‘number’ blocking– Background processing (requires connected

socket for message passing)– Access to contacts list etc.– Access to device information (CPU, Network)

• Additive RTC features not supported by ORTC– DataChannel for communicating P2P data

Page 18: WebRTC  – Challenges and Best Practices

Competing school of thoughts(CU-RTC-Web, and now ORTC)

Page 19: WebRTC  – Challenges and Best Practices

Best practices• Bitrate encoding:– Log captured network speed, and build prediction

model on it to automatically adjust bitrate– Use a native shim to get access to network and CPU

speed• Mesh vs Star– Use star for multiple user conferencing scenarios– Use mesh for data channel based scenarios

Page 20: WebRTC  – Challenges and Best Practices

Best practices• Determine CPU speed in web application

– By running stress tests on the client machine.• Use a single method CPU intensive task• Use UI thread to do intensive DOM manipulations and run

a few web workers for CPU intensive tasks in the background

• Calculate CPU clock speed and the number of processors

• Determine network throughput– By making synchronized XHR calls in test environment

to various network endpoints and measuring time taken for turns

– By POSTing large amounts of data to determine speed

Page 21: WebRTC  – Challenges and Best Practices

WebRTC – future ideas– Peer to peer CDN (content delivery network)

Image source: http://inet.cpt.haw-hamburg.de/papers/vws-lwpcd-13.pdf

Page 22: WebRTC  – Challenges and Best Practices

Resources

• Questions/Suggestions – [email protected] • Slides at –

http://www.amar.co.in/ppt/devcon5webrtc.pptx