11/25/2013 1
WebRTC Monitoring and Alerting David A. Bryan Assistant Professor, Computer Science St. Edward s University dbryan@ethernot.org @davidbryan 2 11/25/2013
Speakers Chris Cavigioli Strategy Planning Intel MCG Varun Singh Co-founder callstats.io 3 11/25/2013
Latency is critical for conversational uses cases. Long latency results in double-talking, making conversation difficult. Chris Cavigioli Strategy Planning Intel Mobile and Communications Group (MCG) IMPACT OF TRANSCODING LATENCY TO USER EXPERIENCE CONNECTING WEBRTC TO 3GPP/IMS 4 11/25/2013
VoIP Latency Source: Understanding Latency in IP Telephony, Alan Percy, Brooktrout, Embedded Computing Design, July 2000, http://embedded-computing.com/article-id/?76# 5 11/25/2013
VoIP Latency Measurements Source (Table 9, Fig.3): Mouth-To-Ear Latency in Popular VoIP Clients, Agastya, Mechanic, and Kothari, Columbia University, July 2009, http://bit.ly/1ed6imm Source: (Fig.1) Understanding Latency in IP Telephony, Alan Percy, Brooktrout, Embedded Computing Design, July 2000, http://embedded-computing.com/article-id/?76# 6 11/25/2013
Latency Limits in 3GPP Source (Table 1): 3GPP TS 22.105 (Rel.11), Nov 2012, http://www.etsi.org/deliver/etsi_ts/122100_122199/122105/11.00.01_60/ts_122105v110001p.pdf Source (Fig.1): Understanding Latency in IP Telephony, Alan Percy, Brooktrout, Embedded Computing Design, July 2000, http://embedded-computing.com/article-id/?76# 7 11/25/2013
IMS Network Audio/Video AV Transcoding Opus Encode Opus Decode Opus Dec Opus Enc AMR-WR Enc AMR-WB Dec AMR-WB Dec AMR-WB Enc VP8 Encode VP8 Decode WebRTC Client VP8 Dec H.264 Enc VP8 Enc H.264 Dec WebRTC2IMS Gateway UE #1 H.264 Dec H.264 Enc IMS Client UE #2 UE #1 must support 12 codecs instead of 4 6 concurrent video codecs in parallel and 6 concurrent audio codecs simultaneously 8 11/25/2013
Codec Latencies add Extra RTD Implementation-agnostic numbers based on worst case to maintain frame rate Function H.264 assumes supports of up to Codec Delay (ms) 1080p60, then each frame has up to 16 ms max to complete. VP8 = 1080p30, thus 33 ms 320x240p30 Level 1.2 720p30 Level 3.1 1080p30 Level 4.1 A = H.264 decode 16/27 (=0.6 ms) 7.1 = 16/2.25 16 max B = VP8 encode 1.2 15 = 33/2.25 33 max C = VP8 decode 1.2 15 33 max D = H.264 encode 0.6 7.1 16 max H.264 decode + VP8 encode [A+B] =1.8 ms =22 ms =49 ms VP8 decode + H.264 encode [C+D] =1.8 ms =22 ms =49 ms Extra RTD, based purely on V codecs =3.6 ms =44 ms =98 ms 1 frame period @ 30 fps 33 ms 33 ms 33 ms 1 frame period @ 60 fps 16 ms 16 ms 16 ms Additional round-trip delay (RTD) incurred purely by transcoding 2x (decode + re-encode) Function Delay A = AMR-WB decode 20 ms B = Opus encode 20 C = Opus decode 20 D = AMR-WB encode 20 AMR-WB decode + Opus encode [A+B] =40 ms Opus decode + AMR-WB encode [C+D] =40 ms Extra RTD, based purely on A codecs =80 ms 9 11/25/2013
Call for Action Latency is #1 concern for best conversational user experience 3GPP, operators target 200-150 ms for VoLTE (and IR.94 video) Transcoding adds Up to 49 ms video or 40 ms audio in parallel for codec delays Extra 49 or 40 ms frame slips to re-align audio-video mismatches Additional 30 ms delay for jitter buffer in network-based transcoder Users perceive Round Trip Delay (RTD) which doubles end-to-end delay To preserve end-user experience, AVOID transcoding altogether End points MUST be able to negotiate and pick identical codecs 11/25/2013 10
Chris.Cavigioli@Intel.com +1 415 254 4545 11 11/25/2013
Varun Singh Co-founder, CEO callstats.io PERFORMANCE MONITORING OF MEDIA FLOWS IN WEBRTC 12 11/25/2013
Recap: WebRTC Signaling Protocol (e.g., SIP, Jingle, ) WebRTC Server APP WebRTC API APP WebRTC API Browser Internals (WebRTC Stack) 13 PeerConnection SRTP/DTLS/UDP Data/SCTP/DTLS/UDP Browser Internals (WebRTC Stack)
Latency kills http://geek-and-poke.com/ 14
Delay Variation [ms] Berlin-Helsinki 3000 2500 2000 1500 1000 500 0 0 50 100 150 200 250 300 time [s] audio video 15 Calls between TU Berlin- Aalto Univ. Helsinki
Delay Variation [ms] but on a bad day 4000 3500 3000 2500 2000 1500 1000 500 0 0 50 100 150 200 250 300 350 400 450 500 16 time [s] and this is just audio
Monitoring Annoyances Call setup time, call failures, NAT traversal Transport quality Relayed or not Session throughput, delay and loss Per-stream media quality MoS, User feedback 17
Client Monitoring STATS API Monitoring Architecture WebRTC Server Monitoring Server APP APP WebRTC API Browser Internals (WebRTC Stack) PeerConnection HTTP, IPFIX, or NetFlow WebRTC API Browser Internals (WebRTC Stack) 18 TURN Gateway
Stats API Web app queries underlying RTP stack Per stream statistics (e.g., Audio and Video) In-bound and out-bound statistics Identifiers RTCP RR ICE candidates, Query at application defined intervals Typically, 1s 19 http://tools.ietf.org/html/draft-alvestrand-rtcweb-stats-registry http://tools.ietf.org/html/draft-singh-xrblock-webrtc-additional-stats
StatsAPI: Example var statcollector = setinterval(function () { if (pc && pc.getremotestreams() && active == true) { if (pc.getstats) { pc.getstats(onstatssuccess); } else { log('no stats function. Use Chrome >24.0.1285'); } } }, 1000); onstatssuccess = function (stats) { // parse the stats.result() // Audio and Video stats // Local and Remote stats } 20 http://dev.w3.org/2011/webrtc/editor/webrtc.html#example
RTCP Monitoring Needs support in the WebRTC Stack implement RTCP Extension Reports Send XRs to a performance monitoring server http://tools.ietf.org/html/rfc6792 21
Multiplexing helps TURN server WebRTC Gateway Detecting WebRTC flows observe 2 or more categories of packets STUN messages DTLS packets RTP packets Audio frames (ptime between 10-30ms) Video packets (at least 7 frames per second) Implemented in https://github.com/vr000m/conmon (Connection Monitor) 22
Receive UDP Packet DTLS Processing Packet Monitoring (1/2) H-> Parse first 8-bits of UDP Payload H < 2 19 < H < 64 127 < H < 192 0b00 STUN Message 0b01 ChannelData Message (TURN) -> Parse Recursively SCTP DTLS Forward to RTP Processing Implemented in https://github.com/vr000m/conmon (Connection Monitor) 23
Parse PT Parse SSRC Parse PT SSRC #1 0 < PT < 72 76 < PT < 128 RTP media FEC retx 191 < PT < 255 RTCP Receive RTP Packet Codec #1 SSRC #N same as above media FEC retx Codec #2 Codec #3 24
Tying it together Endpoints monitor their calls observe raw stats: loss, delay Build a QoE model Diagnosing by analysing transport G.1070 for video, P.1201.2 for audio Cloud monitoring across calls http://www.callstats.io 25
Conclusions Tools for Performance monitoring WebRTC s StatsAPI Packet capture Bonus tip: Coupling getusermedia() constraints and stats APIs Bonus tip: better initial application settings 26