idnits 2.17.1 draft-ietf-quic-http-05.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (August 15, 2017) is 2417 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** 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) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC M. Bishop, Ed. 3 Internet-Draft Microsoft 4 Intended status: Standards Track August 15, 2017 5 Expires: February 16, 2018 7 Hypertext Transfer Protocol (HTTP) over QUIC 8 draft-ietf-quic-http-05 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 QUIC. 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. 25 Working Group information can be found at https://github.com/quicwg; 26 source code and issues list for this draft can be found at 27 https://github.com/quicwg/base-drafts/labels/http. 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 http://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 February 16, 2018. 46 Copyright Notice 48 Copyright (c) 2017 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 (http://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 . . . . . . . . . . . . . . . . . . . . . . . . 3 64 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 65 2. QUIC Advertisement . . . . . . . . . . . . . . . . . . . . . 3 66 2.1. QUIC Version Hints . . . . . . . . . . . . . . . . . . . 4 67 3. Connection Establishment . . . . . . . . . . . . . . . . . . 5 68 3.1. Draft Version Identification . . . . . . . . . . . . . . 5 69 4. Stream Mapping and Usage . . . . . . . . . . . . . . . . . . 5 70 4.1. Stream 1: Control Stream . . . . . . . . . . . . . . . . 6 71 4.2. HTTP Message Exchanges . . . . . . . . . . . . . . . . . 6 72 4.2.1. Header Compression . . . . . . . . . . . . . . . . . 7 73 4.2.2. The CONNECT Method . . . . . . . . . . . . . . . . . 8 74 4.3. Request Prioritization . . . . . . . . . . . . . . . . . 9 75 4.4. Server Push . . . . . . . . . . . . . . . . . . . . . . . 9 76 5. HTTP Framing Layer . . . . . . . . . . . . . . . . . . . . . 10 77 5.1. Frame Layout . . . . . . . . . . . . . . . . . . . . . . 10 78 5.2. Frame Definitions . . . . . . . . . . . . . . . . . . . . 11 79 5.2.1. DATA . . . . . . . . . . . . . . . . . . . . . . . . 11 80 5.2.2. HEADERS . . . . . . . . . . . . . . . . . . . . . . . 11 81 5.2.3. PRIORITY . . . . . . . . . . . . . . . . . . . . . . 11 82 5.2.4. CANCEL_PUSH . . . . . . . . . . . . . . . . . . . . . 13 83 5.2.5. SETTINGS . . . . . . . . . . . . . . . . . . . . . . 14 84 5.2.6. PUSH_PROMISE . . . . . . . . . . . . . . . . . . . . 16 85 5.2.7. GOAWAY . . . . . . . . . . . . . . . . . . . . . . . 17 86 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 19 87 6.1. HTTP-Defined QUIC Error Codes . . . . . . . . . . . . . . 19 88 7. Considerations for Transitioning from HTTP/2 . . . . . . . . 21 89 7.1. HTTP Frame Types . . . . . . . . . . . . . . . . . . . . 21 90 7.2. HTTP/2 SETTINGS Parameters . . . . . . . . . . . . . . . 23 91 7.3. HTTP/2 Error Codes . . . . . . . . . . . . . . . . . . . 24 92 8. Security Considerations . . . . . . . . . . . . . . . . . . . 25 93 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 94 9.1. Registration of HTTP/QUIC Identification String . . . . . 25 95 9.2. Registration of QUIC Version Hint Alt-Svc Parameter . . . 25 96 9.3. Frame Types . . . . . . . . . . . . . . . . . . . . . . . 25 97 9.4. Settings Parameters . . . . . . . . . . . . . . . . . . . 26 98 9.5. Error Codes . . . . . . . . . . . . . . . . . . . . . . . 27 99 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 29 100 10.1. Normative References . . . . . . . . . . . . . . . . . . 30 101 10.2. Informative References . . . . . . . . . . . . . . . . . 31 102 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 31 103 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 31 104 B.1. Since draft-ietf-quic-http-04 . . . . . . . . . . . . . . 31 105 B.2. Since draft-ietf-quic-http-03 . . . . . . . . . . . . . . 31 106 B.3. Since draft-ietf-quic-http-02 . . . . . . . . . . . . . . 31 107 B.4. Since draft-ietf-quic-http-01 . . . . . . . . . . . . . . 32 108 B.5. Since draft-ietf-quic-http-00 . . . . . . . . . . . . . . 32 109 B.6. Since draft-shade-quic-http2-mapping-00 . . . . . . . . . 33 110 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 33 112 1. Introduction 114 The QUIC transport protocol has several features that are desirable 115 in a transport for HTTP, such as stream multiplexing, per-stream flow 116 control, and low-latency connection establishment. This document 117 describes a mapping of HTTP semantics over QUIC, drawing heavily on 118 the existing TCP mapping, HTTP/2. Specifically, this document 119 identifies HTTP/2 features that are subsumed by QUIC, and describes 120 how the other features can be implemented atop QUIC. 122 QUIC is described in [QUIC-TRANSPORT]. For a full description of 123 HTTP/2, see [RFC7540]. 125 1.1. Notational Conventions 127 The words "MUST", "MUST NOT", "SHOULD", and "MAY" are used in this 128 document. It's not shouting; when they are capitalized, they have 129 the special meaning defined in [RFC2119]. 131 Field definitions are given in Augmented Backus-Naur Form (ABNF), as 132 defined in [RFC5234]. 134 2. QUIC Advertisement 136 An HTTP origin advertises the availability of an equivalent HTTP/QUIC 137 endpoint via the Alt-Svc HTTP response header or the HTTP/2 ALTSVC 138 frame ([RFC7838]), using the ALPN token defined in Section 3. 140 For example, an origin could indicate in an HTTP/1.1 or HTTP/2 141 response that HTTP/QUIC was available on UDP port 50781 at the same 142 hostname by including the following header in any response: 144 Alt-Svc: hq=":50781" 146 On receipt of an Alt-Svc header indicating HTTP/QUIC support, a 147 client MAY attempt to establish a QUIC connection to the indicated 148 host and port and, if successful, send HTTP requests using the 149 mapping described in this document. 151 Connectivity problems (e.g. firewall blocking UDP) can result in QUIC 152 connection establishment failure, in which case the client SHOULD 153 continue using the existing connection or try another alternative 154 endpoint offered by the origin. 156 Servers MAY serve HTTP/QUIC on any UDP port. Servers MUST use the 157 same port across all IP addresses that serve a single domain, and 158 SHOULD NOT change this port. 160 2.1. QUIC Version Hints 162 This document defines the "quic" parameter for Alt-Svc, which MAY be 163 used to provide version-negotiation hints to HTTP/QUIC clients. QUIC 164 versions are four-octet sequences with no additional constraints on 165 format. Syntax: 167 quic = version-number 168 version-number = 1*8HEXDIG; hex-encoded QUIC version 170 Leading zeros SHOULD be omitted for brevity. When multiple versions 171 are supported, the "quic" parameter MAY be repeated multiple times in 172 a single Alt-Svc entry. For example, if a server supported both 173 version 0x00000001 and the version rendered in ASCII as "Q034", it 174 could specify the following header: 176 Alt-Svc: hq=":49288";quic=1;quic=51303334 178 Where multiple versions are listed, the order of the values reflects 179 the server's preference (with the first value being the most 180 preferred version). Origins SHOULD list only versions which are 181 supported by the alternative, but MAY omit supported versions for any 182 reason. 184 3. Connection Establishment 186 HTTP/QUIC connections are established as described in 187 [QUIC-TRANSPORT]. During connection establishment, HTTP/QUIC support 188 is indicated by selecting the ALPN token "hq" in the crypto 189 handshake. 191 While connection-level options pertaining to the core QUIC protocol 192 are set in the initial crypto handshake, HTTP-specific settings are 193 conveyed in the SETTINGS frame. After the QUIC connection is 194 established, a SETTINGS frame (Section 5.2.5) MUST be sent as the 195 initial frame of the HTTP control stream (Stream ID 1, see 196 Section 4). The server MUST NOT send data on any other stream until 197 the client's SETTINGS frame has been received. 199 3.1. Draft Version Identification 201 *RFC Editor's Note:* Please remove this section prior to 202 publication of a final version of this document. 204 Only implementations of the final, published RFC can identify 205 themselves as "hq". Until such an RFC exists, implementations MUST 206 NOT identify themselves using this string. 208 Implementations of draft versions of the protocol MUST add the string 209 "-" and the corresponding draft number to the identifier. For 210 example, draft-ietf-quic-http-01 is identified using the string "hq- 211 01". 213 Non-compatible experiments that are based on these draft versions 214 MUST append the string "-" and an experiment name to the identifier. 215 For example, an experimental implementation based on draft-ietf-quic- 216 http-09 which reserves an extra stream for unsolicited transmission 217 of 1980s pop music might identify itself as "hq-09-rickroll". Note 218 that any label MUST conform to the "token" syntax defined in 219 Section 3.2.6 of [RFC7230]. Experimenters are encouraged to 220 coordinate their experiments on the quic@ietf.org mailing list. 222 4. Stream Mapping and Usage 224 A QUIC stream provides reliable in-order delivery of bytes, but makes 225 no guarantees about order of delivery with regard to bytes on other 226 streams. On the wire, data is framed into QUIC STREAM frames, but 227 this framing is invisible to the HTTP framing layer. A QUIC receiver 228 buffers and orders received STREAM frames, exposing the data 229 contained within as a reliable byte stream to the application. 231 QUIC reserves Stream 0 for crypto operations (the handshake, crypto 232 config updates). Stream 1 is reserved for sending and receiving HTTP 233 control frames, and is analogous to HTTP/2's Stream 0. This control 234 stream is considered critical to the HTTP connection. If the control 235 stream is closed for any reason, this MUST be treated as a connection 236 error of type QUIC_CLOSED_CRITICAL_STREAM. 238 When HTTP headers and data are sent over QUIC, the QUIC layer handles 239 most of the stream management. An HTTP request/response consumes a 240 single stream: This means that the client's first request occurs on 241 QUIC stream 3, the second on stream 5, and so on. The server's first 242 push consumes stream 2. 244 This stream carries frames related to the request/response (see 245 Section 5.2). When a stream terminates cleanly, if the last frame on 246 the stream was truncated, this MUST be treated as a connection error 247 (see HTTP_MALFORMED_* in Section 6.1). Streams which terminate 248 abruptly may be reset at any point in the frame. 250 Streams SHOULD be used sequentially, with no gaps. Streams used for 251 pushed resources MAY be initiated out-of-order, but stream IDs SHOULD 252 be allocated to promised resources sequentially. 254 HTTP does not need to do any separate multiplexing when using QUIC - 255 data sent over a QUIC stream always maps to a particular HTTP 256 transaction. Requests and responses are considered complete when the 257 corresponding QUIC stream is closed in the appropriate direction. 259 4.1. Stream 1: Control Stream 261 Since most connection-level concerns will be managed by QUIC, the 262 primary use of Stream 1 will be for the SETTINGS frame when the 263 connection opens and for PRIORITY frames subsequently. 265 4.2. HTTP Message Exchanges 267 A client sends an HTTP request on a new QUIC stream. A server sends 268 an HTTP response on the same stream as the request. 270 An HTTP message (request or response) consists of: 272 1. one header block (see Section 5.2.2) containing the message 273 headers (see [RFC7230], Section 3.2), 275 2. the payload body (see [RFC7230], Section 3.3), sent as a series 276 of DATA frames (see Section 5.2.1), 278 3. optionally, one header block containing the trailer-part, if 279 present (see [RFC7230], Section 4.1.2). 281 In addition, prior to sending the message header block indicated 282 above, a response may contain zero or more header blocks containing 283 the message headers of informational (1xx) HTTP responses (see 284 [RFC7230], Section 3.2 and [RFC7231], Section 6.2). 286 The "chunked" transfer encoding defined in Section 4.1 of [RFC7230] 287 MUST NOT be used. 289 Trailing header fields are carried in an additional header block 290 following the body. Such a header block is a sequence of HEADERS 291 frames with End Header Block set on the last frame. Senders MUST 292 send only one header block in the trailers section; receivers MUST 293 discard any subsequent header blocks. 295 An HTTP request/response exchange fully consumes a QUIC stream. 296 After sending a request, a client closes the stream for sending; 297 after sending a response, the server closes the stream for sending 298 and the QUIC stream is fully closed. 300 A server can send a complete response prior to the client sending an 301 entire request if the response does not depend on any portion of the 302 request that has not been sent and received. When this is true, a 303 server MAY request that the client abort transmission of a request 304 without error by triggering a QUIC STOP_SENDING with error code 305 HTTP_EARLY_RESPONSE, sending a complete response, and cleanly closing 306 its streams. Clients MUST NOT discard complete responses as a result 307 of having their request terminated abruptly, though clients can 308 always discard responses at their discretion for other reasons. 309 Servers MUST NOT abort a response in progress as a result of 310 receiving a solicited RST_STREAM. 312 4.2.1. Header Compression 314 HTTP/QUIC uses HPACK header compression as described in [RFC7541]. 315 HPACK was designed for HTTP/2 with the assumption of in-order 316 delivery such as that provided by TCP. A sequence of encoded header 317 blocks must arrive (and be decoded) at an endpoint in the same order 318 in which they were encoded. This ensures that the dynamic state at 319 the two endpoints remains in sync. 321 QUIC streams provide in-order delivery of data sent on those streams, 322 but there are no guarantees about order of delivery between streams. 323 QUIC anticipates moving to a modified version of HPACK without this 324 assumption. In the meantime, by fixing the size of the dynamic table 325 at zero, HPACK can be used in an unordered environment. 327 4.2.2. The CONNECT Method 329 The pseudo-method CONNECT ([RFC7231], Section 4.3.6) is primarily 330 used with HTTP proxies to establish a TLS session with an origin 331 server for the purposes of interacting with "https" resources. In 332 HTTP/1.x, CONNECT is used to convert an entire HTTP connection into a 333 tunnel to a remote host. In HTTP/2, the CONNECT method is used to 334 establish a tunnel over a single HTTP/2 stream to a remote host for 335 similar purposes. 337 A CONNECT request in HTTP/QUIC functions in the same manner as in 338 HTTP/2. The request MUST be formatted as described in [RFC7540], 339 Section 8.3. A CONNECT request that does not conform to these 340 restrictions is malformed. The message data stream MUST NOT be 341 closed at the end of the request. 343 A proxy that supports CONNECT establishes a TCP connection 344 ([RFC0793]) to the server identified in the ":authority" pseudo- 345 header field. Once this connection is successfully established, the 346 proxy sends a HEADERS frame containing a 2xx series status code to 347 the client, as defined in [RFC7231], Section 4.3.6. 349 All DATA frames on the request stream correspond to data sent on the 350 TCP connection. Any DATA frame sent by the client is transmitted by 351 the proxy to the TCP server; data received from the TCP server is 352 packaged into DATA frames by the proxy. Note that the size and 353 number of TCP segments is not guaranteed to map predictably to the 354 size and number of HTTP DATA or QUIC STREAM frames. 356 The TCP connection can be closed by either peer. When the client 357 half-closes the request stream, the proxy will set the FIN bit on its 358 connection to the TCP server. When the proxy receives a packet with 359 the FIN bit set, it will half-close the corresponding stream. TCP 360 connections which remain half-closed in a single direction are not 361 invalid, but are often handled poorly by servers, so clients SHOULD 362 NOT half-close connections on which they are still expecting data. 364 A TCP connection error is signaled with RST_STREAM. A proxy treats 365 any error in the TCP connection, which includes receiving a TCP 366 segment with the RST bit set, as a stream error of type 367 HTTP_CONNECT_ERROR (Section 6.1). Correspondingly, a proxy MUST send 368 a TCP segment with the RST bit set if it detects an error with the 369 stream or the QUIC connection. 371 4.3. Request Prioritization 373 HTTP/QUIC uses the priority scheme described in [RFC7540], 374 Section 5.3. In this priority scheme, a given request can be 375 designated as dependent upon another request, which expresses the 376 preference that the latter stream (the "parent" request) be allocated 377 resources before the former stream (the "dependent" request). Taken 378 together, the dependencies across all requests in a connection form a 379 dependency tree. The structure of the dependency tree changes as 380 PRIORITY frames add, remove, or change the dependency links between 381 requests. 383 HTTP/2 defines its priorities in terms of streams whereas HTTP over 384 QUIC identifies requests. The PRIORITY frame Section 5.2.3 385 identifies a request either by identifying the stream that carries a 386 request or by using a Push ID (Section 5.2.6). Other than the means 387 of identifying requests, the prioritization system is identical to 388 that in HTTP/2. 390 Only a client can send PRIORITY frames. A server MUST NOT send a 391 PRIORITY frame. 393 4.4. Server Push 395 HTTP/QUIC supports server push as described in [RFC7540]. During 396 connection establishment, the client indicates whether it is willing 397 to receive server pushes via the SETTINGS_ENABLE_PUSH setting in the 398 SETTINGS frame (see Section 3), which is disabled by default. 400 As with server push for HTTP/2, the server initiates a server push by 401 sending a PUSH_PROMISE frame that includes request header fields 402 attributed to the request. The PUSH_PROMISE frame is sent on a 403 response stream. Unlike HTTP/2, the PUSH_PROMISE does not reference 404 a stream; when a server fulfills a promise, the stream that carries 405 the stream headers references the PUSH_PROMISE. This allows a server 406 to fulfill promises in the order that best suits its needs. 408 The server push response is conveyed on a push stream. A push stream 409 is a server-initiated stream. A push stream includes a header (see 410 Figure 1) that identifies the PUSH_PROMISE that it fulfills. This 411 header consists of a 32-bit Push ID, which identifies a server push 412 (see Section 5.2.6). 414 0 1 2 3 415 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 416 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 417 | Push ID (32) | 418 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 420 Figure 1: Push Stream Header 422 Each Push ID MUST only be used once in a push stream header. If a 423 push stream header includes a Push ID that was used in another push 424 stream header, the client MUST treat this as a connection error of 425 type HTTP_DUPLICATE_PUSH. The same Push ID can be used in multiple 426 PUSH_PROMISE frames (see Section 5.2.6). 428 After the push stream header, a push contains a response 429 (Section 4.2), with response headers, a response body (if any) 430 carried by DATA frames, then trailers (if any) carried by HEADERS 431 frames. 433 If a promised server push is not needed by the client, the client 434 SHOULD send a CANCEL_PUSH frame; if the push stream is already open, 435 a QUIC STOP_SENDING frame with an appropriate error code can be used 436 instead (e.g., HTTP_PUSH_REFUSED, HTTP_PUSH_ALREADY_IN_CACHE; see 437 Section 6). This asks the server not to transfer the data and 438 indicates that it will be discarded upon receipt. 440 5. HTTP Framing Layer 442 Frames are used on each stream. This section describes HTTP framing 443 in QUIC and highlights some differences from HTTP/2 framing. For 444 more detail on differences from HTTP/2, see Section 7.1. 446 5.1. Frame Layout 448 All frames have the following format: 450 0 1 2 3 451 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 452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 453 | Length (16) | Type (8) | Flags (8) | 454 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 455 | Frame Payload (*) ... 456 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 458 Figure 2: HTTP/QUIC frame format 460 5.2. Frame Definitions 462 5.2.1. DATA 464 DATA frames (type=0x0) convey arbitrary, variable-length sequences of 465 octets associated with an HTTP request or response payload. 467 The DATA frame defines no flags. 469 DATA frames MUST be associated with an HTTP request or response. If 470 a DATA frame is received on the control stream, the recipient MUST 471 respond with a connection error (Section 6) of type 472 HTTP_WRONG_STREAM. 474 DATA frames MUST contain a non-zero-length payload. If a DATA frame 475 is received with a payload length of zero, the recipient MUST respond 476 with a stream error (Section 6) of type HTTP_MALFORMED_DATA. 478 5.2.2. HEADERS 480 The HEADERS frame (type=0x1) is used to carry part of a header set, 481 compressed using HPACK Section 4.2.1. 483 One flag is defined: 485 End Header Block (0x4): This frame concludes a header block. 487 A HEADERS frame with any other flags set MUST be treated as a 488 connection error of type HTTP_MALFORMED_HEADERS. 490 The next frame on the same stream after a HEADERS frame without the 491 EHB flag set MUST be another HEADERS frame. A receiver MUST treat 492 the receipt of any other type of frame as a stream error of type 493 HTTP_INTERRUPTED_HEADERS. (Note that QUIC can intersperse data from 494 other streams between frames, or even during transmission of frames, 495 so multiplexing is not blocked by this requirement.) 497 A full header block is contained in a sequence of zero or more 498 HEADERS frames without EHB set, followed by a HEADERS frame with EHB 499 set. 501 5.2.3. PRIORITY 503 The PRIORITY (type=0x02) frame specifies the sender-advised priority 504 of a stream and is substantially different in format from [RFC7540]. 505 In order to ensure that prioritization is processed in a consistent 506 order, PRIORITY frames MUST be sent on the control stream. A 507 PRIORITY frame sent on any other stream MUST be treated as a 508 HTTP_WRONG_STREAM error. 510 The format has been modified to accommodate not being sent on a 511 request stream, to allow for identification of server pushes, and the 512 larger stream ID space of QUIC. The semantics of the Stream 513 Dependency, Weight, and E flag are otherwise the same as in HTTP/2. 515 The flags defined are: 517 PUSH_PRIORITIZED (0x04): Indicates that the Prioritized Stream is a 518 server push rather than a request. 520 PUSH_DEPENDENT (0x02): Indicates a dependency on a server push. 522 E (0x01): Indicates that the stream dependency is exclusive (see 523 [RFC7540], Section 5.3). 525 0 1 2 3 526 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 527 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 528 | Prioritized Request ID (32) | 529 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 530 | Stream Dependency ID (32) | 531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 532 | Weight (8) | 533 +-+-+-+-+-+-+-+-+ 535 Figure 3: PRIORITY frame payload 537 The PRIORITY frame payload has the following fields: 539 Prioritized Request ID: A 32-bit identifier for a request. This 540 contains the stream ID of a request stream when the 541 PUSH_PRIORITIZED flag is clear, or a Push ID when the 542 PUSH_PRIORITIZED flag is set. 544 Stream Dependency ID: A 32-bit stream identifier for a dependent 545 request. This contains the stream ID of a request stream when the 546 PUSH_DEPENDENT flag is clear, or a Push ID when the PUSH_DEPENDENT 547 flag is set. A request stream ID of 0 indicates a dependency on 548 the root stream. For details of dependencies, see Section 4.3 and 549 [RFC7540], Section 5.3. 551 Weight: An unsigned 8-bit integer representing a priority weight for 552 the stream (see [RFC7540], Section 5.3). Add one to the value to 553 obtain a weight between 1 and 256. 555 A PRIORITY frame identifies a request to priotize, and a request upon 556 which that request is dependent. A Prioritized Request ID or Stream 557 Dependency ID identifies a client-initiated request using the 558 corresponding stream ID when the corresponding PUSH_PRIORITIZED or 559 PUSH_DEPENDENT flag is not set. Setting the PUSH_PRIORITIZED or 560 PUSH_DEPENDENT flag causes the Prioritized Request ID or Stream 561 Dependency ID (respectively) to identify a server push using a Push 562 ID (see Section 5.2.6 for details). 564 A PRIORITY frame MAY identify a Stream Dependency ID using a stream 565 ID of 0; as in [RFC7540], this makes the request dependent on the 566 root of the dependency tree. 568 Stream ID 0 and stream ID 1 cannot be reprioritized. A Prioritized 569 Request ID that identifies Stream 0 or 1 MUST be treated as a 570 connection error of type HTTP_MALFORMED_PRIORITY. 572 A PRIORITY frame that does not reference a request MUST be treated as 573 a HTTP_MALFORMED_PRIORITY error, unless it references stream ID 0. A 574 PRIORITY that sets a PUSH_PRIORITIZED or PUSH_DEPENDENT flag, but 575 then references a non-existent Push ID MUST be treated as a 576 HTTP_MALFORMED_PRIORITY error. 578 The length of a PRIORITY frame is 9 octets. A PRIORITY frame with 579 any other length MUST be treated as a connection error of type 580 HTTP_MALFORMED_PRIORITY. 582 5.2.4. CANCEL_PUSH 584 The CANCEL_PUSH frame (type=0x3) is used to request cancellation of 585 server push prior to the push stream being created. The CANCEL_PUSH 586 frame identifies a server push request by Push ID (see 587 Section 5.2.6). 589 When a server receives this frame, it aborts sending the response for 590 the identified server push. If the server has not yet started to 591 send the server push, it can use the receipt of a CANCEL_PUSH frame 592 to avoid opening a stream. If the push stream has been opened by the 593 server, the server SHOULD sent a QUIC RST_STREAM frame on those 594 streams and cease transmission of the response. 596 A server can send this frame to indicate that it won't be sending a 597 response prior to creation of a push stream. Once the push stream 598 has been created, sending CANCEL_PUSH has no effect on the state of 599 the push stream. A QUIC RST_STREAM frame SHOULD be used instead to 600 cancel transmission of the server push response. 602 A CANCEL_PUSH frame is sent on the control stream. Sending a 603 CANCEL_PUSH frame on a stream other than the control stream MUST be 604 treated as a stream error of type HTTP_WRONG_STREAM. 606 The CANCEL_PUSH frame has no defined flags. 608 The CANCEL_PUSH frame carries a 32-bit Push ID that identifies the 609 server push that is being cancelled (see Section 5.2.6). 611 If the client receives a CANCEL_PUSH frame, that frame might identify 612 a Push ID that has not yet been mentioned by a PUSH_PROMISE frame. 614 A server MUST treat a CANCEL_PUSH frame payload that is other than 4 615 octets in length as a connection error of type 616 HTTP_MALFORMED_CANCEL_PUSH. 618 5.2.5. SETTINGS 620 The SETTINGS frame (type=0x4) conveys configuration parameters that 621 affect how endpoints communicate, such as preferences and constraints 622 on peer behavior, and is different from [RFC7540]. Individually, a 623 SETTINGS parameter can also be referred to as a "setting". 625 SETTINGS parameters are not negotiated; they describe characteristics 626 of the sending peer, which can be used by the receiving peer. 627 However, a negotiation can be implied by the use of SETTINGS - a peer 628 uses SETTINGS to advertise a set of supported values. The recipient 629 can then choose which entries from this list are also acceptable and 630 proceed with the value it has chosen. (This choice could be 631 announced in a field of an extension frame, or in its own value in 632 SETTINGS.) 634 Different values for the same parameter can be advertised by each 635 peer. For example, a client might be willing to consume very large 636 response headers, while servers are more cautious about request size. 638 Parameters MUST NOT occur more than once. A receiver MAY treat the 639 presence of the same parameter more than once as a connection error 640 of type HTTP_MALFORMED_SETTINGS. 642 The SETTINGS frame defines no flags. 644 The payload of a SETTINGS frame consists of zero or more parameters, 645 each consisting of an unsigned 16-bit setting identifier and a 646 length-prefixed binary value. 648 0 1 2 3 649 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 650 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 651 | Identifier (16) | Length (16) | 652 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 653 | Contents (?) ... 654 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 656 Figure 4: SETTINGS value format 658 A zero-length content indicates that the setting value is a Boolean 659 and true. False is indicated by the absence of the setting. 661 Non-zero-length values MUST be compared against the remaining length 662 of the SETTINGS frame. Any value which purports to cross the end of 663 the frame MUST cause the SETTINGS frame to be considered malformed 664 and trigger a connection error of type HTTP_MALFORMED_SETTINGS. 666 An implementation MUST ignore the contents for any SETTINGS 667 identifier it does not understand. 669 SETTINGS frames always apply to a connection, never a single stream. 670 A SETTINGS frame MUST be sent as the first frame of the control 671 stream (see Section 4) by each peer, and MUST NOT be sent 672 subsequently or on any other stream. If an endpoint receives an 673 SETTINGS frame on a different stream, the endpoint MUST respond with 674 a connection error of type HTTP_WRONG_STREAM. If an endpoint 675 receives a second SETTINGS frame, the endpoint MUST respond with a 676 connection error of type HTTP_MULTIPLE_SETTINGS. 678 The SETTINGS frame affects connection state. A badly formed or 679 incomplete SETTINGS frame MUST be treated as a connection error 680 (Section 6) of type HTTP_MALFORMED_SETTINGS. 682 5.2.5.1. Integer encoding 684 Settings which are integers are transmitted in network byte order. 685 Leading zero octets are permitted, but implementations SHOULD use 686 only as many bytes as are needed to represent the value. An integer 687 MUST NOT be represented in more bytes than would be used to transfer 688 the maximum permitted value. 690 5.2.5.2. Defined SETTINGS Parameters 692 The following settings are defined in HTTP/QUIC: 694 SETTINGS_HEADER_TABLE_SIZE (0x1): An integer with a maximum value of 695 2^32 - 1. This value MUST be zero. 697 SETTINGS_ENABLE_PUSH (0x2): Transmitted as a Boolean 699 SETTINGS_MAX_HEADER_LIST_SIZE (0x6): An integer with a maximum value 700 of 2^32 - 1 702 5.2.5.3. Usage in 0-RTT 704 When a 0-RTT QUIC connection is being used, the client's initial 705 requests will be sent before the arrival of the server's SETTINGS 706 frame. Clients SHOULD cache at least the following settings about 707 servers: 709 o SETTINGS_HEADER_TABLE_SIZE 711 o SETTINGS_MAX_HEADER_LIST_SIZE 713 Clients MUST comply with cached settings until the server's current 714 settings are received. If a client does not have cached values, it 715 SHOULD assume the following values: 717 o SETTINGS_HEADER_TABLE_SIZE: 0 octets 719 o SETTINGS_MAX_HEADER_LIST_SIZE: 16,384 octets 721 Servers MAY continue processing data from clients which exceed its 722 current configuration during the initial flight. In this case, the 723 client MUST apply the new settings immediately upon receipt. 725 If the connection is closed because these or other constraints were 726 violated during the 0-RTT flight (e.g. with 727 HTTP_HPACK_DECOMPRESSION_FAILED), clients MAY establish a new 728 connection and retry any 0-RTT requests using the settings sent by 729 the server on the closed connection. (This assumes that only 730 requests that are safe to retry are sent in 0-RTT.) If the 731 connection was closed before the SETTINGS frame was received, clients 732 SHOULD discard any cached values and use the defaults above on the 733 next connection. 735 5.2.6. PUSH_PROMISE 737 The PUSH_PROMISE frame (type=0x05) is used to carry a request header 738 set from server to client, as in HTTP/2. The PUSH_PROMISE frame 739 defines no flags. 741 0 1 2 3 742 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 743 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 744 | Push ID (32) | 745 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 746 | Header Block (*) ... 747 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 749 Figure 5: PUSH_PROMISE frame payload 751 The payload consists of: 753 Push ID: A 32-bit identifier for the server push request. A push ID 754 is used in push stream header (Section 4.4), CANCEL_PUSH frames 755 (Section 5.2.4), and PRIORITY frames (Section 5.2.3). 757 Header Block: HPACK-compressed request headers for the promised 758 response. 760 A server MAY use the same Push ID in multiple PUSH_PROMISE frames. 761 This allows the server to use the same server push in response to 762 multiple concurrent requests. Referencing the same server push 763 ensures that a PUSH_PROMISE can be made in relation to every response 764 in which server push might be needed without duplicating pushes. 766 A server that uses the same Push ID in multiple PUSH_PROMISE frames 767 MUST include the same header fields each time. The octets of the 768 header block MAY be different due to differing encoding, but the 769 header fields and their values MUST be identical. Note that ordering 770 of header fields is significant. A client MUST treat receipt of a 771 PUSH_PROMISE with conflicting header field values for the same Push 772 ID as a connection error of type HTTP_MALFORMED_PUSH_PROMISE. 774 Allowing duplicate references to the same Push ID is primarily to 775 reduce duplication caused by concurrent requests. A server SHOULD 776 avoid reusing a Push ID over a long period. Clients are likely to 777 consume server push responses and not retain them for reuse over 778 time. Clients that see a PUSH_PROMISE that uses a Push ID that they 779 have since consumed and discarded are forced to ignore the 780 PUSH_PROMISE. 782 5.2.7. GOAWAY 784 The GOAWAY frame (type=0x7) is used to initiate graceful shutdown of 785 a connection by a server. GOAWAY allows a server to stop accepting 786 new requests while still finishing processing of previously received 787 requests. This enables administrative actions, like server 788 maintenance. GOAWAY by itself does not close a connection. (Note 789 that clients do not need to send GOAWAY to gracefully close a 790 connection; they simply stop making new requests.) 792 The GOAWAY frame does not define any flags, and the payload is a QUIC 793 stream identifier. The GOAWAY frame applies to the connection, not a 794 specific stream. An endpoint MUST treat a GOAWAY frame on a stream 795 other than the control stream as a connection error (Section 6) of 796 type HTTP_WRONG_STREAM. 798 New client requests might already have been sent before the client 799 receives the server's GOAWAY frame. The GOAWAY frame contains the 800 stream identifier of the last client-initiated request that was or 801 might be processed in this connection, which enables client and 802 server to agree on which requests were accepted prior to the 803 connection shutdown. This identifier MAY be lower than the stream 804 limit identified by a QUIC MAX_STREAM_ID frame, and MAY be zero if no 805 requests were processed. Servers SHOULD NOT increase the 806 MAX_STREAM_ID limit after sending a GOAWAY frame. 808 Note: In this context, "processed" means that some data from the 809 stream was passed to some higher layer of software that might have 810 taken some action as a result. 812 Once sent, the server will refuse requests sent on streams with an 813 identifier higher than the included last stream identifier. Clients 814 MUST NOT send new requests on the connection after receiving GOAWAY, 815 although requests might already be in transit. A new connection can 816 be established for new requests. 818 If the client has sent requests on streams with a higher stream 819 identifier than indicated in the GOAWAY frame, those requests were 820 not and will not be processed. Endpoints SHOULD reset any streams 821 above this ID with the error code HTTP_REQUEST_CANCELLED. Servers 822 MAY also reset streams below the indicated ID with 823 HTTP_REQUEST_CANCELLED if the associated requests were not processed. 825 The client can treat requests cancelled by the server as though they 826 had never been sent at all, thereby allowing them to be retried later 827 on a new connection. Automatically retrying other requests is not 828 possible, unless this is otherwise permitted (e.g. idempotent actions 829 like GET, PUT, or DELETE). Requests on stream IDs less than or equal 830 to the stream ID in the GOAWAY frame might have been processed; their 831 status cannot be known until they are completed successfully, reset, 832 or the connection terminates. 834 Servers SHOULD send a GOAWAY frame when the closing of a connection 835 is known in advance, even if the advance notice is small, so that the 836 remote peer can know whether a stream has been partially processed or 837 not. For example, if an HTTP client sends a POST at the same time 838 that a server closes a QUIC connection, the client cannot know if the 839 server started to process that POST request if the server does not 840 send a GOAWAY frame to indicate what streams it might have acted on. 842 For unexpected closures caused by error conditions, a QUIC 843 CONNECTION_CLOSE frame MUST be used. However, a GOAWAY MAY be sent 844 first to provide additional detail to clients. If a connection 845 terminates without a GOAWAY frame, the last stream identifier is 846 effectively the highest possible stream identifier (as determined by 847 QUIC's MAX_STREAM_ID). 849 An endpoint MAY send multiple GOAWAY frames if circumstances change. 850 For instance, an endpoint that sends GOAWAY without an error code 851 during graceful shutdown could subsequently encounter an error 852 condition. The last stream identifier from the last GOAWAY frame 853 received indicates which streams could have been acted upon. 854 Endpoints MUST NOT increase the value they send in the last stream 855 identifier, since the peers might already have retried unprocessed 856 requests on another connection. 858 A client that is unable to retry requests loses all requests that are 859 in flight when the server closes the connection. A server that is 860 attempting to gracefully shut down a connection SHOULD send an 861 initial GOAWAY frame with the last stream identifier set to the 862 current value of QUIC's MAX_STREAM_ID and SHOULD NOT increase the 863 MAX_STREAM_ID thereafter. This signals to the client that a shutdown 864 is imminent and that initiating further requests is prohibited. 865 After allowing time for any in-flight requests (at least one round- 866 trip time), the server MAY send another GOAWAY frame with an updated 867 last stream identifier. This ensures that a connection can be 868 cleanly shut down without losing requests. 870 6. Error Handling 872 QUIC allows the application to abruptly terminate (reset) individual 873 streams or the entire connection when an error is encountered. These 874 are referred to as "stream errors" or "connection errors" and are 875 described in more detail in [QUIC-TRANSPORT]. 877 This section describes HTTP-specific error codes which can be used to 878 express the cause of a connection or stream error. 880 6.1. HTTP-Defined QUIC Error Codes 882 QUIC allocates error codes 0x0000-0x3FFF to application protocol 883 definition. The following error codes are defined by HTTP for use in 884 QUIC RST_STREAM and CONNECTION_CLOSE frames. 886 HTTP_PUSH_REFUSED (0x01): The server has attempted to push content 887 which the client will not accept on this connection. 889 HTTP_INTERNAL_ERROR (0x02): An internal error has occurred in the 890 HTTP stack. 892 HTTP_PUSH_ALREADY_IN_CACHE (0x03): The server has attempted to push 893 content which the client has cached. 895 HTTP_REQUEST_CANCELLED (0x04): The client no longer needs the 896 requested data. 898 HTTP_HPACK_DECOMPRESSION_FAILED (0x05): HPACK failed to decompress a 899 frame and cannot continue. 901 HTTP_CONNECT_ERROR (0x06): The connection established in response to 902 a CONNECT request was reset or abnormally closed. 904 HTTP_EXCESSIVE_LOAD (0x07): The endpoint detected that its peer is 905 exhibiting a behavior that might be generating excessive load. 907 HTTP_VERSION_FALLBACK (0x08): The requested operation cannot be 908 served over HTTP/QUIC. The peer should retry over HTTP/2. 910 HTTP_MALFORMED_HEADERS (0x09): A HEADERS frame has been received 911 with an invalid format. 913 HTTP_MALFORMED_PRIORITY (0x0A): A PRIORITY frame has been received 914 with an invalid format. 916 HTTP_MALFORMED_SETTINGS (0x0B): A SETTINGS frame has been received 917 with an invalid format. 919 HTTP_MALFORMED_PUSH_PROMISE (0x0C): A PUSH_PROMISE frame has been 920 received with an invalid format. 922 HTTP_MALFORMED_DATA (0x0D): A DATA frame has been received with an 923 invalid format. 925 HTTP_INTERRUPTED_HEADERS (0x0E): A HEADERS frame without the End 926 Header Block flag was followed by a frame other than HEADERS. 928 HTTP_WRONG_STREAM (0x0F): A frame was received on stream where it is 929 not permitted. 931 HTTP_MULTIPLE_SETTINGS (0x10): More than one SETTINGS frame was 932 received. 934 HTTP_DUPLICATE_PUSH (0x11): Multiple push streams used the same Push 935 ID. 937 7. Considerations for Transitioning from HTTP/2 939 HTTP/QUIC is strongly informed by HTTP/2, and bears many 940 similarities. This section describes the approach taken to design 941 HTTP/QUIC, points out important differences from HTTP/2, and 942 describes how to map HTTP/2 extensions into HTTP/QUIC. 944 HTTP/QUIC begins from the premise that HTTP/2 code reuse is a useful 945 feature, but not a hard requirement. HTTP/QUIC departs from HTTP/2 946 primarily where necessary to accommodate the differences in behavior 947 between QUIC and TCP (lack of ordering, support for streams). We 948 intend to avoid gratuitous changes which make it difficult or 949 impossible to build extensions with the same semantics applicable to 950 both protocols at once. 952 These departures are noted in this section. 954 7.1. HTTP Frame Types 956 Many framing concepts from HTTP/2 can be elided away on QUIC, because 957 the transport deals with them. Because frames are already on a 958 stream, they can omit the stream number. Because frames do not block 959 multiplexing (QUIC's multiplexing occurs below this layer), the 960 support for variable-maximum-length packets can be removed. Because 961 stream termination is handled by QUIC, an END_STREAM flag is not 962 required. 964 Frame payloads are largely drawn from [RFC7540]. However, QUIC 965 includes many features (e.g. flow control) which are also present in 966 HTTP/2. In these cases, the HTTP mapping does not re-implement them. 967 As a result, several HTTP/2 frame types are not required in HTTP/ 968 QUIC. Where an HTTP/2-defined frame is no longer used, the frame ID 969 has been reserved in order to maximize portability between HTTP/2 and 970 HTTP/QUIC implementations. However, even equivalent frames between 971 the two mappings are not identical. 973 Many of the differences arise from the fact that HTTP/2 provides an 974 absolute ordering between frames across all streams, while QUIC 975 provides this guarantee on each stream only. As a result, if a frame 976 type makes assumptions that frames from different streams will still 977 be received in the order sent, HTTP/QUIC will break them. 979 For example, implicit in the HTTP/2 prioritization scheme is the 980 notion of in-order delivery of priority changes (i.e., dependency 981 tree mutations): since operations on the dependency tree such as 982 reparenting a subtree are not commutative, both sender and receiver 983 must apply them in the same order to ensure that both sides have a 984 consistent view of the stream dependency tree. HTTP/2 specifies 985 priority assignments in PRIORITY frames and (optionally) in HEADERS 986 frames. To achieve in-order delivery of priority changes in HTTP/ 987 QUIC, PRIORITY frames are sent on the control stream and the PRIORITY 988 section is removed from the HEADERS frame. 990 Other than this issue, frame type HTTP/2 extensions are typically 991 portable to QUIC simply by replacing Stream 0 in HTTP/2 with Stream 1 992 in HTTP/QUIC. HTTP/QUIC extensions will not assume ordering, but 993 would not be harmed by ordering, and would be portable to HTTP/2 in 994 the same manner. 996 Below is a listing of how each HTTP/2 frame type is mapped: 998 DATA (0x0): Padding is not defined in HTTP/QUIC frames. See 999 Section 5.2.1. 1001 HEADERS (0x1): As described above, the PRIORITY region of HEADERS is 1002 not supported. A separate PRIORITY frame MUST be used. Padding 1003 is not defined in HTTP/QUIC frames. See Section 5.2.2. 1005 PRIORITY (0x2): As described above, the PRIORITY frame is sent on 1006 the control stream. See Section 5.2.3. 1008 RST_STREAM (0x3): RST_STREAM frames do not exist, since QUIC 1009 provides stream lifecycle management. The same code point is used 1010 for the CANCEL_PUSH frame (Section 5.2.4). 1012 SETTINGS (0x4): SETTINGS frames are sent only at the beginning of 1013 the connection. See Section 5.2.5 and Section 7.2. 1015 PUSH_PROMISE (0x5): The PUSH_PROMISE does not reference a stream; 1016 instead the push stream references the PUSH_PROMISE frame using a 1017 Push ID. See Section 5.2.6. 1019 PING (0x6): PING frames do not exist, since QUIC provides equivalent 1020 functionality. 1022 GOAWAY (0x7): GOAWAY is sent only from server to client and does not 1023 contain an error code. See Section 5.2.7. 1025 WINDOW_UPDATE (0x8): WINDOW_UPDATE frames do not exist, since QUIC 1026 provides flow control. 1028 CONTINUATION (0x9): CONTINUATION frames do not exist; instead, 1029 larger HEADERS/PUSH_PROMISE frames than HTTP/2 are permitted, and 1030 HEADERS frames can be used in series. 1032 Frame types defined by extensions to HTTP/2 need to be separately 1033 registered for HTTP/QUIC if still applicable. The IDs of frames 1034 defined in [RFC7540] have been reserved for simplicity. See 1035 Section 9.3. 1037 7.2. HTTP/2 SETTINGS Parameters 1039 An important difference from HTTP/2 is that settings are sent once, 1040 at the beginning of the connection, and thereafter cannot change. 1041 This eliminates many corner cases around synchronization of changes. 1043 Some transport-level options that HTTP/2 specifies via the SETTINGS 1044 frame are superseded by QUIC transport parameters in HTTP/QUIC. The 1045 HTTP-level options that are retained in HTTP/QUIC have the same value 1046 as in HTTP/2. 1048 Below is a listing of how each HTTP/2 SETTINGS parameter is mapped: 1050 SETTINGS_HEADER_TABLE_SIZE: See Section 5.2.5.2. 1052 SETTINGS_ENABLE_PUSH: See Section 5.2.5.2. 1054 SETTINGS_MAX_CONCURRENT_STREAMS: QUIC controls the largest open 1055 stream ID as part of its flow control logic. Specifying 1056 SETTINGS_MAX_CONCURRENT_STREAMS in the SETTINGS frame is an error. 1058 SETTINGS_INITIAL_WINDOW_SIZE: QUIC requires both stream and 1059 connection flow control window sizes to be specified in the 1060 initial transport handshake. Specifying 1061 SETTINGS_INITIAL_WINDOW_SIZE in the SETTINGS frame is an error. 1063 SETTINGS_MAX_FRAME_SIZE: This setting has no equivalent in HTTP/ 1064 QUIC. Specifying it in the SETTINGS frame is an error. 1066 SETTINGS_MAX_HEADER_LIST_SIZE: See Section 5.2.5.2. 1068 Settings need to be defined separately for HTTP/2 and HTTP/QUIC. The 1069 IDs of settings defined in [RFC7540] have been reserved for 1070 simplicity. See Section 9.4. 1072 7.3. HTTP/2 Error Codes 1074 QUIC has the same concepts of "stream" and "connection" errors that 1075 HTTP/2 provides. However, because the error code space is shared 1076 between multiple components, there is no direct portability of HTTP/2 1077 error codes. 1079 The HTTP/2 error codes defined in Section 7 of [RFC7540] map to QUIC 1080 error codes as follows: 1082 NO_ERROR (0x0): QUIC_NO_ERROR 1084 PROTOCOL_ERROR (0x1): No single mapping. See new HTTP_MALFORMED_* 1085 error codes defined in Section 6.1. 1087 INTERNAL_ERROR (0x2): HTTP_INTERNAL_ERROR in Section 6.1. 1089 FLOW_CONTROL_ERROR (0x3): Not applicable, since QUIC handles flow 1090 control. Would provoke a QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA 1091 from the QUIC layer. 1093 SETTINGS_TIMEOUT (0x4): Not applicable, since no acknowledgement of 1094 SETTINGS is defined. 1096 STREAM_CLOSED (0x5): Not applicable, since QUIC handles stream 1097 management. Would provoke a QUIC_STREAM_DATA_AFTER_TERMINATION 1098 from the QUIC layer. 1100 FRAME_SIZE_ERROR (0x6) No single mapping. See new error codes 1101 defined in Section 6.1. 1103 REFUSED_STREAM (0x7): Not applicable, since QUIC handles stream 1104 management. Would provoke a QUIC_TOO_MANY_OPEN_STREAMS from the 1105 QUIC layer. 1107 CANCEL (0x8): HTTP_REQUEST_CANCELLED in Section 6.1. 1109 COMPRESSION_ERROR (0x9): HTTP_HPACK_DECOMPRESSION_FAILED in 1110 Section 6.1. 1112 CONNECT_ERROR (0xa): HTTP_CONNECT_ERROR in Section 6.1. 1114 ENHANCE_YOUR_CALM (0xb): HTTP_EXCESSIVE_LOAD in Section 6.1. 1116 INADEQUATE_SECURITY (0xc): Not applicable, since QUIC is assumed to 1117 provide sufficient security on all connections. 1119 HTTP_1_1_REQUIRED (0xd): HTTP_VERSION_FALLBACK in Section 6.1. 1121 Error codes need to be defined for HTTP/2 and HTTP/QUIC separately. 1122 See Section 9.5. 1124 8. Security Considerations 1126 The security considerations of HTTP over QUIC should be comparable to 1127 those of HTTP/2. 1129 The modified SETTINGS format contains nested length elements, which 1130 could pose a security risk to an uncautious implementer. A SETTINGS 1131 frame parser MUST ensure that the length of the frame exactly matches 1132 the length of the settings it contains. 1134 9. IANA Considerations 1136 9.1. Registration of HTTP/QUIC Identification String 1138 This document creates a new registration for the identification of 1139 HTTP/QUIC in the "Application Layer Protocol Negotiation (ALPN) 1140 Protocol IDs" registry established in [RFC7301]. 1142 The "hq" string identifies HTTP/QUIC: 1144 Protocol: HTTP over QUIC 1146 Identification Sequence: 0x68 0x71 ("hq") 1148 Specification: This document 1150 9.2. Registration of QUIC Version Hint Alt-Svc Parameter 1152 This document creates a new registration for version-negotiation 1153 hints in the "Hypertext Transfer Protocol (HTTP) Alt-Svc Parameter" 1154 registry established in [RFC7838]. 1156 Parameter: "quic" 1158 Specification: This document, Section 2.1 1160 9.3. Frame Types 1162 This document establishes a registry for HTTP/QUIC frame type codes. 1163 The "HTTP/QUIC Frame Type" registry manages an 8-bit space. The 1164 "HTTP/QUIC Frame Type" registry operates under either of the "IETF 1165 Review" or "IESG Approval" policies [RFC5226] for values between 0x00 1166 and 0xef, with values between 0xf0 and 0xff being reserved for 1167 Experimental Use. 1169 While this registry is separate from the "HTTP/2 Frame Type" registry 1170 defined in [RFC7540], it is preferable that the assignments parallel 1171 each other. If an entry is present in only one registry, every 1172 effort SHOULD be made to avoid assigning the corresponding value to 1173 an unrelated operation. 1175 New entries in this registry require the following information: 1177 Frame Type: A name or label for the frame type. 1179 Code: The 8-bit code assigned to the frame type. 1181 Specification: A reference to a specification that includes a 1182 description of the frame layout, its semantics, and flags that the 1183 frame type uses, including any parts of the frame that are 1184 conditionally present based on the value of flags. 1186 The entries in the following table are registered by this document. 1188 +--------------+------+---------------+ 1189 | Frame Type | Code | Specification | 1190 +--------------+------+---------------+ 1191 | DATA | 0x0 | Section 5.2.1 | 1192 | | | | 1193 | HEADERS | 0x1 | Section 5.2.2 | 1194 | | | | 1195 | PRIORITY | 0x2 | Section 5.2.3 | 1196 | | | | 1197 | CANCEL_PUSH | 0x3 | Section 5.2.4 | 1198 | | | | 1199 | SETTINGS | 0x4 | Section 5.2.5 | 1200 | | | | 1201 | PUSH_PROMISE | 0x5 | Section 5.2.6 | 1202 | | | | 1203 | Reserved | 0x6 | N/A | 1204 | | | | 1205 | GOAWAY | 0x7 | Section 5.2.7 | 1206 | | | | 1207 | Reserved | 0x8 | N/A | 1208 | | | | 1209 | Reserved | 0x9 | N/A | 1210 +--------------+------+---------------+ 1212 9.4. Settings Parameters 1214 This document establishes a registry for HTTP/QUIC settings. The 1215 "HTTP/QUIC Settings" registry manages a 16-bit space. The "HTTP/QUIC 1216 Settings" registry operates under the "Expert Review" policy 1218 [RFC5226] for values in the range from 0x0000 to 0xefff, with values 1219 between and 0xf000 and 0xffff being reserved for Experimental Use. 1220 The designated experts are the same as those for the "HTTP/2 1221 Settings" registry defined in [RFC7540]. 1223 While this registry is separate from the "HTTP/2 Settings" registry 1224 defined in [RFC7540], it is preferable that the assignments parallel 1225 each other. If an entry is present in only one registry, every 1226 effort SHOULD be made to avoid assigning the corresponding value to 1227 an unrelated operation. 1229 New registrations are advised to provide the following information: 1231 Name: A symbolic name for the setting. Specifying a setting name is 1232 optional. 1234 Code: The 16-bit code assigned to the setting. 1236 Specification: An optional reference to a specification that 1237 describes the use of the setting. 1239 The entries in the following table are registered by this document. 1241 +----------------------+------+-----------------+ 1242 | Setting Name | Code | Specification | 1243 +----------------------+------+-----------------+ 1244 | HEADER_TABLE_SIZE | 0x1 | Section 5.2.5.2 | 1245 | | | | 1246 | ENABLE_PUSH | 0x2 | Section 5.2.5.2 | 1247 | | | | 1248 | Reserved | 0x3 | N/A | 1249 | | | | 1250 | Reserved | 0x4 | N/A | 1251 | | | | 1252 | Reserved | 0x5 | N/A | 1253 | | | | 1254 | MAX_HEADER_LIST_SIZE | 0x6 | Section 5.2.5.2 | 1255 +----------------------+------+-----------------+ 1257 9.5. Error Codes 1259 This document establishes a registry for HTTP/QUIC error codes. The 1260 "HTTP/QUIC Error Code" registry manages a 30-bit space. The "HTTP/ 1261 QUIC Error Code" registry operates under the "Expert Review" policy 1262 [RFC5226]. 1264 Registrations for error codes are required to include a description 1265 of the error code. An expert reviewer is advised to examine new 1266 registrations for possible duplication with existing error codes. 1267 Use of existing registrations is to be encouraged, but not mandated. 1269 New registrations are advised to provide the following information: 1271 Name: A name for the error code. Specifying an error code name is 1272 optional. 1274 Code: The 30-bit error code value. 1276 Description: A brief description of the error code semantics, longer 1277 if no detailed specification is provided. 1279 Specification: An optional reference for a specification that 1280 defines the error code. 1282 The entries in the following table are registered by this document. 1284 +------------------------------+-----+--------------+---------------+ 1285 | Name | Cod | Description | Specification | 1286 | | e | | | 1287 +------------------------------+-----+--------------+---------------+ 1288 | HTTP_PUSH_REFUSED | 0x0 | Client | Section 6.1 | 1289 | | 1 | refused | | 1290 | | | pushed | | 1291 | | | content | | 1292 | | | | | 1293 | HTTP_INTERNAL_ERROR | 0x0 | Internal | Section 6.1 | 1294 | | 2 | error | | 1295 | | | | | 1296 | HTTP_PUSH_ALREADY_IN_CACHE | 0x0 | Pushed | Section 6.1 | 1297 | | 3 | content | | 1298 | | | already | | 1299 | | | cached | | 1300 | | | | | 1301 | HTTP_REQUEST_CANCELLED | 0x0 | Data no | Section 6.1 | 1302 | | 4 | longer | | 1303 | | | needed | | 1304 | | | | | 1305 | HTTP_HPACK_DECOMPRESSION_FAI | 0x0 | HPACK cannot | Section 6.1 | 1306 | LED | 5 | continue | | 1307 | | | | | 1308 | HTTP_CONNECT_ERROR | 0x0 | TCP reset or | Section 6.1 | 1309 | | 6 | error on | | 1310 | | | CONNECT | | 1311 | | | request | | 1312 | | | | | 1313 | HTTP_EXCESSIVE_LOAD | 0x0 | Peer | Section 6.1 | 1314 | | 7 | generating | | 1315 | | | excessive | | 1316 | | | load | | 1317 | | | | | 1318 | HTTP_VERSION_FALLBACK | 0x0 | Retry over | Section 6.1 | 1319 | | 8 | HTTP/2 | | 1320 | | | | | 1321 | HTTP_MALFORMED_HEADERS | 0x0 | Invalid | Section 6.1 | 1322 | | 9 | HEADERS | | 1323 | | | frame | | 1324 | | | | | 1325 | HTTP_MALFORMED_PRIORITY | 0x0 | Invalid | Section 6.1 | 1326 | | A | PRIORITY | | 1327 | | | frame | | 1328 | | | | | 1329 | HTTP_MALFORMED_SETTINGS | 0x0 | Invalid | Section 6.1 | 1330 | | B | SETTINGS | | 1331 | | | frame | | 1332 | | | | | 1333 | HTTP_MALFORMED_PUSH_PROMISE | 0x0 | Invalid | Section 6.1 | 1334 | | C | PUSH_PROMISE | | 1335 | | | frame | | 1336 | | | | | 1337 | HTTP_MALFORMED_DATA | 0x0 | Invalid DATA | Section 6.1 | 1338 | | D | frame | | 1339 | | | | | 1340 | HTTP_INTERRUPTED_HEADERS | 0x0 | Incomplete | Section 6.1 | 1341 | | E | HEADERS | | 1342 | | | block | | 1343 | | | | | 1344 | HTTP_WRONG_STREAM | 0x0 | A frame was | Section 6.1 | 1345 | | F | sent on the | | 1346 | | | wrong stream | | 1347 | | | | | 1348 | HTTP_MULTIPLE_SETTINGS | 0x1 | Multiple | Section 6.1 | 1349 | | 0 | SETTINGS | | 1350 | | | frames | | 1351 | | | | | 1352 | HTTP_DUPLICATE_PUSH | 0x1 | Duplicate | Section 6.1 | 1353 | | 1 | server push | | 1354 +------------------------------+-----+--------------+---------------+ 1356 10. References 1357 10.1. Normative References 1359 [QUIC-TRANSPORT] 1360 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 1361 Multiplexed and Secure Transport", draft-ietf-quic- 1362 transport (work in progress), August 2017. 1364 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 1365 RFC 793, DOI 10.17487/RFC0793, September 1981, 1366 . 1368 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1369 Requirement Levels", BCP 14, RFC 2119, 1370 DOI 10.17487/RFC2119, March 1997, 1371 . 1373 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 1374 Specifications: ABNF", STD 68, RFC 5234, 1375 DOI 10.17487/RFC5234, January 2008, 1376 . 1378 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1379 Protocol (HTTP/1.1): Message Syntax and Routing", 1380 RFC 7230, DOI 10.17487/RFC7230, June 2014, 1381 . 1383 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1384 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1385 DOI 10.17487/RFC7231, June 2014, 1386 . 1388 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 1389 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 1390 DOI 10.17487/RFC7540, May 2015, 1391 . 1393 [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for 1394 HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, 1395 . 1397 [RFC7838] Nottingham, M., McManus, P., and J. Reschke, "HTTP 1398 Alternative Services", RFC 7838, DOI 10.17487/RFC7838, 1399 April 2016, . 1401 10.2. Informative References 1403 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1404 IANA Considerations Section in RFCs", RFC 5226, 1405 DOI 10.17487/RFC5226, May 2008, 1406 . 1408 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1409 "Transport Layer Security (TLS) Application-Layer Protocol 1410 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1411 July 2014, . 1413 Appendix A. Contributors 1415 The original authors of this specification were Robbie Shade and Mike 1416 Warres. 1418 Appendix B. Change Log 1420 *RFC Editor's Note:* Please remove this section prior to 1421 publication of a final version of this document. 1423 B.1. Since draft-ietf-quic-http-04 1425 o Cite RFC 5234 (#404) 1427 o Return to a single stream per request (#245,#557) 1429 o Use separate frame type and settings registries from HTTP/2 (#81) 1431 o SETTINGS_ENABLE_PUSH instead of SETTINGS_DISABLE_PUSH (#477) 1433 o Restored GOAWAY (#696) 1435 o Identify server push using Push ID rather than a stream ID 1436 (#702,#281) 1438 o DATA frames cannot be empty (#700) 1440 B.2. Since draft-ietf-quic-http-03 1442 None. 1444 B.3. Since draft-ietf-quic-http-02 1446 o Track changes in transport draft 1448 B.4. Since draft-ietf-quic-http-01 1450 o SETTINGS changes (#181): 1452 * SETTINGS can be sent only once at the start of a connection; no 1453 changes thereafter 1455 * SETTINGS_ACK removed 1457 * Settings can only occur in the SETTINGS frame a single time 1459 * Boolean format updated 1461 o Alt-Svc parameter changed from "v" to "quic"; format updated 1462 (#229) 1464 o Closing the connection control stream or any message control 1465 stream is a fatal error (#176) 1467 o HPACK Sequence counter can wrap (#173) 1469 o 0-RTT guidance added 1471 o Guide to differences from HTTP/2 and porting HTTP/2 extensions 1472 added (#127,#242) 1474 B.5. Since draft-ietf-quic-http-00 1476 o Changed "HTTP/2-over-QUIC" to "HTTP/QUIC" throughout (#11,#29) 1478 o Changed from using HTTP/2 framing within Stream 3 to new framing 1479 format and two-stream-per-request model (#71,#72,#73) 1481 o Adopted SETTINGS format from draft-bishop-httpbis-extended- 1482 settings-01 1484 o Reworked SETTINGS_ACK to account for indeterminate inter-stream 1485 order (#75) 1487 o Described CONNECT pseudo-method (#95) 1489 o Updated ALPN token and Alt-Svc guidance (#13,#87) 1491 o Application-layer-defined error codes (#19,#74) 1493 B.6. Since draft-shade-quic-http2-mapping-00 1495 o Adopted as base for draft-ietf-quic-http 1497 o Updated authors/editors list 1499 Author's Address 1501 Mike Bishop (editor) 1502 Microsoft 1504 Email: Michael.Bishop@microsoft.com