WebRTC and QUIC: how hard can it be? @ RTC.ON 2024

LorenzoMiniero 355 views 58 slides Sep 12, 2024
Slide 1
Slide 1 of 58
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58

About This Presentation

Slides for my "WebRTC and QUIC: how hard can it be?" presentation at the RTC.ON 2024 event.

They describe my efforts studying and prototyping QUIC, to then move to WebTransport and ways to do real-time media over QUIC. It focuses specifically on RTP Over QUIC (RoQ) and Media Over QUIC (Mo...


Slide Content

WebRTC and QUIC: how hard can it be?
Lorenzo Miniero RTC.ON @ Krakow September 12, 2024

Who am I?
Lorenzo Miniero
•Ph.D @ UniNA
•Chairman @ Meetecho
•Main author of Janus
Contacts and info
[email protected]
•https://fosstodon.org/@lminiero
•https://www.meetecho.com
•https://lminiero.it

Just a few words on Meetecho
•Co-founded in 2009 as an academic spin-off
•University research efforts brought to the market
•Completely independent from the University
•Focus on real-time multimedia applications
•Strong perspective on standardization and open source
•Several activities
•Consulting services
•Commercial support and Janus licenses
•Streaming of live events (IETF, ACM, etc.)
•Proudly brewed in sunny Napoli, Italy

Nice recent picture from Napoli...

... with a few familiar faces!

QUIC has been on my mind for a while...

What’s QUIC and why does it matter?

What’s QUIC and why does it matter?

Learning about QUIC
•Spread over different RFCs
•https://datatracker.ietf.org/doc/html/rfc8999
•https://datatracker.ietf.org/doc/html/rfc9000
•https://datatracker.ietf.org/doc/html/rfc9001
•https://datatracker.ietf.org/doc/html/rfc9002
•Many related efforts
•https://datatracker.ietf.org/doc/html/rfc9114
•https://datatracker.ietf.org/doc/html/rfc9204
•https://datatracker.ietf.org/doc/html/rfc9221
•https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3
(WebTransport)
•...

Learning about QUIC
•Spread over different RFCs
•https://datatracker.ietf.org/doc/html/rfc8999
•https://datatracker.ietf.org/doc/html/rfc9000
•https://datatracker.ietf.org/doc/html/rfc9001
•https://datatracker.ietf.org/doc/html/rfc9002
•Many related efforts
•https://datatracker.ietf.org/doc/html/rfc9114
•https://datatracker.ietf.org/doc/html/rfc9204
•https://datatracker.ietf.org/doc/html/rfc9221
•https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3
(WebTransport)
•...

Learning about QUIC
•Many existing implementations
•https://github.com/ngtcp2/ngtcp2
•https://github.com/private-octopus/picoquic
•https://github.com/litespeedtech/lsquic
•https://github.com/aiortc/aioquic
•https://github.com/google/quiche
•https://github.com/cloudflare/quiche
•https://github.com/quic-go/quic-go
•...
•Incredibly useful blog posts!
•https://www.andy-pearce.com/blog/posts/2023/Mar/http3-in-practice-quic/
•https://www.andy-pearce.com/blog/posts/2023/Apr/http3-in-practice-http3/

Learning about QUIC
•Many existing implementations
•https://github.com/ngtcp2/ngtcp2
•https://github.com/private-octopus/picoquic
•https://github.com/litespeedtech/lsquic
•https://github.com/aiortc/aioquic
•https://github.com/google/quiche
•https://github.com/cloudflare/quiche
•https://github.com/quic-go/quic-go
•...
•Incredibly useful blog posts!
•https://www.andy-pearce.com/blog/posts/2023/Mar/http3-in-practice-quic/
•https://www.andy-pearce.com/blog/posts/2023/Apr/http3-in-practice-http3/

Implementing a QUIC stack from scratch

Spoiler alert: not that easy...
https://www.meetecho.com/blog/quic-journey/

Starting from the basics
•Started with a basic parser
•Familiarize with varint, connection IDs, QUIC transport parameters, header
protection, ACK, message framing, etc.
•Moved to a basic hardcoded server
•Figure out (levels of) encryption, new messages, STREAM, etc.
•Understanding the way buffering/chunking works for STREAM
•Generalized the server and started the client side
•Slightly different things clients and servers have to do
•Super simple demos againstaioquic
•DoQ (DNS over QUIC) demo apps very helpful

Starting from the basics
•Started with a basic parser
•Familiarize with varint, connection IDs, QUIC transport parameters, header
protection, ACK, message framing, etc.
•Moved to a basic hardcoded server
•Figure out (levels of) encryption, new messages, STREAM, etc.
•Understanding the way buffering/chunking works for STREAM
•Generalized the server and started the client side
•Slightly different things clients and servers have to do
•Super simple demos againstaioquic
•DoQ (DNS over QUIC) demo apps very helpful

Starting from the basics
•Started with a basic parser
•Familiarize with varint, connection IDs, QUIC transport parameters, header
protection, ACK, message framing, etc.
•Moved to a basic hardcoded server
•Figure out (levels of) encryption, new messages, STREAM, etc.
•Understanding the way buffering/chunking works for STREAM
•Generalized the server and started the client side
•Slightly different things clients and servers have to do
•Super simple demos againstaioquic
•DoQ (DNS over QUIC) demo apps very helpful

Starting from the basics
•Started with a basic parser
•Familiarize with varint, connection IDs, QUIC transport parameters, header
protection, ACK, message framing, etc.
•Moved to a basic hardcoded server
•Figure out (levels of) encryption, new messages, STREAM, etc.
•Understanding the way buffering/chunking works for STREAM
•Generalized the server and started the client side
•Slightly different things clients and servers have to do
•Super simple demos againstaioquic
•DoQ (DNS over QUIC) demo apps very helpful

Adding support for WebTransport

A simple interop demo

A simple interop demo

Having a look at RTP Over QUIC (RoQ)
•IETF is defining how to transport RTP on top of QUIC
•https://datatracker.ietf.org/doc/draft-ietf-avtcore-rtp-over-quic/
•Using QUIC, there are things we can (or have to) do differently
•No need for SRTP, QUIC is already encrypted
•Some feedback RTCP provides QUIC can already give us
•QUIC has integrated BWE as well
•We need framing for RTP packets (as in TCP)
•Multiplexing has interesting opportunities too
•Can multiplex multiple sessions over the same QUIC connection (Flow ID)
•Multiplexing can be done in different ways (DATAGRAM vs. STREAM(s))

Having a look at RTP Over QUIC (RoQ)
•IETF is defining how to transport RTP on top of QUIC
•https://datatracker.ietf.org/doc/draft-ietf-avtcore-rtp-over-quic/
•Using QUIC, there are things we can (or have to) do differently
•No need for SRTP, QUIC is already encrypted
•Some feedback RTCP provides QUIC can already give us
•QUIC has integrated BWE as well
•We need framing for RTP packets (as in TCP)
•Multiplexing has interesting opportunities too
•Can multiplex multiple sessions over the same QUIC connection (Flow ID)
•Multiplexing can be done in different ways (DATAGRAM vs. STREAM(s))

Having a look at RTP Over QUIC (RoQ)
•IETF is defining how to transport RTP on top of QUIC
•https://datatracker.ietf.org/doc/draft-ietf-avtcore-rtp-over-quic/
•Using QUIC, there are things we can (or have to) do differently
•No need for SRTP, QUIC is already encrypted
•Some feedback RTCP provides QUIC can already give us
•QUIC has integrated BWE as well
•We need framing for RTP packets (as in TCP)
•Multiplexing has interesting opportunities too
•Can multiplex multiple sessions over the same QUIC connection (Flow ID)
•Multiplexing can be done in different ways (DATAGRAM vs. STREAM(s))

RoQ multiplexing
https://www.meetecho.com/blog/roq-n-roll/

A basic client/server demo

Involving Janus (and WebRTC!)

Involving Janus (and WebRTC!)

Involving Janus (and WebRTC!)

Interop @ IETF 120 Hackathon

Interop @ IETF 120 Hackathon

A step further: Media Over QUIC (MoQ)
•Low-latency media delivery solution for ingest/distribution of media
•https://datatracker.ietf.org/group/moq/about/
•Publisher/Subscriber kind of approach
•Possible roles arePublisher,SubscriberandPubSub
•Not that far from a cascaded SFU, if you’re familiar with WebRTC
•MoQ transport on top of QUIC or WebTransport
•Encryption via QUIC, but E2EE encryption possible too
•Independent of media formats (can transport anything media)
•Support for relays, caching and replication points

A step further: Media Over QUIC (MoQ)
•Low-latency media delivery solution for ingest/distribution of media
•https://datatracker.ietf.org/group/moq/about/
•Publisher/Subscriber kind of approach
•Possible roles arePublisher,SubscriberandPubSub
•Not that far from a cascaded SFU, if you’re familiar with WebRTC
•MoQ transport on top of QUIC or WebTransport
•Encryption via QUIC, but E2EE encryption possible too
•Independent of media formats (can transport anything media)
•Support for relays, caching and replication points

A step further: Media Over QUIC (MoQ)
•Low-latency media delivery solution for ingest/distribution of media
•https://datatracker.ietf.org/group/moq/about/
•Publisher/Subscriber kind of approach
•Possible roles arePublisher,SubscriberandPubSub
•Not that far from a cascaded SFU, if you’re familiar with WebRTC
•MoQ transport on top of QUIC or WebTransport
•Encryption via QUIC, but E2EE encryption possible too
•Independent of media formats (can transport anything media)
•Support for relays, caching and replication points

The simplest architecture diagram

Something a bit more complex

Objects, Groups and Tracks

Implementation status
•Different implementations (sometimes different MoQT versions)
•https://github.com/kixelated/moq-rs
•https://github.com/facebookexperimental/moxygen
•https://github.com/Quicr/libquicr
•https://github.com/facebookexperimental/moq-encoder-player
•https://github.com/kota-yata/media-over-quic-experiment
•https://github.com/mengelbart/gst-moq-app
•Regular interop tests as part of the MoQ WG
•Current interop matrix discussed at IETF 120
•No report sent for my implementation yet (hopefully soon!)

Implementation status
•Different implementations (sometimes different MoQT versions)
•https://github.com/kixelated/moq-rs
•https://github.com/facebookexperimental/moxygen
•https://github.com/Quicr/libquicr
•https://github.com/facebookexperimental/moq-encoder-player
•https://github.com/kota-yata/media-over-quic-experiment
•https://github.com/mengelbart/gst-moq-app
•Regular interop tests as part of the MoQ WG
•Current interop matrix discussed at IETF 120
•No report sent for my implementation yet (hopefully soon!)

MoQ @ IETF 120

MoQ @ IETF 120

MoQ @ IETF 120

Prototyping MoQ
•Integrating MoQ (both -03 and -04) in my test library itself
•Leverages library core and events
•Exposes MoQ-specific APIs to end user
•Different demo applications for testing
•imquic-moq-pub: basic MoQ publisher (same as Luke’smoq-clock)
•imquic-moq-sub: basic MoQ subscriber (different formats)
•imquic-moq-relay: relay stub (doesn’t do anything meaningful yet)
•Janus QUIC plugin: gatewaying of MoQ pub/sub to WebRTC (using LOC)
•A few interop tests for validation
•Luke’smoq-rs(clock, relay, subscribing to MP4 video)
•Meta’s implementations (using relay, translating encoder/sender)

Prototyping MoQ
•Integrating MoQ (both -03 and -04) in my test library itself
•Leverages library core and events
•Exposes MoQ-specific APIs to end user
•Different demo applications for testing
•imquic-moq-pub: basic MoQ publisher (same as Luke’smoq-clock)
•imquic-moq-sub: basic MoQ subscriber (different formats)
•imquic-moq-relay: relay stub (doesn’t do anything meaningful yet)
•Janus QUIC plugin: gatewaying of MoQ pub/sub to WebRTC (using LOC)
•A few interop tests for validation
•Luke’smoq-rs(clock, relay, subscribing to MP4 video)
•Meta’s implementations (using relay, translating encoder/sender)

Prototyping MoQ
•Integrating MoQ (both -03 and -04) in my test library itself
•Leverages library core and events
•Exposes MoQ-specific APIs to end user
•Different demo applications for testing
•imquic-moq-pub: basic MoQ publisher (same as Luke’smoq-clock)
•imquic-moq-sub: basic MoQ subscriber (different formats)
•imquic-moq-relay: relay stub (doesn’t do anything meaningful yet)
•Janus QUIC plugin: gatewaying of MoQ pub/sub to WebRTC (using LOC)
•A few interop tests for validation
•Luke’smoq-rs(clock, relay, subscribing to MP4 video)
•Meta’s implementations (using relay, translating encoder/sender)

moq-rs + imquic

moq-rs + imquic

moq-rs + imquic

moq-rs + imquic

moxygen + moq-encoder-player (Meta)

MoQ + WebRTC (via Janus/imquic)
https://www.meetecho.com/blog/moq-webrtc/

MoQ + WebRTC (via Janus/imquic)
https://www.meetecho.com/blog/moq-webrtc/

MoQ + WebRTC (via Janus/imquic)
https://www.meetecho.com/blog/moq-webrtc/

Next steps
•ALOTstill to do
•QUIC stack itself is incomplete (took some shortcuts to get here)
•Retransmissions and flow/congestion control still missing
•Keep up to date with MoQ
•Working group isveryactive
•Specification changes often, thanks to feedback from implementations
•Release all this as open source, of course
•The library needs improvement and documentation
•Hopefully we’ll get there soon, stay tuned for that!
•Testing testing testing!
•Interop (for everything, from QUIC to MoQ) will be fundamental

Next steps
•ALOTstill to do
•QUIC stack itself is incomplete (took some shortcuts to get here)
•Retransmissions and flow/congestion control still missing
•Keep up to date with MoQ
•Working group isveryactive
•Specification changes often, thanks to feedback from implementations
•Release all this as open source, of course
•The library needs improvement and documentation
•Hopefully we’ll get there soon, stay tuned for that!
•Testing testing testing!
•Interop (for everything, from QUIC to MoQ) will be fundamental

Next steps
•ALOTstill to do
•QUIC stack itself is incomplete (took some shortcuts to get here)
•Retransmissions and flow/congestion control still missing
•Keep up to date with MoQ
•Working group isveryactive
•Specification changes often, thanks to feedback from implementations
•Release all this as open source, of course
•The library needs improvement and documentation
•Hopefully we’ll get there soon, stay tuned for that!
•Testing testing testing!
•Interop (for everything, from QUIC to MoQ) will be fundamental

Next steps
•ALOTstill to do
•QUIC stack itself is incomplete (took some shortcuts to get here)
•Retransmissions and flow/congestion control still missing
•Keep up to date with MoQ
•Working group isveryactive
•Specification changes often, thanks to feedback from implementations
•Release all this as open source, of course
•The library needs improvement and documentation
•Hopefully we’ll get there soon, stay tuned for that!
•Testing testing testing!
•Interop (for everything, from QUIC to MoQ) will be fundamental

Thanks! Questions? Comments?
Contacts

https://fosstodon.org/@lminiero

https://x.com/elminiero

https://x.com/meetecho

https://www.meetecho.com/blog/