Skip to content

Conversation

@Chi-Kai
Copy link
Contributor

@Chi-Kai Chi-Kai commented Jul 8, 2025

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:

  • Prevents ossification: Keeps the QUIC bit available for future protocol extensions
  • Enhances privacy: Makes QUIC traffic less identifiable to passive observers
  • Maintains compatibility: Only activates when both endpoints support it

Details

  1. Transport Parameter Negotiation (src/trans_param.rs)
    - Added grease_quic_bit field to TransportParams
    - Implemented parameter ID 0x2ab2 encoding/decoding
    - Added validation for empty parameter value requirement
  2. Configuration API (src/lib.rs)
    - Added Config::enable_grease_quic_bit() method
    - Added configuration field with default false
    - Added comprehensive documentation
  3. Connection Management (src/connection/connection.rs)
    - Added bilateral negotiation logic
    - Added connection state tracking for greasing capability
    - Added public API grease_quic_bit_enabled()
  4. Packet Processing (src/packet.rs)
    - Added QUIC bit randomization inencrypt_packet()
    - Implemented 50% probability randomization
    - Added safety checks for packet types

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2025

Codecov Report

❌ Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.74%. Comparing base (b62863a) to head (27882d0).

Files with missing lines Patch % Lines
src/packet.rs 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #473      +/-   ##
===========================================
+ Coverage    94.72%   94.74%   +0.01%     
===========================================
  Files           50       50              
  Lines        30282    30371      +89     
===========================================
+ Hits         28685    28774      +89     
  Misses        1597     1597              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Support greasing the QUIC Bit

3 participants