Skip to content

Conversation

@larseggert
Copy link
Contributor

@larseggert larseggert commented Nov 2, 2025

feat: accept connection ID validation in amplificationlimit test

Context

The amplificationlimit test failure criteria implemented by this code was too narrow.
RFC 9000 Section 8.1 paragraph 2 (https://datatracker.ietf.org/doc/html/rfc9000#section-8.1-2)
contains an additional criterion for when it's safe to stop applying the amplification limit.
The interop runner should permit that exit criterion and mark the test as passed.

The RFC states: "Additionally, an endpoint MAY consider the peer address validated if the
peer uses a connection ID chosen by the endpoint and the connection ID contains at least
64 bits of entropy."

Changes

Updated TestCaseAmplificationLimit.check() in testcases.py to accept both RFC 9000
Section 8.1 exit criteria:

  1. Original criterion: Server receives a Handshake packet from the client (existing behavior)
  2. New criterion: Client uses a server-chosen connection ID with ≥64 bits of entropy

Implementation

  • Added tracking of server-chosen connection IDs from Initial packets (lines 830-841)
  • Filter SCIDs to only include those with at least 8 bytes (64 bits) of entropy
  • Added validation check in packet processing loop (lines 864-876)
  • When client Initial packet uses a matching server-chosen CID, mark address as validated
  • Includes debug logging for visibility into which criterion triggered success

Benefits

  • More accurate RFC 9000 compliance testing
  • Accepts valid server implementations that use connection ID-based address validation
  • Reduces false negatives in interoperability testing

The amplificationlimit test failure criteria implemented by this code was too narrow.
RFC 9000 Section 8.1 paragraph 2 (https://datatracker.ietf.org/doc/html/rfc9000#section-8.1-2)
contains an additional criterion for when it's safe to stop applying the amplification limit.
The interop runner should permit that exit criterion and mark the test as passed.

The RFC states: "Additionally, an endpoint MAY consider the peer address validated if the
peer uses a connection ID chosen by the endpoint and the connection ID contains at least
64 bits of entropy."

Updated `TestCaseAmplificationLimit.check()` in `testcases.py` to accept both RFC 9000
Section 8.1 exit criteria:

1. **Original criterion**: Server receives a Handshake packet from the client (existing behavior)
2. **New criterion**: Client uses a server-chosen connection ID with ≥64 bits of entropy

- Added tracking of server-chosen connection IDs from Initial packets (lines 830-841)
- Filter SCIDs to only include those with at least 8 bytes (64 bits) of entropy
- Added validation check in packet processing loop (lines 864-876)
- When client Initial packet uses a matching server-chosen CID, mark address as validated
- Includes debug logging for visibility into which criterion triggered success

- More accurate RFC 9000 compliance testing
- Accepts valid server implementations that use connection ID-based address validation
- Reduces false negatives in interoperability testing
@larseggert larseggert changed the title feat: accept connection ID validation in amplificationlimit test feat: accept connection ID validation in amplificationlimit test Nov 2, 2025
@larseggert
Copy link
Contributor Author

@marten-seemann ping?

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