arthrop0d

Brief articles on varied topics.

QUIC Connection Migration and Path Validation

networking

QUIC connection migration lets an established QUIC connection continue when the client’s IP address or port changes. It works because QUIC identifies a connection with connection IDs, not only with the network address pair, and validates a new network path before trusting it.

The problem with an address-based connection

A conventional TCP connection is identified by a four-tuple:

If a laptop moves from Wi-Fi to cellular, its source IP usually changes. A NAT gateway can also change the apparent source port during a rebinding. To TCP, the new four-tuple looks like a different connection. The old connection becomes unusable, so an application must reconnect and usually repeat transport and application setup.

That is particularly expensive for a modern encrypted protocol. A reconnect can require a new TLS handshake, new HTTP/2 or HTTP/3 state, and retransmission of requests or other application data. Any in-flight work must be reconciled by the application.

QUIC separates the identity of the connection from the address currently used to reach it. This allows the transport connection—and, for example, an HTTP/3 session running on it—to survive the change.

Connection IDs identify the connection

A QUIC packet carries a connection ID (CID): an opaque value chosen by an endpoint and used by the peer to associate the packet with an existing connection. “Opaque” means that the receiver treats it as an identifier, not as a value with a defined application-level meaning.

The CID is not the same thing as an IP address or port. A server can use it to find the right connection state even when the packet arrives from a new source address. This is especially useful for servers behind a load balancer: the CID can be structured or assigned so that the packet reaches the worker holding the connection, without requiring the worker to be selected solely from the current five-tuple.

During a connection, endpoints can provide one another with additional connection IDs. A client therefore normally has an unused ID available when it needs to move. The protocol also supports retiring IDs, so an endpoint can stop using an identifier that is no longer safe or useful.

The CID does not by itself authorize a new path. It answers which connection is this? Path validation answers can this endpoint really receive traffic at this address?

What migration looks like

Suppose a client has an established QUIC connection to 203.0.113.10:443 over Wi-Fi. Its local address changes from 192.0.2.20:51000 to 198.51.100.7:43000 after it switches networks.

The client can send a new QUIC packet from the new address using the existing connection’s destination CID. The server sees an authenticated QUIC packet for a known connection, but from a previously unseen path. It records the new address as a candidate path rather than immediately treating it as the established one.

The connection’s packet-number space and cryptographic keys continue to apply. The client does not start a new TLS handshake or create a new HTTP connection. Data that was already in flight can still be acknowledged, and new application data can be sent once the path is usable.

The address change may be deliberate—such as switching interfaces—or incidental, such as NAT rebinding changing only the source port. QUIC can handle both. A client may also use a new connection ID when moving, which reduces linkability between paths: an observer should not necessarily be able to identify the same connection merely by watching its visible CID.

Path validation prevents blind sending

Before adopting the new path, QUIC validates it with a small challenge exchange:

  1. The endpoint sends a PATH_CHALLENGE containing an unpredictable token on the candidate path.
  2. The peer returns that token in a PATH_RESPONSE on the same path.
  3. The challenger confirms that packets sent to the new address reached the peer and that the peer could send a response back.

A successful response is evidence that the address is reachable by the connection’s peer. It also helps protect against an attacker who forges a packet claiming that the peer moved to an innocent third party’s address. Without validation, a server might send substantial amounts of traffic to an address chosen by an off-path attacker, creating an amplification attack.

Until validation succeeds, an endpoint limits what it sends on the candidate path. QUIC also applies anti-amplification rules: an endpoint that has not validated a client’s address must not send more than three times the amount of data it received from that address. The exact packet exchange and connection state remain under normal packet protection, but path validation is specifically about reachability and controlling where traffic is sent.

A path can fail validation. The endpoint can continue using the old path if it remains available, try another path, or eventually declare the connection lost if no path works. A timeout or a PATH_CHALLENGE that receives no matching response is therefore not automatically a failed HTTP request; it may indicate that one network path disappeared.

State that does and does not move

The connection survives, but a network path has its own characteristics. Round-trip time, packet loss, maximum packet size, and congestion-control conditions can change after migration. Implementations measure the new path and may adjust path-specific sending behavior rather than assuming that Wi-Fi and cellular have the same capacity.

Packets from the old path can also arrive late. QUIC’s connection-level packet numbers and acknowledgments let the implementation distinguish old traffic from new traffic, while the selected path determines where new packets are sent.

Connection migration is therefore not “ignore the address.” It is a controlled transition: use a CID to locate the existing encrypted connection, detect a new source path, validate that path, and then send the surviving connection over it.

If an incident report says a QUIC client experienced a “path change,” “NAT rebinding,” or “failed PATH_CHALLENGE,” it is describing this machinery. The important result is that a changed IP address or port need not imply a new session—provided the peer can still be reached and the new path passes validation.

← All articles