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

Harden retry processing #1661

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Harden retry processing #1661

merged 4 commits into from
Mar 26, 2024

Conversation

huitema
Copy link
Collaborator

@huitema huitema commented Mar 26, 2024

The first version of the retry processing was limiting CPU and memory consumption in an indirect way: if there were too many connection in progress, picoquic would send a "stateless retry" packet to the peer, and the connection would not progress until an initial packet was received with the correct token. The CPU consumption was limited, because the expensive asymmetrical key operations would only happen after the retry/token handshake, but the memory consumption would still grow quickly, because each "initial" packet caused creation of a connection context (about 5KB). These contexts would only be freed after a timer, and thus the memory consumption could be large.

This PR ensures that no context is created if the initial packet is not "accepted". The picoquic server will simply queue a "stateless packet" containing either the "retry" packet or an initial packet with a connection close frame stating "server busy".

The "cnx_ddos" test has been updated to verify that not to many contexts are created.

@huitema huitema merged commit 4b49e9a into master Mar 26, 2024
11 checks passed
@huitema huitema deleted the harden-retry-processing branch March 26, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant