Successfully reported this slideshow.
Your SlideShare is downloading. ×

Demuxed 2020

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 60 Ad

More Related Content

Slideshows for you (20)

Similar to Demuxed 2020 (20)

Advertisement

Recently uploaded (20)

Demuxed 2020

  1. 1. 1 My Perspective Pion WebRTC (Go implementation) - Wrote it with servers in mind - Introduced to the other use cases by contributors - WebTorrent, Snowflake, IPFS, self-hosted conference. WebRTC for the Curious - People don’t really know how WebRTC works! - Hard to build/debug your cool idea….
  2. 2. WHAT IS WEBRTC?
  3. 3. 2 API and a Protocol API defined by the W3C - Only available in the browser Protocol defined by the IETF - C - C++ - Python - Go - Typescript - GStreamer - Erlang (not public) - Java (not public)
  4. 4. 3 WebRTC the Protocol Multiple Audio/Video Tracks - Add or Remove them at anytime Binary Data - Can be lossy - Can be unordered - Multiple distinct DataChannels Security is Mandatory
  5. 5. 4 WebRTC the Protocol Userland Connectivity Establishment - UDP or TCP - You can choose the route - You can switch at anytime - P2P or Client/Server Userland Congestion Control - Do you prefer latency or loss? - Sender or receiver can pick bitrate
  6. 6. 5 Bundle of Protocols Session Description Protocol (RFC 2327 ICE (RFC 8445) - STUN (RFC 5389) - TURN (RFC 5776) DTLS (RFC 6347) RTP/RTCP (RFC 1889) SCTP (RFC 2960)
  7. 7. 6 WebRTC in Four Steps Signaling -> Connecting -> Securing -> Communicating
  8. 8. SIGNALING
  9. 9. 7 Minimum Details to start Call Global state - ICE Auth and Candidates - DTLS Role and Fingerprint Media Sections - Offer/Answer model - How many tracks you want to send and receive - Protocol makes no restriction around codecs
  10. 10. CONNECTING
  11. 11. 8 Two Roles - Controlling - Controlled Both Sides Have Auth Both Sides Have Candidates - Which then create candidate pairs
  12. 12. What is the best pair? 9 Do you take the first connected pair? Do you wait for the best pair? What should we measure? - Round Trip Time - Packet Loss - Bandwidth Costs
  13. 13. Stay connected on the move 10 New candidates as you move (Wifi/LTE) Nominating new candidate pair Needs to be cheap
  14. 14. SECURING
  15. 15. 11 DTLS Handshake - Sent over ICE - Keys extracted to encrypt RTP Self-signed certs verified via hash Requires you to trust your signaling
  16. 16. MEDIA COMMUNICATION
  17. 17. Video Basics 12 Constraints - Bandwidth - Hardware - Network (MTU, Loss, Jitter) - Decoders (Hardware vs Software) Solutions - Keyframe Interval - Coding Complexity - Bitrate
  18. 18. Not so basic…
  19. 19. RTP 13
  20. 20. Common RTP Problems 14 Jitter - Add Delay/Re-order Latency - Move ahead when possible Packet Loss - NACK - PLI - FEC
  21. 21. RTP Trade-offs 15 Latency vs quality Does one track matter more? Spend bandwidth on FEC?
  22. 22. Receiver Driven Congestion Control 16 Receiver tells sender requested bitrate (REMB) Really simple, but all state exists on one side.
  23. 23. Sender Driven Congestion Control 17 Receiver sends reception status (TWCC) Sender then chooses bitrate Sender is aware of Jitter, PacketLoss and much more. You can play with algorithm more.
  24. 24. https://datatracker.ietf.org/wg/rmcat/documents/
  25. 25. DATA COMMUNICATION
  26. 26. DataChannel Basics 18 Multiple Streams Each have distinct behavior - ordered - maxPacketLifetime - maxRetransmits Datagram Based
  27. 27. All about Chunks 19 DATA - Transmission Sequence Number - Stream Identifier - Stream Sequence Number SACK - What is the last TSN I saw?
  28. 28. Don’t wait on lost data 20 Don’t worry when you lose one part - Sender skips the TSN ahead Don’t block on old data - Why do we care about what happened in the past?
  29. 29. SOLVE UNIQUE PROBLEMS
  30. 30. Problem: Connect two users with no Public IP 21
  31. 31. Solution: NAT Traversal 22
  32. 32. Solution: NAT Traversal 23
  33. 33. Problem: Wi-Fi on Fire 24
  34. 34. Solution: ICE Renomination 25
  35. 35. Problem: What bitrate do I upload? 26
  36. 36. Problem: What bitrate do I upload? 27
  37. 37. Solution: Congestion Control 28
  38. 38. Problem: connect without knowing IP? 29
  39. 39. Solution: mDNS Candidates 30
  40. 40. Problem: Don’t block on the past 1331
  41. 41. Solution: SCTP 1332
  42. 42. WEBRTC IN ACTION
  43. 43. ns-remote https://github.com/mzyy94/ns-remote 33
  44. 44. CloudRetro.io 34
  45. 45. 35 Neko github.com/nurdism/neko
  46. 46. 36 TelloGo https://github.com/Ragnar-H/TelloGo
  47. 47. 37 ascii https://github.com/dialup-inc/ascii
  48. 48. Strive CDN 38
  49. 49. 39 Protocol Bridge
  50. 50. 40 ssh-p2p github.com/nobonobo/ssh-p2p
  51. 51. 41 RTCTunnel github.com/rtctunnel
  52. 52. 42 Snowflake snowflake.torproject.org
  53. 53. webwormhole.io 43
  54. 54. 44 Ion github.com/pion/ion

×