facebook / mvfst

An implementation of the QUIC transport protocol.
MIT License
1.5k stars 244 forks source link

Question about Connection ID in mvfst's implementation of QUIC #269

Closed wtao0221 closed 2 years ago

wtao0221 commented 2 years ago

Hi team,

Suppose one host may have multiple QUIC connections. Will there any source or destination connection IDs be the same?

mjoras commented 2 years ago

They shouldn't be, otherwise there'd be no way to reliably distinguish the connections. CID generation thus has to have a degree of randomness in it to avoid such eventualities. You can see how our CID generation tries to account for this here: https://github.com/facebookincubator/mvfst/blob/main/quic/codec/DefaultConnectionIdAlgo.h#L18