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

Connection sharing/pooling #128

Closed
aboba opened this issue Jul 24, 2020 · 14 comments
Closed

Connection sharing/pooling #128

aboba opened this issue Jul 24, 2020 · 14 comments
Labels
Discuss at next meeting Flags an issue to be discussed at the next WG working

Comments

@aboba
Copy link
Collaborator

aboba commented Jul 24, 2020

The text in Section 14.2.1 lacks clarity on sharing/pooling of HTTP/3 connections:

"Either establish an HTTP/3 connection or reuse an existing HTTP/3 connection to the host specificed by the url, as specified in [WEB-TRANSPORT-HTTP3]."

Does this mean that an HTTP/3 connection created by fetch will be reused if an Http3Transport is constructed to the same host? Or is the text only applicable to reuse of connections constructed by Http3Transport? Is it possible for a QUIC connection previously created by the QuicTransport constructor to the same host to be reused by Http3Transport?

@yutakahirano
Copy link
Contributor

https://fetch.spec.whatwg.org/#connections has some logic about connection, so we need to talk with @annevk.

@annevk
Copy link
Member

annevk commented Oct 22, 2020

Thanks for flagging me, I think that the right thing to do would be to integrate with that section in Fetch and given the questions raised in OP that may or may not need some changes to better accommodate your requirements.

(There are some risks with giving pages detailed control over connections as they can use the user agent/OS global limit as communication channel, but I'm not entirely sure if this API would make the status quo worse.)

@aboba
Copy link
Collaborator Author

aboba commented Nov 9, 2020

There is some complexity here that goes beyond what is in Fetch. For example, Http3Transport requires support for HTTP/3 Datagrams, whereas a connection set up to handle a conventional HTTP/3 Request/Response will not. This means that WebTransport cannot necessarily reuse an existing HTTP/3 connection to the same Origin if that connection was not negotiated for use with WebTransport.

@annevk
Copy link
Member

annevk commented Nov 10, 2020

And the other way around? In any event, it seems feasible to add conditions as an optional parameter to "obtain a connection" or something equivalent. It seems nice to keep establishing connections somewhat centralized so any security/privacy considerations that end up changing how they are allocated (such as the ongoing state partitioning effort) end up affecting all. (There might still be work to do here when it comes to WebRTC, not sure.)

@aboba
Copy link
Collaborator Author

aboba commented Jan 19, 2021

This issue needs to take into account whether the client has disabled pooling and whether the origin allows pooling.

@aboba
Copy link
Collaborator Author

aboba commented Feb 4, 2021

@jan-ivar Do we still believe that this issue is "ready for PR"? Using Fetch as a model, it wouldn't seem to difficult to come up with a PR, but wanted to check if that is everyone's understanding.

@jan-ivar
Copy link
Member

jan-ivar commented Feb 4, 2021

Hmm, looks like I labeled it and assigned it to @yutakahirano at the second TPAC meeting. Unfortunately, I don't recall the reason, and now wish I'd left a comment. We can go back and look at the meeting I suppose. Does anyone else remember?

@aboba
Copy link
Collaborator Author

aboba commented Feb 4, 2021

At the time, pooling didn't seem particularly controversial. Some concerns were subsequently raised at the IETF WebTransport WG interim meeting (e.g. enabling control of pooling in the API as well as on the server). But I think it's still possible to compose a PR although it might take a bit of back and forth before we're ready to merge it.

@yutakahirano
Copy link
Contributor

Sorry for the long silence. I'm planning something like the following:

  • Send SETTINGS_ENABLE_WEBTRANSPORT and H3_DATAGRAM SETTINGS when we obtain a connection in the fetch spec.
  • Define "webtransport ready" in the WebTransport spec.
    • A connection is webtransport ready if it has received SETTINGS_ENABLE_WEBTRANSPORT and H3_DATAGRAM SETTINGS.

Do they make sense?

@annevk
Copy link
Member

annevk commented Feb 9, 2021

I think you also need to pass a parameter to "obtain a connection" to essentially demand a "webtransport ready" connection (in which case you might not have to define it in WebTransport?).

@aboba
Copy link
Collaborator Author

aboba commented Feb 17, 2021

@annevk I am not sure whether a QUIC connection established for use with WebTransport can be reused for HTTP/3 Request/Response. While negotiating support for HTTP/3 datagrams would not preclude this, HTTP/3 Request/Response and WebTransport would need to cooperate in allocation and use of stream IDs. IMHO, it would be good to figure out if this is possible and if not, whether changes to the HTTP/3 specification could make it possible.

@yutakahirano I think we need to add an (optional) WebTransport constructor argument to disable pooling. Also, an internal slot that indicates whether a WebTransport connection once established supports pooling. At the January 2021 WEBTRANS WG interim, it was agreed that a server supporting WebTransport could refuse to support pooling, in which case the internal slot would indicate that the connection could not be pooled. At present, I believe that support for HTTP/3 Datagrams is required for successful negotiation of a WebTransport connection.

annevk pushed a commit to whatwg/fetch that referenced this issue Mar 4, 2021
@wilaw wilaw added the Discuss at next meeting Flags an issue to be discussed at the next WG working label Mar 10, 2021
yutakahirano added a commit that referenced this issue Mar 16, 2021
This is for #128.

 - Introduce WebTransportOptions.dedicated.
 - Initialize a connection with
   https://fetch.spec.whatwg.org/#concept-connection-obtain.
 - (Bonus) Introduce WebTransport.Closed and reject it when the
   connection establishment fails.
github-actions bot added a commit that referenced this issue Mar 16, 2021
)

This is for #128.

 - Introduce WebTransportOptions.dedicated.
 - Initialize a connection with
   https://fetch.spec.whatwg.org/#concept-connection-obtain.
 - (Bonus) Introduce WebTransport.Closed and reject it when the
   connection establishment fails.

SHA: 02a7570
Reason: push, by @yutakahirano

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@wilaw wilaw removed the Discuss at next meeting Flags an issue to be discussed at the next WG working label Mar 31, 2021
@yutakahirano yutakahirano added this to the Uncategorized Future milestone Jun 30, 2021
@yutakahirano
Copy link
Contributor

@yutakahirano I think we need to add an (optional) WebTransport constructor argument to disable pooling. Also, an internal slot that indicates whether a WebTransport connection once established supports pooling. At the January 2021 WEBTRANS WG interim, it was agreed that a server supporting WebTransport could refuse to support pooling, in which case the internal slot would indicate that the connection could not be pooled.

@aboba and @vasilvv, has this been already specified in the protocol side? I assume this should be specified at https://ietf-wg-webtrans.github.io/draft-ietf-webtrans-http3/draft-ietf-webtrans-http3.html#name-http-3-settings-parameter-r but I see nothing about it.

@jan-ivar
Copy link
Member

jan-ivar commented Aug 2, 2022

Meeting:

  • allowPooling is already in the API and defaults to false so we can probably close this.
  • The remaining issue is determining whether pooling is supported on a connection.
  • Do we want to pass up the number of concurrent sessions? or a boolean? This may be a privacy issue and leak information about other tabs. So maybe no.
  • We can expose how much is allowed or a boolean.
  • Keep this issue open to track the situation in the protocol.
  • Add a comment to issue 34 in the HTTP/3 draft asking if this is resolved or not?

@yutakahirano yutakahirano removed their assignment Aug 2, 2022
@wilaw wilaw added Discuss at next meeting Flags an issue to be discussed at the next WG working and removed Ready for PR labels Jun 3, 2024
@jan-ivar
Copy link
Member

Meeting:

  • fetch spec is good wrt to pooling of HTTP/3 connections
  • @ekinnear to open an issue on fetch to handle HTTP/2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discuss at next meeting Flags an issue to be discussed at the next WG working
Projects
None yet
Development

No branches or pull requests

5 participants