Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WebTransport (QUICTransport) API #9017

Open
starkpsmichael opened this issue Jan 5, 2021 · 25 comments
Open

Implement WebTransport (QUICTransport) API #9017

starkpsmichael opened this issue Jan 5, 2021 · 25 comments
Labels
runtime Relates to code in the runtime crate suggestion suggestions for new features (yet to be agreed)

Comments

@starkpsmichael
Copy link

starkpsmichael commented Jan 5, 2021

Once we have QUIC support implemented, we should consider implementing the WebTransport API.

A long way to go, but just to have a place for discussions for this feature.

More informations:

@starkpsmichael starkpsmichael changed the title Implement WebTransport API Implement WebTransport (QuicTransport) API Jan 5, 2021
@starkpsmichael starkpsmichael changed the title Implement WebTransport (QuicTransport) API Implement WebTransport (QUICTransport) API Jan 5, 2021
@stale
Copy link

stale bot commented Mar 7, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 7, 2021
@stale stale bot closed this as completed Mar 14, 2021
@ry ry reopened this Mar 14, 2021
@stale stale bot removed the stale label Mar 14, 2021
@kitsonk kitsonk added cli related to cli/ dir suggestion suggestions for new features (yet to be agreed) runtime Relates to code in the runtime crate and removed cli related to cli/ dir labels Mar 14, 2021
@lucsoft
Copy link

lucsoft commented Oct 20, 2021

Info: WebTransport will land in Chrome stable in 76 days (Jan 4).
If everything goes as planned

@ekanna
Copy link

ekanna commented Jan 5, 2022

Info: Webtransport landed in chrome 97

@mreinstein
Copy link
Contributor

ieft just published rfc for http/3 : https://www.theregister.com/2022/06/07/http3_rfc_9114_published/

And just to add more acronyms, omg, bbq, wtf

@realtimetodie
Copy link
Contributor

I am working on this

https://github.com/diceride/deno/tree/feat-ext-webtransport

@tom-sherman
Copy link

How does this feature relate to WebSocketStream that has already shipped and available in deno unstable?

As far as I understand WebTransport is a superset of WebSocketStream? The latter only supporting backpressure ontop of the existing WebSocket spec (ie. ordered messages).

@mreinstein
Copy link
Contributor

How does this feature relate to WebSocketStream that has already shipped and available in deno

Really good question! WebSocketStream provides a way to have back pressure and other elegant streaming primitives via traditional websockets.

Web sockets are TCP based, and WebTransport is UDP based. It's usually presented as a tradeoff between reliable, ordered messages and unreliable but lower latency message delivery. e.g., most commercial multiplayer video games and video streaming apps are built upon UDP because latency is one of the biggest problems with these kinds of networked applications.

WebTransport's inclusion in deno will open up a new class of real-time apps, without having to resort to messy hacks like using WebRTC on the server, or having Websocket<->udp socket bridge apps.

@tom-sherman
Copy link

tom-sherman commented Jan 27, 2023

Web sockets are TCP based, and WebTransport is UDP based.

WebTransport also supports reliable delivery (TCP) via transport.datagrams. This API is essentially the same as WebSocketStream infact.

I suppose what I'm getting at is this: WebTransport seems to be a superset of WebSocketStream, and be mature with regards to its specification.

Has the Deno team considered proceeding with a WebTransport implementation instead of promoting WebSocketStream to stable?

@mreinstein
Copy link
Contributor

datagrams are not reliable or ordered. UDP packets are typically datagrams (User Datagram Protocol). This is the key difference between websockets and webtransport.

WebTransport seems to be a superset of WebSocketStream

It's not. Under the hood they are fundamentally different transport protocols

Has the Deno team considered proceeding with a WebTransport implementation instead of promoting WebSocketStream to stable?

They are complementary; WebSocketStream is good for handling traditional websockets as streams, and WebTransport is good for enabling UDP.

@mreinstein
Copy link
Contributor

Although technically if we want to get into the fine details, WebTransport is not pure UDP access either. It's another protocol that offers things on top of UDP, such as TLS encryption.

@tom-sherman
Copy link

tom-sherman commented Jan 27, 2023

Ah, apologies. I got this mixed up with streams portion of the API. From the web.dev explainer:

WebSockets communications are modeled around a single, reliable, ordered stream of messages, which is fine for some types of communication needs. If you need those characteristics, then WebTransport's streams APIs can provide them as well.

I don't see how then this can't replace WebSocketStreams as again, it seems to be a superset.

@mreinstein
Copy link
Contributor

https://www.lifesize.com/blog/tcp-vs-udp/

think of websockets as the tcp example, and webtransport as the udp example

@tom-sherman
Copy link

@mreinstein it is a superset tho 😅

https://web.dev/webtransport/#stream

@mreinstein
Copy link
Contributor

mreinstein commented Jan 27, 2023

I understand what you mean now. There does appear to be a reliably-ordered stream API described in this explainer doc.

I'm not sure though that because both websocket streams and webtransport streams provide a similar api that webtransport is truly a superset. Under the hood they are still completely different transports, with different network behavior.

Maybe the better question is why shouldn't deno support both WebSocketStreams and WebTransport? They are both legitimate web apis with different use cases.

@realtimetodie
Copy link
Contributor

No, WebTransport is neither a super-set of WebSocketStream nor are these Web APIs related. They are based on different networking protocols.

@realtimetodie
Copy link
Contributor

The implementation should be finished by next week. I just need to get my ass up. No one is paying me for doing this and I'm just a simple blue-collar worker. I clean floors and move pallets within a warehouse. Computer programming is my hobby. I'm usually just too exhausted at the end of day.

@o-t-w
Copy link

o-t-w commented Mar 17, 2023

There's a relevant discussion here WebKit/standards-positions#18
Both WebTransport and WebSocketStream are only prospective web standards at this point. Deno should only stabilise things that are actually standards rather than Chrome only. WebTransport is a draft spec, WebSocketStream doesn't even have a spec.

@petamoriken
Copy link
Contributor

Deno should only stabilise things that are actually standards rather than Chrome only.

It makes sense. However, since Firefox will also implement WebTransport, it will soon become a web standard.
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/fe76d1e4-cd4c-be11-99d2-6a58550b39dd%40mozilla.com

@o-t-w
Copy link

o-t-w commented Apr 4, 2023

Safari have now officially marked their position as "support". Also enabled in Firefox Nightly.

@lucsoft
Copy link

lucsoft commented Apr 4, 2023

Quic is really the next big thing and I hope that the new flash server "rewrite" will have quic support.

@SOVLOOKUP
Copy link

https://github.com/BiagioFesta/wtransport

@lucsoft
Copy link

lucsoft commented Oct 29, 2023

If HTTP3 is the current blocker for this feature wouldn't it be more beneficial for everyone if the first version would be WebTransport over HTTP2 and then when the time comes adding HTTP3 to it?

@mreinstein
Copy link
Contributor

the first version would be WebTransport over HTTP2

That doesn't provide benefit because HTTP/2 lacks a non-TCP transport mode. Anything based on HTTP/2 would effectively have identical latency characteristics to websockets. The point of WebTransport is it gives you a UDP based delivery with encryption.

@lucsoft
Copy link

lucsoft commented Oct 30, 2023

@mreinstein thats a myth quic is kinda like tcp on udp (simplified).
Because pure UDP could lead into data loss or out of order and so on.
So if you run it TCP you still get all the new stream based API features and stuff like back pressure.
The only effect would be datagrams as that is intended to be "unreliable".

@mreinstein
Copy link
Contributor

thats a myth quic is kinda like tcp on udp (simplified).

It's not a myth, and it's documented pretty clearly, in both the chrome intro article:
https://developer.chrome.com/articles/webtransport/#datagram

As well as the mdn docs:
https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime Relates to code in the runtime crate suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests