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

Rejection of 0-RTT: start over? #761

Closed
martinthomson opened this issue Sep 6, 2017 · 5 comments
Closed

Rejection of 0-RTT: start over? #761

martinthomson opened this issue Sep 6, 2017 · 5 comments
Labels
-tls -transport design An issue that affects the design of the protocol; resolution requires consensus. has-consensus An issue that the Chairs have determined has consensus, by canvassing the mailing list.
Projects

Comments

@martinthomson
Copy link
Member

If 0-RTT is rejected should the client:

  1. start over at the application layer
  2. close all streams that it initiated (can't do that because stream 1 is special)
  3. just pretend that the packets were lost and need retransmission

Previously, people (@RyanatGoogle) advocated for 3. So far the preponderance of feedback on the list has been in favour of 1, which is at least consistent with the approach in TLS.

@martinthomson martinthomson added -tls -transport design An issue that affects the design of the protocol; resolution requires consensus. labels Sep 6, 2017
@mikkelfj
Copy link
Contributor

mikkelfj commented Sep 20, 2017

At least 2. would seem wrong because arbitrarily closing a stream at transport layer breaks application context.

1. Seems fair, but it complicates application development. Why should developers really care.
3. Might cause unexpected delays, and application might prefer connecting elsewhere.

The API could have an open flag indicating whether they want an error on 0-RTT, or treat the failed connect as a packet loss.

Thus, both 1. and 3. makes sense and might be selectable by application choise. In QUIC terms this means the transport should either fail connection with a specific error on 0-RTT or alternatively silently use 1-RTT via packet loss without disrupting the application depending on the users API configuration.

A 4th option could be to start over but having the API think it is the same connection. This is not a good idea because the API might have data buffers linked to the connection and moving those associations to a new connection might be complicated. Suddenly API connection and transport connection becomes different things.

@RyanTheOptimist
Copy link
Contributor

RyanTheOptimist commented Sep 20, 2017 via email

@mikkelfj
Copy link
Contributor

mikkelfj commented Sep 20, 2017

So I didn't define 1 or 2, but my understanding is:

Option 1 cancels the connection attempt with a specific error allowing the application at a high level loop to start a new connection with different arguments.

Option 2 just cancels streams, meaning the application connection context remains, but suddenly certain streams start to fail. For some applications this might just be pulling a new stream, but for others complicated application state must be managed - for example some protocols might never fail the first 10 streams because, short of connection failure, there is nothing inherent that can fail - this because the transport layer does not arbitrarily fail streams - it at most blocks them on flow - except for option 2 behavior.

Thus, having transport cancelling a stream is highly disruptive whereas giving up a new connection attemt as in option 1, is to be expected for many reasons, and comparatively easy to deal with.

@mnot mnot added this to 0-RTT in QUIC Sep 25, 2017
@martinthomson
Copy link
Member Author

@mikkelfj got it right. This is what we do for TLS 1.3 now. Simple example: we want to send "GET /favicon.ico", we have a 0-RTT capable ticket. We start TLS 1.3 and h2 and send the request. If we get a reject, we will mark the request as needing retry and try again. We throw away all h2 state at that point. The same connection can be used, but all the other intermediate stuff goes away. The request is matched to the "new" connection and it starts over, even reassessing the protocol. That is, if we get http/1.1 (which is possible), it works.

That's a bit of a pain to implement correctly, but not too bad if you get the abstractions right. I think that the way we do it (@ddragana can confirm) is to add the connection back to the connection pool so that it gets picked up as though it were a new one.

@martinthomson
Copy link
Member Author

Duplicate of #390.

@mnot mnot added the has-consensus An issue that the Chairs have determined has consensus, by canvassing the mailing list. label Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-tls -transport design An issue that affects the design of the protocol; resolution requires consensus. has-consensus An issue that the Chairs have determined has consensus, by canvassing the mailing list.
Projects
No open projects
QUIC
0-RTT
Development

No branches or pull requests

4 participants