diff --git a/interface.go b/interface.go index 0b75fe2b111..1d690b64b4b 100644 --- a/interface.go +++ b/interface.go @@ -211,15 +211,22 @@ type EarlyConnection interface { NextConnection() Connection } -// A ConnectionIDGenerator is a interface that allows clients to implement their own format +// A ConnectionIDGenerator is an interface that allows clients to implement their own format // for the Connection IDs that servers/clients use as SrcConnectionID in QUIC packets. +// +// Connection IDs generated by an implementation should always produce IDs of constant size. type ConnectionIDGenerator interface { // GenerateConnectionID generates a new ConnectionID. + // Generated ConnectionIDs should be unique and observers should not be able to correlate two ConnectionIDs. GenerateConnectionID() ([]byte, error) // ConnectionIDLen tells what is the length of the ConnectionIDs generated by the implementation of // this interface. + // Effectively, this means that implementations of ConnectionIDGenerator must always return constant-size + // connection IDs. Valid lengths are between 0 and 20 and calls to GenerateConnectionID. + // 0-length ConnectionsIDs can be used when an endpoint (server or client) does not require multiplexing connections + // in the presence of a connection migration environment. ConnectionIDLen() int }