idnits 2.17.1 draft-ietf-quic-http-19.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([2], [3], [1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 11, 2019) is 1867 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 2014 -- Looks like a reference, but probably isn't: '2' on line 2016 -- Looks like a reference, but probably isn't: '3' on line 2018 -- Looks like a reference, but probably isn't: '4' on line 2020 == Unused Reference: 'RFC7413' is defined on line 2008, but no explicit reference was found in the text == Outdated reference: A later version (-21) exists of draft-ietf-quic-qpack-07 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-18 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7540 (Obsoleted by RFC 9113) -- Duplicate reference: RFC7838, mentioned in 'RFC7838', was also mentioned in 'ALTSVC'. Summary: 5 errors (**), 0 flaws (~~), 4 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC M. Bishop, Ed. 3 Internet-Draft Akamai 4 Intended status: Standards Track March 11, 2019 5 Expires: September 12, 2019 7 Hypertext Transfer Protocol Version 3 (HTTP/3) 8 draft-ietf-quic-http-19 10 Abstract 12 The QUIC transport protocol has several features that are desirable 13 in a transport for HTTP, such as stream multiplexing, per-stream flow 14 control, and low-latency connection establishment. This document 15 describes a mapping of HTTP semantics over QUIC. This document also 16 identifies HTTP/2 features that are subsumed by QUIC, and describes 17 how HTTP/2 extensions can be ported to HTTP/3. 19 Note to Readers 21 Discussion of this draft takes place on the QUIC working group 22 mailing list (quic@ietf.org), which is archived at 23 https://mailarchive.ietf.org/arch/search/?email_list=quic [1]. 25 Working Group information can be found at https://github.com/quicwg 26 [2]; source code and issues list for this draft can be found at 27 https://github.com/quicwg/base-drafts/labels/-http [3]. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on September 12, 2019. 46 Copyright Notice 48 Copyright (c) 2019 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 64 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 4 65 2. Connection Setup and Management . . . . . . . . . . . . . . . 5 66 2.1. Draft Version Identification . . . . . . . . . . . . . . 5 67 2.2. Discovering an HTTP/3 Endpoint . . . . . . . . . . . . . 5 68 2.2.1. QUIC Version Hints . . . . . . . . . . . . . . . . . 6 69 2.3. Connection Establishment . . . . . . . . . . . . . . . . 6 70 2.4. Connection Reuse . . . . . . . . . . . . . . . . . . . . 7 71 3. Stream Mapping and Usage . . . . . . . . . . . . . . . . . . 7 72 3.1. Bidirectional Streams . . . . . . . . . . . . . . . . . . 8 73 3.2. Unidirectional Streams . . . . . . . . . . . . . . . . . 8 74 3.2.1. Control Streams . . . . . . . . . . . . . . . . . . . 9 75 3.2.2. Push Streams . . . . . . . . . . . . . . . . . . . . 10 76 3.2.3. Reserved Stream Types . . . . . . . . . . . . . . . . 10 77 4. HTTP Framing Layer . . . . . . . . . . . . . . . . . . . . . 11 78 4.1. Frame Layout . . . . . . . . . . . . . . . . . . . . . . 12 79 4.2. Frame Definitions . . . . . . . . . . . . . . . . . . . . 12 80 4.2.1. DATA . . . . . . . . . . . . . . . . . . . . . . . . 12 81 4.2.2. HEADERS . . . . . . . . . . . . . . . . . . . . . . . 13 82 4.2.3. PRIORITY . . . . . . . . . . . . . . . . . . . . . . 13 83 4.2.4. CANCEL_PUSH . . . . . . . . . . . . . . . . . . . . . 16 84 4.2.5. SETTINGS . . . . . . . . . . . . . . . . . . . . . . 17 85 4.2.6. PUSH_PROMISE . . . . . . . . . . . . . . . . . . . . 19 86 4.2.7. GOAWAY . . . . . . . . . . . . . . . . . . . . . . . 20 87 4.2.8. MAX_PUSH_ID . . . . . . . . . . . . . . . . . . . . . 20 88 4.2.9. DUPLICATE_PUSH . . . . . . . . . . . . . . . . . . . 21 89 4.2.10. Reserved Frame Types . . . . . . . . . . . . . . . . 22 90 5. HTTP Request Lifecycle . . . . . . . . . . . . . . . . . . . 22 91 5.1. HTTP Message Exchanges . . . . . . . . . . . . . . . . . 22 92 5.1.1. Header Formatting and Compression . . . . . . . . . . 24 93 5.1.2. Request Cancellation and Rejection . . . . . . . . . 24 95 5.2. The CONNECT Method . . . . . . . . . . . . . . . . . . . 25 96 5.3. Prioritization . . . . . . . . . . . . . . . . . . . . . 26 97 5.3.1. Placeholders . . . . . . . . . . . . . . . . . . . . 27 98 5.3.2. Priority Tree Maintenance . . . . . . . . . . . . . . 27 99 5.4. Server Push . . . . . . . . . . . . . . . . . . . . . . . 28 100 6. Connection Closure . . . . . . . . . . . . . . . . . . . . . 29 101 6.1. Idle Connections . . . . . . . . . . . . . . . . . . . . 30 102 6.2. Connection Shutdown . . . . . . . . . . . . . . . . . . . 30 103 6.3. Immediate Application Closure . . . . . . . . . . . . . . 31 104 6.4. Transport Closure . . . . . . . . . . . . . . . . . . . . 32 105 7. Extensions to HTTP/3 . . . . . . . . . . . . . . . . . . . . 32 106 8. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 33 107 8.1. HTTP/3 Error Codes . . . . . . . . . . . . . . . . . . . 33 108 9. Security Considerations . . . . . . . . . . . . . . . . . . . 35 109 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35 110 10.1. Registration of HTTP/3 Identification String . . . . . . 35 111 10.2. Registration of QUIC Version Hint Alt-Svc Parameter . . 36 112 10.3. Frame Types . . . . . . . . . . . . . . . . . . . . . . 36 113 10.4. Settings Parameters . . . . . . . . . . . . . . . . . . 37 114 10.5. Error Codes . . . . . . . . . . . . . . . . . . . . . . 38 115 10.6. Stream Types . . . . . . . . . . . . . . . . . . . . . . 41 116 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 117 11.1. Normative References . . . . . . . . . . . . . . . . . . 42 118 11.2. Informative References . . . . . . . . . . . . . . . . . 43 119 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 43 120 Appendix A. Considerations for Transitioning from HTTP/2 . . . . 44 121 A.1. Streams . . . . . . . . . . . . . . . . . . . . . . . . . 44 122 A.2. HTTP Frame Types . . . . . . . . . . . . . . . . . . . . 44 123 A.3. HTTP/2 SETTINGS Parameters . . . . . . . . . . . . . . . 46 124 A.4. HTTP/2 Error Codes . . . . . . . . . . . . . . . . . . . 47 125 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 48 126 B.1. Since draft-ietf-quic-http-18 . . . . . . . . . . . . . . 48 127 B.2. Since draft-ietf-quic-http-17 . . . . . . . . . . . . . . 49 128 B.3. Since draft-ietf-quic-http-16 . . . . . . . . . . . . . . 49 129 B.4. Since draft-ietf-quic-http-15 . . . . . . . . . . . . . . 50 130 B.5. Since draft-ietf-quic-http-14 . . . . . . . . . . . . . . 50 131 B.6. Since draft-ietf-quic-http-13 . . . . . . . . . . . . . . 50 132 B.7. Since draft-ietf-quic-http-12 . . . . . . . . . . . . . . 50 133 B.8. Since draft-ietf-quic-http-11 . . . . . . . . . . . . . . 51 134 B.9. Since draft-ietf-quic-http-10 . . . . . . . . . . . . . . 51 135 B.10. Since draft-ietf-quic-http-09 . . . . . . . . . . . . . . 51 136 B.11. Since draft-ietf-quic-http-08 . . . . . . . . . . . . . . 51 137 B.12. Since draft-ietf-quic-http-07 . . . . . . . . . . . . . . 51 138 B.13. Since draft-ietf-quic-http-06 . . . . . . . . . . . . . . 51 139 B.14. Since draft-ietf-quic-http-05 . . . . . . . . . . . . . . 51 140 B.15. Since draft-ietf-quic-http-04 . . . . . . . . . . . . . . 52 141 B.16. Since draft-ietf-quic-http-03 . . . . . . . . . . . . . . 52 142 B.17. Since draft-ietf-quic-http-02 . . . . . . . . . . . . . . 52 143 B.18. Since draft-ietf-quic-http-01 . . . . . . . . . . . . . . 52 144 B.19. Since draft-ietf-quic-http-00 . . . . . . . . . . . . . . 53 145 B.20. Since draft-shade-quic-http2-mapping-00 . . . . . . . . . 53 146 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 53 147 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 53 149 1. Introduction 151 HTTP semantics are used for a broad range of services on the 152 Internet. These semantics have commonly been used with two different 153 TCP mappings, HTTP/1.1 and HTTP/2. HTTP/2 introduced a framing and 154 multiplexing layer to improve latency without modifying the transport 155 layer. However, TCP's lack of visibility into parallel requests in 156 both mappings limited the possible performance gains. 158 The QUIC transport protocol incorporates stream multiplexing and per- 159 stream flow control, similar to that provided by the HTTP/2 framing 160 layer. By providing reliability at the stream level and congestion 161 control across the entire connection, it has the capability to 162 improve the performance of HTTP compared to a TCP mapping. QUIC also 163 incorporates TLS 1.3 at the transport layer, offering comparable 164 security to running TLS over TCP, but with improved connection setup 165 latency (unless TCP Fast Open [RFC7413]} is used). 167 This document defines a mapping of HTTP semantics over the QUIC 168 transport protocol, drawing heavily on the design of HTTP/2. This 169 document identifies HTTP/2 features that are subsumed by QUIC, and 170 describes how the other features can be implemented atop QUIC. 172 QUIC is described in [QUIC-TRANSPORT]. For a full description of 173 HTTP/2, see [RFC7540]. 175 1.1. Notational Conventions 177 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 178 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 179 "OPTIONAL" in this document are to be interpreted as described in BCP 180 14 [RFC2119] [RFC8174] when, and only when, they appear in all 181 capitals, as shown here. 183 Field definitions are given in Augmented Backus-Naur Form (ABNF), as 184 defined in [RFC5234]. 186 This document uses the variable-length integer encoding from 187 [QUIC-TRANSPORT]. 189 Protocol elements called "frames" exist in both this document and 190 [QUIC-TRANSPORT]. Where frames from [QUIC-TRANSPORT] are referenced, 191 the frame name will be prefaced with "QUIC." For example, "QUIC 192 CONNECTION_CLOSE frames." References without this preface refer to 193 frames defined in Section 4.2. 195 2. Connection Setup and Management 197 2.1. Draft Version Identification 199 *RFC Editor's Note:* Please remove this section prior to 200 publication of a final version of this document. 202 HTTP/3 uses the token "h3" to identify itself in ALPN and Alt-Svc. 203 Only implementations of the final, published RFC can identify 204 themselves as "h3". Until such an RFC exists, implementations MUST 205 NOT identify themselves using this string. 207 Implementations of draft versions of the protocol MUST add the string 208 "-" and the corresponding draft number to the identifier. For 209 example, draft-ietf-quic-http-01 is identified using the string 210 "h3-01". 212 Non-compatible experiments that are based on these draft versions 213 MUST append the string "-" and an experiment name to the identifier. 214 For example, an experimental implementation based on draft-ietf-quic- 215 http-09 which reserves an extra stream for unsolicited transmission 216 of 1980s pop music might identify itself as "h3-09-rickroll". Note 217 that any label MUST conform to the "token" syntax defined in 218 Section 3.2.6 of [RFC7230]. Experimenters are encouraged to 219 coordinate their experiments on the quic@ietf.org mailing list. 221 2.2. Discovering an HTTP/3 Endpoint 223 An HTTP origin advertises the availability of an equivalent HTTP/3 224 endpoint via the Alt-Svc HTTP response header field or the HTTP/2 225 ALTSVC frame ([ALTSVC]), using the ALPN token defined in Section 2.3. 227 For example, an origin could indicate in an HTTP response that HTTP/3 228 was available on UDP port 50781 at the same hostname by including the 229 following header field: 231 Alt-Svc: h3=":50781" 233 On receipt of an Alt-Svc record indicating HTTP/3 support, a client 234 MAY attempt to establish a QUIC connection to the indicated host and 235 port and, if successful, send HTTP requests using the mapping 236 described in this document. 238 Connectivity problems (e.g. firewall blocking UDP) can result in QUIC 239 connection establishment failure, in which case the client SHOULD 240 continue using the existing connection or try another alternative 241 endpoint offered by the origin. 243 Servers MAY serve HTTP/3 on any UDP port, since an alternative always 244 includes an explicit port. 246 2.2.1. QUIC Version Hints 248 This document defines the "quic" parameter for Alt-Svc, which MAY be 249 used to provide version-negotiation hints to HTTP/3 clients. QUIC 250 versions are four-byte sequences with no additional constraints on 251 format. Leading zeros SHOULD be omitted for brevity. 253 Syntax: 255 quic = DQUOTE version-number [ "," version-number ] * DQUOTE 256 version-number = 1*8HEXDIG; hex-encoded QUIC version 258 Where multiple versions are listed, the order of the values reflects 259 the server's preference (with the first value being the most 260 preferred version). Reserved versions MAY be listed, but unreserved 261 versions which are not supported by the alternative SHOULD NOT be 262 present in the list. Origins MAY omit supported versions for any 263 reason. 265 Clients MUST ignore any included versions which they do not support. 266 The "quic" parameter MUST NOT occur more than once; clients SHOULD 267 process only the first occurrence. 269 For example, suppose a server supported both version 0x00000001 and 270 the version rendered in ASCII as "Q034". If it also opted to include 271 the reserved version (from Section 15 of [QUIC-TRANSPORT]) 272 0x1abadaba, it could specify the following header field: 274 Alt-Svc: h3=":49288";quic="1,1abadaba,51303334" 276 A client acting on this header field would drop the reserved version 277 (not supported), then attempt to connect to the alternative using the 278 first version in the list which it does support, if any. 280 2.3. Connection Establishment 282 HTTP/3 relies on QUIC as the underlying transport. The QUIC version 283 being used MUST use TLS version 1.3 or greater as its handshake 284 protocol. HTTP/3 clients MUST indicate the target domain name during 285 the TLS handshake. This may be done using the Server Name Indication 286 (SNI) [RFC6066] extension to TLS or using some other mechanism. 288 QUIC connections are established as described in [QUIC-TRANSPORT]. 289 During connection establishment, HTTP/3 support is indicated by 290 selecting the ALPN token "h3" in the TLS handshake. Support for 291 other application-layer protocols MAY be offered in the same 292 handshake. 294 While connection-level options pertaining to the core QUIC protocol 295 are set in the initial crypto handshake, HTTP/3-specific settings are 296 conveyed in the SETTINGS frame. After the QUIC connection is 297 established, a SETTINGS frame (Section 4.2.5) MUST be sent by each 298 endpoint as the initial frame of their respective HTTP control stream 299 (see Section 3.2.1). 301 2.4. Connection Reuse 303 Once a connection exists to a server endpoint, this connection MAY be 304 reused for requests with multiple different URI authority components. 305 The client MAY send any requests for which the client considers the 306 server authoritative. 308 An authoritative HTTP/3 endpoint is typically discovered because the 309 client has received an Alt-Svc record from the request's origin which 310 nominates the endpoint as a valid HTTP Alternative Service for that 311 origin. As required by [RFC7838], clients MUST check that the 312 nominated server can present a valid certificate for the origin 313 before considering it authoritative. Clients MUST NOT assume that an 314 HTTP/3 endpoint is authoritative for other origins without an 315 explicit signal. 317 A server that does not wish clients to reuse connections for a 318 particular origin can indicate that it is not authoritative for a 319 request by sending a 421 (Misdirected Request) status code in 320 response to the request (see Section 9.1.2 of [RFC7540]). 322 The considerations discussed in Section 9.1 of [RFC7540] also apply 323 to the management of HTTP/3 connections. 325 3. Stream Mapping and Usage 327 A QUIC stream provides reliable in-order delivery of bytes, but makes 328 no guarantees about order of delivery with regard to bytes on other 329 streams. On the wire, data is framed into QUIC STREAM frames, but 330 this framing is invisible to the HTTP framing layer. The transport 331 layer buffers and orders received QUIC STREAM frames, exposing the 332 data contained within as a reliable byte stream to the application. 334 Although QUIC permits out-of-order delivery within a stream HTTP/3 335 does not make use of this feature. 337 QUIC streams can be either unidirectional, carrying data only from 338 initiator to receiver, or bidirectional. Streams can be initiated by 339 either the client or the server. For more detail on QUIC streams, 340 see Section 2 of [QUIC-TRANSPORT]. 342 When HTTP headers and data are sent over QUIC, the QUIC layer handles 343 most of the stream management. HTTP does not need to do any separate 344 multiplexing when using QUIC - data sent over a QUIC stream always 345 maps to a particular HTTP transaction or connection context. 347 3.1. Bidirectional Streams 349 All client-initiated bidirectional streams are used for HTTP requests 350 and responses. A bidirectional stream ensures that the response can 351 be readily correlated with the request. This means that the client's 352 first request occurs on QUIC stream 0, with subsequent requests on 353 stream 4, 8, and so on. In order to permit these streams to open, an 354 HTTP/3 client SHOULD send non-zero values for the QUIC transport 355 parameters "initial_max_stream_data_bidi_local". An HTTP/3 server 356 SHOULD send non-zero values for the QUIC transport parameters 357 "initial_max_stream_data_bidi_remote" and "initial_max_bidi_streams". 358 It is recommended that "initial_max_bidi_streams" be no smaller than 359 100, so as to not unnecessarily limit parallelism. 361 These streams carry frames related to the request/response (see 362 Section 5.1). When a stream terminates cleanly, if the last frame on 363 the stream was truncated, this MUST be treated as a connection error 364 (see HTTP_MALFORMED_FRAME in Section 8.1). Streams which terminate 365 abruptly may be reset at any point in the frame. 367 HTTP/3 does not use server-initiated bidirectional streams; clients 368 MUST omit or specify a value of zero for the QUIC transport parameter 369 "initial_max_bidi_streams". 371 3.2. Unidirectional Streams 373 Unidirectional streams, in either direction, are used for a range of 374 purposes. The purpose is indicated by a stream type, which is sent 375 as a variable-length integer at the start of the stream. The format 376 and structure of data that follows this integer is determined by the 377 stream type. 379 0 1 2 3 380 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 381 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 382 | Stream Type (i) ... 383 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 385 Figure 1: Unidirectional Stream Header 387 Some stream types are reserved (Section 3.2.3). Two stream types are 388 defined in this document: control streams (Section 3.2.1) and push 389 streams (Section 3.2.2). Other stream types can be defined by 390 extensions to HTTP/3; see Section 7 for more details. 392 Both clients and servers SHOULD send a value of three or greater for 393 the QUIC transport parameter "initial_max_uni_streams". 395 If the stream header indicates a stream type which is not supported 396 by the recipient, the remainder of the stream cannot be consumed as 397 the semantics are unknown. Recipients of unknown stream types MAY 398 trigger a QUIC STOP_SENDING frame with an error code of 399 HTTP_UNKNOWN_STREAM_TYPE, but MUST NOT consider such streams to be an 400 error of any kind. 402 Implementations MAY send stream types before knowing whether the peer 403 supports them. However, stream types which could modify the state or 404 semantics of existing protocol components, including QPACK or other 405 extensions, MUST NOT be sent until the peer is known to support them. 407 A sender can close or reset a unidirectional stream unless otherwise 408 specified. A receiver MUST tolerate unidirectional streams being 409 closed or reset prior to the reception of the unidirectional stream 410 header. 412 3.2.1. Control Streams 414 A control stream is indicated by a stream type of "0x00". Data on 415 this stream consists of HTTP/3 frames, as defined in Section 4.2. 417 Each side MUST initiate a single control stream at the beginning of 418 the connection and send its SETTINGS frame as the first frame on this 419 stream. If the first frame of the control stream is any other frame 420 type, this MUST be treated as a connection error of type 421 HTTP_MISSING_SETTINGS. Only one control stream per peer is 422 permitted; receipt of a second stream which claims to be a control 423 stream MUST be treated as a connection error of type 424 HTTP_WRONG_STREAM_COUNT. The sender MUST NOT close the control 425 stream. If the control stream is closed at any point, this MUST be 426 treated as a connection error of type HTTP_CLOSED_CRITICAL_STREAM. 428 A pair of unidirectional streams is used rather than a single 429 bidirectional stream. This allows either peer to send data as soon 430 they are able. Depending on whether 0-RTT is enabled on the 431 connection, either client or server might be able to send stream data 432 first after the cryptographic handshake completes. 434 3.2.2. Push Streams 436 A push stream is indicated by a stream type of "0x01", followed by 437 the Push ID of the promise that it fulfills, encoded as a variable- 438 length integer. The remaining data on this stream consists of HTTP/3 439 frames, as defined in Section 4.2, and fulfills a promised server 440 push. Server push and Push IDs are described in Section 5.4. 442 Only servers can push; if a server receives a client-initiated push 443 stream, this MUST be treated as a stream error of type 444 HTTP_WRONG_STREAM_DIRECTION. 446 0 1 2 3 447 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 448 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 449 | 0x01 (i) ... 450 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 451 | Push ID (i) ... 452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 454 Figure 2: Push Stream Header 456 Each Push ID MUST only be used once in a push stream header. If a 457 push stream header includes a Push ID that was used in another push 458 stream header, the client MUST treat this as a connection error of 459 type HTTP_DUPLICATE_PUSH. 461 3.2.3. Reserved Stream Types 463 Stream types of the format "0x1f * N + 0x21" for integer values of N 464 are reserved to exercise the requirement that unknown types be 465 ignored. These streams have no semantics, and can be sent when 466 application-layer padding is desired. They MAY also be sent on 467 connections where no data is currently being transferred. Endpoints 468 MUST NOT consider these streams to have any meaning upon receipt. 470 The payload and length of the stream are selected in any manner the 471 implementation chooses. 473 4. HTTP Framing Layer 475 HTTP frames are carried on QUIC streams, as described in Section 3. 476 HTTP/3 defines three stream types: control stream, request stream, 477 and push stream. This section describes HTTP/3 frame formats and the 478 streams types on which they are permitted; see Table 1 for an 479 overiew. A comparison between HTTP/2 and HTTP/3 frames is provided 480 in Appendix A.2. 482 +----------------+------------+------------+-----------+------------+ 483 | Frame | Control | Request | Push | Section | 484 | | Stream | Stream | Stream | | 485 +----------------+------------+------------+-----------+------------+ 486 | DATA | No | Yes | Yes | Section | 487 | | | | | 4.2.1 | 488 | | | | | | 489 | HEADERS | No | Yes | Yes | Section | 490 | | | | | 4.2.2 | 491 | | | | | | 492 | PRIORITY | Yes | Yes (1) | No | Section | 493 | | | | | 4.2.3 | 494 | | | | | | 495 | CANCEL_PUSH | Yes | No | No | Section | 496 | | | | | 4.2.4 | 497 | | | | | | 498 | SETTINGS | Yes (1) | No | No | Section | 499 | | | | | 4.2.5 | 500 | | | | | | 501 | PUSH_PROMISE | No | Yes | No | Section | 502 | | | | | 4.2.6 | 503 | | | | | | 504 | GOAWAY | Yes | No | No | Section | 505 | | | | | 4.2.7 | 506 | | | | | | 507 | MAX_PUSH_ID | Yes | No | No | Section | 508 | | | | | 4.2.8 | 509 | | | | | | 510 | DUPLICATE_PUSH | No | Yes | No | Section | 511 | | | | | 4.2.9 | 512 +----------------+------------+------------+-----------+------------+ 514 Table 1: HTTP/3 frames and stream type overview 516 Certain frames can only occur as the first frame of a particular 517 stream type; these are indicated in Table 1 with a (1). Specific 518 guidance is provided in the relevant section. 520 4.1. Frame Layout 522 All frames have the following format: 524 0 1 2 3 525 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 526 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 527 | Type (i) ... 528 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 529 | Length (i) ... 530 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 531 | Frame Payload (*) ... 532 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 534 Figure 3: HTTP/3 frame format 536 A frame includes the following fields: 538 Type: A variable-length integer that identifies the frame type. 540 Length: A variable-length integer that describes the length of the 541 Frame Payload. 543 Frame Payload: A payload, the semantics of which are determined by 544 the Type field. 546 Each frame's payload MUST contain exactly the fields identified in 547 its description. A frame payload that contains additional bytes 548 after the identified fields or a frame payload that terminates before 549 the end of the identified fields MUST be treated as a connection 550 error of type HTTP_MALFORMED_FRAME. 552 4.2. Frame Definitions 554 4.2.1. DATA 556 DATA frames (type=0x0) convey arbitrary, variable-length sequences of 557 bytes associated with an HTTP request or response payload. 559 DATA frames MUST be associated with an HTTP request or response. If 560 a DATA frame is received on either control stream, the recipient MUST 561 respond with a connection error (Section 8) of type 562 HTTP_WRONG_STREAM. 564 0 1 2 3 565 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 566 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 567 | Payload (*) ... 568 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 570 Figure 4: DATA frame payload 572 4.2.2. HEADERS 574 The HEADERS frame (type=0x1) is used to carry a header block, 575 compressed using QPACK. See [QPACK] for more details. 577 0 1 2 3 578 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 579 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 580 | Header Block (*) ... 581 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 583 Figure 5: HEADERS frame payload 585 HEADERS frames can only be sent on request / push streams. 587 4.2.3. PRIORITY 589 The PRIORITY (type=0x2) frame specifies the client-advised priority 590 of a request, server push or placeholder. 592 A PRIORITY frame identifies an element to prioritize, and an element 593 upon which it depends. A Prioritized ID or Dependency ID identifies 594 a client-initiated request using the corresponding stream ID, a 595 server push using a Push ID (see Section 4.2.6), or a placeholder 596 using a Placeholder ID (see Section 5.3.1). 598 When a client initiates a request, a PRIORITY frame MAY be sent as 599 the first frame of the stream, creating a dependency on an existing 600 element. In order to ensure that prioritization is processed in a 601 consistent order, any subsequent PRIORITY frames for that request 602 MUST be sent on the control stream. A PRIORITY frame received after 603 other frames on a request stream MUST be treated as a stream error of 604 type HTTP_UNEXPECTED_FRAME. 606 If, by the time a new request stream is opened, its priority 607 information has already been received via the control stream, the 608 PRIORITY frame sent on the request stream MUST be ignored. 610 0 1 2 3 611 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 613 |PT |DT | Empty | [Prioritized Element ID (i)] ... 614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 615 | [Element Dependency ID (i)] ... 616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 617 | Weight (8) | 618 +-+-+-+-+-+-+-+-+ 620 Figure 6: PRIORITY frame payload 622 The PRIORITY frame payload has the following fields: 624 PT (Prioritized Element Type): A two-bit field indicating the type 625 of element being prioritized (see Table 2). When sent on a 626 request stream, this MUST be set to "11". When sent on the 627 control stream, this MUST NOT be set to "11". 629 DT (Element Dependency Type): A two-bit field indicating the type of 630 element being depended on (see Table 3). 632 Empty: A four-bit field which MUST be zero when sent and MUST be 633 ignored on receipt. 635 Prioritized Element ID: A variable-length integer that identifies 636 the element being prioritized. Depending on the value of 637 Prioritized Type, this contains the Stream ID of a request stream, 638 the Push ID of a promised resource, a Placeholder ID of a 639 placeholder, or is absent. 641 Element Dependency ID: A variable-length integer that identifies the 642 element on which a dependency is being expressed. Depending on 643 the value of Dependency Type, this contains the Stream ID of a 644 request stream, the Push ID of a promised resource, the 645 Placeholder ID of a placeholder, or is absent. For details of 646 dependencies, see Section 5.3 and [RFC7540], Section 5.3. 648 Weight: An unsigned 8-bit integer representing a priority weight for 649 the prioritized element (see [RFC7540], Section 5.3). Add one to 650 the value to obtain a weight between 1 and 256. 652 The values for the Prioritized Element Type (Table 2) and Element 653 Dependency Type (Table 3) imply the interpretation of the associated 654 Element ID fields. 656 +---------+------------------+---------------------------------+ 657 | PT Bits | Type Description | Prioritized Element ID Contents | 658 +---------+------------------+---------------------------------+ 659 | 00 | Request stream | Stream ID | 660 | | | | 661 | 01 | Push stream | Push ID | 662 | | | | 663 | 10 | Placeholder | Placeholder ID | 664 | | | | 665 | 11 | Current stream | Absent | 666 +---------+------------------+---------------------------------+ 668 Table 2: Prioritized Element Types 670 +---------+------------------+--------------------------------+ 671 | DT Bits | Type Description | Element Dependency ID Contents | 672 +---------+------------------+--------------------------------+ 673 | 00 | Request stream | Stream ID | 674 | | | | 675 | 01 | Push stream | Push ID | 676 | | | | 677 | 10 | Placeholder | Placeholder ID | 678 | | | | 679 | 11 | Root of the tree | Absent | 680 +---------+------------------+--------------------------------+ 682 Table 3: Element Dependency Types 684 Note that unlike in [RFC7540], the root of the tree cannot be 685 referenced using a Stream ID of 0, as in QUIC stream 0 carries a 686 valid HTTP request. The root of the tree cannot be reprioritized. A 687 PRIORITY frame sent on a request stream with the Prioritized Element 688 Type set to any value other than "11" or which expresses a dependency 689 on a request with a greater Stream ID than the current stream MUST be 690 treated as a stream error of type HTTP_MALFORMED_FRAME. Likewise, a 691 PRIORITY frame sent on a control stream with the Prioritized Element 692 Type set to "11" MUST be treated as a connection error of type 693 HTTP_MALFORMED_FRAME. 695 When a PRIORITY frame claims to reference a request, the associated 696 ID MUST identify a client-initiated bidirectional stream. A server 697 MUST treat receipt of a PRIORITY frame identifying a stream of any 698 other type as a connection error of type HTTP_MALFORMED_FRAME. 700 A PRIORITY frame that references a non-existent Push ID, a 701 Placeholder ID greater than the server's limit, or a Stream ID the 702 client is not yet permitted to open MUST be treated as an 703 HTTP_LIMIT_EXCEEDED error. 705 A PRIORITY frame received on any stream other than a request or 706 control stream MUST be treated as a connection error of type 707 HTTP_WRONG_STREAM. 709 PRIORITY frames received by a client MUST be treated as a connection 710 error of type HTTP_UNEXPECTED_FRAME. 712 4.2.4. CANCEL_PUSH 714 The CANCEL_PUSH frame (type=0x3) is used to request cancellation of a 715 server push prior to the push stream being received. The CANCEL_PUSH 716 frame identifies a server push by Push ID (see Section 4.2.6), 717 encoded as a variable-length integer. 719 When a server receives this frame, it aborts sending the response for 720 the identified server push. If the server has not yet started to 721 send the server push, it can use the receipt of a CANCEL_PUSH frame 722 to avoid opening a push stream. If the push stream has been opened 723 by the server, the server SHOULD send a QUIC RESET_STREAM frame on 724 that stream and cease transmission of the response. 726 A server can send the CANCEL_PUSH frame to indicate that it will not 727 be fulfilling a promise prior to creation of a push stream. Once the 728 push stream has been created, sending CANCEL_PUSH has no effect on 729 the state of the push stream. A QUIC RESET_STREAM frame SHOULD be 730 used instead to abort transmission of the server push response. 732 A CANCEL_PUSH frame is sent on the control stream. Receiving a 733 CANCEL_PUSH frame on a stream other than the control stream MUST be 734 treated as a stream error of type HTTP_WRONG_STREAM. 736 0 1 2 3 737 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 739 | Push ID (i) ... 740 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 742 Figure 7: CANCEL_PUSH frame payload 744 The CANCEL_PUSH frame carries a Push ID encoded as a variable-length 745 integer. The Push ID identifies the server push that is being 746 cancelled (see Section 4.2.6). 748 If the client receives a CANCEL_PUSH frame, that frame might identify 749 a Push ID that has not yet been mentioned by a PUSH_PROMISE frame. 751 4.2.5. SETTINGS 753 The SETTINGS frame (type=0x4) conveys configuration parameters that 754 affect how endpoints communicate, such as preferences and constraints 755 on peer behavior. Individually, a SETTINGS parameter can also be 756 referred to as a "setting"; the identifier and value of each setting 757 parameter can be referred to as a "setting identifier" and a "setting 758 value". 760 SETTINGS frames always apply to a connection, never a single stream. 761 A SETTINGS frame MUST be sent as the first frame of each control 762 stream (see Section 3.2.1) by each peer, and MUST NOT be sent 763 subsequently or on any other stream. If an endpoint receives a 764 SETTINGS frame on a different stream, the endpoint MUST respond with 765 a connection error of type HTTP_WRONG_STREAM. If an endpoint 766 receives a second SETTINGS frame, the endpoint MUST respond with a 767 connection error of type HTTP_UNEXPECTED_FRAME. 769 SETTINGS parameters are not negotiated; they describe characteristics 770 of the sending peer, which can be used by the receiving peer. 771 However, a negotiation can be implied by the use of SETTINGS - each 772 peer uses SETTINGS to advertise a set of supported values. The 773 definition of the setting would describe how each peer combines the 774 two sets to conclude which choice will be used. SETTINGS does not 775 provide a mechanism to identify when the choice takes effect. 777 Different values for the same parameter can be advertised by each 778 peer. For example, a client might be willing to consume a very large 779 response header, while servers are more cautious about request size. 781 Parameters MUST NOT occur more than once in the SETTINGS frame. A 782 receiver MAY treat the presence of the same parameter more than once 783 as a connection error of type HTTP_MALFORMED_FRAME. 785 The payload of a SETTINGS frame consists of zero or more parameters. 786 Each parameter consists of a setting identifier and a value, both 787 encoded as QUIC variable-length integers. 789 0 1 2 3 790 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 791 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 792 | Identifier (i) ... 793 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 794 | Value (i) ... 795 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 797 Figure 8: SETTINGS parameter format 799 An implementation MUST ignore the contents for any SETTINGS 800 identifier it does not understand. 802 4.2.5.1. Defined SETTINGS Parameters 804 The following settings are defined in HTTP/3: 806 SETTINGS_MAX_HEADER_LIST_SIZE (0x6): The default value is unlimited. 807 See Section 5.1.1 for usage. 809 SETTINGS_NUM_PLACEHOLDERS (0x8): The default value is 0. However, 810 this value SHOULD be set to a non-zero value by servers. See 811 Section 5.3.1 for usage. 813 Setting identifiers of the format "0x1f * N + 0x21" for integer 814 values of N are reserved to exercise the requirement that unknown 815 identifiers be ignored. Such settings have no defined meaning. 816 Endpoints SHOULD include at least one such setting in their SETTINGS 817 frame. Endpoints MUST NOT consider such settings to have any meaning 818 upon receipt. 820 Because the setting has no defined meaning, the value of the setting 821 can be any value the implementation selects. 823 Additional settings can be defined by extensions to HTTP/3; see 824 Section 7 for more details. 826 4.2.5.2. Initialization 828 An HTTP implementation MUST NOT send frames or requests which would 829 be invalid based on its current understanding of the peer's settings. 830 All settings begin at an initial value, and are updated upon receipt 831 of a SETTINGS frame. For servers, the initial value of each client 832 setting is the default value. 834 For clients using a 1-RTT QUIC connection, the initial value of each 835 server setting is the default value. When a 0-RTT QUIC connection is 836 being used, the initial value of each server setting is the value 837 used in the previous session. Clients MUST store the settings the 838 server provided in the session being resumed and MUST comply with 839 stored settings until the current server settings are received. 841 A server can remember the settings that it advertised, or store an 842 integrity-protected copy of the values in the ticket and recover the 843 information when accepting 0-RTT data. A server uses the HTTP/3 844 settings values in determining whether to accept 0-RTT data. 846 A server MAY accept 0-RTT and subsequently provide different settings 847 in its SETTINGS frame. If 0-RTT data is accepted by the server, its 848 SETTINGS frame MUST NOT reduce any limits or alter any values that 849 might be violated by the client with its 0-RTT data. 851 4.2.6. PUSH_PROMISE 853 The PUSH_PROMISE frame (type=0x5) is used to carry a promised request 854 header set from server to client on a request stream, as in HTTP/2. 856 0 1 2 3 857 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 858 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 859 | Push ID (i) ... 860 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 861 | Header Block (*) ... 862 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 864 Figure 9: PUSH_PROMISE frame payload 866 The payload consists of: 868 Push ID: A variable-length integer that identifies the server push 869 operation. A Push ID is used in push stream headers 870 (Section 5.4), CANCEL_PUSH frames (Section 4.2.4), DUPLICATE_PUSH 871 frames (Section 4.2.9), and PRIORITY frames (Section 4.2.3). 873 Header Block: QPACK-compressed request header fields for the 874 promised response. See [QPACK] for more details. 876 A server MUST NOT use a Push ID that is larger than the client has 877 provided in a MAX_PUSH_ID frame (Section 4.2.8) and MUST NOT use the 878 same Push ID in multiple PUSH_PROMISE frames. A client MUST treat 879 receipt of a PUSH_PROMISE that contains a larger Push ID than the 880 client has advertised or a Push ID which has already been promised as 881 a connection error of type HTTP_MALFORMED_FRAME. 883 If a PUSH_PROMISE frame is received on either control stream, the 884 recipient MUST respond with a connection error (Section 8) of type 885 HTTP_WRONG_STREAM. 887 See Section 5.4 for a description of the overall server push 888 mechanism. 890 4.2.7. GOAWAY 892 The GOAWAY frame (type=0x7) is used to initiate graceful shutdown of 893 a connection by a server. GOAWAY allows a server to stop accepting 894 new requests while still finishing processing of previously received 895 requests. This enables administrative actions, like server 896 maintenance. GOAWAY by itself does not close a connection. 898 0 1 2 3 899 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 900 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 901 | Stream ID (i) ... 902 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 904 Figure 10: GOAWAY frame payload 906 The GOAWAY frame is always sent on the control stream. It carries a 907 QUIC Stream ID for a client-initiated bidirectional stream encoded as 908 a variable-length integer. A client MUST treat receipt of a GOAWAY 909 frame containing a Stream ID of any other type as a connection error 910 of type HTTP_WRONG_STREAM. 912 Clients do not need to send GOAWAY to initiate a graceful shutdown; 913 they simply stop making new requests. A server MUST treat receipt of 914 a GOAWAY frame on any stream as a connection error (Section 8) of 915 type HTTP_UNEXPECTED_FRAME. 917 The GOAWAY frame applies to the connection, not a specific stream. A 918 client MUST treat a GOAWAY frame on a stream other than the control 919 stream as a connection error (Section 8) of type 920 HTTP_UNEXPECTED_FRAME. 922 See Section 6.2 for more information on the use of the GOAWAY frame. 924 4.2.8. MAX_PUSH_ID 926 The MAX_PUSH_ID frame (type=0xD) is used by clients to control the 927 number of server pushes that the server can initiate. This sets the 928 maximum value for a Push ID that the server can use in a PUSH_PROMISE 929 frame. Consequently, this also limits the number of push streams 930 that the server can initiate in addition to the limit set by the QUIC 931 MAX_STREAM_ID frame. 933 The MAX_PUSH_ID frame is always sent on the control stream. Receipt 934 of a MAX_PUSH_ID frame on any other stream MUST be treated as a 935 connection error of type HTTP_WRONG_STREAM. 937 A server MUST NOT send a MAX_PUSH_ID frame. A client MUST treat the 938 receipt of a MAX_PUSH_ID frame as a connection error of type 939 HTTP_UNEXPECTED_FRAME. 941 The maximum Push ID is unset when a connection is created, meaning 942 that a server cannot push until it receives a MAX_PUSH_ID frame. A 943 client that wishes to manage the number of promised server pushes can 944 increase the maximum Push ID by sending MAX_PUSH_ID frames as the 945 server fulfills or cancels server pushes. 947 0 1 2 3 948 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 949 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 950 | Push ID (i) ... 951 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 953 Figure 11: MAX_PUSH_ID frame payload 955 The MAX_PUSH_ID frame carries a single variable-length integer that 956 identifies the maximum value for a Push ID that the server can use 957 (see Section 4.2.6). A MAX_PUSH_ID frame cannot reduce the maximum 958 Push ID; receipt of a MAX_PUSH_ID that contains a smaller value than 959 previously received MUST be treated as a connection error of type 960 HTTP_MALFORMED_FRAME. 962 4.2.9. DUPLICATE_PUSH 964 The DUPLICATE_PUSH frame (type=0xE) is used by servers to indicate 965 that an existing pushed resource is related to multiple client 966 requests. 968 The DUPLICATE_PUSH frame is always sent on a request stream. Receipt 969 of a DUPLICATE_PUSH frame on any other stream MUST be treated as a 970 connection error of type HTTP_WRONG_STREAM. 972 A client MUST NOT send a DUPLICATE_PUSH frame. A server MUST treat 973 the receipt of a DUPLICATE_PUSH frame as a connection error of type 974 HTTP_UNEXPECTED_FRAME. 976 0 1 2 3 977 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 978 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 979 | Push ID (i) ... 980 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 982 Figure 12: DUPLICATE_PUSH frame payload 984 The DUPLICATE_PUSH frame carries a single variable-length integer 985 that identifies the Push ID of a resource that the server has 986 previously promised (see Section 4.2.6). 988 This frame allows the server to use the same server push in response 989 to multiple concurrent requests. Referencing the same server push 990 ensures that a promise can be made in relation to every response in 991 which server push might be needed without duplicating request headers 992 or pushed responses. 994 Allowing duplicate references to the same Push ID is primarily to 995 reduce duplication caused by concurrent requests. A server SHOULD 996 avoid reusing a Push ID over a long period. Clients are likely to 997 consume server push responses and not retain them for reuse over 998 time. Clients that see a DUPLICATE_PUSH that uses a Push ID that 999 they have since consumed and discarded are forced to ignore the 1000 DUPLICATE_PUSH. 1002 4.2.10. Reserved Frame Types 1004 Frame types of the format "0x1f * N + 0x21" for integer values of N 1005 are reserved to exercise the requirement that unknown types be 1006 ignored (Section 7). These frames have no semantics, and can be sent 1007 when application-layer padding is desired. They MAY also be sent on 1008 connections where no data is currently being transferred. Endpoints 1009 MUST NOT consider these frames to have any meaning upon receipt. 1011 The payload and length of the frames are selected in any manner the 1012 implementation chooses. 1014 5. HTTP Request Lifecycle 1016 5.1. HTTP Message Exchanges 1018 A client sends an HTTP request on a client-initiated bidirectional 1019 QUIC stream. A client MUST send only a single request on a given 1020 stream. A server sends one or more HTTP responses on the same stream 1021 as the request, as detailed below. 1023 An HTTP message (request or response) consists of: 1025 1. the message header (see [RFC7230], Section 3.2), sent as a single 1026 HEADERS frame (see Section 4.2.2), 1028 2. the payload body (see [RFC7230], Section 3.3), sent as a series 1029 of DATA frames (see Section 4.2.1), 1031 3. optionally, one HEADERS frame containing the trailer-part, if 1032 present (see [RFC7230], Section 4.1.2). 1034 A server MAY interleave one or more PUSH_PROMISE frames (see 1035 Section 4.2.6) with the frames of a response message. These 1036 PUSH_PROMISE frames are not part of the response; see Section 5.4 for 1037 more details. 1039 The "chunked" transfer encoding defined in Section 4.1 of [RFC7230] 1040 MUST NOT be used. 1042 Trailing header fields are carried in an additional HEADERS frame 1043 following the body. Senders MUST send only one HEADERS frame in the 1044 trailers section; receivers MUST discard any subsequent HEADERS 1045 frames. 1047 A response MAY consist of multiple messages when and only when one or 1048 more informational responses (1xx, see [RFC7231], Section 6.2) 1049 precede a final response to the same request. Non-final responses do 1050 not contain a payload body or trailers. 1052 An HTTP request/response exchange fully consumes a bidirectional QUIC 1053 stream. After sending a request, a client MUST close the stream for 1054 sending. Unless using the CONNECT method (see Section 5.2), clients 1055 MUST NOT make stream closure dependent on receiving a response to 1056 their request. After sending a final response, the server MUST close 1057 the stream for sending. At this point, the QUIC stream is fully 1058 closed. 1060 When a stream is closed, this indicates the end of an HTTP message. 1061 Because some messages are large or unbounded, endpoints SHOULD begin 1062 processing partial HTTP messages once enough of the message has been 1063 received to make progress. If a client stream terminates without 1064 enough of the HTTP message to provide a complete response, the server 1065 SHOULD abort its response with the error code 1066 HTTP_INCOMPLETE_REQUEST. 1068 A server can send a complete response prior to the client sending an 1069 entire request if the response does not depend on any portion of the 1070 request that has not been sent and received. When this is true, a 1071 server MAY request that the client abort transmission of a request 1072 without error by triggering a QUIC STOP_SENDING frame with error code 1073 HTTP_EARLY_RESPONSE, sending a complete response, and cleanly closing 1074 its stream. Clients MUST NOT discard complete responses as a result 1075 of having their request terminated abruptly, though clients can 1076 always discard responses at their discretion for other reasons. 1078 5.1.1. Header Formatting and Compression 1080 HTTP message headers carry information as a series of key-value 1081 pairs, called header fields. For a listing of registered HTTP header 1082 fields, see the "Message Header Field" registry maintained at 1083 https://www.iana.org/assignments/message-headers [4]. 1085 Just as in previous versions of HTTP, header field names are strings 1086 of ASCII characters that are compared in a case-insensitive fashion. 1087 Properties of HTTP header field names and values are discussed in 1088 more detail in Section 3.2 of [RFC7230], though the wire rendering in 1089 HTTP/3 differs. As in HTTP/2, header field names MUST be converted 1090 to lowercase prior to their encoding. A request or response 1091 containing uppercase header field names MUST be treated as malformed. 1093 As in HTTP/2, HTTP/3 uses special pseudo-header fields beginning with 1094 the ':' character (ASCII 0x3a) to convey the target URI, the method 1095 of the request, and the status code for the response. These pseudo- 1096 header fields are defined in Section 8.1.2.3 and 8.1.2.4 of 1097 [RFC7540]. Pseudo-header fields are not HTTP header fields. 1098 Endpoints MUST NOT generate pseudo-header fields other than those 1099 defined in [RFC7540]. The restrictions on the use of pseudo-header 1100 fields in Section 8.1.2.1 of [RFC7540] also apply to HTTP/3. 1102 HTTP/3 uses QPACK header compression as described in [QPACK], a 1103 variation of HPACK which allows the flexibility to avoid header- 1104 compression-induced head-of-line blocking. See that document for 1105 additional details. 1107 An HTTP/3 implementation MAY impose a limit on the maximum size of 1108 the header it will accept on an individual HTTP message; encountering 1109 a larger message header SHOULD be treated as a stream error of type 1110 "HTTP_EXCESSIVE_LOAD". If an implementation wishes to advise its 1111 peer of this limit, it can be conveyed as a number of bytes in the 1112 "SETTINGS_MAX_HEADER_LIST_SIZE" parameter. The size of a header list 1113 is calculated based on the uncompressed size of header fields, 1114 including the length of the name and value in bytes plus an overhead 1115 of 32 bytes for each header field. 1117 5.1.2. Request Cancellation and Rejection 1119 Clients can cancel requests by aborting the stream (QUIC RESET_STREAM 1120 and/or STOP_SENDING frames, as appropriate) with an error code of 1121 HTTP_REQUEST_CANCELLED (Section 8.1). When the client cancels a 1122 response, it indicates that this response is no longer of interest. 1123 Implementations SHOULD cancel requests by aborting both directions of 1124 a stream. 1126 When the server rejects a request without performing any application 1127 processing, it SHOULD abort its response stream with the error code 1128 HTTP_REQUEST_REJECTED. In this context, "processed" means that some 1129 data from the stream was passed to some higher layer of software that 1130 might have taken some action as a result. The client can treat 1131 requests rejected by the server as though they had never been sent at 1132 all, thereby allowing them to be retried later on a new connection. 1133 Servers MUST NOT use the HTTP_REQUEST_REJECTED error code for 1134 requests which were partially or fully processed. When a server 1135 abandons a response after partial processing, it SHOULD abort its 1136 response stream with the error code HTTP_REQUEST_CANCELLED. 1138 When a client sends a STOP_SENDING with HTTP_REQUEST_CANCELLED, a 1139 server MAY send the error code HTTP_REQUEST_REJECTED in the 1140 corresponding RESET_STREAM if no processing was performed. Clients 1141 MUST NOT reset streams with the HTTP_REQUEST_REJECTED error code 1142 except in response to a QUIC STOP_SENDING frame that contains the 1143 same code. 1145 If a stream is cancelled after receiving a complete response, the 1146 client MAY ignore the cancellation and use the response. However, if 1147 a stream is cancelled after receiving a partial response, the 1148 response SHOULD NOT be used. Automatically retrying such requests is 1149 not possible, unless this is otherwise permitted (e.g., idempotent 1150 actions like GET, PUT, or DELETE). 1152 5.2. The CONNECT Method 1154 The pseudo-method CONNECT ([RFC7231], Section 4.3.6) is primarily 1155 used with HTTP proxies to establish a TLS session with an origin 1156 server for the purposes of interacting with "https" resources. In 1157 HTTP/1.x, CONNECT is used to convert an entire HTTP connection into a 1158 tunnel to a remote host. In HTTP/2, the CONNECT method is used to 1159 establish a tunnel over a single HTTP/2 stream to a remote host for 1160 similar purposes. 1162 A CONNECT request in HTTP/3 functions in the same manner as in 1163 HTTP/2. The request MUST be formatted as described in [RFC7540], 1164 Section 8.3. A CONNECT request that does not conform to these 1165 restrictions is malformed. The request stream MUST NOT be closed at 1166 the end of the request. 1168 A proxy that supports CONNECT establishes a TCP connection 1169 ([RFC0793]) to the server identified in the ":authority" pseudo- 1170 header field. Once this connection is successfully established, the 1171 proxy sends a HEADERS frame containing a 2xx series status code to 1172 the client, as defined in [RFC7231], Section 4.3.6. 1174 All DATA frames on the stream correspond to data sent or received on 1175 the TCP connection. Any DATA frame sent by the client is transmitted 1176 by the proxy to the TCP server; data received from the TCP server is 1177 packaged into DATA frames by the proxy. Note that the size and 1178 number of TCP segments is not guaranteed to map predictably to the 1179 size and number of HTTP DATA or QUIC STREAM frames. 1181 The TCP connection can be closed by either peer. When the client 1182 ends the request stream (that is, the receive stream at the proxy 1183 enters the "Data Recvd" state), the proxy will set the FIN bit on its 1184 connection to the TCP server. When the proxy receives a packet with 1185 the FIN bit set, it will terminate the send stream that it sends to 1186 the client. TCP connections which remain half-closed in a single 1187 direction are not invalid, but are often handled poorly by servers, 1188 so clients SHOULD NOT close a stream for sending while they still 1189 expect to receive data from the target of the CONNECT. 1191 A TCP connection error is signaled with QUIC RESET_STREAM frame. A 1192 proxy treats any error in the TCP connection, which includes 1193 receiving a TCP segment with the RST bit set, as a stream error of 1194 type HTTP_CONNECT_ERROR (Section 8.1). Correspondingly, a proxy MUST 1195 send a TCP segment with the RST bit set if it detects an error with 1196 the stream or the QUIC connection. 1198 5.3. Prioritization 1200 HTTP/3 uses a priority scheme similar to that described in [RFC7540], 1201 Section 5.3. In this priority scheme, a given element can be 1202 designated as dependent upon another element. This information is 1203 expressed in the PRIORITY frame Section 4.2.3 which identifies the 1204 element and the dependency. The elements that can be prioritized 1205 are: 1207 o Requests, identified by the ID of the request stream 1209 o Pushes, identified by the Push ID of the promised resource 1210 (Section 4.2.6) 1212 o Placeholders, identified by a Placeholder ID 1214 Taken together, the dependencies across all prioritized elements in a 1215 connection form a dependency tree. An element can depend on another 1216 element or on the root of the tree. A reference to an element which 1217 is no longer in the tree is treated as a reference to the root of the 1218 tree. The structure of the dependency tree changes as PRIORITY 1219 frames modify the dependency links between prioritized elements. 1221 Due to reordering between streams, an element can also be prioritized 1222 which is not yet in the tree. Such elements are added to the tree 1223 with the requested priority. 1225 When a prioritized element is first created, it has a default initial 1226 weight of 16 and a default dependency. Requests and placeholders are 1227 dependent on the root of the priority tree; pushes are dependent on 1228 the client request on which the PUSH_PROMISE frame was sent. 1230 Requests may override the default initial values by including a 1231 PRIORTIY frame (see Section 4.2.3) at the beginning of the stream. 1232 These priorities can be updated by sending a PRIORITY frame on the 1233 control stream. 1235 5.3.1. Placeholders 1237 In HTTP/2, certain implementations used closed or unused streams as 1238 placeholders in describing the relative priority of requests. This 1239 created confusion as servers could not reliably identify which 1240 elements of the priority tree could be discarded safely. Clients 1241 could potentially reference closed streams long after the server had 1242 discarded state, leading to disparate views of the prioritization the 1243 client had attempted to express. 1245 In HTTP/3, a number of placeholders are explicitly permitted by the 1246 server using the "SETTINGS_NUM_PLACEHOLDERS" setting. Because the 1247 server commits to maintaining these placeholders in the 1248 prioritization tree, clients can use them with confidence that the 1249 server will not have discarded the state. Clients MUST NOT send the 1250 "SETTINGS_NUM_PLACEHOLDERS" setting; receipt of this setting by a 1251 server MUST be treated as a connection error of type 1252 "HTTP_WRONG_SETTING_DIRECTION". 1254 Placeholders are identified by an ID between zero and one less than 1255 the number of placeholders the server has permitted. 1257 Like streams, placeholders have priority information associated with 1258 them. 1260 5.3.2. Priority Tree Maintenance 1262 Because placeholders will be used to "root" any persistent structure 1263 of the tree which the client cares about retaining, servers can 1264 aggressively prune inactive regions from the priority tree. For 1265 prioritization purposes, a node in the tree is considered "inactive" 1266 when the corresponding stream has been closed for at least two round- 1267 trip times (using any reasonable estimate available on the server). 1268 This delay helps mitigate race conditions where the server has pruned 1269 a node the client believed was still active and used as a Stream 1270 Dependency. 1272 Specifically, the server MAY at any time: 1274 o Identify and discard branches of the tree containing only inactive 1275 nodes (i.e. a node with only other inactive nodes as descendants, 1276 along with those descendants) 1278 o Identify and condense interior regions of the tree containing only 1279 inactive nodes, allocating weight appropriately 1281 x x x 1282 | | | 1283 P P P 1284 / \ | | 1285 I I ==> I ==> A 1286 / \ | | 1287 A I A A 1288 | | 1289 A A 1291 Figure 13: Example of Priority Tree Pruning 1293 In the example in Figure 13, "P" represents a Placeholder, "A" 1294 represents an active node, and "I" represents an inactive node. In 1295 the first step, the server discards two inactive branches (each a 1296 single node). In the second step, the server condenses an interior 1297 inactive node. Note that these transformations will result in no 1298 change in the resources allocated to a particular active stream. 1300 Clients SHOULD assume the server is actively performing such pruning 1301 and SHOULD NOT declare a dependency on a stream it knows to have been 1302 closed. 1304 5.4. Server Push 1306 HTTP/3 server push is similar to what is described in HTTP/2 1307 [RFC7540], but uses different mechanisms. 1309 Each server push is identified by a unique Push ID. This Push ID is 1310 used in a single PUSH_PROMISE frame (see Section 4.2.6) which carries 1311 the request headers, possibly included in one or more DUPLICATE_PUSH 1312 frames (see Section 4.2.9), then included with the push stream which 1313 ultimately fulfills those promises. 1315 Server push is only enabled on a connection when a client sends a 1316 MAX_PUSH_ID frame (see Section 4.2.8). A server cannot use server 1317 push until it receives a MAX_PUSH_ID frame. A client sends 1318 additional MAX_PUSH_ID frames to control the number of pushes that a 1319 server can promise. A server SHOULD use Push IDs sequentially, 1320 starting at 0. A client MUST treat receipt of a push stream with a 1321 Push ID that is greater than the maximum Push ID as a connection 1322 error of type HTTP_LIMIT_EXCEEDED. 1324 The header of the request message is carried by a PUSH_PROMISE frame 1325 (see Section 4.2.6) on the request stream which generated the push. 1326 This allows the server push to be associated with a client request. 1327 Ordering of a PUSH_PROMISE in relation to certain parts of the 1328 response is important (see Section 8.2.1 of [RFC7540]). Promised 1329 requests MUST conform to the requirements in Section 8.2 of 1330 [RFC7540]. 1332 The same server push can be associated with additional client 1333 requests using a DUPLICATE_PUSH frame (see Section 4.2.9). Ordering 1334 of a DUPLICATE_PUSH in relation to certain parts of the response is 1335 similarly important. Due to reordering, DUPLICATE_PUSH frames can 1336 arrive before the corresponding PUSH_PROMISE frame, in which case the 1337 request headers of the push would not be immediately available. 1338 Clients which receive a DUPLICATE_PUSH frame for an as-yet-unknown 1339 Push ID can either delay generating new requests for content 1340 referenced following the DUPLICATE_PUSH frame until the request 1341 headers become available, or can initiate requests for discovered 1342 resources and cancel the requests if the requested resource is 1343 already being pushed. 1345 When a server later fulfills a promise, the server push response is 1346 conveyed on a push stream (see Section 3.2.2). The push stream 1347 identifies the Push ID of the promise that it fulfills, then contains 1348 a response to the promised request using the same format described 1349 for responses in Section 5.1. 1351 If a promised server push is not needed by the client, the client 1352 SHOULD send a CANCEL_PUSH frame. If the push stream is already open 1353 or opens after sending the CANCEL_PUSH frame, a QUIC STOP_SENDING 1354 frame with an appropriate error code can also be used (e.g., 1355 HTTP_PUSH_REFUSED, HTTP_PUSH_ALREADY_IN_CACHE; see Section 8). This 1356 asks the server not to transfer additional data and indicates that it 1357 will be discarded upon receipt. 1359 6. Connection Closure 1361 Once established, an HTTP/3 connection can be used for many requests 1362 and responses over time until the connection is closed. Connection 1363 closure can happen in any of several different ways. 1365 6.1. Idle Connections 1367 Each QUIC endpoint declares an idle timeout during the handshake. If 1368 the connection remains idle (no packets received) for longer than 1369 this duration, the peer will assume that the connection has been 1370 closed. HTTP/3 implementations will need to open a new connection 1371 for new requests if the existing connection has been idle for longer 1372 than the server's advertised idle timeout, and SHOULD do so if 1373 approaching the idle timeout. 1375 HTTP clients are expected to request that the transport keep 1376 connections open while there are responses outstanding for requests 1377 or server pushes, as described in Section 19.2 of [QUIC-TRANSPORT]. 1378 If the client is not expecting a response from the server, allowing 1379 an idle connection to time out is preferred over expending effort 1380 maintaining a connection that might not be needed. A gateway MAY 1381 maintain connections in anticipation of need rather than incur the 1382 latency cost of connection establishment to servers. Servers SHOULD 1383 NOT actively keep connections open. 1385 6.2. Connection Shutdown 1387 Even when a connection is not idle, either endpoint can decide to 1388 stop using the connection and let the connection close gracefully. 1389 Since clients drive request generation, clients perform a connection 1390 shutdown by not sending additional requests on the connection; 1391 responses and pushed responses associated to previous requests will 1392 continue to completion. Servers perform the same function by 1393 communicating with clients. 1395 Servers initiate the shutdown of a connection by sending a GOAWAY 1396 frame (Section 4.2.7). The GOAWAY frame indicates that client- 1397 initiated requests on lower stream IDs were or might be processed in 1398 this connection, while requests on the indicated stream ID and 1399 greater were rejected. This enables client and server to agree on 1400 which requests were accepted prior to the connection shutdown. This 1401 identifier MAY be lower than the stream limit identified by a QUIC 1402 MAX_STREAM_ID frame, and MAY be zero if no requests were processed. 1403 Servers SHOULD NOT increase the QUIC MAX_STREAM_ID limit after 1404 sending a GOAWAY frame. 1406 Clients MUST NOT send new requests on the connection after receiving 1407 GOAWAY; a new connection MAY be established to send additional 1408 requests. 1410 Some requests might already be in transit. If the client has already 1411 sent requests on streams with a Stream ID greater than or equal to 1412 that indicated in the GOAWAY frame, those requests will not be 1413 processed and MAY be retried by the client on a different connection. 1414 The client MAY cancel these requests. It is RECOMMENDED that the 1415 server explicitly reject such requests (see Section 5.1.2) in order 1416 to clean up transport state for the affected streams. 1418 Requests on Stream IDs less than the Stream ID in the GOAWAY frame 1419 might have been processed; their status cannot be known until a 1420 response is received, the stream is reset individually, or the 1421 connection terminates. Servers MAY reject individual requests on 1422 streams below the indicated ID if these requests were not processed. 1424 Servers SHOULD send a GOAWAY frame when the closing of a connection 1425 is known in advance, even if the advance notice is small, so that the 1426 remote peer can know whether a request has been partially processed 1427 or not. For example, if an HTTP client sends a POST at the same time 1428 that a server closes a QUIC connection, the client cannot know if the 1429 server started to process that POST request if the server does not 1430 send a GOAWAY frame to indicate what streams it might have acted on. 1432 A client that is unable to retry requests loses all requests that are 1433 in flight when the server closes the connection. A server MAY send 1434 multiple GOAWAY frames indicating different stream IDs, but MUST NOT 1435 increase the value they send in the last Stream ID, since clients 1436 might already have retried unprocessed requests on another 1437 connection. A server that is attempting to gracefully shut down a 1438 connection SHOULD send an initial GOAWAY frame with the last Stream 1439 ID set to the current value of QUIC's MAX_STREAM_ID and SHOULD NOT 1440 increase the MAX_STREAM_ID thereafter. This signals to the client 1441 that a shutdown is imminent and that initiating further requests is 1442 prohibited. After allowing time for any in-flight requests (at least 1443 one round-trip time), the server MAY send another GOAWAY frame with 1444 an updated last Stream ID. This ensures that a connection can be 1445 cleanly shut down without losing requests. 1447 Once all accepted requests have been processed, the server can permit 1448 the connection to become idle, or MAY initiate an immediate closure 1449 of the connection. An endpoint that completes a graceful shutdown 1450 SHOULD use the HTTP_NO_ERROR code when closing the connection. 1452 6.3. Immediate Application Closure 1454 An HTTP/3 implementation can immediately close the QUIC connection at 1455 any time. This results in sending a QUIC CONNECTION_CLOSE frame to 1456 the peer; the error code in this frame indicates to the peer why the 1457 connection is being closed. See Section 8 for error codes which can 1458 be used when closing a connection. 1460 Before closing the connection, a GOAWAY MAY be sent to allow the 1461 client to retry some requests. Including the GOAWAY frame in the 1462 same packet as the QUIC CONNECTION_CLOSE frame improves the chances 1463 of the frame being received by clients. 1465 6.4. Transport Closure 1467 For various reasons, the QUIC transport could indicate to the 1468 application layer that the connection has terminated. This might be 1469 due to an explicit closure by the peer, a transport-level error, or a 1470 change in network topology which interrupts connectivity. 1472 If a connection terminates without a GOAWAY frame, clients MUST 1473 assume that any request which was sent, whether in whole or in part, 1474 might have been processed. 1476 7. Extensions to HTTP/3 1478 HTTP/3 permits extension of the protocol. Within the limitations 1479 described in this section, protocol extensions can be used to provide 1480 additional services or alter any aspect of the protocol. Extensions 1481 are effective only within the scope of a single HTTP/3 connection. 1483 This applies to the protocol elements defined in this document. This 1484 does not affect the existing options for extending HTTP, such as 1485 defining new methods, status codes, or header fields. 1487 Extensions are permitted to use new frame types (Section 4.2), new 1488 settings (Section 4.2.5.1), new error codes (Section 8), or new 1489 unidirectional stream types (Section 3.2). Registries are 1490 established for managing these extension points: frame types 1491 (Section 10.3), settings (Section 10.4), error codes (Section 10.5), 1492 and stream types (Section 10.6). 1494 Implementations MUST ignore unknown or unsupported values in all 1495 extensible protocol elements. Implementations MUST discard frames 1496 and unidirectional streams that have unknown or unsupported types. 1497 This means that any of these extension points can be safely used by 1498 extensions without prior arrangement or negotiation. 1500 Extensions that could change the semantics of existing protocol 1501 components MUST be negotiated before being used. For example, an 1502 extension that changes the layout of the HEADERS frame cannot be used 1503 until the peer has given a positive signal that this is acceptable. 1504 In this case, it could also be necessary to coordinate when the 1505 revised layout comes into effect. 1507 This document doesn't mandate a specific method for negotiating the 1508 use of an extension but notes that a setting (Section 4.2.5.1) could 1509 be used for that purpose. If both peers set a value that indicates 1510 willingness to use the extension, then the extension can be used. If 1511 a setting is used for extension negotiation, the default value MUST 1512 be defined in such a fashion that the extension is disabled if the 1513 setting is omitted. 1515 8. Error Handling 1517 QUIC allows the application to abruptly terminate (reset) individual 1518 streams or the entire connection when an error is encountered. These 1519 are referred to as "stream errors" or "connection errors" and are 1520 described in more detail in [QUIC-TRANSPORT]. An endpoint MAY choose 1521 to treat a stream error as a connection error. 1523 This section describes HTTP/3-specific error codes which can be used 1524 to express the cause of a connection or stream error. 1526 8.1. HTTP/3 Error Codes 1528 The following error codes are defined for use in QUIC RESET_STREAM 1529 frames, STOP_SENDING frames, and CONNECTION_CLOSE frames when using 1530 HTTP/3. 1532 HTTP_NO_ERROR (0x00): No error. This is used when the connection or 1533 stream needs to be closed, but there is no error to signal. 1535 HTTP_WRONG_SETTING_DIRECTION (0x01): A client-only setting was sent 1536 by a server, or a server-only setting by a client. 1538 HTTP_PUSH_REFUSED (0x02): The server has attempted to push content 1539 which the client will not accept on this connection. 1541 HTTP_INTERNAL_ERROR (0x03): An internal error has occurred in the 1542 HTTP stack. 1544 HTTP_PUSH_ALREADY_IN_CACHE (0x04): The server has attempted to push 1545 content which the client has cached. 1547 HTTP_REQUEST_CANCELLED (0x05): The request or its response is 1548 cancelled. 1550 HTTP_INCOMPLETE_REQUEST (0x06): The client's stream terminated 1551 without containing a fully-formed request. 1553 HTTP_CONNECT_ERROR (0x07): The connection established in response to 1554 a CONNECT request was reset or abnormally closed. 1556 HTTP_EXCESSIVE_LOAD (0x08): The endpoint detected that its peer is 1557 exhibiting a behavior that might be generating excessive load. 1559 HTTP_VERSION_FALLBACK (0x09): The requested operation cannot be 1560 served over HTTP/3. The peer should retry over HTTP/1.1. 1562 HTTP_WRONG_STREAM (0x0A): A frame was received on a stream where it 1563 is not permitted. 1565 HTTP_LIMIT_EXCEEDED (0x0B): A Stream ID, Push ID, or Placeholder ID 1566 greater than the current maximum for that identifier was 1567 referenced. 1569 HTTP_DUPLICATE_PUSH (0x0C): A Push ID was referenced in two 1570 different stream headers. 1572 HTTP_UNKNOWN_STREAM_TYPE (0x0D): A unidirectional stream header 1573 contained an unknown stream type. 1575 HTTP_WRONG_STREAM_COUNT (0x0E): A unidirectional stream type was 1576 used more times than is permitted by that type. 1578 HTTP_CLOSED_CRITICAL_STREAM (0x0F): A stream required by the 1579 connection was closed or reset. 1581 HTTP_WRONG_STREAM_DIRECTION (0x0010): A unidirectional stream type 1582 was used by a peer which is not permitted to do so. 1584 HTTP_EARLY_RESPONSE (0x0011): The remainder of the client's request 1585 is not needed to produce a response. For use in STOP_SENDING 1586 only. 1588 HTTP_MISSING_SETTINGS (0x0012): No SETTINGS frame was received at 1589 the beginning of the control stream. 1591 HTTP_UNEXPECTED_FRAME (0x0013): A frame was received which was not 1592 permitted in the current state. 1594 HTTP_REQUEST_REJECTED (0x0014): A server rejected a request without 1595 performing any application processing. 1597 HTTP_GENERAL_PROTOCOL_ERROR (0x00FF): Peer violated protocol 1598 requirements in a way which doesn't match a more specific error 1599 code, or endpoint declines to use the more specific error code. 1601 HTTP_MALFORMED_FRAME (0x01XX): An error in a specific frame type. 1602 If the frame type is "0xfe" or less, the type is included as the 1603 last byte of the error code. For example, an error in a 1604 MAX_PUSH_ID frame would be indicated with the code (0x10D). The 1605 last byte "0xff" is used to indicate any frame type greater than 1606 "0xfe". 1608 9. Security Considerations 1610 The security considerations of HTTP/3 should be comparable to those 1611 of HTTP/2 with TLS. Note that where HTTP/2 employs PADDING frames 1612 and Padding fields in other frames to make a connection more 1613 resistant to traffic analysis, HTTP/3 can rely on QUIC PADDING frames 1614 or employ the reserved frame and stream types discussed in 1615 Section 4.2.10 and Section 3.2.3. 1617 When HTTP Alternative Services is used for discovery for HTTP/3 1618 endpoints, the security considerations of [ALTSVC] also apply. 1620 Several protocol elements contain nested length elements, typically 1621 in the form of frames with an explicit length containing variable- 1622 length integers. This could pose a security risk to an incautious 1623 implementer. An implementation MUST ensure that the length of a 1624 frame exactly matches the length of the fields it contains. 1626 The use of 0-RTT with HTTP/3 creates an exposure to replay attack. 1627 The anti-replay mitigations in [HTTP-REPLAY] MUST be applied when 1628 using HTTP/3 with 0-RTT. 1630 Certain HTTP implementations use the client address for logging or 1631 access-control purposes. Since a QUIC client's address might change 1632 during a connection (and future versions might support simultaneous 1633 use of multiple addresses), such implementations will need to either 1634 actively retrieve the client's current address or addresses when they 1635 are relevant or explicitly accept that the original address might 1636 change. 1638 10. IANA Considerations 1640 10.1. Registration of HTTP/3 Identification String 1642 This document creates a new registration for the identification of 1643 HTTP/3 in the "Application Layer Protocol Negotiation (ALPN) Protocol 1644 IDs" registry established in [RFC7301]. 1646 The "h3" string identifies HTTP/3: 1648 Protocol: HTTP/3 1650 Identification Sequence: 0x68 0x33 ("h3") 1651 Specification: This document 1653 10.2. Registration of QUIC Version Hint Alt-Svc Parameter 1655 This document creates a new registration for version-negotiation 1656 hints in the "Hypertext Transfer Protocol (HTTP) Alt-Svc Parameter" 1657 registry established in [RFC7838]. 1659 Parameter: "quic" 1661 Specification: This document, Section 2.2.1 1663 10.3. Frame Types 1665 This document establishes a registry for HTTP/3 frame type codes. 1666 The "HTTP/3 Frame Type" registry governs a 62-bit space. This space 1667 is split into three spaces that are governed by different policies. 1668 Values between "0x00" and "0x3f" (in hexadecimal) are assigned via 1669 the Standards Action or IESG Review policies [RFC8126]. Values from 1670 "0x40" to "0x3fff" operate on the Specification Required policy 1671 [RFC8126]. All other values are assigned to Private Use [RFC8126]. 1673 While this registry is separate from the "HTTP/2 Frame Type" registry 1674 defined in [RFC7540], it is preferable that the assignments parallel 1675 each other where the code spaces overlap. If an entry is present in 1676 only one registry, every effort SHOULD be made to avoid assigning the 1677 corresponding value to an unrelated operation. 1679 New entries in this registry require the following information: 1681 Frame Type: A name or label for the frame type. 1683 Code: The 62-bit code assigned to the frame type. 1685 Specification: A reference to a specification that includes a 1686 description of the frame layout and its semantics, including any 1687 parts of the frame that are conditionally present. 1689 The entries in the following table are registered by this document. 1691 +----------------+------+---------------+ 1692 | Frame Type | Code | Specification | 1693 +----------------+------+---------------+ 1694 | DATA | 0x0 | Section 4.2.1 | 1695 | | | | 1696 | HEADERS | 0x1 | Section 4.2.2 | 1697 | | | | 1698 | PRIORITY | 0x2 | Section 4.2.3 | 1699 | | | | 1700 | CANCEL_PUSH | 0x3 | Section 4.2.4 | 1701 | | | | 1702 | SETTINGS | 0x4 | Section 4.2.5 | 1703 | | | | 1704 | PUSH_PROMISE | 0x5 | Section 4.2.6 | 1705 | | | | 1706 | Reserved | 0x6 | N/A | 1707 | | | | 1708 | GOAWAY | 0x7 | Section 4.2.7 | 1709 | | | | 1710 | Reserved | 0x8 | N/A | 1711 | | | | 1712 | Reserved | 0x9 | N/A | 1713 | | | | 1714 | MAX_PUSH_ID | 0xD | Section 4.2.8 | 1715 | | | | 1716 | DUPLICATE_PUSH | 0xE | Section 4.2.9 | 1717 +----------------+------+---------------+ 1719 Additionally, each code of the format "0x1f * N + 0x21" for integer 1720 values of N (that is, "0x21", "0x40", ..., through 1721 "0x‭3FFFFFFFFFFFFFFE‬") MUST NOT be assigned by IANA. 1723 10.4. Settings Parameters 1725 This document establishes a registry for HTTP/3 settings. The 1726 "HTTP/3 Settings" registry governs a 62-bit space. This space is 1727 split into three spaces that are governed by different policies. 1728 Values between "0x00" and "0x3f" (in hexadecimal) are assigned via 1729 the Standards Action or IESG Review policies [RFC8126]. Values from 1730 "0x40" to "0x3fff" operate on the Specification Required policy 1731 [RFC8126]. All other values are assigned to Private Use [RFC8126]. 1732 The designated experts are the same as those for the "HTTP/2 1733 Settings" registry defined in [RFC7540]. 1735 While this registry is separate from the "HTTP/2 Settings" registry 1736 defined in [RFC7540], it is preferable that the assignments parallel 1737 each other. If an entry is present in only one registry, every 1738 effort SHOULD be made to avoid assigning the corresponding value to 1739 an unrelated operation. 1741 New registrations are advised to provide the following information: 1743 Name: A symbolic name for the setting. Specifying a setting name is 1744 optional. 1746 Code: The 62-bit code assigned to the setting. 1748 Specification: An optional reference to a specification that 1749 describes the use of the setting. 1751 The entries in the following table are registered by this document. 1753 +----------------------+------+-----------------+ 1754 | Setting Name | Code | Specification | 1755 +----------------------+------+-----------------+ 1756 | Reserved | 0x2 | N/A | 1757 | | | | 1758 | Reserved | 0x3 | N/A | 1759 | | | | 1760 | Reserved | 0x4 | N/A | 1761 | | | | 1762 | Reserved | 0x5 | N/A | 1763 | | | | 1764 | MAX_HEADER_LIST_SIZE | 0x6 | Section 4.2.5.1 | 1765 | | | | 1766 | NUM_PLACEHOLDERS | 0x8 | Section 4.2.5.1 | 1767 +----------------------+------+-----------------+ 1769 Additionally, each code of the format "0x1f * N + 0x21" for integer 1770 values of N (that is, "0x21", "0x40", ..., through 1771 "0x‭3FFFFFFFFFFFFFFE‬") MUST NOT be assigned by IANA. 1773 10.5. Error Codes 1775 This document establishes a registry for HTTP/3 error codes. The 1776 "HTTP/3 Error Code" registry manages a 16-bit space. The "HTTP/3 1777 Error Code" registry operates under the "Expert Review" policy 1778 [RFC8126]. 1780 Registrations for error codes are required to include a description 1781 of the error code. An expert reviewer is advised to examine new 1782 registrations for possible duplication with existing error codes. 1783 Use of existing registrations is to be encouraged, but not mandated. 1785 New registrations are advised to provide the following information: 1787 Name: A name for the error code. Specifying an error code name is 1788 optional. 1790 Code: The 16-bit error code value. 1792 Description: A brief description of the error code semantics, longer 1793 if no detailed specification is provided. 1795 Specification: An optional reference for a specification that 1796 defines the error code. 1798 The entries in the following table are registered by this document. 1800 +---------------------------+--------+---------------+--------------+ 1801 | Name | Code | Description | Specificatio | 1802 | | | | n | 1803 +---------------------------+--------+---------------+--------------+ 1804 | HTTP_NO_ERROR | 0x0000 | No error | Section 8.1 | 1805 | | | | | 1806 | HTTP_WRONG_SETTING_DIRECT | 0x0001 | Setting sent | Section 8.1 | 1807 | ION | | in wrong | | 1808 | | | direction | | 1809 | | | | | 1810 | HTTP_PUSH_REFUSED | 0x0002 | Client | Section 8.1 | 1811 | | | refused | | 1812 | | | pushed | | 1813 | | | content | | 1814 | | | | | 1815 | HTTP_INTERNAL_ERROR | 0x0003 | Internal | Section 8.1 | 1816 | | | error | | 1817 | | | | | 1818 | HTTP_PUSH_ALREADY_IN_CACH | 0x0004 | Pushed | Section 8.1 | 1819 | E | | content | | 1820 | | | already | | 1821 | | | cached | | 1822 | | | | | 1823 | HTTP_REQUEST_CANCELLED | 0x0005 | Data no | Section 8.1 | 1824 | | | longer needed | | 1825 | | | | | 1826 | HTTP_INCOMPLETE_REQUEST | 0x0006 | Stream | Section 8.1 | 1827 | | | terminated | | 1828 | | | early | | 1829 | | | | | 1830 | HTTP_CONNECT_ERROR | 0x0007 | TCP reset or | Section 8.1 | 1831 | | | error on | | 1832 | | | CONNECT | | 1833 | | | request | | 1834 | | | | | 1835 | HTTP_EXCESSIVE_LOAD | 0x0008 | Peer | Section 8.1 | 1836 | | | generating | | 1837 | | | excessive | | 1838 | | | load | | 1839 | | | | | 1840 | HTTP_VERSION_FALLBACK | 0x0009 | Retry over | Section 8.1 | 1841 | | | HTTP/1.1 | | 1842 | | | | | 1843 | HTTP_WRONG_STREAM | 0x000A | A frame was | Section 8.1 | 1844 | | | sent on the | | 1845 | | | wrong stream | | 1846 | | | | | 1847 | HTTP_LIMIT_EXCEEDED | 0x000B | An identifier | Section 8.1 | 1848 | | | limit was | | 1849 | | | exceeded | | 1850 | | | | | 1851 | HTTP_DUPLICATE_PUSH | 0x000C | Push ID was | Section 8.1 | 1852 | | | fulfilled | | 1853 | | | multiple | | 1854 | | | times | | 1855 | | | | | 1856 | HTTP_UNKNOWN_STREAM_TYPE | 0x000D | Unknown unidi | Section 8.1 | 1857 | | | rectional | | 1858 | | | stream type | | 1859 | | | | | 1860 | HTTP_WRONG_STREAM_COUNT | 0x000E | Too many unid | Section 8.1 | 1861 | | | irectional | | 1862 | | | streams | | 1863 | | | | | 1864 | HTTP_CLOSED_CRITICAL_STRE | 0x000F | Critical | Section 8.1 | 1865 | AM | | stream was | | 1866 | | | closed | | 1867 | | | | | 1868 | HTTP_WRONG_STREAM_DIRECTI | 0x0010 | Unidirectiona | Section 8.1 | 1869 | ON | | l stream in | | 1870 | | | wrong | | 1871 | | | direction | | 1872 | | | | | 1873 | HTTP_EARLY_RESPONSE | 0x0011 | Remainder of | Section 8.1 | 1874 | | | request not | | 1875 | | | needed | | 1876 | | | | | 1877 | HTTP_MISSING_SETTINGS | 0x0012 | No SETTINGS | Section 8.1 | 1878 | | | frame | | 1879 | | | received | | 1880 | | | | | 1881 | HTTP_UNEXPECTED_FRAME | 0x0013 | Frame not | Section 8.1 | 1882 | | | permitted in | | 1883 | | | the current | | 1884 | | | state | | 1885 | | | | | 1886 | HTTP_REQUEST_REJECTED | 0x0014 | Request not | Section 8.1 | 1887 | | | processed | | 1888 | | | | | 1889 | HTTP_MALFORMED_FRAME | 0x01XX | Error in | Section 8.1 | 1890 | | | frame | | 1891 | | | formatting | | 1892 +---------------------------+--------+---------------+--------------+ 1894 10.6. Stream Types 1896 This document establishes a registry for HTTP/3 unidirectional stream 1897 types. The "HTTP/3 Stream Type" registry governs a 62-bit space. 1898 This space is split into three spaces that are governed by different 1899 policies. Values between "0x00" and 0x3f (in hexadecimal) are 1900 assigned via the Standards Action or IESG Review policies [RFC8126]. 1901 Values from "0x40" to "0x3fff" operate on the Specification Required 1902 policy [RFC8126]. All other values are assigned to Private Use 1903 [RFC8126]. 1905 New entries in this registry require the following information: 1907 Stream Type: A name or label for the stream type. 1909 Code: The 62-bit code assigned to the stream type. 1911 Specification: A reference to a specification that includes a 1912 description of the stream type, including the layout semantics of 1913 its payload. 1915 Sender: Which endpoint on a connection may initiate a stream of this 1916 type. Values are "Client", "Server", or "Both". 1918 The entries in the following table are registered by this document. 1920 +----------------+------+---------------+--------+ 1921 | Stream Type | Code | Specification | Sender | 1922 +----------------+------+---------------+--------+ 1923 | Control Stream | 0x00 | Section 3.2.1 | Both | 1924 | | | | | 1925 | Push Stream | 0x01 | Section 5.4 | Server | 1926 +----------------+------+---------------+--------+ 1928 Additionally, each code of the format "0x1f * N + 0x21" for integer 1929 values of N (that is, "0x21", "0x40", ..., through 1930 "0x‭3FFFFFFFFFFFFFFE‬") MUST NOT be assigned by IANA. 1932 11. References 1934 11.1. Normative References 1936 [ALTSVC] Nottingham, M., McManus, P., and J. Reschke, "HTTP 1937 Alternative Services", RFC 7838, DOI 10.17487/RFC7838, 1938 April 2016, . 1940 [HTTP-REPLAY] 1941 Thomson, M., Nottingham, M., and W. Tarreau, "Using Early 1942 Data in HTTP", RFC 8470, DOI 10.17487/RFC8470, September 1943 2018, . 1945 [QPACK] Krasic, C., Bishop, M., and A. Frindell, Ed., "QPACK: 1946 Header Compression for HTTP over QUIC", draft-ietf-quic- 1947 qpack-07 (work in progress), March 2019. 1949 [QUIC-TRANSPORT] 1950 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 1951 Multiplexed and Secure Transport", draft-ietf-quic- 1952 transport-18 (work in progress), March 2019. 1954 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 1955 RFC 793, DOI 10.17487/RFC0793, September 1981, 1956 . 1958 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1959 Requirement Levels", BCP 14, RFC 2119, 1960 DOI 10.17487/RFC2119, March 1997, 1961 . 1963 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 1964 Specifications: ABNF", STD 68, RFC 5234, 1965 DOI 10.17487/RFC5234, January 2008, 1966 . 1968 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 1969 Extensions: Extension Definitions", RFC 6066, 1970 DOI 10.17487/RFC6066, January 2011, 1971 . 1973 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1974 Protocol (HTTP/1.1): Message Syntax and Routing", 1975 RFC 7230, DOI 10.17487/RFC7230, June 2014, 1976 . 1978 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1979 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1980 DOI 10.17487/RFC7231, June 2014, 1981 . 1983 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 1984 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 1985 DOI 10.17487/RFC7540, May 2015, 1986 . 1988 [RFC7838] Nottingham, M., McManus, P., and J. Reschke, "HTTP 1989 Alternative Services", RFC 7838, DOI 10.17487/RFC7838, 1990 April 2016, . 1992 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 1993 Writing an IANA Considerations Section in RFCs", BCP 26, 1994 RFC 8126, DOI 10.17487/RFC8126, June 2017, 1995 . 1997 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1998 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1999 May 2017, . 2001 11.2. Informative References 2003 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 2004 "Transport Layer Security (TLS) Application-Layer Protocol 2005 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 2006 July 2014, . 2008 [RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP 2009 Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014, 2010 . 2012 11.3. URIs 2014 [1] https://mailarchive.ietf.org/arch/search/?email_list=quic 2016 [2] https://github.com/quicwg 2018 [3] https://github.com/quicwg/base-drafts/labels/-http 2020 [4] https://www.iana.org/assignments/message-headers 2022 Appendix A. Considerations for Transitioning from HTTP/2 2024 HTTP/3 is strongly informed by HTTP/2, and bears many similarities. 2025 This section describes the approach taken to design HTTP/3, points 2026 out important differences from HTTP/2, and describes how to map 2027 HTTP/2 extensions into HTTP/3. 2029 HTTP/3 begins from the premise that similarity to HTTP/2 is 2030 preferable, but not a hard requirement. HTTP/3 departs from HTTP/2 2031 primarily where necessary to accommodate the differences in behavior 2032 between QUIC and TCP (lack of ordering, support for streams). We 2033 intend to avoid gratuitous changes which make it difficult or 2034 impossible to build extensions with the same semantics applicable to 2035 both protocols at once. 2037 These departures are noted in this section. 2039 A.1. Streams 2041 HTTP/3 permits use of a larger number of streams (2^62-1) than 2042 HTTP/2. The considerations about exhaustion of stream identifier 2043 space apply, though the space is significantly larger such that it is 2044 likely that other limits in QUIC are reached first, such as the limit 2045 on the connection flow control window. 2047 A.2. HTTP Frame Types 2049 Many framing concepts from HTTP/2 can be elided on QUIC, because the 2050 transport deals with them. Because frames are already on a stream, 2051 they can omit the stream number. Because frames do not block 2052 multiplexing (QUIC's multiplexing occurs below this layer), the 2053 support for variable-maximum-length packets can be removed. Because 2054 stream termination is handled by QUIC, an END_STREAM flag is not 2055 required. This permits the removal of the Flags field from the 2056 generic frame layout. 2058 Frame payloads are largely drawn from [RFC7540]. However, QUIC 2059 includes many features (e.g., flow control) which are also present in 2060 HTTP/2. In these cases, the HTTP mapping does not re-implement them. 2061 As a result, several HTTP/2 frame types are not required in HTTP/3. 2062 Where an HTTP/2-defined frame is no longer used, the frame ID has 2063 been reserved in order to maximize portability between HTTP/2 and 2064 HTTP/3 implementations. However, even equivalent frames between the 2065 two mappings are not identical. 2067 Many of the differences arise from the fact that HTTP/2 provides an 2068 absolute ordering between frames across all streams, while QUIC 2069 provides this guarantee on each stream only. As a result, if a frame 2070 type makes assumptions that frames from different streams will still 2071 be received in the order sent, HTTP/3 will break them. 2073 For example, implicit in the HTTP/2 prioritization scheme is the 2074 notion of in-order delivery of priority changes (i.e., dependency 2075 tree mutations): since operations on the dependency tree such as 2076 reparenting a subtree are not commutative, both sender and receiver 2077 must apply them in the same order to ensure that both sides have a 2078 consistent view of the stream dependency tree. HTTP/2 specifies 2079 priority assignments in PRIORITY frames and (optionally) in HEADERS 2080 frames. To achieve in-order delivery of priority changes in HTTP/3, 2081 PRIORITY frames are sent on the control stream and exclusive 2082 prioritization has been removed. 2084 Likewise, HPACK was designed with the assumption of in-order 2085 delivery. A sequence of encoded header blocks must arrive (and be 2086 decoded) at an endpoint in the same order in which they were encoded. 2087 This ensures that the dynamic state at the two endpoints remains in 2088 sync. As a result, HTTP/3 uses a modified version of HPACK, 2089 described in [QPACK]. 2091 Frame type definitions in HTTP/3 often use the QUIC variable-length 2092 integer encoding. In particular, Stream IDs use this encoding, which 2093 allow for a larger range of possible values than the encoding used in 2094 HTTP/2. Some frames in HTTP/3 use an identifier rather than a Stream 2095 ID (e.g. Push IDs in PRIORITY frames). Redefinition of the encoding 2096 of extension frame types might be necessary if the encoding includes 2097 a Stream ID. 2099 Because the Flags field is not present in generic HTTP/3 frames, 2100 those frames which depend on the presence of flags need to allocate 2101 space for flags as part of their frame payload. 2103 Other than this issue, frame type HTTP/2 extensions are typically 2104 portable to QUIC simply by replacing Stream 0 in HTTP/2 with a 2105 control stream in HTTP/3. HTTP/3 extensions will not assume 2106 ordering, but would not be harmed by ordering, and would be portable 2107 to HTTP/2 in the same manner. 2109 Below is a listing of how each HTTP/2 frame type is mapped: 2111 DATA (0x0): Padding is not defined in HTTP/3 frames. See 2112 Section 4.2.1. 2114 HEADERS (0x1): As described above, the PRIORITY region of HEADERS is 2115 not supported. A separate PRIORITY frame MUST be used. Padding 2116 is not defined in HTTP/3 frames. See Section 4.2.2. 2118 PRIORITY (0x2): As described above, the PRIORITY frame is sent on 2119 the control stream and can reference a variety of identifiers. 2120 See Section 4.2.3. 2122 RST_STREAM (0x3): RST_STREAM frames do not exist, since QUIC 2123 provides stream lifecycle management. The same code point is used 2124 for the CANCEL_PUSH frame (Section 4.2.4). 2126 SETTINGS (0x4): SETTINGS frames are sent only at the beginning of 2127 the connection. See Section 4.2.5 and Appendix A.3. 2129 PUSH_PROMISE (0x5): The PUSH_PROMISE does not reference a stream; 2130 instead the push stream references the PUSH_PROMISE frame using a 2131 Push ID. See Section 4.2.6. 2133 PING (0x6): PING frames do not exist, since QUIC provides equivalent 2134 functionality. 2136 GOAWAY (0x7): GOAWAY is sent only from server to client and does not 2137 contain an error code. See Section 4.2.7. 2139 WINDOW_UPDATE (0x8): WINDOW_UPDATE frames do not exist, since QUIC 2140 provides flow control. 2142 CONTINUATION (0x9): CONTINUATION frames do not exist; instead, 2143 larger HEADERS/PUSH_PROMISE frames than HTTP/2 are permitted. 2145 Frame types defined by extensions to HTTP/2 need to be separately 2146 registered for HTTP/3 if still applicable. The IDs of frames defined 2147 in [RFC7540] have been reserved for simplicity. Note that the frame 2148 type space in HTTP/3 is substantially larger (62 bits versus 8 bits), 2149 so many HTTP/3 frame types have no equivalent HTTP/2 code points. 2150 See Section 10.3. 2152 A.3. HTTP/2 SETTINGS Parameters 2154 An important difference from HTTP/2 is that settings are sent once, 2155 at the beginning of the connection, and thereafter cannot change. 2156 This eliminates many corner cases around synchronization of changes. 2158 Some transport-level options that HTTP/2 specifies via the SETTINGS 2159 frame are superseded by QUIC transport parameters in HTTP/3. The 2160 HTTP-level options that are retained in HTTP/3 have the same value as 2161 in HTTP/2. 2163 Below is a listing of how each HTTP/2 SETTINGS parameter is mapped: 2165 SETTINGS_HEADER_TABLE_SIZE: See [QPACK]. 2167 SETTINGS_ENABLE_PUSH: This is removed in favor of the MAX_PUSH_ID 2168 which provides a more granular control over server push. 2170 SETTINGS_MAX_CONCURRENT_STREAMS: QUIC controls the largest open 2171 Stream ID as part of its flow control logic. Specifying 2172 SETTINGS_MAX_CONCURRENT_STREAMS in the SETTINGS frame is an error. 2174 SETTINGS_INITIAL_WINDOW_SIZE: QUIC requires both stream and 2175 connection flow control window sizes to be specified in the 2176 initial transport handshake. Specifying 2177 SETTINGS_INITIAL_WINDOW_SIZE in the SETTINGS frame is an error. 2179 SETTINGS_MAX_FRAME_SIZE: This setting has no equivalent in HTTP/3. 2180 Specifying it in the SETTINGS frame is an error. 2182 SETTINGS_MAX_HEADER_LIST_SIZE: See Section 4.2.5.1. 2184 In HTTP/3, setting values are variable-length integers (6, 14, 30, or 2185 62 bits long) rather than fixed-length 32-bit fields as in HTTP/2. 2186 This will often produce a shorter encoding, but can produce a longer 2187 encoding for settings which use the full 32-bit space. Settings 2188 ported from HTTP/2 might choose to redefine the format of their 2189 settings to avoid using the 62-bit encoding. 2191 Settings need to be defined separately for HTTP/2 and HTTP/3. The 2192 IDs of settings defined in [RFC7540] have been reserved for 2193 simplicity. Note that the settings identifier space in HTTP/3 is 2194 substantially larger (62 bits versus 16 bits), so many HTTP/3 2195 settings have no equivalent HTTP/2 code point. See Section 10.4. 2197 A.4. HTTP/2 Error Codes 2199 QUIC has the same concepts of "stream" and "connection" errors that 2200 HTTP/2 provides. However, there is no direct portability of HTTP/2 2201 error codes. 2203 The HTTP/2 error codes defined in Section 7 of [RFC7540] map to the 2204 HTTP/3 error codes as follows: 2206 NO_ERROR (0x0): HTTP_NO_ERROR in Section 8.1. 2208 PROTOCOL_ERROR (0x1): No single mapping. See new 2209 HTTP_MALFORMED_FRAME error codes defined in Section 8.1. 2211 INTERNAL_ERROR (0x2): HTTP_INTERNAL_ERROR in Section 8.1. 2213 FLOW_CONTROL_ERROR (0x3): Not applicable, since QUIC handles flow 2214 control. Would provoke a QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA 2215 from the QUIC layer. 2217 SETTINGS_TIMEOUT (0x4): Not applicable, since no acknowledgement of 2218 SETTINGS is defined. 2220 STREAM_CLOSED (0x5): Not applicable, since QUIC handles stream 2221 management. Would provoke a QUIC_STREAM_DATA_AFTER_TERMINATION 2222 from the QUIC layer. 2224 FRAME_SIZE_ERROR (0x6): HTTP_MALFORMED_FRAME error codes defined in 2225 Section 8.1. 2227 REFUSED_STREAM (0x7): HTTP_REQUEST_REJECTED (in Section 8.1) is used 2228 to indicate that a request was not processed. Otherwise, not 2229 applicable because QUIC handles stream management. A 2230 STREAM_ID_ERROR at the QUIC layer is used for streams that are 2231 improperly opened. 2233 CANCEL (0x8): HTTP_REQUEST_CANCELLED in Section 8.1. 2235 COMPRESSION_ERROR (0x9): Multiple error codes are defined in 2236 [QPACK]. 2238 CONNECT_ERROR (0xa): HTTP_CONNECT_ERROR in Section 8.1. 2240 ENHANCE_YOUR_CALM (0xb): HTTP_EXCESSIVE_LOAD in Section 8.1. 2242 INADEQUATE_SECURITY (0xc): Not applicable, since QUIC is assumed to 2243 provide sufficient security on all connections. 2245 HTTP_1_1_REQUIRED (0xd): HTTP_VERSION_FALLBACK in Section 8.1. 2247 Error codes need to be defined for HTTP/2 and HTTP/3 separately. See 2248 Section 10.5. 2250 Appendix B. Change Log 2252 *RFC Editor's Note:* Please remove this section prior to 2253 publication of a final version of this document. 2255 B.1. Since draft-ietf-quic-http-18 2257 o Resetting streams following a GOAWAY is recommended, but not 2258 required (#2256,#2457) 2260 o Use variable-length integers throughout (#2437,#2233,#2253,#2275) 2261 * Variable-length frame types, stream types, and settings 2262 identifiers 2264 * Renumbered stream type assignments 2266 * Modified associated reserved values 2268 o Frame layout switched from Length-Type-Value to Type-Length-Value 2269 (#2395,#2235) 2271 o Specified error code for servers receiving DUPLICATE_PUSH (#2497) 2273 o Use connection error for invalid PRIORITY (#2507, #2508) 2275 B.2. Since draft-ietf-quic-http-17 2277 o HTTP_REQUEST_REJECTED is used to indicate a request can be retried 2278 (#2106, #2325) 2280 o Changed error code for GOAWAY on the wrong stream (#2231, #2343) 2282 B.3. Since draft-ietf-quic-http-16 2284 o Rename "HTTP/QUIC" to "HTTP/3" (#1973) 2286 o Changes to PRIORITY frame (#1865, #2075) 2288 * Permitted as first frame of request streams 2290 * Remove exclusive reprioritization 2292 * Changes to Prioritized Element Type bits 2294 o Define DUPLICATE_PUSH frame to refer to another PUSH_PROMISE 2295 (#2072) 2297 o Set defaults for settings, allow request before receiving SETTINGS 2298 (#1809, #1846, #2038) 2300 o Clarify message processing rules for streams that aren't closed 2301 (#1972, #2003) 2303 o Removed reservation of error code 0 and moved HTTP_NO_ERROR to 2304 this value (#1922) 2306 o Removed prohibition of zero-length DATA frames (#2098) 2308 B.4. Since draft-ietf-quic-http-15 2310 Substantial editorial reorganization; no technical changes. 2312 B.5. Since draft-ietf-quic-http-14 2314 o Recommend sensible values for QUIC transport parameters 2315 (#1720,#1806) 2317 o Define error for missing SETTINGS frame (#1697,#1808) 2319 o Setting values are variable-length integers (#1556,#1807) and do 2320 not have separate maximum values (#1820) 2322 o Expanded discussion of connection closure (#1599,#1717,#1712) 2324 o HTTP_VERSION_FALLBACK falls back to HTTP/1.1 (#1677,#1685) 2326 B.6. Since draft-ietf-quic-http-13 2328 o Reserved some frame types for grease (#1333, #1446) 2330 o Unknown unidirectional stream types are tolerated, not errors; 2331 some reserved for grease (#1490, #1525) 2333 o Require settings to be remembered for 0-RTT, prohibit reductions 2334 (#1541, #1641) 2336 o Specify behavior for truncated requests (#1596, #1643) 2338 B.7. Since draft-ietf-quic-http-12 2340 o TLS SNI extension isn't mandatory if an alternative method is used 2341 (#1459, #1462, #1466) 2343 o Removed flags from HTTP/3 frames (#1388, #1398) 2345 o Reserved frame types and settings for use in preserving 2346 extensibility (#1333, #1446) 2348 o Added general error code (#1391, #1397) 2350 o Unidirectional streams carry a type byte and are extensible 2351 (#910,#1359) 2353 o Priority mechanism now uses explicit placeholders to enable 2354 persistent structure in the tree (#441,#1421,#1422) 2356 B.8. Since draft-ietf-quic-http-11 2358 o Moved QPACK table updates and acknowledgments to dedicated streams 2359 (#1121, #1122, #1238) 2361 B.9. Since draft-ietf-quic-http-10 2363 o Settings need to be remembered when attempting and accepting 0-RTT 2364 (#1157, #1207) 2366 B.10. Since draft-ietf-quic-http-09 2368 o Selected QCRAM for header compression (#228, #1117) 2370 o The server_name TLS extension is now mandatory (#296, #495) 2372 o Specified handling of unsupported versions in Alt-Svc (#1093, 2373 #1097) 2375 B.11. Since draft-ietf-quic-http-08 2377 o Clarified connection coalescing rules (#940, #1024) 2379 B.12. Since draft-ietf-quic-http-07 2381 o Changes for integer encodings in QUIC (#595,#905) 2383 o Use unidirectional streams as appropriate (#515, #240, #281, #886) 2385 o Improvement to the description of GOAWAY (#604, #898) 2387 o Improve description of server push usage (#947, #950, #957) 2389 B.13. Since draft-ietf-quic-http-06 2391 o Track changes in QUIC error code usage (#485) 2393 B.14. Since draft-ietf-quic-http-05 2395 o Made push ID sequential, add MAX_PUSH_ID, remove 2396 SETTINGS_ENABLE_PUSH (#709) 2398 o Guidance about keep-alive and QUIC PINGs (#729) 2400 o Expanded text on GOAWAY and cancellation (#757) 2402 B.15. Since draft-ietf-quic-http-04 2404 o Cite RFC 5234 (#404) 2406 o Return to a single stream per request (#245,#557) 2408 o Use separate frame type and settings registries from HTTP/2 (#81) 2410 o SETTINGS_ENABLE_PUSH instead of SETTINGS_DISABLE_PUSH (#477) 2412 o Restored GOAWAY (#696) 2414 o Identify server push using Push ID rather than a stream ID 2415 (#702,#281) 2417 o DATA frames cannot be empty (#700) 2419 B.16. Since draft-ietf-quic-http-03 2421 None. 2423 B.17. Since draft-ietf-quic-http-02 2425 o Track changes in transport draft 2427 B.18. Since draft-ietf-quic-http-01 2429 o SETTINGS changes (#181): 2431 * SETTINGS can be sent only once at the start of a connection; no 2432 changes thereafter 2434 * SETTINGS_ACK removed 2436 * Settings can only occur in the SETTINGS frame a single time 2438 * Boolean format updated 2440 o Alt-Svc parameter changed from "v" to "quic"; format updated 2441 (#229) 2443 o Closing the connection control stream or any message control 2444 stream is a fatal error (#176) 2446 o HPACK Sequence counter can wrap (#173) 2448 o 0-RTT guidance added 2449 o Guide to differences from HTTP/2 and porting HTTP/2 extensions 2450 added (#127,#242) 2452 B.19. Since draft-ietf-quic-http-00 2454 o Changed "HTTP/2-over-QUIC" to "HTTP/QUIC" throughout (#11,#29) 2456 o Changed from using HTTP/2 framing within Stream 3 to new framing 2457 format and two-stream-per-request model (#71,#72,#73) 2459 o Adopted SETTINGS format from draft-bishop-httpbis-extended- 2460 settings-01 2462 o Reworked SETTINGS_ACK to account for indeterminate inter-stream 2463 order (#75) 2465 o Described CONNECT pseudo-method (#95) 2467 o Updated ALPN token and Alt-Svc guidance (#13,#87) 2469 o Application-layer-defined error codes (#19,#74) 2471 B.20. Since draft-shade-quic-http2-mapping-00 2473 o Adopted as base for draft-ietf-quic-http 2475 o Updated authors/editors list 2477 Acknowledgements 2479 The original authors of this specification were Robbie Shade and Mike 2480 Warres. 2482 A substantial portion of Mike's contribution was supported by 2483 Microsoft during his employment there. 2485 Author's Address 2487 Mike Bishop (editor) 2488 Akamai 2490 Email: mbishop@evequefou.be