113 points · by Jarred · 6y ago · 66 comments
I can't find the video link, but the slides from that session are here: https://datatracker.ietf.org/meeting/106/materials/slides-10...
Webtransport is designed as a 'QUIC-native' client-server communication protocol to replace websockets. You can think of it like websockets but better (faster handshake, it reuses the http2 / QUIC connection, and you can relax websocket's reliability & ordering constraints). Or you can think of it as WebRTC, except way simpler for the 95% case where you want to communicate server/client.
I'm excited about it for browser based video games.
It looks complicated, but there's very little thats new here for browsers and web servers to implement. Remember QUIC is already built on top of UDP, and internally, QUIC supports basically all of webtransport's features natively. Webtransport mostly just re-exposes many of QUIC's features to applications. Browsers and HTTP servers are adding all that functionality anyway - so we may as well take advantage of it in our web applications.
My favorite criticism voiced at the IETF was the name - webtransport has nothing to do with the web, and its not a transport. Its mostly just an application API around some of QUIC's features, with fallbacks for HTTP 1.1 and HTTP2.
The remaining difference would be websockets having builtin frame delimiters and a meaning of text and binary frames - whereas with HTTP streams you would need to do that on the appliction level.
Getting Streaming APIs for HTTP was planned to be part of the ReadableStream and WritableStream extensions for fetch - but I have no idea how that effort went since I last looked at it (5 years ago).
HTTP is still very much geared towards request/response semantics, just sometimes serving requests you didn‘t yet know you want to make.
Also, WebTransport seems to be more of an extension of the idea of WebSockets to UDP and other reliability/ordering semantics than an outright replacement.
I am going to assume things will improve one HTTP/3 is finalised. But right now I dont see QUIC from non-google server at all.
And I cant help but think ( May be it is just me ), are we trying to over-engineer the Internet?
Edit: I just check on the clients side. Turns out Safari 14 may be the first browser to ship with HTTP/3 enabled by default.
You won't see webtransport appearing for awhile either. Its all still in draft status. The IETF doesn't rush these things.
And for what its worth, the spec for Webtransport is being worked on with close collaboration with the QUIC (HTTP/3) working group at the IETF. Everyone wants webtransport and QUIC to be a good fit for one another, and straightforward to implement in browsers once its ready.
I worry about over-engineering too; but the best way to express those fears is to get involved. Standards are written by those who show up. And the IETF welcomes anyone who's interested to join the mailing lists and attend IETF sessions. (So long as you accept the community norms.) Even the in-person events (when they come back) bend over backwards to welcome remote attendance and remote questions.
This is the video of the webtransport BoF session from Singapore last year, if you're curious how this sort of thing plays out in person. There were only about 25 people there:
https://play.conf.meetecho.com/Playout/?session=IETF106-WEBT...
Or the direct youtube link (without the text from remote participants): https://youtu.be/o5cJEuO2-vk
0. https://www.bram.us/2020/04/08/how-to-enable-http3-in-chrome...
1. https://mailarchive.ietf.org/arch/msg/quic/F7wvKGnA1FJasmaE3...
Is there anything wrong with websockets? I thought websockets were cool.
WebTransport works on HTTP/3 and exposes a part of the underlying UDP QUIC connection (while still allowing HTTP/3 messages to travel across the same underlying connection), allowing for stream-based or packet-based subconnections, reliable or unreliable. Basically, it’s a lot more flexible and doesn’t require setting up an entire new connection to work.
I'm excited for the option of having an unreliable connection. Currently you'd need to establish a webrtc data connection to the server, which is a bit cumbersome when you really don't need or want the rest of webrtc.
I might have just found a weekend project.
It addresses a number of the top comments here, e.g. why not just use WebRTC data channels:
"While WebRTC data channel has been used for client/server communications (e.g. for cloud gaming applications), this requires that the server endpoint implement several protocols uncommonly found on servers (ICE, DTLS, and SCTP) and that the application use a complex API (RTCPeerConnection) designed for a very different use case."
I can see this replacing most use cases of WebSockets once brought to ubiquity.
STUN, TURN, and ICE are a few technologies you need to understand to get started with WebRTC. I'd guess most folks aren't familiar when first looking into it.
The complexity is worth it if you're determined to push most bandwidth costs to clients like I am.
If you want near 100% connectivity at a lower complexity, WebSockets are almost always preferred.
This is just not something you run into with WebSockets.
I'd recommend simple-peer for anyone who does choose to use WebRTC. The maintainers are usually able to smooth these issues out in a reasonable timeframe. <3
channel = new RTCPeerConnection().createDataChannel("foo", {ordered: false})
Then you can read from it with: channel.onopen = () => { ... }
channel.onmessage = (event) => { ... }
This is widely supported in every modern browser.It's a simpler spec to solve a simpler problem. WebRTC is necessarily complex, but still overkill for a bunch of scenarios.
EDIT: bizarrely, I found this article on The Verge more descriptive of what metastream does than the website, WIKI and source code :-) [1].
1: https://www.theverge.com/2020/3/25/21191604/watch-movies-fri...
Specifically, how would this work for say, a PHP app that wants to stream stuff? I use https://reactphp.org/ for websockets in PHP (so I can have a shared codebase with my main app, etc).
I don't think I understand how this would look on the server-side. I'm interested to understand how it would look like to support this in Caddy (I'm one of the core contributors).
https://github.com/tinspin/rupy/wiki/Comet-Stream
The only thing that is annoying in the browser is that Chrome does not allow you to remove or change the User-Agent header which wastes a little bandwidth.
Rupy is a complete beast in terms of multi-core power, as long as the selector thread is not saturated it can scale linearly on all cores on shared memory = no memory copying or locks like all other solutions!
But the real upside is you get one process for async. HTTP (client and server), including database; which means you can use micro services the way they should be used by hosting all services on all machines and call them locally = more robust and less complex (no discovery after the initial client -> server DNS) completely without IO-wait!
WebSockets are completely over-engineered, as is HTTP/2 and 3...
So to answer your question: rupy is the final solution to internet servers. ;)
Now I'm working on the final solution for internet clients: http://talk.binarytask.com/task?id=5959519327505901449
And internet 2.0: http://radiomesh.org
And the final computer: http://talk.binarytask.com/task?id=8015986770003767235
WebSockets only works for the mere basics.
Also webrtc functionality is a superset of this so it's not a technically necessary protocol.
If anyone is wondering if this is already implemented anywhere, we're currently experimenting with it in Chrome: https://web.dev/quictransport/ -- I'd be curious to hear what people think about it.