issues 223: Support greasing the QUIC Bit #473
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.
Overview
This PR implements RFC 9287 "Greasing the QUIC Bit" to enhance QUIC protocol privacy and prevent network ossification. The implementation allows endpoints to negotiate the ability to randomize the second-most significant bit (QUIC bit) in QUIC packets.
Issue
Fixes #223
RPC 9287
RFC 9287 addresses the problem that QUIC packets are easily identifiable because the "QUIC bit" (0x40) is always set to 1. This implementation:
Details
src/trans_param.rs)- Added
grease_quic_bitfield toTransportParams- Implemented parameter ID
0x2ab2encoding/decoding- Added validation for empty parameter value requirement
src/lib.rs)- Added
Config::enable_grease_quic_bit()method- Added configuration field with default
false- Added comprehensive documentation
src/connection/connection.rs)- Added bilateral negotiation logic
- Added connection state tracking for greasing capability
- Added public API
grease_quic_bit_enabled()src/packet.rs)- Added QUIC bit randomization in
encrypt_packet()- Implemented 50% probability randomization
- Added safety checks for packet types