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
• lorenzo@meetecho.com
• 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 (QUIC invariants)
• https://datatracker.ietf.org/doc/html/rfc9000 (QUIC v1 itself)
• https://datatracker.ietf.org/doc/html/rfc9001 (QUIC + TLS)
• https://datatracker.ietf.org/doc/html/rfc9002 (Congestion control)
Learning about QUIC
• Spread over different RFCs
• https://datatracker.ietf.org/doc/html/rfc8999 (QUIC invariants)
• https://datatracker.ietf.org/doc/html/rfc9000 (QUIC v1 itself)
• https://datatracker.ietf.org/doc/html/rfc9001 (QUIC + TLS)
• https://datatracker.ietf.org/doc/html/rfc9002 (Congestion control)
• Many related efforts
• https://datatracker.ietf.org/doc/html/rfc9114 (HTTP/3)
• https://datatracker.ietf.org/doc/html/rfc9204 (QPACK)
• https://datatracker.ietf.org/doc/html/rfc9221 (DATAGRAM)
• https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3
(WebTransport)
• ...
Learning about QUIC
• Many existing implementations
• https://github.com/ngtcp2/ngtcp2 (C)
• https://github.com/private-octopus/picoquic (C)
• https://github.com/litespeedtech/lsquic (C)
• https://github.com/aiortc/aioquic (Python)
• https://github.com/google/quiche (C++)
• https://github.com/cloudflare/quiche (Rust)
• https://github.com/quic-go/quic-go (Go)
• ...
Learning about QUIC
• Many existing implementations
• https://github.com/ngtcp2/ngtcp2 (C)
• https://github.com/private-octopus/picoquic (C)
• https://github.com/litespeedtech/lsquic (C)
• https://github.com/aiortc/aioquic (Python)
• https://github.com/google/quiche (C++)
• https://github.com/cloudflare/quiche (Rust)
• https://github.com/quic-go/quic-go (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.
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
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
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 against aioquic
• 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/
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)
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/
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 are Publisher, Subscriber and PubSub
• Not that far from a cascaded SFU, if you’re familiar with WebRTC
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 are Publisher, Subscriber and PubSub
• 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 (pub/sub/relay)
• https://github.com/facebookexperimental/moxygen (relay)
• https://github.com/Quicr/libquicr (relay/pub/sub)
• https://github.com/facebookexperimental/moq-encoder-player (pub/sub)
• https://github.com/kota-yata/media-over-quic-experiment (pub/sub)
• https://github.com/mengelbart/gst-moq-app (pub/sub)
Implementation status
• Different implementations (sometimes different MoQT versions)
• https://github.com/kixelated/moq-rs (pub/sub/relay)
• https://github.com/facebookexperimental/moxygen (relay)
• https://github.com/Quicr/libquicr (relay/pub/sub)
• https://github.com/facebookexperimental/moq-encoder-player (pub/sub)
• https://github.com/kota-yata/media-over-quic-experiment (pub/sub)
• https://github.com/mengelbart/gst-moq-app (pub/sub)
• 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
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’s moq-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)
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’s moq-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’s moq-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
• A LOT still to do
• QUIC stack itself is incomplete (took some shortcuts to get here)
• Retransmissions and flow/congestion control still missing
Next steps
• A LOT still 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 is very active
• Specification changes often, thanks to feedback from implementations
Next steps
• A LOT still 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 is very active
• 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!
Next steps
• A LOT still 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 is very active
• 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/

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

  • 1.
    WebRTC and QUIC:how hard can it be? Lorenzo Miniero RTC.ON @ Krakow September 12, 2024
  • 2.
    Who am I? LorenzoMiniero • Ph.D @ UniNA • Chairman @ Meetecho • Main author of Janus Contacts and info • lorenzo@meetecho.com • https://fosstodon.org/@lminiero • https://www.meetecho.com • https://lminiero.it
  • 3.
    Just a fewwords 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
  • 4.
    Nice recent picturefrom Napoli...
  • 5.
    ... with afew familiar faces!
  • 6.
    QUIC has beenon my mind for a while...
  • 7.
    What’s QUIC andwhy does it matter?
  • 8.
    What’s QUIC andwhy does it matter?
  • 9.
    Learning about QUIC •Spread over different RFCs • https://datatracker.ietf.org/doc/html/rfc8999 (QUIC invariants) • https://datatracker.ietf.org/doc/html/rfc9000 (QUIC v1 itself) • https://datatracker.ietf.org/doc/html/rfc9001 (QUIC + TLS) • https://datatracker.ietf.org/doc/html/rfc9002 (Congestion control)
  • 10.
    Learning about QUIC •Spread over different RFCs • https://datatracker.ietf.org/doc/html/rfc8999 (QUIC invariants) • https://datatracker.ietf.org/doc/html/rfc9000 (QUIC v1 itself) • https://datatracker.ietf.org/doc/html/rfc9001 (QUIC + TLS) • https://datatracker.ietf.org/doc/html/rfc9002 (Congestion control) • Many related efforts • https://datatracker.ietf.org/doc/html/rfc9114 (HTTP/3) • https://datatracker.ietf.org/doc/html/rfc9204 (QPACK) • https://datatracker.ietf.org/doc/html/rfc9221 (DATAGRAM) • https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3 (WebTransport) • ...
  • 11.
    Learning about QUIC •Many existing implementations • https://github.com/ngtcp2/ngtcp2 (C) • https://github.com/private-octopus/picoquic (C) • https://github.com/litespeedtech/lsquic (C) • https://github.com/aiortc/aioquic (Python) • https://github.com/google/quiche (C++) • https://github.com/cloudflare/quiche (Rust) • https://github.com/quic-go/quic-go (Go) • ...
  • 12.
    Learning about QUIC •Many existing implementations • https://github.com/ngtcp2/ngtcp2 (C) • https://github.com/private-octopus/picoquic (C) • https://github.com/litespeedtech/lsquic (C) • https://github.com/aiortc/aioquic (Python) • https://github.com/google/quiche (C++) • https://github.com/cloudflare/quiche (Rust) • https://github.com/quic-go/quic-go (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/
  • 13.
    Implementing a QUICstack from scratch
  • 14.
    Spoiler alert: notthat easy... https://www.meetecho.com/blog/quic-journey/
  • 15.
    Starting from thebasics • Started with a basic parser • Familiarize with varint, connection IDs, QUIC transport parameters, header protection, ACK, message framing, etc.
  • 16.
    Starting from thebasics • 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
  • 17.
    Starting from thebasics • 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
  • 18.
    Starting from thebasics • 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 against aioquic • DoQ (DNS over QUIC) demo apps very helpful
  • 19.
    Adding support forWebTransport
  • 20.
  • 21.
  • 22.
    Having a lookat 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/
  • 23.
    Having a lookat 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)
  • 24.
    Having a lookat 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))
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
    Interop @ IETF120 Hackathon
  • 31.
    Interop @ IETF120 Hackathon
  • 32.
    A step further:Media Over QUIC (MoQ) • Low-latency media delivery solution for ingest/distribution of media • https://datatracker.ietf.org/group/moq/about/
  • 33.
    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 are Publisher, Subscriber and PubSub • Not that far from a cascaded SFU, if you’re familiar with WebRTC
  • 34.
    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 are Publisher, Subscriber and PubSub • 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
  • 35.
  • 36.
    Something a bitmore complex
  • 37.
  • 38.
    Implementation status • Differentimplementations (sometimes different MoQT versions) • https://github.com/kixelated/moq-rs (pub/sub/relay) • https://github.com/facebookexperimental/moxygen (relay) • https://github.com/Quicr/libquicr (relay/pub/sub) • https://github.com/facebookexperimental/moq-encoder-player (pub/sub) • https://github.com/kota-yata/media-over-quic-experiment (pub/sub) • https://github.com/mengelbart/gst-moq-app (pub/sub)
  • 39.
    Implementation status • Differentimplementations (sometimes different MoQT versions) • https://github.com/kixelated/moq-rs (pub/sub/relay) • https://github.com/facebookexperimental/moxygen (relay) • https://github.com/Quicr/libquicr (relay/pub/sub) • https://github.com/facebookexperimental/moq-encoder-player (pub/sub) • https://github.com/kota-yata/media-over-quic-experiment (pub/sub) • https://github.com/mengelbart/gst-moq-app (pub/sub) • 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!)
  • 40.
  • 41.
  • 42.
  • 43.
    Prototyping MoQ • IntegratingMoQ (both -03 and -04) in my test library itself • Leverages library core and events • Exposes MoQ-specific APIs to end user
  • 44.
    Prototyping MoQ • IntegratingMoQ (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’s moq-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)
  • 45.
    Prototyping MoQ • IntegratingMoQ (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’s moq-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’s moq-rs (clock, relay, subscribing to MP4 video) • Meta’s implementations (using relay, translating encoder/sender)
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
    MoQ + WebRTC(via Janus/imquic) https://www.meetecho.com/blog/moq-webrtc/
  • 52.
    MoQ + WebRTC(via Janus/imquic) https://www.meetecho.com/blog/moq-webrtc/
  • 53.
    MoQ + WebRTC(via Janus/imquic) https://www.meetecho.com/blog/moq-webrtc/
  • 54.
    Next steps • ALOT still to do • QUIC stack itself is incomplete (took some shortcuts to get here) • Retransmissions and flow/congestion control still missing
  • 55.
    Next steps • ALOT still 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 is very active • Specification changes often, thanks to feedback from implementations
  • 56.
    Next steps • ALOT still 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 is very active • 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!
  • 57.
    Next steps • ALOT still 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 is very active • 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
  • 58.
    Thanks! Questions? Comments? Contacts •https://fosstodon.org/@lminiero • https://x.com/elminiero • https://x.com/meetecho • https://www.meetecho.com/blog/