QUIC R. Marx, Ed. Internet-Draft Akamai Intended status: Standards Track L. Niccolini, Ed. Expires: 11 January 2024 Meta M. Seemann, Ed. Protocol Labs L. Pardue, Ed. Cloudflare 10 July 2023 HTTP/3 and QPACK qlog event definitions draft-ietf-quic-qlog-h3-events-05 Abstract This document describes concrete qlog event definitions and their metadata for HTTP/3 and QPACK-related events. These events can then be embedded in the higher level schema defined in [QLOG-MAIN]. Note to Readers Note to RFC editor: Please remove this section before publication. Feedback and discussion are welcome at https://github.com/quicwg/qlog (https://github.com/quicwg/qlog). Readers are advised to refer to the "editor's draft" at that URL for an up-to-date version of this document. Concrete examples of integrations of this schema in various programming languages can be found at https://github.com/quiclog/ qlog/ (https://github.com/quiclog/qlog/). Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." Marx, et al. Expires 11 January 2024 [Page 1] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 This Internet-Draft will expire on 11 January 2024. Copyright Notice Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 4 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1. Usage with QUIC . . . . . . . . . . . . . . . . . . . . . 4 3. HTTP/3 and QPACK Event Overview . . . . . . . . . . . . . . . 5 4. HTTP/3 Events . . . . . . . . . . . . . . . . . . . . . . . . 6 4.1. parameters_set . . . . . . . . . . . . . . . . . . . . . 6 4.2. parameters_restored . . . . . . . . . . . . . . . . . . . 7 4.3. stream_type_set . . . . . . . . . . . . . . . . . . . . . 8 4.4. priority_updated . . . . . . . . . . . . . . . . . . . . 8 4.5. frame_created . . . . . . . . . . . . . . . . . . . . . . 9 4.6. frame_parsed . . . . . . . . . . . . . . . . . . . . . . 9 4.7. datagram_created . . . . . . . . . . . . . . . . . . . . 10 4.8. datagram_parsed . . . . . . . . . . . . . . . . . . . . . 10 4.9. push_resolved . . . . . . . . . . . . . . . . . . . . . . 11 5. HTTP/3 Data Field Definitions . . . . . . . . . . . . . . . . 11 5.1. Owner . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.2. H3Frame . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.3. H3Datagram . . . . . . . . . . . . . . . . . . . . . . . 12 5.3.1. H3DataFrame . . . . . . . . . . . . . . . . . . . . . 13 5.3.2. H3HeadersFrame . . . . . . . . . . . . . . . . . . . 13 5.3.3. H3CancelPushFrame . . . . . . . . . . . . . . . . . . 14 5.3.4. H3SettingsFrame . . . . . . . . . . . . . . . . . . . 14 5.3.5. H3PushPromiseFrame . . . . . . . . . . . . . . . . . 14 5.3.6. H3GoAwayFrame . . . . . . . . . . . . . . . . . . . . 14 5.3.7. H3MaxPushIDFrame . . . . . . . . . . . . . . . . . . 15 5.3.8. H3PriorityUpdateFrame . . . . . . . . . . . . . . . . 15 5.3.9. H3ReservedFrame . . . . . . . . . . . . . . . . . . . 15 5.3.10. H3UnknownFrame . . . . . . . . . . . . . . . . . . . 15 5.3.11. H3ApplicationError . . . . . . . . . . . . . . . . . 16 Marx, et al. Expires 11 January 2024 [Page 2] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 6. QPACK Events . . . . . . . . . . . . . . . . . . . . . . . . 16 6.1. state_updated . . . . . . . . . . . . . . . . . . . . . . 17 6.2. stream_state_updated . . . . . . . . . . . . . . . . . . 18 6.3. dynamic_table_updated . . . . . . . . . . . . . . . . . . 18 6.4. headers_encoded . . . . . . . . . . . . . . . . . . . . . 19 6.5. headers_decoded . . . . . . . . . . . . . . . . . . . . . 20 6.6. instruction_created . . . . . . . . . . . . . . . . . . . 20 6.7. instruction_parsed . . . . . . . . . . . . . . . . . . . 21 7. QPACK Data Field Definitions . . . . . . . . . . . . . . . . 21 7.1. QPACKInstruction . . . . . . . . . . . . . . . . . . . . 21 7.1.1. SetDynamicTableCapacityInstruction . . . . . . . . . 21 7.1.2. InsertWithNameReferenceInstruction . . . . . . . . . 22 7.1.3. InsertWithoutNameReferenceInstruction . . . . . . . . 22 7.1.4. DuplicateInstruction . . . . . . . . . . . . . . . . 22 7.1.5. SectionAcknowledgementInstruction . . . . . . . . . . 22 7.1.6. StreamCancellationInstruction . . . . . . . . . . . . 23 7.1.7. InsertCountIncrementInstruction . . . . . . . . . . . 23 7.2. QPACKHeaderBlockRepresentation . . . . . . . . . . . . . 23 7.2.1. IndexedHeaderField . . . . . . . . . . . . . . . . . 23 7.2.2. LiteralHeaderFieldWithName . . . . . . . . . . . . . 23 7.2.3. LiteralHeaderFieldWithoutName . . . . . . . . . . . . 24 7.3. QPACKHeaderBlockPrefix . . . . . . . . . . . . . . . . . 24 7.4. QPACKTableType . . . . . . . . . . . . . . . . . . . . . 25 8. Security and Privacy Considerations . . . . . . . . . . . . . 25 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 10.1. Normative References . . . . . . . . . . . . . . . . . . 25 10.2. Informative References . . . . . . . . . . . . . . . . . 26 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 26 A.1. Since draft-ietf-quic-qlog-h3-events-04: . . . . . . . . 26 A.2. Since draft-ietf-quic-qlog-h3-events-03: . . . . . . . . 27 A.3. Since draft-ietf-quic-qlog-h3-events-02: . . . . . . . . 27 A.4. Since draft-ietf-quic-qlog-h3-events-01: . . . . . . . . 27 A.5. Since draft-ietf-quic-qlog-h3-events-00: . . . . . . . . 27 A.6. Since draft-marx-qlog-event-definitions-quic-h3-02: . . . 28 A.7. Since draft-marx-qlog-event-definitions-quic-h3-01: . . . 28 A.8. Since draft-marx-qlog-event-definitions-quic-h3-00: . . . 29 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 30 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 30 1. Introduction This document describes the values of the qlog name ("category" + "event") and "data" fields and their semantics for the HTTP/3 protocol [HTTP3], QPACK [QPACK], and some of their extensions (see [EXTENDED-CONNECT], [H3_PRIORITIZATION] and [H3-DATAGRAM]). Marx, et al. Expires 11 January 2024 [Page 3] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 1.1. Notational Conventions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. The event and data structure definitions in ths document are expressed in the Concise Data Definition Language [CDDL] and its extensions described in [QLOG-MAIN]. The following fields from [QLOG-MAIN] are imported and used: name, category, type, data, group_id, protocol_type, importance, RawInfo, and time-related fields. 2. Overview This document describes how the HTTP/3 and QPACK can be expressed in qlog using the schema defined in [QLOG-MAIN]. HTTP/3 and QPACK events are defined with a category, a name (the concatenation of "category" and "event"), an "importance", an optional "trigger", and "data" fields. Some data fields use complex datastructures. These are represented as enums or re-usable definitions, which are grouped together on the bottom of this document for clarity. When any event from this document is included in a qlog trace, the "protocol_type" qlog array field MUST contain an entry with the value "HTTP3". 2.1. Usage with QUIC The events described in this document can be used with or without logging the related QUIC events defined in [QLOG-QUIC]. If used with QUIC events, the QUIC document takes precedence in terms of recommended filenames and trace separation setups. If used without QUIC events, it is recommended that the implementation assign a globally unique identifier to each HTTP/3 connection. This ID can then be used as the value of the qlog "group_id" field, as well as the qlog filename or file identifier, potentially suffixed by the vantagepoint type (For example, abcd1234_server.qlog would contain the server-side trace of the connection with GUID abcd1234). Marx, et al. Expires 11 January 2024 [Page 4] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 3. HTTP/3 and QPACK Event Overview This document defines events in two categories, written as lowercase to follow convention: h3 (Section 4) and qpack (Section 6). As described in Section 3.4.2 of [QLOG-MAIN], the qlog "name" field is the concatenation of category and type. Table 1 summarizes the name value of each event type that is defined in this specification. +=============================+============+=============+ | Name value | Importance | Definition | +=============================+============+=============+ | h3:parameters_set | Base | Section 4.1 | +-----------------------------+------------+-------------+ | h3:parameters_restored | Base | Section 4.2 | +-----------------------------+------------+-------------+ | h3:stream_type_set | Base | Section 4.3 | +-----------------------------+------------+-------------+ | h3:priority_updated | Base | Section 4.4 | +-----------------------------+------------+-------------+ | h3:frame_created | Core | Section 4.5 | +-----------------------------+------------+-------------+ | h3:frame_parsed | Core | Section 4.6 | +-----------------------------+------------+-------------+ | h3:datagram_created | Base | Section 4.7 | +-----------------------------+------------+-------------+ | h3:datagram_parsed | Base | Section 4.8 | +-----------------------------+------------+-------------+ | h3:push_resolved | Extra | Section 4.9 | +-----------------------------+------------+-------------+ | qpack:state_updated | Base | Section 6.1 | +-----------------------------+------------+-------------+ | qpack:stream_state_updated | Core | Section 6.2 | +-----------------------------+------------+-------------+ | qpack:dynamic_table_updated | Extra | Section 6.3 | +-----------------------------+------------+-------------+ | qpack:headers_encoded | Base | Section 6.4 | +-----------------------------+------------+-------------+ | qpack:headers_decoded | Base | Section 6.5 | +-----------------------------+------------+-------------+ | qpack:instruction_created | Base | Section 6.6 | +-----------------------------+------------+-------------+ | qpack:instruction_parsed | Base | Section 6.7 | +-----------------------------+------------+-------------+ Table 1: HTTP/3 and QPACK Events Marx, et al. Expires 11 January 2024 [Page 5] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 4. HTTP/3 Events HTTP/3 events extend the $ProtocolEventBody extension point defined in [QLOG-MAIN]. H3Events = H3ParametersSet / H3ParametersRestored / H3StreamTypeSet / H3PriorityUpdated / H3FrameCreated / H3FrameParsed / H3DatagramCreated / H3DatagramParsed / H3PushResolved $ProtocolEventBody /= H3Events Figure 1: H3Events definition and ProtocolEventBody extension HTTP events are logged when a certain condition happens at the application layer, and there isn't always a one to one mapping between HTTP and QUIC events. The exchange of data between the HTTP and QUIC layer is logged via the "stream_data_moved" and "datagram_data_moved" events in [QLOG-QUIC]. 4.1. parameters_set Importance: Base This event contains HTTP/3 and QPACK-level settings, mostly those received from the HTTP/3 SETTINGS frame. All these parameters are typically set once and never change. However, they are typically set at different times during the connection, so there can be several instances of this event with different fields set. The "owner" field reflects how Settings are exchanged on a connection. Sent settings have the value "local" and received settings have the value "received". A qlog can have multiple instances of this event. As a reminder the CDDL unwrap operator (~), see [RFC8610]), copies the fields from the referenced type (H3Parameters) into the target type directly, extending the target with the unwrapped fields. Definition: Marx, et al. Expires 11 January 2024 [Page 6] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 H3ParametersSet = { ? owner: Owner ~H3Parameters ; qlog-specific ; indicates whether this implementation waits for a SETTINGS ; frame before processing requests ? waits_for_settings: bool } H3Parameters = { ; RFC9114 ? max_field_section_size: uint64 ; RFC9204 ? max_table_capacity: uint64 ? blocked_streams_count: uint64 ; RFC9220 (SETTINGS_ENABLE_CONNECT_PROTOCOL) ? extended_connect: uint16 ; RFC9297 (SETTINGS_H3_DATAGRAM) ? h3_datagram: uint16 ; additional settings for grease and extensions * text => uint64 } Figure 2: H3ParametersSet definition This event can contain any number of unspecified fields. This allows for representation of reserved settings (aka GREASE) or ad-hoc support for extension settings that do not have a related qlog schema definition. 4.2. parameters_restored Importance: Base When using QUIC 0-RTT, HTTP/3 clients are expected to remember and reuse the server's SETTINGs from the previous connection. This event is used to indicate which HTTP/3 settings were restored and to which values when utilizing 0-RTT. Definition: Marx, et al. Expires 11 January 2024 [Page 7] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 H3ParametersRestored = { ~H3Parameters } Figure 3: H3ParametersRestored definition Similar to H3ParametersSet this event can contain any number of unspecified fields to allow for reserved or extension settings. 4.3. stream_type_set Importance: Base Emitted when a stream's type becomes known. This is typically when a stream is opened and the stream's type indicator is sent or received. The stream_type_value field is the numerical value without VLIE encoding. Definition: H3StreamTypeSet = { ? owner: Owner stream_id: uint64 stream_type: H3StreamType ; only when stream_type === "unknown" ? stream_type_value: uint64 ; only when stream_type === "push" ? associated_push_id: uint64 } H3StreamType = "request" / "control" / "push" / "reserved" / "unknown" / "qpack_encode" / "qpack_decode" Figure 4: H3StreamTypeSet definition 4.4. priority_updated Importance: Base Marx, et al. Expires 11 January 2024 [Page 8] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 Emitted when the priority of a request stream or push stream is initialized or updated through mechanisms defined in [RFC9218]. For example, the priority can be updated through signals received from client and/or server (e.g., in HTTP/3 HEADERS or PRIORITY_UPDATE frames) or it can be changed or overridden due to local policies. Definition: H3PriorityUpdated = { ; if the prioritized element is a request stream ? stream_id: uint64 ; if the prioritized element is a push stream ? push_id: uint64 ? old: H3Priority new: H3Priority } Figure 5: H3PriorityUpdated definition 4.5. frame_created Importance: Core This event is emitted when the HTTP/3 framing actually happens. This does not necessarily coincide with HTTP/3 data getting passed to the QUIC layer. For that, see the "stream_data_moved" event in [QLOG-QUIC]. Definition: H3FrameCreated = { stream_id: uint64 ? length: uint64 frame: $H3Frame ? raw: RawInfo } Figure 6: H3FrameCreated definition 4.6. frame_parsed Importance: Core Marx, et al. Expires 11 January 2024 [Page 9] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 This event is emitted when the HTTP/3 frame is parsed. This is not necessarily the same as when the HTTP/3 data is actually received on the QUIC layer. For that, see the "stream_data_moved" event in [QLOG-QUIC]. Definition: H3FrameParsed = { stream_id: uint64 ? length: uint64 frame: $H3Frame ? raw: RawInfo } Figure 7: H3FrameParsed definition HTTP/3 DATA frames can have arbitrarily large lengths to reduce frame header overhead. As such, DATA frames can span multiple QUIC packets. In this case, the frame_parsed event is emitted once for the frame header, and further streamed data is indicated using the stream_data_moved event. 4.7. datagram_created Importance: Base This event is emitted when an HTTP/3 Datagram is created (see [RFC9297]). This does not necessarily coincide with the HTTP/3 Datagram getting passed to the QUIC layer. For that, see the "datagram_data_moved" event in [QLOG-QUIC]. Definition: H3DatagramCreated = { quarter_stream_id: uint64 ? datagram: $H3Datagram ? raw: RawInfo } Figure 8: H3DatagramCreated definition 4.8. datagram_parsed Importance: Base Marx, et al. Expires 11 January 2024 [Page 10] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 This event is emitted when the HTTP/3 Datagram is parsed (see [RFC9297]). This is not necessarily the same as when the HTTP/3 Datagram is actually received on the QUIC layer. For that, see the "datagram_data_moved" event in [QLOG-QUIC]. Definition: H3DatagramParsed = { quarter_stream_id: uint64 ? datagram: $H3Datagram ? raw: RawInfo } Figure 9: H3DatagramParsed definition 4.9. push_resolved Importance: Extra This event is emitted when a pushed resource is successfully claimed (used) or, conversely, abandoned (rejected) by the application on top of HTTP/3 (e.g., the web browser). This event is added to help debug problems with unexpected PUSH behaviour, which is commonplace with HTTP/2. Definition: H3PushResolved = { ? push_id: uint64 ; in case this is logged from a place that does not have access ; to the push_id ? stream_id: uint64 decision: H3PushDecision } H3PushDecision = "claimed" / "abandoned" Figure 10: H3PushResolved definition 5. HTTP/3 Data Field Definitions The following data field definitions can be used in HTTP/3 events. 5.1. Owner Marx, et al. Expires 11 January 2024 [Page 11] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 Owner = "local" / "remote" Figure 11: Owner definition 5.2. H3Frame The generic $H3Frame is defined here as a CDDL extension point (a "socket" or "plug"). It can be extended to support additional HTTP/3 frame types. ; The H3Frame is any key-value map (e.g., JSON object) $H3Frame /= { * text => any } Figure 12: H3Frame plug definition The HTTP/3 frame types defined in this document are as follows: H3BaseFrames = H3DataFrame / H3HeadersFrame / H3CancelPushFrame / H3SettingsFrame / H3PushPromiseFrame / H3GoawayFrame / H3MaxPushIDFrame / H3ReservedFrame / H3UnknownFrame $H3Frame /= H3BaseFrames Figure 13: H3BaseFrames definition 5.3. H3Datagram The generic $H3Datagram is defined here as a CDDL extension point (a "socket" or "plug"). It can be extended to support additional HTTP/3 datagram types. This document intentionally does not define any specific HTTP/3 Datagram types. ; The H3Datagram is any key-value map (e.g., JSON object) $H3Datagram /= { * text => any } Figure 14: H3Datagram plug definition Marx, et al. Expires 11 January 2024 [Page 12] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 5.3.1. H3DataFrame H3DataFrame = { frame_type: "data" ? raw: RawInfo } Figure 15: H3DataFrame definition 5.3.2. H3HeadersFrame This represents an _uncompressed_, plaintext HTTP Headers frame (e.g., no QPACK compression is applied). For example: headers: [ { "name": ":path", "value": "/" }, { "name": ":method", "value": "GET" }, { "name": ":authority", "value": "127.0.0.1:4433" }, { "name": ":scheme", "value": "https" } ] Figure 16: H3HeadersFrame example H3HeadersFrame = { frame_type: "headers" headers: [* H3HTTPField] } Figure 17: H3HeadersFrame definition H3HTTPField = { name: text ? value: text } Marx, et al. Expires 11 January 2024 [Page 13] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 Figure 18: H3HTTPField definition 5.3.3. H3CancelPushFrame H3CancelPushFrame = { frame_type: "cancel_push" push_id: uint64 } Figure 19: H3CancelPushFrame definition 5.3.4. H3SettingsFrame H3SettingsFrame = { frame_type: "settings" settings: [* H3Setting] } H3Setting = { name: text value: uint64 } Figure 20: H3SettingsFrame definition 5.3.5. H3PushPromiseFrame H3PushPromiseFrame = { frame_type: "push_promise" push_id: uint64 headers: [* H3HTTPField] } Figure 21: H3PushPromiseFrame definition 5.3.6. H3GoAwayFrame H3GoawayFrame = { frame_type: "goaway" ; Either stream_id or push_id. ; This is implicit from the sender of the frame id: uint64 } Figure 22: H3GoawayFrame definition Marx, et al. Expires 11 January 2024 [Page 14] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 5.3.7. H3MaxPushIDFrame H3MaxPushIDFrame = { frame_type: "max_push_id" push_id: uint64 } Figure 23: H3MaxPushIDFrame definition 5.3.8. H3PriorityUpdateFrame The PRIORITY_UPDATE frame is defined in [RFC9218]. H3PriorityUpdateFrame = { frame_type: "priority_update" ; if the prioritized element is a request stream ? stream_id: uint64 ; if the prioritized element is a push stream ? push_id: uint64 priority_field_value: H3Priority } ; The priority value in ASCII text, encoded using Structured Fields ; Example: u=5, i H3Priority = text Figure 24: h3priorityupdateframe definition 5.3.9. H3ReservedFrame H3ReservedFrame = { frame_type: "reserved" ? length: uint64 } Figure 25: H3ReservedFrame definition 5.3.10. H3UnknownFrame The frame_type_value field is the numerical value without VLIE encoding. Marx, et al. Expires 11 January 2024 [Page 15] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 H3UnknownFrame = { frame_type: "unknown" frame_type_value: uint64 ? raw: RawInfo } Figure 26: UnknownFrame definition 5.3.11. H3ApplicationError H3ApplicationError = "http_no_error" / "http_general_protocol_error" / "http_internal_error" / "http_stream_creation_error" / "http_closed_critical_stream" / "http_frame_unexpected" / "http_frame_error" / "http_excessive_load" / "http_id_error" / "http_settings_error" / "http_missing_settings" / "http_request_rejected" / "http_request_cancelled" / "http_request_incomplete" / "http_early_response" / "http_connect_error" / "http_version_fallback" Figure 27: H3ApplicationError definition The H3ApplicationError defines the general $ApplicationError definition in the qlog QUIC definition, see [QLOG-QUIC]. ; ensure HTTP errors are properly validate in QUIC events as well ; e.g., QUIC's ConnectionClose Frame $ApplicationError /= H3ApplicationError 6. QPACK Events QPACK events extend the $ProtocolEventBody extension point defined in [QLOG-MAIN]. Marx, et al. Expires 11 January 2024 [Page 16] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 QPACKEvents = QPACKStateUpdate / QPACKStreamStateUpdate / QPACKDynamicTableUpdate / QPACKHeadersEncoded / QPACKHeadersDecoded / QPACKInstructionCreated / QPACKInstructionParsed $ProtocolEventBody /= QPACKEvents Figure 28: QPACKEvents definition and ProtocolEventBody extension QPACK events mainly serve as an aid to debug low-level QPACK issues.The higher-level, plaintext header values SHOULD (also) be logged in the http.frame_created and http.frame_parsed event data (instead). QPACK does not have its own parameters_set event. This was merged with http.parameters_set for brevity, since qpack is a required extension for HTTP/3 anyway. Other HTTP/3 extensions MAY also log their SETTINGS fields in http.parameters_set or MAY define their own events. 6.1. state_updated Importance: Base This event is emitted when one or more of the internal QPACK variables changes value. Note that some variables have two variations (one set locally, one requested by the remote peer). This is reflected in the "owner" field. As such, this field MUST be correct for all variables included a single event instance. If you need to log settings from two sides, you MUST emit two separate event instances. Definition: QPACKStateUpdate = { owner: Owner ? dynamic_table_capacity: uint64 ; effective current size, sum of all the entries ? dynamic_table_size: uint64 ? known_received_count: uint64 ? current_insert_count: uint64 } Figure 29: QPACKStateUpdate definition Marx, et al. Expires 11 January 2024 [Page 17] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 6.2. stream_state_updated Importance: Core This event is emitted when a stream becomes blocked or unblocked by header decoding requests or QPACK instructions. This event is of "Core" importance, as it might have a large impact on HTTP/3's observed performance. Definition: QPACKStreamStateUpdate = { stream_id: uint64 ; streams are assumed to start "unblocked" ; until they become "blocked" state: QPACKStreamState } QPACKStreamState = "blocked" / "unblocked" Figure 30: QPACKStreamStateUpdate definition 6.3. dynamic_table_updated Importance: Extra This event is emitted when one or more entries are inserted or evicted from QPACK's dynamic table. Definition: Marx, et al. Expires 11 January 2024 [Page 18] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 QPACKDynamicTableUpdate = { ; local = the encoder's dynamic table ; remote = the decoder's dynamic table owner: Owner update_type: QPACKDynamicTableUpdateType entries: [+ QPACKDynamicTableEntry] } QPACKDynamicTableUpdateType = "inserted" / "evicted" QPACKDynamicTableEntry = { index: uint64 ? name: text / hexstring ? value: text / hexstring } Figure 31: QPACKDynamicTableUpdate definition 6.4. headers_encoded Importance: Base This event is emitted when an uncompressed header block is encoded successfully. This event has overlap with http.frame_created for the HeadersFrame type. When outputting both events, implementers MAY omit the "headers" field in this event. Definition: QPACKHeadersEncoded = { ? stream_id: uint64 ? headers: [+ H3HTTPField] block_prefix: QPACKHeaderBlockPrefix header_block: [+ QPACKHeaderBlockRepresentation] ? raw: RawInfo } Figure 32: QPACKHeadersEncoded definition Marx, et al. Expires 11 January 2024 [Page 19] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 6.5. headers_decoded Importance: Base This event is emitted when a compressed header block is decoded successfully. This event has overlap with http.frame_parsed for the HeadersFrame type. When outputting both events, implementers MAY omit the "headers" field in this event. Definition: QPACKHeadersDecoded = { ? stream_id: uint64 ? headers: [+ H3HTTPField] block_prefix: QPACKHeaderBlockPrefix header_block: [+ QPACKHeaderBlockRepresentation] ? raw: RawInfo } Figure 33: QPACKHeadersDecoded definition 6.6. instruction_created Importance: Base This event is emitted when a QPACK instruction (both decoder and encoder) is created and added to the encoder/decoder stream. Definition: QPACKInstructionCreated = { ; see definition in appendix instruction: QPACKInstruction ? raw: RawInfo } Figure 34: QPACKInstructionCreated definition Encoder/decoder semantics and stream_id's are implicit in either the instruction types or can be logged via other events (e.g., http.stream_type_set) Marx, et al. Expires 11 January 2024 [Page 20] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 6.7. instruction_parsed Importance: Base This event is emitted when a QPACK instruction (both decoder and encoder) is read from the encoder/decoder stream. Definition: QPACKInstructionParsed = { ; see QPACKInstruction definition in appendix instruction: QPACKInstruction ? raw: RawInfo } Figure 35: QPACKInstructionParsed definition Encoder/decoder semantics and stream_id's are implicit in either the instruction types or can be logged via other events (e.g., http.stream_type_set) 7. QPACK Data Field Definitions The following data field definitions can be used in QPACK events. 7.1. QPACKInstruction The instructions do not have explicit encoder/decoder types, since there is no overlap between the instructions of both types in neither name nor function. QPACKInstruction = SetDynamicTableCapacityInstruction / InsertWithNameReferenceInstruction / InsertWithoutNameReferenceInstruction / DuplicateInstruction / SectionAcknowledgementInstruction / StreamCancellationInstruction / InsertCountIncrementInstruction Figure 36: QPACKInstruction definition 7.1.1. SetDynamicTableCapacityInstruction SetDynamicTableCapacityInstruction = { instruction_type: "set_dynamic_table_capacity" capacity: uint32 } Marx, et al. Expires 11 January 2024 [Page 21] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 Figure 37: SetDynamicTableCapacityInstruction definition 7.1.2. InsertWithNameReferenceInstruction InsertWithNameReferenceInstruction = { instruction_type: "insert_with_name_reference" table_type: QPACKTableType name_index: uint32 huffman_encoded_value: bool ? value_length: uint32 ? value: text } Figure 38: InsertWithNameReferenceInstruction definition 7.1.3. InsertWithoutNameReferenceInstruction InsertWithoutNameReferenceInstruction = { instruction_type: "insert_without_name_reference" huffman_encoded_name: bool ? name_length: uint32 ? name: text huffman_encoded_value: bool ? value_length: uint32 ? value: text } Figure 39: InsertWithoutNameReferenceInstruction definition 7.1.4. DuplicateInstruction DuplicateInstruction = { instruction_type: "duplicate" index: uint32 } Figure 40: DuplicateInstruction definition 7.1.5. SectionAcknowledgementInstruction SectionAcknowledgementInstruction = { instruction_type: "section_acknowledgement" stream_id: uint64 } Figure 41: SectionAcknowledgementInstruction definition Marx, et al. Expires 11 January 2024 [Page 22] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 7.1.6. StreamCancellationInstruction StreamCancellationInstruction = { instruction_type: "stream_cancellation" stream_id: uint64 } Figure 42: StreamCancellationInstruction definition 7.1.7. InsertCountIncrementInstruction InsertCountIncrementInstruction = { instruction_type: "insert_count_increment" increment: uint32 } Figure 43: InsertCountIncrementInstruction definition 7.2. QPACKHeaderBlockRepresentation QPACKHeaderBlockRepresentation = IndexedHeaderField / LiteralHeaderFieldWithName / LiteralHeaderFieldWithoutName Figure 44: QPACKHeaderBlockRepresentation definition 7.2.1. IndexedHeaderField This is also used for "indexed header field with post-base index" IndexedHeaderField = { header_field_type: "indexed_header" ; MUST be "dynamic" if is_post_base is true table_type: QPACKTableType index: uint32 ; to represent the "indexed header field with post-base index" ; header field type is_post_base: bool .default false } Figure 45: IndexedHeaderField definition 7.2.2. LiteralHeaderFieldWithName This is also used for "Literal header field with post-base name reference". Marx, et al. Expires 11 January 2024 [Page 23] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 LiteralHeaderFieldWithName = { header_field_type: "literal_with_name" ; the 3rd "N" bit preserve_literal: bool ; MUST be "dynamic" if is_post_base is true table_type: QPACKTableType name_index: uint32 huffman_encoded_value: bool ? value_length: uint32 ? value: text ; to represent the "indexed header field with post-base index" ; header field type is_post_base: bool .default false } Figure 46: LiteralHeaderFieldWithName definition 7.2.3. LiteralHeaderFieldWithoutName LiteralHeaderFieldWithoutName = { header_field_type: "literal_without_name" ; the 3rd "N" bit preserve_literal: bool huffman_encoded_name: bool ? name_length: uint32 ? name: text huffman_encoded_value: bool ? value_length: uint32 ? value: text } Figure 47: LiteralHeaderFieldWithoutName definition 7.3. QPACKHeaderBlockPrefix QPACKHeaderBlockPrefix = { required_insert_count: uint32 sign_bit: bool delta_base: uint32 } Figure 48: QPACKHeaderBlockPrefix definition Marx, et al. Expires 11 January 2024 [Page 24] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 7.4. QPACKTableType QPACKTableType = "static" / "dynamic" Figure 49: QPACKTableType definition 8. Security and Privacy Considerations The security and privacy considerations discussed in [QLOG-MAIN] apply to this document as well. 9. IANA Considerations TBD 10. References 10.1. Normative References [CDDL] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, June 2019, . [EXTENDED-CONNECT] Hamilton, R., "Bootstrapping WebSockets with HTTP/3", RFC 9220, DOI 10.17487/RFC9220, June 2022, . [H3-DATAGRAM] Schinazi, D. and L. Pardue, "HTTP Datagrams and the Capsule Protocol", RFC 9297, DOI 10.17487/RFC9297, August 2022, . [H3_PRIORITIZATION] Oku, K. and L. Pardue, "Extensible Prioritization Scheme for HTTP", RFC 9218, DOI 10.17487/RFC9218, June 2022, . [HTTP/3] Bishop, M., Ed., "HTTP/3", RFC 9114, DOI 10.17487/RFC9114, June 2022, . [HTTP3] Bishop, M., Ed., "HTTP/3", RFC 9114, DOI 10.17487/RFC9114, June 2022, . Marx, et al. Expires 11 January 2024 [Page 25] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 [QLOG-MAIN] Marx, R., Niccolini, L., Seemann, M., and L. Pardue, "Main logging schema for qlog", Work in Progress, Internet- Draft, draft-ietf-quic-qlog-main-schema-05, 13 February 2023, . [QLOG-QUIC] Marx, R., Niccolini, L., Seemann, M., and L. Pardue, "QUIC event definitions for qlog", Work in Progress, Internet- Draft, draft-ietf-quic-qlog-quic-events-04, 13 February 2023, . [QPACK] Krasic, C., Bishop, M., and A. Frindell, Ed., "QPACK: Field Compression for HTTP/3", RFC 9204, DOI 10.17487/RFC9204, June 2022, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC9218] Oku, K. and L. Pardue, "Extensible Prioritization Scheme for HTTP", RFC 9218, DOI 10.17487/RFC9218, June 2022, . [RFC9297] Schinazi, D. and L. Pardue, "HTTP Datagrams and the Capsule Protocol", RFC 9297, DOI 10.17487/RFC9297, August 2022, . 10.2. Informative References [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, June 2019, . Appendix A. Change Log A.1. Since draft-ietf-quic-qlog-h3-events-04: Marx, et al. Expires 11 January 2024 [Page 26] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 * Renamed 'http' category to 'h3' (#300) * H3HTTPField.value is now optional (#296) * Added definitions for RFC9297 (HTTP/3 Datagram extension) (#310) * Added definitions for RFC9218 (HTTP Extensible Prioritizations extension) (#312) * Added definitions for RFC9220 (Extended Connect extension) (#325) * Editorial and formatting changes (#298, #258, #299, #304, #327) A.2. Since draft-ietf-quic-qlog-h3-events-03: * Ensured consistent use of RawInfo to indicate raw wire bytes (#243) * Changed HTTPStreamTypeSet:raw_stream_type to stream_type_value (#54) * Changed HTTPUnknownFrame:raw_frame_type to frame_type_value (#54) * Renamed max_header_list_size to max_field_section_size (#282) A.3. Since draft-ietf-quic-qlog-h3-events-02: * Renamed HTTPStreamType data to request (#222) * Added HTTPStreamType value unknown (#227) * Added HTTPUnknownFrame (#224) * Replaced old and new fields with stream_type in HTTPStreamTypeSet (#240) * Changed HTTPFrame to a CDDL plug type (#257) * Moved data definitions out of the appendix into separate sections * Added overview Table of Contents A.4. Since draft-ietf-quic-qlog-h3-events-01: * No changes - new draft to prevent expiration A.5. Since draft-ietf-quic-qlog-h3-events-00: Marx, et al. Expires 11 January 2024 [Page 27] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 * Change the data definition language from TypeScript to CDDL (#143) A.6. Since draft-marx-qlog-event-definitions-quic-h3-02: * These changes were done in preparation of the adoption of the drafts by the QUIC working group (#137) * Split QUIC and HTTP/3 events into two separate documents * Moved RawInfo, Importance, Generic events and Simulation events to the main schema document. A.7. Since draft-marx-qlog-event-definitions-quic-h3-01: Major changes: * Moved data_moved from http to transport. Also made the "from" and "to" fields flexible strings instead of an enum (#111,#65) * Moved packet_type fields to PacketHeader. Moved packet_size field out of PacketHeader to RawInfo:length (#40) * Made events that need to log packet_type and packet_number use a header field instead of logging these fields individually * Added support for logging retry, stateless reset and initial tokens (#94,#86,#117) * Moved separate general event categories into a single category "generic" (#47) * Added "transport:connection_closed" event (#43,#85,#78,#49) * Added version_information and alpn_information events (#85,#75,#28) * Added parameters_restored events to help clarify 0-RTT behaviour (#88) Smaller changes: * Merged loss_timer events into one loss_timer_updated event * Field data types are now strongly defined (#10,#39,#36,#115) * Renamed qpack instruction_received and instruction_sent to instruction_created and instruction_parsed (#114) Marx, et al. Expires 11 January 2024 [Page 28] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 * Updated qpack:dynamic_table_updated.update_type. It now has the value "inserted" instead of "added" (#113) * Updated qpack:dynamic_table_updated. It now has an "owner" field to differentiate encoder vs decoder state (#112) * Removed push_allowed from http:parameters_set (#110) * Removed explicit trigger field indications from events, since this was moved to be a generic property of the "data" field (#80) * Updated transport:connection_id_updated to be more in line with other similar events. Also dropped importance from Core to Base (#45) * Added length property to PaddingFrame (#34) * Added packet_number field to transport:frames_processed (#74) * Added a way to generically log packet header flags (first 8 bits) to PacketHeader * Added additional guidance on which events to log in which situations (#53) * Added "simulation:scenario" event to help indicate simulation details * Added "packets_acked" event (#107) * Added "datagram_ids" to the datagram_X and packet_X events to allow tracking of coalesced QUIC packets (#91) * Extended connection_state_updated with more fine-grained states (#49) A.8. Since draft-marx-qlog-event-definitions-quic-h3-00: * Event and category names are now all lowercase * Added many new events and their definitions * "type" fields have been made more specific (especially important for PacketType fields, which are now called packet_type instead of type) * Events are given an importance indicator (issue #22) Marx, et al. Expires 11 January 2024 [Page 29] Internet-Draft HTTP/3 and QPACK qlog event definitions July 2023 * Event names are more consistent and use past tense (issue #21) * Triggers have been redefined as properties of the "data" field and updated for most events (issue #23) Acknowledgements Much of the initial work by Robin Marx was done at the Hasselt and KU Leuven Universities. Thanks to Jana Iyengar, Brian Trammell, Dmitri Tikhonov, Stephen Petrides, Jari Arkko, Marcus Ihlar, Victor Vasiliev, Mirja Kuehlewind, Jeremy Laine, Kazu Yamamoto, and Christian Huitema for their feedback and suggestions. Authors' Addresses Robin Marx (editor) Akamai Email: rmarx@akamai.com Luca Niccolini (editor) Meta Email: lniccolini@meta.com Marten Seemann (editor) Protocol Labs Email: marten@protocol.ai Lucas Pardue (editor) Cloudflare Email: lucaspardue.24.7@gmail.com Marx, et al. Expires 11 January 2024 [Page 30]