Skip to content

proto: tell ConnectionIdGenerator which peer a CID is for - #2800

Open
efagerho wants to merge 1 commit into
quinn-rs:mainfrom
efagerho:cid-generator-remote-address
Open

proto: tell ConnectionIdGenerator which peer a CID is for#2800
efagerho wants to merge 1 commit into
quinn-rs:mainfrom
efagerho:cid-generator-remote-address

Conversation

@efagerho

Copy link
Copy Markdown

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.

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.
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