Does a QUIC server generate a Connection ID or just the client? Some people say there's a source CID and a destination CID, others say there is only one CID per connection. Does anyone know for sure?
2 Answers
The QUIC specification defines connection IDs in section 5.1.
You can infer from the structure of packets with long headers that there is a source connection ID and a destination connection ID, but section 5.1 clearly states that there may be multiple connection IDs for the same endpoint.
Packets with short headers only carry the destination connection ID.
In summary, at the logical level, a QUIC connection is identified by a set of connection IDs. A single endpoint may have source and destination connection IDs; minimally they are 1 source and 1 destination connection IDs, but there can be more, and they not need to be in the same quantity (e.g. for a single connection there may be N source connection IDs and M destination connection IDs, where N != M).
Refer to the QUIC specification for more information.

- 16,856
- 1
- 50
- 45
-
Thanks for the explanation and official sources! – greyyit Jan 24 '22 at 18:24
Both client and server generate (1 or more) connection ID's the peer should use for the packets it sends. E.g. the server generates connection ID's the client should use (as destination) in the packets it sends.
Of course this implies a bootstrap problem (the client can't know the which connection ID the server will generate), so the first packet from client to server contains a random destination connection ID; upon receipt, the server will itself generate a connection ID and communicate that back to the client so the client can use that connection ID in subsequent packets it sends.

- 725
- 4
- 13