Skip to main content

10. Connection Termination

10. Connection Termination​

An established QUIC connection can be terminated in one of three ways:

  • idle timeout (Section 10.1)
  • immediate close (Section 10.2)
  • stateless reset (Section 10.3)

10.1 Idle Timeout​

If a max_idle_timeout is specified by either endpoint in its transport parameters (Section 18.2), the connection is silently closed and its state is discarded when it remains idle for longer than the minimum of the max_idle_timeout value advertised by both endpoints.

10.1.1 Liveness Testing​

An endpoint can use PING frames (Section 19.2) to test the liveness of a connection or to prevent idle timeout.

10.1.2 Deferring Idle Timeout​

An endpoint might need to send ack-eliciting packets to avoid an idle timeout if it wishes to maintain a connection.

10.2 Immediate Close​

An endpoint sends a CONNECTION_CLOSE frame (Section 19.19) to terminate the connection immediately.

10.2.1 Closing Connection State​

After sending a CONNECTION_CLOSE frame, an endpoint enters the closing state.

10.2.2 Draining Connection State​

The draining state is entered when an endpoint receives a CONNECTION_CLOSE frame.

10.2.3 Immediate Close during the Handshake​

Endpoints can close a connection during the handshake by sending a CONNECTION_CLOSE frame in packets using the appropriate cryptographic level.

10.3 Stateless Reset​

A stateless reset is provided as an option of last resort for an endpoint that does not have access to the state of a connection.

10.3.1 Detecting a Stateless Reset​

An endpoint detects a potential Stateless Reset by examining the trailing 16 bytes of a datagram.

10.3.2 Calculating a Stateless Reset Token​

The stateless reset token MUST be difficult to guess.

10.3.3 Looping​

The design of a Stateless Reset is such that without knowledge of the stateless reset token, a Stateless Reset cannot be generated by an endpoint.