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

HTTP/QUIC without Alt-Svc? #253

Closed
MikeBishop opened this issue Jan 31, 2017 · 59 comments · Fixed by #3558
Closed

HTTP/QUIC without Alt-Svc? #253

MikeBishop opened this issue Jan 31, 2017 · 59 comments · Fixed by #3558
Assignees
Labels
-http design has-consensus

Comments

@MikeBishop
Copy link
Contributor

@MikeBishop MikeBishop commented Jan 31, 2017

While HTTP/QUIC doesn't formally require a client to implement Alt-Svc, there's no discovery mechanism other than Alt-Svc provided, so you're not going to get very far without it. That makes a full HTTP(/TLS)/TCP stack mandatory simply to open the connection in the first place. For various reasons (e.g. an embedded device in a controlled environment), a client might want to dispense with TCP altogether when it knows that the endpoint will support QUIC. It might also be useful in testing to be able to directly reference a QUIC endpoint.

Should we mint new scheme(s) that allows direct reference to a resource served exclusively over HTTP/QUIC?

(Note, in HTTP/2 the answer was "no," because HTTP/2 could be negotiated using the same TCP connection. QUIC doesn't have that luxury.)

@MikeBishop MikeBishop added design -http labels Jan 31, 2017
@martinthomson
Copy link
Member

@martinthomson martinthomson commented Jan 31, 2017

I'm thinking that the answer is "no" here as well. Developing a way to provide supplementary annotations on links would be less reliable, but ultimately more likely to succeed.

@LPardue
Copy link
Member

@LPardue LPardue commented Feb 1, 2017

I agree with the opinions about new scheme(s). However, it does seem a shame to have this implicit dependency on Alt-Svc delivered by HTTP. By my understanding of Alt-Svc, the origin would have the requirement of offering resources via HTTP(/TLS)/TCP in perpetuity. That seems a bit unfair to me.

I recall some talk about TCP fallback (e.g. at the QUIC BoF IETF 96). No text currently in WG docs seem to require this though. the closest is in the HTTP/QUIC mapping:

Connectivity problems (e.g. firewall blocking UDP) may result in QUIC connection
establishment failure, in which case the client should gracefully fall back to
HTTP/2.

If TCP fallback is not actually required, and a solution can be found to directly open QUIC connections then there is a route to deprecate HTTP(/TLS)/TCP. Similarly, constrained devices that want to operate without HTTP(/TLS)/TCP could do so, bearing the risk of %N connection failure rate.

Forgive this stupid question: is there text somewhere in an RFC that requires a client accessing resources with a https scheme to use TCP? I appreciate the scheme is described in terms of TCP and port 443 but wonder if there is anything preventing a client from trying their luck on opening a QUIC connection whenever it sees a https scheme? ( a more sensible whitelist approach could also be taken). Perhaps this is more suited to an implementation debug feature, which supports Mike's testing ideas.

Forgive this other stupid question: what about other application-layer protocols over QUIC? Do they also have an implicit dependency on Alt-Svc, or is that totally inappropriate?

@martinthomson
Copy link
Member

@martinthomson martinthomson commented Feb 1, 2017

Other protocols have their own bootstrapping problems. Too much depends on context to be sure. For instance, migrating something like FTP might be tricky and something akin to Alt-Svc might be the most practical approach. On the other hand, migrating RTP probably won't have problems in this area because it uses a signaling protocol for setup (RTP would have a host of other problems, of course).

@mcmanus
Copy link
Contributor

@mcmanus mcmanus commented Feb 1, 2017

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Feb 1, 2017

We already have different URLs for things that might/might not be interchangeable. When you use Alt-Svc between an http:// origin and an https:// endpoint, you're declaring that they're either interchangeable or you can properly process the distinction.

I can envision several scenarios where either server or client won't want to carry a full HTTP/TLS/TCP stack simply for bootstrapping, when they already know both peers will support HTTP/QUIC. Maybe authenticated SRV is the path forward, but it seems like the simplest would be something like:

HTTP/QUIC is differentiated from HTTP and HTTPS URIs by using the 'httpq' protocol identifier in place of the 'http' or 'https' protocol identifier. An example URI specifying HTTP/QUIC is httpq://www.example.com/~smith/home.html. Origins which serve the same content over HTTP/QUIC and HTTPS SHOULD provide an Alt-Svc header on the HTTPS endpoint declaring that the resource can be obtained over QUIC as well, and SHOULD NOT reference URIs with the 'httpq' scheme in responses to 'http' or 'https' requests. Such origins MAY consider 'https' and 'httpq' to be equivalent while processing requests.

Note that I don't expect this to be used in browser-land anytime soon, if ever. httpq:// would be inaccessible to legacy browsers, and you'd be cutting off a substantial portion of the web from following the link. However, I think for non-browser scenarios and for testing, there should be a way to explicitly describe a QUIC endpoint.

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Feb 1, 2017

Oh, and @LPardue: RFC 2818 says in Section 2.3:

When HTTP/TLS is being run over a TCP/IP connection, the default port is 443. This does not preclude HTTP/TLS from being run over another transport. TLS only presumes a reliable connection-oriented data stream.

RFC 7230 updates this by saying:

The "https" URI scheme is hereby defined for the purpose of minting identifiers according to their association with the hierarchical namespace governed by a potential HTTP origin server listening to a given TCP port for TLS-secured connections ([RFC5246]).

All of the requirements listed above for the "http" scheme are also requirements for the "https" scheme, except that TCP port 443 is the default if the port subcomponent is empty or not given....

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Feb 1, 2017

Also in RFC 7230:

Although HTTP is independent of the transport protocol, the "http" scheme is specific to TCP-based services because the name delegation process depends on TCP for establishing authority. An HTTP service based on some other underlying connection protocol would presumably be identified using a different URI scheme....

@LPardue
Copy link
Member

@LPardue LPardue commented Feb 1, 2017

@MikeBishop thanks for these, really interesting food for thought

@mcmanus
Copy link
Contributor

@mcmanus mcmanus commented Feb 2, 2017

@LPardue
Copy link
Member

@LPardue LPardue commented Feb 2, 2017

@mcmanus
Copy link
Contributor

@mcmanus mcmanus commented Feb 2, 2017

@hardie
Copy link

@hardie hardie commented Feb 2, 2017

@LPardue
Copy link
Member

@LPardue LPardue commented Feb 3, 2017

In the non-conservative case, this seems to me somewhat of an implementation choice. For a client that wants to retrieve https://www.example.org/example.txt:

Zero knowledge of hqm availability

  • Client supports hqm and HTTPS in preference order. Race the hqm and HTTPS connections to the same host:

    • If hqm fails, use the HTTPS connection
      • If the HTTPS connection includes Alt-Svc for hqm on the same host, ignore it. The client already knows that hqm connectivity is not achievable.
      • If the HTTPS connection includes Alt-Svc for hqm on a different host, intelligently decide if its worth setting this up in the background for switch-over (e.g if the host resolves to the same IP, chances are hqm would fail again)
        ii. If hqm succeeds, tear-down the HTTPS connection
  • Client supports hqm only. Tries to connect to host using hqm:

    • If hqm fails, tough luck
    • If hqm succeeds, happy days

Prior knowledge of hqm availability via Alt-Svc

A client that has received Alt-Svc indicating hqm for an alternative that is still fresh:

  • Client supports hqm and HTTPS in preference order. Tries to connect to the alternative using hqm:

    • If hqm fails, invoke Alt-Svc fall back (origin or alternates, hqm or HTTPS)
    • If hqm succeeds, happy days
  • Client supports hqm only. Tries to connect to the alternative using hqm:

    • If hqm fails, invoke Alt-Svc fall back (origin or alternates, hqm)
    • If hqm succeeds, happy days

Prior knowledge of hqm availability by other means

I.e. managed networks, whitelists etc

  • Client supports hqm and HTTPS in preference order. Tries to connect to the host using hqm:

    • If hqm fails, depend on prior knowledge to determine if the host supports HTTPS (or always try HTTPS fallback)
    • If hqm succeeds, happy days
  • Client supports hqm only. Tries to connect to the host using hqm:

    • If hqm fails, tough luck
    • If hqm succeeds, happy days

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Feb 3, 2017

@mcmanus, I'd agree that we don't need to update 7230 to allow QUIC. The authoritative endpoint for an https origin is a TCP port, and Alt-Svc allows that authoritative endpoint to delegate to different endpoints -- other hosts, other ports, other protocols. But the authoritative endpoint is always TCP to the port given in the URL. That's why we're able to use the same scheme and avoid all the branching of stuff underneath it; the origin hasn't changed.

But when there's a service in which the authoritative endpoint is over QUIC -- a device-to-device REST API, or a device's configuration page -- then that requires a different way to express it. I'd be fine with something like https://www.example.com:q443/, except that RFC 2396 restricts the port number to digits only. (It's a little odd, in retrospect, that 2396 describes things in terms of IP and port, with no notion of ports being specific to their transport.) @hardie is right that we're not defining a different name-delegation process here.

I'm leary of saying that clients should (or SHOULD, or even MAY) guess that an origin might be available elsewhere without a way to know that. That's a proposition we rejected when discussing how to find TLS-protected equivalents to http:// origins.

Sure, we could put a checkbox in the UI or a parameter in the config file that says "'https' doesn't mean what you think it means," then couple that with "prior knowledge" language in the spec. But it just seems cleaner to designate a scheme that's semantically equivalent to 'https' except that the ports in the URI are relative to a different transport protocol.

@RyanTheOptimist
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist commented Feb 7, 2017

One example of such an "authoritative endpoint is over QUIC" is a QUIC proxy. That is to say, a semantically "HTTP proxy' which one speaks to via QUIC. Chrome today, for example, can be configured to speak QUIC to a proxy by using the "scheme" "quic" in the proxy.pac function.

@martinthomson
Copy link
Member

@martinthomson martinthomson commented Feb 7, 2017

Why don't you use ALTSVC at the proxy? It's not like proxy setup is a commonplace action. A new scheme isn't something one does lightly.

@RyanTheOptimist
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist commented Feb 7, 2017

@martinthomson
Copy link
Member

@martinthomson martinthomson commented Feb 7, 2017

An ALTSVC frame should work for the proxy if the intent was to move the proxy. The ALTSVC frame is processed hop-by-hop. I don't know how well that use case has been tested, but it should be possible to advertise an alternative for the proxy origin.

And as far as the proxy goes, don't you have to deploy a TCP variant for now and into the foreseeable future if you want to have it work? It's just like any other service, I'd imagine, and the h2 server stack isn't that much extra to have.

@RyanTheOptimist
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist commented Feb 8, 2017

I thought we had a discussion about Alt-Svc plus proxies which concluded that Alt-Svc is not for finding proxies:

httpwg/http-extensions#62

quoth mnot:

"Yeah. Alt-Sv is for finding an origin, not for finding a proxy -- a proxy might use it, though.
This should all be clear based upon reading of RFC7230, but if not we could add a sentence or two to clarify."

So I don't think Alt-Svc applies here.

@LPardue
Copy link
Member

@LPardue LPardue commented Feb 8, 2017

@RyanTheOptimist
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist commented Feb 8, 2017

It's an "HTTP proxy" that the client speaks to via QUIC, I guess you could say. This is similar to the "https" proxy scheme that chrome supports when it wants to talk to an "HTTP proxy" over a TLS connection (which may result in an HTTP/2 connection to the proxy as the result of ALPN)

@LPardue
Copy link
Member

@LPardue LPardue commented Feb 8, 2017

@martinthomson
Copy link
Member

@martinthomson martinthomson commented Feb 8, 2017

@LPardue, yeah, that's an old discussion. A client makes a decision to use the proxy first, which results in ignoring Alt-Svc. See RFC 7838.

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Mar 28, 2017

We've talked about four routes here:

  1. Long live TCP. All HTTP sites will be dual-stack, and the authoritative endpoint will be TCP. Clients MUST have a way to find the secure delegation from that TCP endpoint to QUIC, though we might define alternatives to Alt-Svc headers which could be done without TCP. (Alt-Svc in DNS?)

  2. Update RFC3986. RFC 3986 explicitly states that "The type of port designated by the port number (e.g., TCP, UDP, SCTP) is defined by the URI scheme." We could update the URI to contain a protocol designator, whose default is defined by the URI scheme. As it would be omitted in all existing URIs, their interpretation remains unchanged. Then https://www.example.com:q443/ refers to QUIC on UDP 443.

  3. Define a new scheme. See pull request.

  4. What's it matter? Assume that HTTP/QUIC on port 443 is likely equivalent to HTTP/TCP on port 443 if the cert is valid and call it good.

We explicitly do not consider the same host on different ports equivalent authorities, even if they happen to be listening on both ports with the same cert. Why is TCP 443 vs. UDP 443 any different from TCP 443 vs. TCP 444? (4) seems like a security issue waiting to happen.

I'm going to reverse myself and disagree that (3) is undeployable on the web in the near-term. App-to-app handoff on many (most?) platforms now uses custom URI schemes. Apps that encounter unknown URI schemes ask the OS; the OS is able to invoke appropriately-registered apps or tell the user they need to get a capable app. E.g. launching "nonsense://" produces this on Win10:

image

Some cursory testing shows that browsers block navigations to URI schemes that don't have an OS-registered handler. But if you have two browsers, one QUIC-capable and one not, when you click an httpq:// link in the non-QUIC browser the OS will launch the QUIC-capable browser for you and you proceed on your merry way. This seems almost exactly what we'd want to have happen.

(2) probably is undeployable, because legacy apps will attempt to parse the URI and declare it invalid. They're semi-used to seeing unknown schemes (xboxliveapp-1297287741://, anyone?), but changes that break the parsers would be seriously painful.

@enygren
Copy link

@enygren enygren commented Mar 31, 2017

What about extending the HTTP URI syntax in a way to give connection hints?
For example (very likely not the right syntax):

  https://www.example.com#svc=hq.443/

Where in the above example, the Origin (and thus host header and SNI) would come from the part before the "#". On failure to connect, a TCP connect (ie without the hint) could also be used. Cache entries would not include the part following the # as part of the cache key.

This is a variant of option 2, but with the difference that the Origin and object cache keys aren't impacted. This is only appropriate for secured connections (eg, TLS / HTTPS).

@martinthomson
Copy link
Member

@martinthomson martinthomson commented Mar 31, 2017

We can't reasonably change the semantics of any of the fields of the URI: we have to assume that any valid field is in use and that an invalid field would trigger rejection.

(e.g., your example syntax would turn into https://www.example.com when passed to a client that didn't understand this. Or, from another angle, that syntax is already a valid HTTPS URI with clear semantics.)

@ThomasSwindells
Copy link

@ThomasSwindells ThomasSwindells commented Apr 7, 2017

@MikeBishop MikeBishop added this to Relationship to HTTP/TCP in HTTP / QPACK Jan 31, 2019
@MikeBishop MikeBishop removed the future-version label Jan 31, 2019
@martinthomson
Copy link
Member

@martinthomson martinthomson commented Jan 31, 2019

FYI, I just opened httpwg/http-core#194

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Jan 31, 2019

Discussed in Tokyo; this needs to be resolved by the HTTP WG, and we need to incorporate their resolution into the doc.

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Jun 3, 2019

Discussed in London; still waiting for text from httpwg/http-core#194.

@quicwg quicwg deleted a comment from fbifido Nov 7, 2019
@LPardue
Copy link
Member

@LPardue LPardue commented Nov 8, 2019

3 Jun

Discussed in London; still waiting for text from httpwg/http-core#194.

on 194

mnot closed this on 20 Aug

so are we waiting for something else now?

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Nov 8, 2019

httpwg/http-core#194 was split into separate issues; the piece we need is now httpwg/http-core#237.

@larseggert
Copy link
Member

@larseggert larseggert commented Feb 5, 2020

Discussed in ZRH. Waiting for HTTP changes to materialize.

@vrubleg
Copy link

@vrubleg vrubleg commented Feb 8, 2020

Could you please describe in a couple of sentences what you decided in ZRH? Just for people who are curious what is happening with these new promising web standards.

IMHO, the best possible solution is to introduce HTTP-specific DNS record which will describe available HTTP versions as well as the preferred one. It even could be used to make an actual HTTP/3 connection when a user opens an http:// URL. So, even old HTTP links to a website which moved to HTTPS recently will be opened through HTTPS.

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Feb 11, 2020

Short version: The http-core draft is contemplating changes that describe the authoritative endpoint as being any endpoint that has the right certificate. Alt-Svc and other mechanisms can give you additional ways to discover an authoritative endpoint to send requests to.

As to a DNS record, please see the SVCB and HTTPS records (naming still TBD) which have been adopted by DNSop, which support exposing whether an endpoint supports TLS/TCP or QUIC.

@MikeBishop
Copy link
Contributor Author

@MikeBishop MikeBishop commented Feb 24, 2020

http-core PR is merged

@MikeBishop MikeBishop added the proposal-ready label Apr 2, 2020
@project-bot project-bot bot moved this from Design Issues to Consensus Emerging in Late Stage Processing Apr 2, 2020
@LPardue LPardue added call-issued and removed proposal-ready labels Apr 4, 2020
@project-bot project-bot bot moved this from Consensus Emerging to Consensus Call issued in Late Stage Processing Apr 4, 2020
@LPardue LPardue added has-consensus and removed call-issued labels Apr 18, 2020
@project-bot project-bot bot moved this from Consensus Call issued to Consensus Declared in Late Stage Processing Apr 18, 2020
Late Stage Processing automation moved this from Consensus Declared to Text Incorporated Apr 20, 2020
@liushengqi000
Copy link

@liushengqi000 liushengqi000 commented Jan 15, 2022

As a user, I want to have a white list like HSTS.

@LPardue
Copy link
Member

@LPardue LPardue commented Jan 15, 2022

The HTTP/3 specification is complete and is awaiting publication by the RFC editor.

Feature requests can be sent to the HTTP WG who we be resuming ownership and maintenance of HTTP/3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-http design has-consensus
Projects
Late Stage Processing
  
Issue Handled
HTTP
Negotiation
HTTP / QPACK
Punt to HTTPbis
Development

Successfully merging a pull request may close this issue.