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

Ping-pong while the TLS asynchronously processes ClientHello #4217

Closed
kazuho opened this issue Oct 15, 2020 · 3 comments
Closed

Ping-pong while the TLS asynchronously processes ClientHello #4217

kazuho opened this issue Oct 15, 2020 · 3 comments
Labels
-tls -transport ietf-lc An issue that was raised during IETF Last Call.

Comments

@kazuho
Copy link
Member

kazuho commented Oct 15, 2020

From Transport draft; section 8.1: To prevent this deadlock, clients MUST send a packet on a probe timeout (PTO, see Section 6.2 of [QUIC-RECOVERY]).
From TLS draft; section 4.1.4: While waiting for TLS processing to complete, ... (snip). An endpoint SHOULD continue to respond to packets that can be processed during this time.

These two statements together lead to a ping-pong of packets when the server-side TLS stack takes time in generating ServerHello. That's because every time the client sends an Initial probe, the server will be acknowledging that packet immediately.

Note that there are cases where the server might actually spend time in generating ServerHello:

  • the TLS stack might be slow and the public key crypto can be heavyweight (e.g., post-quantum)
  • the TLS stack might have to load per-SNI setting (e.g., certificates, cipher-suites that can be used) from a remote location
  • a QUIC server and the TLS backend might be positioned at different locations (something analogous to https://blog.cloudflare.com/keyless-ssl-the-nitty-gritty-technical-details/)

Note: This issue has been spun off from #4183 (comment), as it is not related to PMTU.

@larseggert larseggert added the ietf-lc An issue that was raised during IETF Last Call. label Oct 15, 2020
@gloinul
Copy link
Contributor

gloinul commented Oct 15, 2020

@kazuho do I understand this correctly, this is primarily an efficiency issue, as retransmissions of the initial will be going back and forth during the time until the server can send its ServerHello to the client?

So if the server wouldn't ACK the initial then the PTO timer will fire after 0.5 seconds in the client. But in case if the server ACKs then the PTO will be updated based on the actual RTT between client and server and thus occur much more frequently in most cases.

So what would be the fix, to change the recommendation on ACKing until the server hello is available on the initial?

@ianswett
Copy link
Contributor

ianswett commented Oct 15, 2020

I believe this issue was discussed in the past(#3546), and the solution we reached consensus on was to not reset pto_count on the client until it knows the server has completed address validation. ie:

// Reset pto_count unless the client is unsure if
// the server has validated the client's address.
if (PeerCompletedAddressValidation()):
pto_count = 0

@kazuho
Copy link
Member Author

kazuho commented Oct 15, 2020

@ianswett Thank you for pointing out that this is a duplicate of #3546 and that we have a fix. I missed the "don't reset" clause in the recovery draft.

We can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-tls -transport ietf-lc An issue that was raised during IETF Last Call.
Projects
None yet
Development

No branches or pull requests

4 participants