target = "https://www.rfc-editor.org/rfc/rfc9000#section-7.2" # 7.2. Negotiating Connection IDs # # A connection ID is used to ensure consistent routing of packets, as # described in Section 5.1. The long header contains two connection # IDs: the Destination Connection ID is chosen by the recipient of the # packet and is used to provide consistent routing; the Source # Connection ID is used to set the Destination Connection ID used by # the peer. # # During the handshake, packets with the long header (Section 17.2) are # used to establish the connection IDs used by both endpoints. Each # endpoint uses the Source Connection ID field to specify the # connection ID that is used in the Destination Connection ID field of # packets being sent to them. After processing the first Initial # packet, each endpoint sets the Destination Connection ID field in # subsequent packets it sends to the value of the Source Connection ID # field that it received. # # When an Initial packet is sent by a client that has not previously # received an Initial or Retry packet from the server, the client # populates the Destination Connection ID field with an unpredictable # value. This Destination Connection ID MUST be at least 8 bytes in # length. Until a packet is received from the server, the client MUST # use the same Destination Connection ID value on all packets in this # connection. # # The Destination Connection ID field from the first Initial packet # sent by a client is used to determine packet protection keys for # Initial packets. These keys change after receiving a Retry packet; # see Section 5.2 of [QUIC-TLS]. # # The client populates the Source Connection ID field with a value of # its choosing and sets the Source Connection ID Length field to # indicate the length. # # 0-RTT packets in the first flight use the same Destination Connection # ID and Source Connection ID values as the client's first Initial # packet. # # Upon first receiving an Initial or Retry packet from the server, the # client uses the Source Connection ID supplied by the server as the # Destination Connection ID for subsequent packets, including any 0-RTT # packets. This means that a client might have to change the # connection ID it sets in the Destination Connection ID field twice # during connection establishment: once in response to a Retry packet # and once in response to an Initial packet from the server. Once a # client has received a valid Initial packet from the server, it MUST # discard any subsequent packet it receives on that connection with a # different Source Connection ID. # # A client MUST change the Destination Connection ID it uses for # sending packets in response to only the first received Initial or # Retry packet. A server MUST set the Destination Connection ID it # uses for sending packets based on the first received Initial packet. # Any further changes to the Destination Connection ID are only # permitted if the values are taken from NEW_CONNECTION_ID frames; if # subsequent Initial packets include a different Source Connection ID, # they MUST be discarded. This avoids unpredictable outcomes that # might otherwise result from stateless processing of multiple Initial # packets with different Source Connection IDs. # # The Destination Connection ID that an endpoint sends can change over # the lifetime of a connection, especially in response to connection # migration (Section 9); see Section 5.1.1 for details. [[spec]] level = "MUST" quote = ''' This Destination Connection ID MUST be at least 8 bytes in length. ''' [[spec]] level = "MUST" quote = ''' Until a packet is received from the server, the client MUST use the same Destination Connection ID value on all packets in this connection. ''' [[spec]] level = "MUST" quote = ''' Once a client has received a valid Initial packet from the server, it MUST discard any subsequent packet it receives on that connection with a different Source Connection ID. ''' [[spec]] level = "MUST" quote = ''' A client MUST change the Destination Connection ID it uses for sending packets in response to only the first received Initial or Retry packet. ''' [[spec]] level = "MUST" quote = ''' A server MUST set the Destination Connection ID it uses for sending packets based on the first received Initial packet. ''' [[spec]] level = "MUST" quote = ''' Any further changes to the Destination Connection ID are only permitted if the values are taken from NEW_CONNECTION_ID frames; if subsequent Initial packets include a different Source Connection ID, they MUST be discarded. '''