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

0-RTT for client #466

Closed
kazu-yamamoto opened this issue Dec 22, 2023 · 4 comments
Closed

0-RTT for client #466

kazu-yamamoto opened this issue Dec 22, 2023 · 4 comments
Assignees
Labels

Comments

@kazu-yamamoto
Copy link
Collaborator

Currenly, a client can send early data through clientEarlyData.
This data must be decided in advance.
So, this can only be used for interoperability testing in a fixed scenario.
Ideally, it's nice that sendData can send early data while negotiating.

quic can do this because it is based on the multiple thread model.
The receiver can receive packets while the sender is sending packets.

tls is based on the single thread model.
One approach is fork a thread to receive the server first flight after sending a client hello(CH):

main:                                     receiver:
handshake(RW): CH ->
sendData(W): earlydata ->
                                           (R) <- SH + etc
                                           (W) EndOfEarlyData ->
recvData(R): <- app data

R and W denote locks.

  • Can the receiver send EndOfEarlyData and synchronize with the main thread?
  • If the receiver receives an alert, how to tell the alert to the main thread?
  • How to prevent a thread leak (e.g. no SH come)
@kazu-yamamoto kazu-yamamoto self-assigned this Dec 22, 2023
@kazu-yamamoto
Copy link
Collaborator Author

kazu-yamamoto commented Dec 22, 2023

All three issues are TLS 1.3, sigh.

@kazu-yamamoto
Copy link
Collaborator Author

With handshake state:

handshake(RW): CH ->
sendData(W): earlydata ->
recvData(R):  <- SH + etc + app data
sendData(W) EndOfEarlyData, Finished, app data ->
recvData(R): <- app data

The last 3 actions can be replaced with bye.

@kazu-yamamoto
Copy link
Collaborator Author

kazu-yamamoto commented Dec 28, 2023

Minimal story:

handshake: CH ->
                                          handshake: <- SH, Finished
sendData: edataC ->
                                          recvData: -> edataC
                                          sendData: <- dataS
recvData:  <- SH, Finished, dataS
bye: EndOfEarlyData, Finished ->
                                          bye: -> EndOfEarlyData, Finished
                                               <- NST
bye: <- NST (timeout)

Normal story:

handshake: CH ->
                                          handshake: <- SH, Finished
sendData: edataC ->
                                          recvData: -> edataC
                                          sendData: <- dataS
recvData:  <- SH, Finished, dataS
sendData: EndOfEarlyData, Finished, dataC ->
                                          recvData: -> EndOfEarlyData, Finished, dataC
                                          sendData: <- NST, dataS'
recvData: <- NST, dataS'

@kazu-yamamoto
Copy link
Collaborator Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant