diff --git a/quic/HOL_blocking.png b/quic/HOL_blocking.png new file mode 100644 index 0000000..1bfeba7 Binary files /dev/null and b/quic/HOL_blocking.png differ diff --git a/quic/Makefile b/quic/Makefile new file mode 100644 index 0000000..2976c5e --- /dev/null +++ b/quic/Makefile @@ -0,0 +1,11 @@ +all: + make slide slideshow + +slide: + pandoc -t beamer quic.md -f markdown-implicit_figures -V colorlinks=true -V linkcolor=blue -V urlcolor=red -o quic.pdf + +slideshow: + pandoc -t beamer quic.md -f markdown-implicit_figures -V colorlinks=true -V linkcolor=blue -V urlcolor=red -i -o quic-slideshow.pdf + +view: + zathura --mode=presentation quic.pdf & diff --git a/quic/quic-slideshow.pdf b/quic/quic-slideshow.pdf new file mode 100644 index 0000000..0ee09af Binary files /dev/null and b/quic/quic-slideshow.pdf differ diff --git a/quic/quic.md b/quic/quic.md new file mode 100644 index 0000000..81f514b --- /dev/null +++ b/quic/quic.md @@ -0,0 +1,177 @@ +--- +title: +- QUIC with GStreamer & Rust +author: +- Sanchayan Maity +theme: +- default +classoption: +- aspectratio=169 +--- + +# Who + +- Who am I? + * Embedded Systems background + * Prefer C, Haskell and Rust + * Organize and speak at Rust and Haskell meet-ups in Bangalore +- Work? + * Software Engineer @ [asymptotic](https://asymptotic.io/) + * Open source consulting firm based out of Bangalore and Toronto + * Work on low level systems software centred around multimedia + * GStreamer, PipeWire, PulseAudio + * Language Polyglots + + +# Open source contributions + +- [GStreamer](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests?scope=all&state=all&author_username=SanchayanMaity) +- [gst-plugins-rs](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests?scope=all&state=all&author_username=SanchayanMaity) +- [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests?scope=all&state=all&author_username=SanchayanMaity) +- [PulseAudio](https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests?scope=all&state=all&author_username=SanchayanMaity) +- [Linux](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=author&q=Sanchayan+Maity) +- [u-boot](https://source.denx.de/u-boot/u-boot/-/commits/master?search=Sanchayan%20Maity) + +# Agenda + +- QUIC which is a UDP-Based Multiplexed and Secure Transport and standardized in RFC 9000 +- Whirlwind tour of GStreamer +- QUIC implementations in Rust +- QUIC support in GStreamer +- Demo +- Future work + +# QUIC + +- QUIC is pronounced exactly like the English word "quick" +- Not an acronym +- Reliable and secure transport protocol +- Addresses some of the known shortcomings of doing HTTP/2 over TCP and TLS +- Standardized QUIC in RFC 9000 +- Supported by RFC 8999, RFC 9001 and RFC 9002 + +# Building on shoulders of giants + +- HTTP/2 [RFC7540](https://www.rfc-editor.org/rfc/rfc7540) published in May 2015 +- Makes use of multiplexing + - Multiple logical streams over same logical connection + - Better congestion control + - Makes better use of TCP with bandwidth saturation + - Less bandwidth consumption due to header compression + + +# Head of line blocking[^1] + +![*_HOL Blocking_*](HOL_blocking.png){width=80%} + + +[^1]: [Head of line blocking](https://en.wikipedia.org/wiki/Head-of-line_blocking) + +# Protocol + +- Something new? +- TCP? +- UDP? + +# Security/encryption + +- No clear text version of the protocol +- Negotiation employs cryptography and security with TLS 1.3 + +# QUIC + +- Implemented on top of UDP +- Uses UDP port numbers +- Implements re-transmission, congestion control among others +- Logical streams similar to HTTP/2 + - In-order + - Reliable + - Different streams can be out-of-order +- Flow control +- Fast handshakes (0-RTT and 1-RTT) + +# GStreamer + +- Multiplatform Pipeline based multimedia framework +- Bindings for various languages +- Allows building complex media processing workflows +- Some applications + * PiTiVi (Video Editor) + * amaroK, Banshee, Clementine (audio players) + * Empathy (VOIP and video conferencing) + * GstLAL (gravitational wave data analysis) + * Rygel (DLNA streaming server and renderer) + * Totem (movie player for the GNOME desktop) + + +# Simple pipeline + + ```bash + gst-launch-1.0 videotestsrc ! autovideosink + gst-launch-1.0 audiotestsrc ! autoaudiosink + ``` + +# Media pipeline[^2] + +![*_Simple Player_*](simple-player.png){width=80%} + +[^2]: [Dynamic Pipelines](https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c) + +# Rust implementations + +- [quinn-rs](https://github.com/quinn-rs/quinn) +- [quiche](https://github.com/cloudflare/quiche) +- [s2n-quic](https://github.com/aws/s2n-quic) +- [neqo](https://github.com/mozilla/neqo) +- [msquic](https://github.com/microsoft/msquic) + +# QUIC in GStreamer + +- Prior work + - [gst-quic-transport](https://github.com/bbc/gst-quic-transport) +- `quinnquicsink` and `quinnquicsrc` (Merged just a month ago) +- Written in Rust +- Uses [quinn-rs](https://github.com/quinn-rs/quinn) +- New elements `quinnquicmux` and `quinnquicdemux` to support stream multiplexing + +# Audio demo + +```bash +gst-launch-1.0 -v -e audiotestsrc blocksize=4096 ! \ +audio/x-raw,format=S16LE,rate=48000,channels=2,layout=interleaved ! \ +opusenc ! quinnquicsink use-datagram=false secure-connection=false +``` + +```bash +gst-launch-1.0 -v -e audiotestsrc blocksize=4096 ! \ +audio/x-raw,format=S16LE,rate=48000,channels=2,layout=interleaved ! \ +opusenc ! quinnquicsink use-datagram=false secure-connection=false +``` + +# Video demo + +[quin-quic-mux](https://git.sanchayanmaity.net/sanchayanmaity/quinn-quic-mux) + +- Shows stream and datagram multiplexed on same connection +- Merge request: [!1634](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1634) + +# Future work + +- Handling flow control +- Congestion control +- [RTP over QUIC](https://datatracker.ietf.org/doc/draft-ietf-avtcore-rtp-over-quic/) +- [Media over QUIC](https://datatracker.ietf.org/group/moq/about/) + +# References + +- [RFC 9000](https://www.rfc-editor.org/rfc/rfc9000.html) +- [Road to QUIC](https://blog.cloudflare.com/the-road-to-quic) +- [0-RTT](https://blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption/) + +# Questions + +- Reach out on + * Email: sanchayan@sanchayanmaity.net + * Mastodon: [sanchayanmaity.com](https://sanchayanmaity.com/@sanchayan) + * Telegram: https://t.me/SanchayanMaity + * Blog: [sanchayanmaity.net](https://sanchayanmaity.net/) diff --git a/quic/quic.pdf b/quic/quic.pdf new file mode 100644 index 0000000..d6b998c Binary files /dev/null and b/quic/quic.pdf differ diff --git a/quic/simple-player.png b/quic/simple-player.png new file mode 100644 index 0000000..b3b3ca1 Binary files /dev/null and b/quic/simple-player.png differ