quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.85k stars 394 forks source link

Backport supress stateless packet to 0.10.x #1598

Closed lijunwangs closed 1 year ago

lijunwangs commented 1 year ago

Backport e652b6d999f053ffe21eeea247854882ae480281 from main to 0.10.x branch.

The implementation is different from the main branch due to the refactoring happened to main branch.

  1. The enforcement of the limit is done at the quinn-proto layer as it is where the endpoint generated packets being queued.
  2. The transmit_queue_contents_len to track the buffer contents length at quinn-proto::Endpoint layer.
  3. The outgoing_queue_contents_len to track the buffer contents length at Quinn::Endpoint layer
  4. Quinn::Endpoint uses the new interface set_socket_buffer_fill exposed by proto::Endpoint to communicate the updated outgoing_queue_contents_len
lijunwangs commented 1 year ago

Hi Ben/Dirkjan, can you please review the backport implementation of https://github.com/quinn-rs/quinn/commit/e652b6d999f053ffe21eeea247854882ae480281 to the 0.10.x release? @Ralith @djc

lijunwangs commented 1 year ago

This looks good so far, but did you also want to disable version negotiation and stateless reset packets under the heavily loaded condition?

Great point! I reviewed the implementation in main -- we were suppressing version negotiation and stateless reset packets as well. I will add these into the consideration as well to keep it consistent and more robust.