-
Notifications
You must be signed in to change notification settings - Fork 147
test(s2n-quic): server handle conn migration with zero-length cid #2697
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a88859c
to
17c7a3e
Compare
* revert this change if needed
c33fc87
to
829409b
Compare
Issue with compiling on 32-bit may be due to cloudflare/quiche#2097 |
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
* fix comments about 32-bit build * use ConnectionStarted to track remote cid * remove setting for maximum CID limit * add comments to explain the test * use question mark to unwrap result * only check for client CID is zero-length. Don't check for one handshake * only set max data parameters to what is needed
ConnectionClose with no error instead
maddeleine
reviewed
Jul 9, 2025
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
* add reference link to the start_quiche_client function * use assert to simplify the logic * move some code to make the flow better * assert there is no error received from the server before exit the test
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
quic/s2n-quic/src/tests/zero_length_cid_client_connection_migration.rs
Outdated
Show resolved
Hide resolved
* use active path update to verify that connection migration is successful * add a bool to check if the stream data is echoed back and received
* emphasize the client close the connection with no error
WesleyRosenblum
approved these changes
Jul 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Release Summary:
Resolved issues:
resolves #2378.
Description of changes:
I added a test to verify that S2N-QUIC can handle a client migration which uses a zero-length CID.
I add Cloudflare Quiche as one of our test dependencies to our integration tests. The test uses Quiche as a client which uses a zero-length CID. It would migrate to the a new path once the Quiche client establish a connection with a S2N-QUIC server. Once the migration is completed, it would send a Stream data, "Test Migration", from the new address to the server, and once the client received the message back from the server, it would close the connection. The
Quiche
client set up is taking reference fromquiche/example/client.rs
.I added two event recorder to the
recorders.rs
: one to track theInitial
packet which contains theCrypto
frame, another to track allPATH_CHALLENGE
status. On a successful test, there should only be oneInital
packet withCrypto
frame (because the server and client should only do one full handshake if the migration is successful), and the new path will be validated (thePATH_CHALLENGE
sent to the old path will be abandoned per RFC requirements).Call-outs:
InsufficientConnectionIds
. This was the previous behavior that when a s2n-quic endpoint receives aPATH_CHALLENGE
from another endpoint with zero-length CID: the s2n-quic endpoint will drop the datagram. Commits after that PR are able to handle such connection migration.Cloudflare Quiche
oni686-unknown-linux-gnu
platform.BoringSSL
as its TLS dependency and will pin32-bit-toolchain.cmake
when Quiche is trying to compile on a 32-bit platform. However, as a rust dev dependency to the s2n-quic library, it doesn't contain such CMake file. Hence, it can't be built oni686-unknown-linux-gnu
platform. I put a gate#[cfg(not(target_arch = "x86"))]
on the test andCargo.toml
to indicate that we don't want to compile Quiche and don't run the zero length cid conn migration test on x86 platform.zero_length_cid_client_connection_migration_test
is ran on every tests other than the one that runs oni686-unknown-linux-gnu
:i686-unknown-linux-gnu
, thezero_length_cid_client_connection_migration_test
is no found.client_conn.on_timeout
in quiche. Quiche's and s2n-quic'son_timeout
methods are different. I explain why I need it in https://github.com/aws/s2n-quic/pull/2697/files#r2195668049.Testing:
This PR is to add a test. The CI will runs it.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.