proto: tell ConnectionIdGenerator which peer a CID is for - #2800
Open
efagerho wants to merge 1 commit into
Open
Conversation
Connection ID generators are constructed once per endpoint and are handed no context, so a generator cannot encode anything about the peer into the CIDs it issues. That rules out address-aware load balancing, and it rules out packet-level authentication schemes that bind the peer's address into the connection ID and validate it before the QUIC layer parses a packet. Add a defaulted generate_cid_for(remote, local_ip) alongside generate_cid and call it everywhere a local CID is minted. Every call site already had the addresses to hand, except CID re-issuance, which now uses the address the connection was last observed at. Existing implementations, including both built-in generators, are unaffected. ConnectionMeta::addresses was deliberately stale because zero-length CIDs cannot migrate. Refresh its remote address when the peer switches CIDs, which RFC 9000 requires it to do when migrating, so that re-issued CIDs follow a peer that moves.
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
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.
Connection ID generators are constructed once per endpoint and are handed no context, so a generator cannot encode anything about the peer into the CIDs it issues. That rules out address-aware load balancing, and it rules out packet-level authentication schemes that bind the peer's address into the connection ID and validate it before the QUIC layer parses a packet.
Add a defaulted generate_cid_for(remote, local_ip) alongside generate_cid and call it everywhere a local CID is minted. Every call site already had the addresses to hand, except CID re-issuance, which now uses the address the connection was last observed at. Existing implementations, including both built-in generators, are unaffected.
ConnectionMeta::addresses was deliberately stale because zero-length CIDs cannot migrate. Refresh its remote address when the peer switches CIDs, which RFC 9000 requires it to do when migrating, so that re-issued CIDs follow a peer that moves.