Skip to main content

7. HTTP Framing Layer

HTTP frames are carried on QUIC streams, as described in Section 6. HTTP/3 defines three stream types: control stream, request stream, and push stream. This section describes HTTP/3 frame formats and their permitted stream types; see Table 1 for an overview.

Table 1: HTTP/3 Frames and Stream Type Overview

FrameControl StreamRequest StreamPush StreamSection
DATANoYesYes7.2.1
HEADERSNoYesYes7.2.2
CANCEL_PUSHYesNoNo7.2.3
SETTINGSYes (1)NoNo7.2.4
PUSH_PROMISENoYesNo7.2.5
GOAWAYYesNoNo7.2.6
MAX_PUSH_IDYesNoNo7.2.7
ReservedYesYesYes7.2.8

The SETTINGS frame can only occur as the first frame of a Control stream; this is indicated in Table 1 with a (1).

Note that, unlike QUIC frames, HTTP/3 frames can span multiple packets.

7.1. Frame Layout

All frames have the following format:

HTTP/3 Frame Format {
Type (i),
Length (i),
Frame Payload (..),
}

A frame includes the following fields:

  • Type: A variable-length integer that identifies the frame type
  • Length: A variable-length integer that describes the length in bytes of the Frame Payload
  • Frame Payload: A payload, the semantics of which are determined by the Type field

Each frame's payload MUST contain exactly the fields identified in its description. A frame payload that contains additional bytes after the identified fields or a frame payload that terminates before the end of the identified fields MUST be treated as a connection error of type H3_FRAME_ERROR.

7.2. Frame Definitions

7.2.1. DATA

DATA frames (type=0x00) convey arbitrary, variable-length sequences of bytes associated with HTTP request or response content.

DATA frames MUST be associated with an HTTP request or response. If a DATA frame is received on a control stream, the recipient MUST respond with a connection error of type H3_FRAME_UNEXPECTED.

7.2.2. HEADERS

The HEADERS frame (type=0x01) is used to carry an HTTP field section that is encoded using QPACK.

HEADERS frames can only be sent on request streams or push streams. If a HEADERS frame is received on a control stream, the recipient MUST respond with a connection error of type H3_FRAME_UNEXPECTED.

7.2.3. CANCEL_PUSH

The CANCEL_PUSH frame (type=0x03) is used to request cancellation of a server push prior to the push stream being received.

When a client sends a CANCEL_PUSH frame, it is indicating that it does not wish to receive the promised resource. The server SHOULD abort sending the resource.

CANCEL_PUSH frames are sent on the control stream. Receiving a CANCEL_PUSH frame on a request stream or push stream MUST be treated as a connection error of type H3_FRAME_UNEXPECTED.

7.2.4. SETTINGS

The SETTINGS frame (type=0x04) conveys configuration parameters that affect how endpoints communicate.

SETTINGS frames MUST be sent as the first frame of each control stream. SETTINGS frames MUST NOT be sent on any other stream.

Defined settings identifiers include:

  • SETTINGS_MAX_FIELD_SECTION_SIZE (0x06): Maximum field section size
  • SETTINGS_QPACK_MAX_TABLE_CAPACITY (0x01): QPACK-related setting
  • SETTINGS_QPACK_BLOCKED_STREAMS (0x07): QPACK-related setting

7.2.5. PUSH_PROMISE

The PUSH_PROMISE frame (type=0x05) is used to carry a promised request header field section from server to client on a request stream.

PUSH_PROMISE frames can only be sent on request streams. Receiving a PUSH_PROMISE frame on a control stream or push stream MUST be treated as a connection error of type H3_FRAME_UNEXPECTED.

7.2.6. GOAWAY

The GOAWAY frame (type=0x07) is used to initiate graceful shutdown of a connection.

GOAWAY frames are always sent on the control stream. Receiving a GOAWAY frame on a request stream or push stream MUST be treated as a connection error of type H3_FRAME_UNEXPECTED.

7.2.7. MAX_PUSH_ID

The MAX_PUSH_ID frame (type=0x0d) is used by clients to control the number of server pushes that the server can initiate.

MAX_PUSH_ID frames are always sent on the control stream. A server MUST NOT send a MAX_PUSH_ID frame.

7.2.8. Reserved Frame Types

Frame types of the format 0x1f * N + 0x21 for non-negative integer values of N are reserved to exercise the requirement that unknown types be ignored. These frames have no semantics, and they can be sent on any stream.