quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Should "discarding possible duplicate packet" really be a warning? #1704

Closed nazar-pc closed 10 months ago

nazar-pc commented 10 months ago

We recently deployed QUIC support in libp2p-based networking stack and started getting annoying number of these messages:

2023-11-06T21:44:38.016589Z  WARN quinn_proto::connection: discarding possible duplicate packet

I'm now wondering if those are supposed to be warnings? Looks like debug message to me if those are the duplicates of the the same kind I suspect they are (not familiar with the codebase yet unfortunately).

Ralith commented 10 months ago

What kind do you suspect they are?

Duplicate packets can be an indication of some forms of attack. I'm guessing what you're seeing is some network path element causing that instead, which I hadn't anticipated being common. Since it seems like it is for you, I'm open to reducing the severity. Want to make a quick PR?

nazar-pc commented 10 months ago

What kind do you suspect they are?

General retransmissions for UDP protocols since there are no guarantees about the delivery, I'm guessing there is some kind of timeout and if there is no confirmation packet will be sent again that receiving side will rightfully consider to be a duplicate.

Want to make a quick PR?

Sure!

Ralith commented 10 months ago

General retransmissions for UDP protocols since there are no guarantees about the delivery

Neither UDP itself nor QUIC operate this way. UDP doesn't care about delivery at all, and QUIC retransmits information, not packets. It's got to be something in between that's cloning packets. I think wifi's link-layer recovery might be a risk for that?

nazar-pc commented 10 months ago

QUIC retransmits information, not packets

I see, thanks! My understanding of QUIC is close to zero.

We have a distributed network and no control over what users are running software on, so anything is possible and these warnings usually arrive in bursts of varying size.