< draft-ietf-httpbis-http2bis-02.txt   draft-ietf-httpbis-http2bis-03.txt >
HTTPbis M. Thomson, Ed. HTTPbis M. Thomson, Ed.
Internet-Draft Mozilla Internet-Draft Mozilla
Obsoletes: 7540, 8740 (if approved) C. Benfield, Ed. Obsoletes: 7540, 8740 (if approved) C. Benfield, Ed.
Intended status: Standards Track Apple Inc. Intended status: Standards Track Apple Inc.
Expires: 4 December 2021 2 June 2021 Expires: 13 January 2022 12 July 2021
Hypertext Transfer Protocol Version 2 (HTTP/2) Hypertext Transfer Protocol Version 2 (HTTP/2)
draft-ietf-httpbis-http2bis-02 draft-ietf-httpbis-http2bis-03
Abstract Abstract
This specification describes an optimized expression of the semantics This specification describes an optimized expression of the semantics
of the Hypertext Transfer Protocol (HTTP), referred to as HTTP of the Hypertext Transfer Protocol (HTTP), referred to as HTTP
version 2 (HTTP/2). HTTP/2 enables a more efficient use of network version 2 (HTTP/2). HTTP/2 enables a more efficient use of network
resources and a reduced perception of latency by introducing header resources and a reduced perception of latency by introducing header
field compression and allowing multiple concurrent exchanges on the field compression and allowing multiple concurrent exchanges on the
same connection. same connection.
skipping to change at page 2, line 4 skipping to change at page 2, line 4
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 4 December 2021. This Internet-Draft will expire on 13 January 2022.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2. HTTP/2 Protocol Overview . . . . . . . . . . . . . . . . . . 5 2. HTTP/2 Protocol Overview . . . . . . . . . . . . . . . . . . 5
2.1. Document Organization . . . . . . . . . . . . . . . . . . 5 2.1. Document Organization . . . . . . . . . . . . . . . . . . 6
2.2. Conventions and Terminology . . . . . . . . . . . . . . . 6 2.2. Conventions and Terminology . . . . . . . . . . . . . . . 6
3. Starting HTTP/2 . . . . . . . . . . . . . . . . . . . . . . . 7 3. Starting HTTP/2 . . . . . . . . . . . . . . . . . . . . . . . 7
3.1. HTTP/2 Version Identification . . . . . . . . . . . . . . 7 3.1. HTTP/2 Version Identification . . . . . . . . . . . . . . 8
3.2. Starting HTTP/2 for "https" URIs . . . . . . . . . . . . 8 3.2. Starting HTTP/2 for "https" URIs . . . . . . . . . . . . 8
3.3. Starting HTTP/2 with Prior Knowledge . . . . . . . . . . 8 3.3. Starting HTTP/2 with Prior Knowledge . . . . . . . . . . 8
3.4. HTTP/2 Connection Preface . . . . . . . . . . . . . . . . 9 3.4. HTTP/2 Connection Preface . . . . . . . . . . . . . . . . 9
4. HTTP Frames . . . . . . . . . . . . . . . . . . . . . . . . . 10 4. HTTP Frames . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1. Frame Format . . . . . . . . . . . . . . . . . . . . . . 10 4.1. Frame Format . . . . . . . . . . . . . . . . . . . . . . 10
4.2. Frame Size . . . . . . . . . . . . . . . . . . . . . . . 11 4.2. Frame Size . . . . . . . . . . . . . . . . . . . . . . . 11
4.3. Field Section Compression and Decompression . . . . . . . 12 4.3. Field Section Compression and Decompression . . . . . . . 12
5. Streams and Multiplexing . . . . . . . . . . . . . . . . . . 13 5. Streams and Multiplexing . . . . . . . . . . . . . . . . . . 13
5.1. Stream States . . . . . . . . . . . . . . . . . . . . . . 14 5.1. Stream States . . . . . . . . . . . . . . . . . . . . . . 14
5.1.1. Stream Identifiers . . . . . . . . . . . . . . . . . 19 5.1.1. Stream Identifiers . . . . . . . . . . . . . . . . . 19
skipping to change at page 3, line 10 skipping to change at page 3, line 10
5.4.2. Stream Error Handling . . . . . . . . . . . . . . . . 25 5.4.2. Stream Error Handling . . . . . . . . . . . . . . . . 25
5.4.3. Connection Termination . . . . . . . . . . . . . . . 25 5.4.3. Connection Termination . . . . . . . . . . . . . . . 25
5.5. Extending HTTP/2 . . . . . . . . . . . . . . . . . . . . 25 5.5. Extending HTTP/2 . . . . . . . . . . . . . . . . . . . . 25
6. Frame Definitions . . . . . . . . . . . . . . . . . . . . . . 26 6. Frame Definitions . . . . . . . . . . . . . . . . . . . . . . 26
6.1. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.1. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2. HEADERS . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.2. HEADERS . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.3. PRIORITY . . . . . . . . . . . . . . . . . . . . . . . . 30 6.3. PRIORITY . . . . . . . . . . . . . . . . . . . . . . . . 30
6.4. RST_STREAM . . . . . . . . . . . . . . . . . . . . . . . 31 6.4. RST_STREAM . . . . . . . . . . . . . . . . . . . . . . . 31
6.5. SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . 32 6.5. SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . 32
6.5.1. SETTINGS Format . . . . . . . . . . . . . . . . . . . 33 6.5.1. SETTINGS Format . . . . . . . . . . . . . . . . . . . 33
6.5.2. Defined Settings . . . . . . . . . . . . . . . . . . 33 6.5.2. Defined Settings . . . . . . . . . . . . . . . . . . 34
6.5.3. Settings Synchronization . . . . . . . . . . . . . . 35 6.5.3. Settings Synchronization . . . . . . . . . . . . . . 36
6.6. PUSH_PROMISE . . . . . . . . . . . . . . . . . . . . . . 35 6.6. PUSH_PROMISE . . . . . . . . . . . . . . . . . . . . . . 36
6.7. PING . . . . . . . . . . . . . . . . . . . . . . . . . . 37 6.7. PING . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.8. GOAWAY . . . . . . . . . . . . . . . . . . . . . . . . . 38 6.8. GOAWAY . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.9. WINDOW_UPDATE . . . . . . . . . . . . . . . . . . . . . . 41 6.9. WINDOW_UPDATE . . . . . . . . . . . . . . . . . . . . . . 42
6.9.1. The Flow-Control Window . . . . . . . . . . . . . . . 42 6.9.1. The Flow-Control Window . . . . . . . . . . . . . . . 44
6.9.2. Initial Flow-Control Window Size . . . . . . . . . . 43 6.9.2. Initial Flow-Control Window Size . . . . . . . . . . 45
6.9.3. Reducing the Stream Window Size . . . . . . . . . . . 44 6.9.3. Reducing the Stream Window Size . . . . . . . . . . . 46
6.10. CONTINUATION . . . . . . . . . . . . . . . . . . . . . . 44 6.10. CONTINUATION . . . . . . . . . . . . . . . . . . . . . . 46
7. Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . 45 7. Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . 47
8. HTTP Message Exchanges . . . . . . . . . . . . . . . . . . . 46 8. Expressing HTTP Semantics in HTTP/2 . . . . . . . . . . . . . 48
8.1. HTTP Message Framing . . . . . . . . . . . . . . . . . . 46 8.1. HTTP Message Framing . . . . . . . . . . . . . . . . . . 49
8.1.1. Upgrading from HTTP/2 . . . . . . . . . . . . . . . . 48 8.1.1. Malformed Messages . . . . . . . . . . . . . . . . . 50
8.1.2. HTTP Fields . . . . . . . . . . . . . . . . . . . . . 48 8.2. HTTP Fields . . . . . . . . . . . . . . . . . . . . . . . 51
8.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . 53 8.2.1. Field Validity . . . . . . . . . . . . . . . . . . . 51
8.1.4. Request Reliability Mechanisms in HTTP/2 . . . . . . 56 8.2.2. Connection-Specific Header Fields . . . . . . . . . . 52
8.2. Server Push . . . . . . . . . . . . . . . . . . . . . . . 57 8.2.3. Compressing the Cookie Header Field . . . . . . . . . 53
8.2.1. Push Requests . . . . . . . . . . . . . . . . . . . . 58 8.3. HTTP Control Data . . . . . . . . . . . . . . . . . . . . 53
8.2.2. Push Responses . . . . . . . . . . . . . . . . . . . 60 8.3.1. Request Pseudo-Header Fields . . . . . . . . . . . . 54
8.3. The CONNECT Method . . . . . . . . . . . . . . . . . . . 61 8.3.2. Response Pseudo-Header Fields . . . . . . . . . . . . 55
9. Additional HTTP Requirements/Considerations . . . . . . . . . 62 8.4. Server Push . . . . . . . . . . . . . . . . . . . . . . . 56
9.1. Connection Management . . . . . . . . . . . . . . . . . . 62 8.4.1. Push Requests . . . . . . . . . . . . . . . . . . . . 57
9.1.1. Connection Reuse . . . . . . . . . . . . . . . . . . 63 8.4.2. Push Responses . . . . . . . . . . . . . . . . . . . 58
9.2. Use of TLS Features . . . . . . . . . . . . . . . . . . . 63 8.5. The CONNECT Method . . . . . . . . . . . . . . . . . . . 59
9.2.1. TLS 1.2 Features . . . . . . . . . . . . . . . . . . 64 8.6. The Upgrade Header Field . . . . . . . . . . . . . . . . 60
9.2.2. TLS 1.2 Cipher Suites . . . . . . . . . . . . . . . . 65 8.7. Request Reliability . . . . . . . . . . . . . . . . . . . 61
9.2.3. TLS 1.3 Features . . . . . . . . . . . . . . . . . . 65 8.8. Examples . . . . . . . . . . . . . . . . . . . . . . . . 61
10. Security Considerations . . . . . . . . . . . . . . . . . . . 66 9. HTTP/2 Connections . . . . . . . . . . . . . . . . . . . . . 64
10.1. Server Authority . . . . . . . . . . . . . . . . . . . . 66 9.1. Connection Management . . . . . . . . . . . . . . . . . . 64
10.2. Cross-Protocol Attacks . . . . . . . . . . . . . . . . . 66 9.1.1. Connection Reuse . . . . . . . . . . . . . . . . . . 65
10.3. Intermediary Encapsulation Attacks . . . . . . . . . . . 67 9.2. Use of TLS Features . . . . . . . . . . . . . . . . . . . 66
10.4. Cacheability of Pushed Responses . . . . . . . . . . . . 67 9.2.1. TLS 1.2 Features . . . . . . . . . . . . . . . . . . 66
10.5. Denial-of-Service Considerations . . . . . . . . . . . . 68 9.2.2. TLS 1.2 Cipher Suites . . . . . . . . . . . . . . . . 67
10.5.1. Limits on Field Block Size . . . . . . . . . . . . . 69 9.2.3. TLS 1.3 Features . . . . . . . . . . . . . . . . . . 68
10.5.2. CONNECT Issues . . . . . . . . . . . . . . . . . . . 70 10. Security Considerations . . . . . . . . . . . . . . . . . . . 68
10.6. Use of Compression . . . . . . . . . . . . . . . . . . . 70 10.1. Server Authority . . . . . . . . . . . . . . . . . . . . 68
10.7. Use of Padding . . . . . . . . . . . . . . . . . . . . . 71 10.2. Cross-Protocol Attacks . . . . . . . . . . . . . . . . . 69
10.8. Privacy Considerations . . . . . . . . . . . . . . . . . 71 10.3. Intermediary Encapsulation Attacks . . . . . . . . . . . 69
10.9. Remote Timing Attacks . . . . . . . . . . . . . . . . . 72 10.4. Cacheability of Pushed Responses . . . . . . . . . . . . 70
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 72 10.5. Denial-of-Service Considerations . . . . . . . . . . . . 70
11.1. Registration of HTTP/2 Identification Strings . . . . . 72 10.5.1. Limits on Field Block Size . . . . . . . . . . . . . 72
11.2. Frame Type Registry . . . . . . . . . . . . . . . . . . 73 10.5.2. CONNECT Issues . . . . . . . . . . . . . . . . . . . 72
11.3. Settings Registry . . . . . . . . . . . . . . . . . . . 74 10.6. Use of Compression . . . . . . . . . . . . . . . . . . . 72
11.4. Error Code Registry . . . . . . . . . . . . . . . . . . 75 10.7. Use of Padding . . . . . . . . . . . . . . . . . . . . . 73
11.5. HTTP2-Settings Header Field Registration . . . . . . . . 77 10.8. Privacy Considerations . . . . . . . . . . . . . . . . . 74
11.6. PRI Method Registration . . . . . . . . . . . . . . . . 77 10.9. Remote Timing Attacks . . . . . . . . . . . . . . . . . 74
11.7. The h2c Upgrade Token . . . . . . . . . . . . . . . . . 77 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 74
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 77 11.1. Registration of HTTP/2 Identification Strings . . . . . 75
12.1. Normative References . . . . . . . . . . . . . . . . . . 77 11.2. Frame Type Registry . . . . . . . . . . . . . . . . . . 75
12.2. Informative References . . . . . . . . . . . . . . . . . 79 11.3. Settings Registry . . . . . . . . . . . . . . . . . . . 76
Appendix A. Prohibited TLS 1.2 Cipher Suites . . . . . . . . . . 80 11.4. Error Code Registry . . . . . . . . . . . . . . . . . . 77
Appendix B. Changes from RFC 7540 . . . . . . . . . . . . . . . 86 11.5. HTTP2-Settings Header Field Registration . . . . . . . . 79
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 87 11.6. PRI Method Registration . . . . . . . . . . . . . . . . 79
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 87 11.7. The h2c Upgrade Token . . . . . . . . . . . . . . . . . 79
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 88 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 79
12.1. Normative References . . . . . . . . . . . . . . . . . . 79
12.2. Informative References . . . . . . . . . . . . . . . . . 81
Appendix A. Prohibited TLS 1.2 Cipher Suites . . . . . . . . . . 83
Appendix B. Changes from RFC 7540 . . . . . . . . . . . . . . . 89
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 89
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 90
1. Introduction 1. Introduction
The Hypertext Transfer Protocol (HTTP) is a wildly successful The Hypertext Transfer Protocol (HTTP) is a wildly successful
protocol. However, the way HTTP/1.1 uses the underlying transport protocol. However, the way HTTP/1.1 uses the underlying transport
([HTTP11]) has several characteristics that have a negative overall ([HTTP11]) has several characteristics that have a negative overall
effect on application performance today. effect on application performance today.
In particular, HTTP/1.0 allowed only one request to be outstanding at In particular, HTTP/1.0 allowed only one request to be outstanding at
a time on a given TCP connection. HTTP/1.1 added request pipelining, a time on a given TCP connection. HTTP/1.1 added request pipelining,
skipping to change at page 5, line 41 skipping to change at page 5, line 46
transmitted. Prioritization (Section 5.3) ensures that limited transmitted. Prioritization (Section 5.3) ensures that limited
resources can be directed to the most important streams first. resources can be directed to the most important streams first.
Because HTTP header fields used in a connection can contain large Because HTTP header fields used in a connection can contain large
amounts of redundant data, frames that contain them are compressed amounts of redundant data, frames that contain them are compressed
(Section 4.3). This has especially advantageous impact upon request (Section 4.3). This has especially advantageous impact upon request
sizes in the common case, allowing many requests to be compressed sizes in the common case, allowing many requests to be compressed
into one packet. into one packet.
Finally, HTTP/2 adds a new, optional interaction mode whereby a Finally, HTTP/2 adds a new, optional interaction mode whereby a
server can push responses to a client (Section 8.2). This is server can push responses to a client (Section 8.4). This is
intended to allow a server to speculatively send data to a client intended to allow a server to speculatively send data to a client
that the server anticipates the client will need, trading off some that the server anticipates the client will need, trading off some
network usage against a potential latency gain. The server does this network usage against a potential latency gain. The server does this
by synthesizing a request, which it sends as a PUSH_PROMISE frame. by synthesizing a request, which it sends as a PUSH_PROMISE frame.
The server is then able to send a response to the synthetic request The server is then able to send a response to the synthetic request
on a separate stream. on a separate stream.
2.1. Document Organization 2.1. Document Organization
The HTTP/2 specification is split into four parts: The HTTP/2 specification is split into four parts:
skipping to change at page 6, line 35 skipping to change at page 6, line 39
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
All numeric values are in network byte order. Values are unsigned All numeric values are in network byte order. Values are unsigned
unless otherwise indicated. Literal values are provided in decimal unless otherwise indicated. Literal values are provided in decimal
or hexadecimal as appropriate. Hexadecimal literals are prefixed or hexadecimal as appropriate. Hexadecimal literals are prefixed
with "0x" to distinguish them from decimal literals. with "0x" to distinguish them from decimal literals.
This specification describes binary formats using the convention
described in Section 1.3 of RFC 9000 [QUIC].
The following terms are used: The following terms are used:
client: The endpoint that initiates an HTTP/2 connection. Clients client: The endpoint that initiates an HTTP/2 connection. Clients
send HTTP requests and receive HTTP responses. send HTTP requests and receive HTTP responses.
connection: A transport-layer connection between two endpoints. connection: A transport-layer connection between two endpoints.
connection error: An error that affects the entire HTTP/2 connection error: An error that affects the entire HTTP/2
connection. connection.
skipping to change at page 7, line 32 skipping to change at page 7, line 38
The term "content" as it applies to message bodies is defined in The term "content" as it applies to message bodies is defined in
Section 6.4 of [HTTP]. Section 6.4 of [HTTP].
3. Starting HTTP/2 3. Starting HTTP/2
An HTTP/2 connection is an application-layer protocol running on top An HTTP/2 connection is an application-layer protocol running on top
of a TCP connection ([TCP]). The client is the TCP connection of a TCP connection ([TCP]). The client is the TCP connection
initiator. initiator.
HTTP/2 uses the "http" and "https" URI schemes defined in Section 4.2 HTTP/2 uses the "http" and "https" URI schemes defined in Section 4.2
of [HTTP]. HTTP/2 shares the same default port numbers: 80 for of [HTTP], with the same default port numbers. As a result,
"http" URIs and 443 for "https" URIs. As a result, implementations implementations processing requests for target resource URIs like
processing requests for target resource URIs like
"http://example.org/foo" or "https://example.com/bar" are required to "http://example.org/foo" or "https://example.com/bar" are required to
first discover whether the upstream server (the immediate peer to first discover whether the upstream server (the immediate peer to
which the client wishes to establish a connection) supports HTTP/2. which the client wishes to establish a connection) supports HTTP/2.
The means by which support for HTTP/2 is determined is different for The means by which support for HTTP/2 is determined is different for
"http" and "https" URIs. Discovery for "https" URIs is described in "http" and "https" URIs. Discovery for "https" URIs is described in
Section 3.2. HTTP/2 support for "http" URIs can only be discovered Section 3.2. HTTP/2 support for "http" URIs can only be discovered
by out-of-band means, and requires prior knowledge of the support as by out-of-band means, and requires prior knowledge of the support as
described in Section 3.3. described in Section 3.3.
skipping to change at page 10, line 31 skipping to change at page 10, line 31
4. HTTP Frames 4. HTTP Frames
Once the HTTP/2 connection is established, endpoints can begin Once the HTTP/2 connection is established, endpoints can begin
exchanging frames. exchanging frames.
4.1. Frame Format 4.1. Frame Format
All frames begin with a fixed 9-octet header followed by a variable- All frames begin with a fixed 9-octet header followed by a variable-
length frame payload. length frame payload.
+-----------------------------------------------+ HTTP Frame {
| Length (24) | Length (24),
+---------------+---------------+---------------+ Type (8),
| Type (8) | Flags (8) | Flags (8),
+-+-------------+---------------+-------------------------------+ Reserved (1),
|R| Stream Identifier (31) | Stream Identifier (31),
+=+=============================================================+ Frame Payload (..),
| Frame Payload (0...) ... }
+---------------------------------------------------------------+
Figure 1: Frame Layout Figure 1: Frame Layout
The fields of the frame header are defined as: The fields of the frame header are defined as:
Length: The length of the frame payload expressed as an unsigned Length: The length of the frame payload expressed as an unsigned
24-bit integer. Values greater than 2^14 (16,384) MUST NOT be 24-bit integer. Values greater than 2^14 (16,384) MUST NOT be
sent unless the receiver has set a larger value for sent unless the receiver has set a larger value for
SETTINGS_MAX_FRAME_SIZE. SETTINGS_MAX_FRAME_SIZE.
The 9 octets of the frame header are not included in this value. The 9 octets of the frame header are not included in this value.
Type: The 8-bit type of the frame. The frame type determines the Type: The 8-bit type of the frame. The frame type determines the
format and semantics of the frame. Implementations MUST ignore format and semantics of the frame. Implementations MUST ignore
and discard any frame that has a type that is unknown. and discard any frame that has a type that is unknown.
Flags: An 8-bit field reserved for boolean flags specific to the Flags: An 8-bit field reserved for boolean flags specific to the
frame type. frame type.
Flags are assigned semantics specific to the indicated frame type. Flags are assigned semantics specific to the indicated frame type.
Flags that have no defined semantics for a particular frame type Unused Flags are those that have no defined semantics for a
MUST be ignored and MUST be left unset (0x0) when sending. particular frame type, and MUST be ignored and MUST be left unset
(0x0) when sending.
R: A reserved 1-bit field. The semantics of this bit are undefined, Reserved: A reserved 1-bit field. The semantics of this bit are
and the bit MUST remain unset (0x0) when sending and MUST be undefined, and the bit MUST remain unset (0x0) when sending and
ignored when receiving. MUST be ignored when receiving.
Stream Identifier: A stream identifier (see Section 5.1.1) expressed Stream Identifier: A stream identifier (see Section 5.1.1) expressed
as an unsigned 31-bit integer. The value 0x0 is reserved for as an unsigned 31-bit integer. The value 0x0 is reserved for
frames that are associated with the connection as a whole as frames that are associated with the connection as a whole as
opposed to an individual stream. opposed to an individual stream.
The structure and content of the frame payload is dependent entirely The structure and content of the frame payload is dependent entirely
on the frame type. on the frame type.
4.2. Frame Size 4.2. Frame Size
skipping to change at page 12, line 23 skipping to change at page 12, line 23
Field section compression is the process of compressing a set of Field section compression is the process of compressing a set of
field lines to form a field block. Field section decompression is field lines to form a field block. Field section decompression is
the process of decoding a field block into a set of field lines. the process of decoding a field block into a set of field lines.
Details of HTTP/2 field section compression and decompression is Details of HTTP/2 field section compression and decompression is
defined in [COMPRESSION], which, for historical reasons, refers to defined in [COMPRESSION], which, for historical reasons, refers to
these processes as header compression and decompression. these processes as header compression and decompression.
Field blocks carry the compressed bytes of a field section, with Field blocks carry the compressed bytes of a field section, with
header sections also carrying control data associated with the header sections also carrying control data associated with the
message in the form of pseudo-header fields (Section 8.1.2.1) that message in the form of pseudo-header fields (Section 8.3) that use
use the same format as a field line. the same format as a field line.
| Note: Previous versions of this specification used the term | Note: Previous versions of this specification used the term
| "header block" in place of the more generic "field block". | "header block" in place of the more generic "field block".
Field blocks carry control data and header sections for requests, Field blocks carry control data and header sections for requests,
responses, promised requests, and pushed responses (see Section 8.2). responses, promised requests, and pushed responses (see Section 8.4).
All these messages, except for interim responses and requests All these messages, except for interim responses and requests
contained in PUSH_PROMISE (Section 6.6) frames can optionally include contained in PUSH_PROMISE (Section 6.6) frames can optionally include
a field block that carries a trailer section. a field block that carries a trailer section.
A field section is a collection of zero or more field lines. Each of A field section is a collection of zero or more field lines. Each of
the field lines in a field block carry a single value. The the field lines in a field block carry a single value. The
serialized field block is then divided into one or more octet serialized field block is then divided into one or more octet
sequences, called field block fragments, and transmitted within the sequences, called field block fragments, and transmitted within the
frame payload of HEADERS (Section 6.2) or PUSH_PROMISE (Section 6.6), frame payload of HEADERS (Section 6.2) or PUSH_PROMISE (Section 6.6),
each of which could be followed by CONTINUATION (Section 6.10) each of which could be followed by CONTINUATION (Section 6.10)
frames. frames.
The Cookie header field [COOKIE] is treated specially by the HTTP The Cookie header field [COOKIE] is treated specially by the HTTP
mapping (see Section 8.1.2.5). mapping (see Section 8.2.3).
A receiving endpoint reassembles the field block by concatenating its A receiving endpoint reassembles the field block by concatenating its
fragments and then decompresses the block to reconstruct the field fragments and then decompresses the block to reconstruct the field
section. section.
A complete field section consists of either: A complete field section consists of either:
* a single HEADERS or PUSH_PROMISE frame, with the END_HEADERS flag * a single HEADERS or PUSH_PROMISE frame, with the END_HEADERS flag
set, or set, or
skipping to change at page 15, line 51 skipping to change at page 15, line 51
ID field. ID field.
Receiving any frame other than HEADERS or PRIORITY on a stream in Receiving any frame other than HEADERS or PRIORITY on a stream in
this state MUST be treated as a connection error (Section 5.4.1) this state MUST be treated as a connection error (Section 5.4.1)
of type PROTOCOL_ERROR. of type PROTOCOL_ERROR.
reserved (local): A stream in the "reserved (local)" state is one reserved (local): A stream in the "reserved (local)" state is one
that has been promised by sending a PUSH_PROMISE frame. A that has been promised by sending a PUSH_PROMISE frame. A
PUSH_PROMISE frame reserves an idle stream by associating the PUSH_PROMISE frame reserves an idle stream by associating the
stream with an open stream that was initiated by the remote peer stream with an open stream that was initiated by the remote peer
(see Section 8.2). (see Section 8.4).
In this state, only the following transitions are possible: In this state, only the following transitions are possible:
* The endpoint can send a HEADERS frame. This causes the stream * The endpoint can send a HEADERS frame. This causes the stream
to open in a "half-closed (remote)" state. to open in a "half-closed (remote)" state.
* Either endpoint can send a RST_STREAM frame to cause the stream * Either endpoint can send a RST_STREAM frame to cause the stream
to become "closed". This releases the stream reservation. to become "closed". This releases the stream reservation.
An endpoint MUST NOT send any type of frame other than HEADERS, An endpoint MUST NOT send any type of frame other than HEADERS,
skipping to change at page 18, line 44 skipping to change at page 18, line 44
after closing the stream. after closing the stream.
In the absence of more specific guidance elsewhere in this document, In the absence of more specific guidance elsewhere in this document,
implementations SHOULD treat the receipt of a frame that is not implementations SHOULD treat the receipt of a frame that is not
expressly permitted in the description of a state as a connection expressly permitted in the description of a state as a connection
error (Section 5.4.1) of type PROTOCOL_ERROR. Note that PRIORITY can error (Section 5.4.1) of type PROTOCOL_ERROR. Note that PRIORITY can
be sent and received in any stream state. Frames of unknown types be sent and received in any stream state. Frames of unknown types
are ignored. are ignored.
An example of the state transitions for an HTTP request/response An example of the state transitions for an HTTP request/response
exchange can be found in Section 8.1. An example of the state exchange can be found in Section 8.8. An example of the state
transitions for server push can be found in Sections 8.2.1 and 8.2.2. transitions for server push can be found in Sections 8.4.1 and 8.4.2.
5.1.1. Stream Identifiers 5.1.1. Stream Identifiers
Streams are identified with an unsigned 31-bit integer. Streams Streams are identified with an unsigned 31-bit integer. Streams
initiated by a client MUST use odd-numbered stream identifiers; those initiated by a client MUST use odd-numbered stream identifiers; those
initiated by the server MUST use even-numbered stream identifiers. A initiated by the server MUST use even-numbered stream identifiers. A
stream identifier of zero (0x0) is used for connection control stream identifier of zero (0x0) is used for connection control
messages; the stream identifier of zero cannot be used to establish a messages; the stream identifier of zero cannot be used to establish a
new stream. new stream.
skipping to change at page 20, line 13 skipping to change at page 20, line 13
endpoint is permitted to open. Streams in any of these three states endpoint is permitted to open. Streams in any of these three states
count toward the limit advertised in the count toward the limit advertised in the
SETTINGS_MAX_CONCURRENT_STREAMS setting. Streams in either of the SETTINGS_MAX_CONCURRENT_STREAMS setting. Streams in either of the
"reserved" states do not count toward the stream limit. "reserved" states do not count toward the stream limit.
Endpoints MUST NOT exceed the limit set by their peer. An endpoint Endpoints MUST NOT exceed the limit set by their peer. An endpoint
that receives a HEADERS frame that causes its advertised concurrent that receives a HEADERS frame that causes its advertised concurrent
stream limit to be exceeded MUST treat this as a stream error stream limit to be exceeded MUST treat this as a stream error
(Section 5.4.2) of type PROTOCOL_ERROR or REFUSED_STREAM. The choice (Section 5.4.2) of type PROTOCOL_ERROR or REFUSED_STREAM. The choice
of error code determines whether the endpoint wishes to enable of error code determines whether the endpoint wishes to enable
automatic retry (see Section 8.1.4) for details). automatic retry (see Section 8.7) for details).
An endpoint that wishes to reduce the value of An endpoint that wishes to reduce the value of
SETTINGS_MAX_CONCURRENT_STREAMS to a value that is below the current SETTINGS_MAX_CONCURRENT_STREAMS to a value that is below the current
number of open streams can either close streams that exceed the new number of open streams can either close streams that exceed the new
value or allow streams to complete. value or allow streams to complete.
5.2. Flow Control 5.2. Flow Control
Using streams for multiplexing introduces contention over use of the Using streams for multiplexing introduces contention over use of the
TCP connection, resulting in blocked streams. A flow-control scheme TCP connection, resulting in blocked streams. A flow-control scheme
skipping to change at page 25, line 35 skipping to change at page 25, line 35
round-trip time. This behavior is permitted to deal with misbehaving round-trip time. This behavior is permitted to deal with misbehaving
implementations. implementations.
To avoid looping, an endpoint MUST NOT send a RST_STREAM in response To avoid looping, an endpoint MUST NOT send a RST_STREAM in response
to a RST_STREAM frame. to a RST_STREAM frame.
5.4.3. Connection Termination 5.4.3. Connection Termination
If the TCP connection is closed or reset while streams remain in If the TCP connection is closed or reset while streams remain in
"open" or "half-closed" state, then the affected streams cannot be "open" or "half-closed" state, then the affected streams cannot be
automatically retried (see Section 8.1.4 for details). automatically retried (see Section 8.7 for details).
5.5. Extending HTTP/2 5.5. Extending HTTP/2
HTTP/2 permits extension of the protocol. Within the limitations HTTP/2 permits extension of the protocol. Within the limitations
described in this section, protocol extensions can be used to provide described in this section, protocol extensions can be used to provide
additional services or alter any aspect of the protocol. Extensions additional services or alter any aspect of the protocol. Extensions
are effective only within the scope of a single HTTP/2 connection. are effective only within the scope of a single HTTP/2 connection.
This applies to the protocol elements defined in this document. This This applies to the protocol elements defined in this document. This
does not affect the existing options for extending HTTP, such as does not affect the existing options for extending HTTP, such as
skipping to change at page 26, line 23 skipping to change at page 26, line 23
that have unknown or unsupported types. This means that any of these that have unknown or unsupported types. This means that any of these
extension points can be safely used by extensions without prior extension points can be safely used by extensions without prior
arrangement or negotiation. However, extension frames that appear in arrangement or negotiation. However, extension frames that appear in
the middle of a field block (Section 4.3) are not permitted; these the middle of a field block (Section 4.3) are not permitted; these
MUST be treated as a connection error (Section 5.4.1) of type MUST be treated as a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
Extensions SHOULD avoiding changing protocol elements defined in this Extensions SHOULD avoiding changing protocol elements defined in this
document or elements for which no extension mechanism is defined. document or elements for which no extension mechanism is defined.
This includes changes to the layout of frames, additions or changes This includes changes to the layout of frames, additions or changes
to the way that frames are composed into HTTP messages (Section 8), to the way that frames are composed into HTTP messages (Section 8.1),
the definition of pseudo-header fields, or changes to any protocol the definition of pseudo-header fields, or changes to any protocol
element that a compliant endpoint might treat as a connection error element that a compliant endpoint might treat as a connection error
(Section 5.4.1). (Section 5.4.1).
An extension that changes existing elements MUST be negotiated before An extension that changes existing elements MUST be negotiated before
being used. For example, an extension that changes the layout of the being used. For example, an extension that changes the layout of the
HEADERS frame cannot be used until the peer has given a positive HEADERS frame cannot be used until the peer has given a positive
signal that this is acceptable. In this case, it could also be signal that this is acceptable. In this case, it could also be
necessary to coordinate when the revised layout comes into effect. necessary to coordinate when the revised layout comes into effect.
For example, treating frames other than DATA frames as flow For example, treating frames other than DATA frames as flow
skipping to change at page 27, line 22 skipping to change at page 27, line 22
6.1. DATA 6.1. DATA
DATA frames (type=0x0) convey arbitrary, variable-length sequences of DATA frames (type=0x0) convey arbitrary, variable-length sequences of
octets associated with a stream. One or more DATA frames are used, octets associated with a stream. One or more DATA frames are used,
for instance, to carry HTTP request or response message contents. for instance, to carry HTTP request or response message contents.
DATA frames MAY also contain padding. Padding can be added to DATA DATA frames MAY also contain padding. Padding can be added to DATA
frames to obscure the size of messages. Padding is a security frames to obscure the size of messages. Padding is a security
feature; see Section 10.7. feature; see Section 10.7.
+---------------+ DATA Frame {
|Pad Length? (8)| Length (24),
+---------------+-----------------------------------------------+ Type (8) = 0,
| Data (*) ... Unused Flags (4),
+---------------------------------------------------------------+ PADDED Flag (1),
| Padding (*) ... Unused Flags (2),
+---------------------------------------------------------------+ END_STREAM Flag (1),
Reserved (1),
Stream Identifier (31),
[Pad Length (8)],
Data (..),
Padding (..),
}
Figure 3: DATA Frame Payload Figure 3: DATA Frame Format
The DATA frame contains the following fields: The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
fields are described in Section 4. The DATA frame contains the
following additional fields:
Pad Length: An 8-bit field containing the length of the frame Pad Length: An 8-bit field containing the length of the frame
padding in units of octets. This field is conditional (as padding in units of octets. This field is conditional (as
signified by a "?" in the diagram) and is only present if the signified by a "?" in the diagram) and is only present if the
PADDED flag is set. PADDED flag is set.
Data: Application data. The amount of data is the remainder of the Data: Application data. The amount of data is the remainder of the
frame payload after subtracting the length of the other fields frame payload after subtracting the length of the other fields
that are present. that are present.
skipping to change at page 27, line 44 skipping to change at page 28, line 4
Pad Length: An 8-bit field containing the length of the frame Pad Length: An 8-bit field containing the length of the frame
padding in units of octets. This field is conditional (as padding in units of octets. This field is conditional (as
signified by a "?" in the diagram) and is only present if the signified by a "?" in the diagram) and is only present if the
PADDED flag is set. PADDED flag is set.
Data: Application data. The amount of data is the remainder of the Data: Application data. The amount of data is the remainder of the
frame payload after subtracting the length of the other fields frame payload after subtracting the length of the other fields
that are present. that are present.
Padding: Padding octets that contain no application semantic value. Padding: Padding octets that contain no application semantic value.
Padding octets MUST be set to zero when sending. A receiver is Padding octets MUST be set to zero when sending. A receiver is
not obligated to verify padding but MAY treat non-zero padding as not obligated to verify padding but MAY treat non-zero padding as
a connection error (Section 5.4.1) of type PROTOCOL_ERROR. a connection error (Section 5.4.1) of type PROTOCOL_ERROR.
The DATA frame defines the following flags: The DATA frame defines the following flags:
END_STREAM (0x1): When set, bit 0 indicates that this frame is the PADDED (0x8): When set, the PADDED Flag indicates that the Pad
last that the endpoint will send for the identified stream. Length field and any padding that it describes are present.
Setting this flag causes the stream to enter one of the
"half-closed" states or the "closed" state (Section 5.1).
PADDED (0x8): When set, bit 3 indicates that the Pad Length field END_STREAM (0x1): When set, the END_STREAM Flag indicates that this
and any padding that it describes are present. frame is the last that the endpoint will send for the identified
stream. Setting this flag causes the stream to enter one of the
"half-closed" states or the "closed" state (Section 5.1).
DATA frames MUST be associated with a stream. If a DATA frame is DATA frames MUST be associated with a stream. If a DATA frame is
received whose stream identifier field is 0x0, the recipient MUST received whose stream identifier field is 0x0, the recipient MUST
respond with a connection error (Section 5.4.1) of type respond with a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
DATA frames are subject to flow control and can only be sent when a DATA frames are subject to flow control and can only be sent when a
stream is in the "open" or "half-closed (remote)" state. The entire stream is in the "open" or "half-closed (remote)" state. The entire
DATA frame payload is included in flow control, including the Pad DATA frame payload is included in flow control, including the Pad
Length and Padding fields if present. If a DATA frame is received Length and Padding fields if present. If a DATA frame is received
skipping to change at page 28, line 40 skipping to change at page 29, line 5
| including a Pad Length field with a value of zero. | including a Pad Length field with a value of zero.
6.2. HEADERS 6.2. HEADERS
The HEADERS frame (type=0x1) is used to open a stream (Section 5.1), The HEADERS frame (type=0x1) is used to open a stream (Section 5.1),
and additionally carries a field block fragment. Despite the name, a and additionally carries a field block fragment. Despite the name, a
HEADERS frame can carry a header section or a trailer section. HEADERS frame can carry a header section or a trailer section.
HEADERS frames can be sent on a stream in the "idle", "reserved HEADERS frames can be sent on a stream in the "idle", "reserved
(local)", "open", or "half-closed (remote)" state. (local)", "open", or "half-closed (remote)" state.
+---------------+ HEADERS Frame {
|Pad Length? (8)| Length (24),
+-+-------------+-----------------------------------------------+ Type (8) = 1,
|E| Stream Dependency? (31) | Unused Flags (2),
+-+-------------+-----------------------------------------------+ PRIORITY Flag (1),
| Weight? (8) | Unused Flag (1),
+-+-------------+-----------------------------------------------+ PADDED Flag (1),
| Field Block Fragment (*) ... END_HEADERS Flag (1),
+---------------------------------------------------------------+ Unused Flag (1),
| Padding (*) ... END_STREAM Flag (1),
+---------------------------------------------------------------+ Reserved (1),
Figure 4: HEADERS Frame Payload Stream Identifier (31),
[Pad Length (8)],
[Exclusive (1)],
[Stream Dependency (31)],
[Weight (8)],
Field Block Fragment (..),
Padding (..),
}
The HEADERS frame payload has the following fields: Figure 4: HEADERS Frame Format
The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
fields are described in Section 4. The HEADERS frame payload has the
following additional fields:
Pad Length: An 8-bit field containing the length of the frame Pad Length: An 8-bit field containing the length of the frame
padding in units of octets. This field is only present if the padding in units of octets. This field is only present if the
PADDED flag is set. PADDED flag is set.
E: A single-bit flag. This field is only present if the PRIORITY Exclusive: A single-bit flag. This field is only present if the
flag is set. PRIORITY flag is set.
Stream Dependency: A 31-bit stream identifier. This field is only Stream Dependency: A 31-bit stream identifier. This field is only
present if the PRIORITY flag is set. present if the PRIORITY flag is set.
Weight: An unsigned 8-bit integer. This field is only present if Weight: An unsigned 8-bit integer. This field is only present if
the PRIORITY flag is set. the PRIORITY flag is set.
Field Block Fragment: A field block fragment (Section 4.3). Field Block Fragment: A field block fragment (Section 4.3).
Padding: Padding octets. Padding: Padding octets.
The HEADERS frame defines the following flags: The HEADERS frame defines the following flags:
END_STREAM (0x1): When set, bit 0 indicates that the field block PRIORITY (0x20): When set, the PRIORITY Flag indicates that the
(Section 4.3) is the last that the endpoint will send for the Exclusive, Stream Dependency, and Weight fields are present.
identified stream.
A HEADERS frame carries the END_STREAM flag that signals the end PADDED (0x8): When set, the PADDED Flag indicates that the Pad
of a stream. However, a HEADERS frame with the END_STREAM flag Length field and any padding that it describes are present.
set can be followed by CONTINUATION frames on the same stream.
Logically, the CONTINUATION frames are part of the HEADERS frame.
END_HEADERS (0x4): When set, bit 2 indicates that this frame END_HEADERS (0x4): When set, the END_HEADERS Flag indicates that
contains an entire field block (Section 4.3) and is not followed this frame contains an entire field block (Section 4.3) and is not
by any CONTINUATION frames. followed by any CONTINUATION frames.
A HEADERS frame without the END_HEADERS flag set MUST be followed A HEADERS frame without the END_HEADERS flag set MUST be followed
by a CONTINUATION frame for the same stream. A receiver MUST by a CONTINUATION frame for the same stream. A receiver MUST
treat the receipt of any other type of frame or a frame on a treat the receipt of any other type of frame or a frame on a
different stream as a connection error (Section 5.4.1) of type different stream as a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
PADDED (0x8): When set, bit 3 indicates that the Pad Length field END_STREAM (0x1): When set, the END_STREAM Flag indicates that the
and any padding that it describes are present. field block (Section 4.3) is the last that the endpoint will send
for the identified stream.
PRIORITY (0x20): When set, bit 5 indicates that the Exclusive Flag A HEADERS frame carries the END_STREAM flag that signals the end
(E), Stream Dependency, and Weight fields are present. of a stream. However, a HEADERS frame with the END_STREAM flag
set can be followed by CONTINUATION frames on the same stream.
Logically, the CONTINUATION frames are part of the HEADERS frame.
The frame payload of a HEADERS frame contains a field block fragment The frame payload of a HEADERS frame contains a field block fragment
(Section 4.3). A field block that does not fit within a HEADERS (Section 4.3). A field block that does not fit within a HEADERS
frame is continued in a CONTINUATION frame (Section 6.10). frame is continued in a CONTINUATION frame (Section 6.10).
HEADERS frames MUST be associated with a stream. If a HEADERS frame HEADERS frames MUST be associated with a stream. If a HEADERS frame
is received whose stream identifier field is 0x0, the recipient MUST is received whose stream identifier field is 0x0, the recipient MUST
respond with a connection error (Section 5.4.1) of type respond with a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
skipping to change at page 30, line 28 skipping to change at page 31, line 5
identical to those defined for DATA frames (Section 6.1). Padding identical to those defined for DATA frames (Section 6.1). Padding
that exceeds the size remaining for the field block fragment MUST be that exceeds the size remaining for the field block fragment MUST be
treated as a PROTOCOL_ERROR. treated as a PROTOCOL_ERROR.
6.3. PRIORITY 6.3. PRIORITY
The PRIORITY frame (type=0x2) is deprecated; see Section 5.3.2. A The PRIORITY frame (type=0x2) is deprecated; see Section 5.3.2. A
PRIORITY frame can be sent in any stream state, including idle or PRIORITY frame can be sent in any stream state, including idle or
closed streams. closed streams.
+-+-------------------------------------------------------------+ PRIORITY Frame {
|E| Stream Dependency (31) | Length (24),
+-+-------------+-----------------------------------------------+ Type (8) = 2,
| Weight (8) | Unused Flags (8),
+-+-------------+ Reserved (1),
Stream Identifier (31),
Exclusive (1),
Stream Dependency (31),
Weight (8),
}
Figure 5: PRIORITY Frame Payload Figure 5: PRIORITY Frame Format
The frame payload of a PRIORITY frame contains the following fields: The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
fields are described in Section 4. The frame payload of a PRIORITY
frame contains the following additional fields:
E: A single-bit flag. Exclusive: A single-bit flag.
Stream Dependency: A 31-bit stream identifier. Stream Dependency: A 31-bit stream identifier.
Weight: An unsigned 8-bit integer. Weight: An unsigned 8-bit integer.
The PRIORITY frame does not define any flags. The PRIORITY frame does not define any flags.
The PRIORITY frame always identifies a stream. If a PRIORITY frame The PRIORITY frame always identifies a stream. If a PRIORITY frame
is received with a stream identifier of 0x0, the recipient MUST is received with a stream identifier of 0x0, the recipient MUST
respond with a connection error (Section 5.4.1) of type respond with a connection error (Section 5.4.1) of type
skipping to change at page 31, line 20 skipping to change at page 32, line 5
A PRIORITY frame with a length other than 5 octets MUST be treated as A PRIORITY frame with a length other than 5 octets MUST be treated as
a stream error (Section 5.4.2) of type FRAME_SIZE_ERROR. a stream error (Section 5.4.2) of type FRAME_SIZE_ERROR.
6.4. RST_STREAM 6.4. RST_STREAM
The RST_STREAM frame (type=0x3) allows for immediate termination of a The RST_STREAM frame (type=0x3) allows for immediate termination of a
stream. RST_STREAM is sent to request cancellation of a stream or to stream. RST_STREAM is sent to request cancellation of a stream or to
indicate that an error condition has occurred. indicate that an error condition has occurred.
+---------------------------------------------------------------+ RST_STREAM Frame {
| Error Code (32) | Length (24),
+---------------------------------------------------------------+ Type (8) = 3,
Unused Flags (8),
Reserved (1),
Stream Identifier (31),
Error Code (32),
}
Figure 6: RST_STREAM Frame Payload Figure 6: RST_STREAM Frame Format
The RST_STREAM frame contains a single unsigned, 32-bit integer The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
identifying the error code (Section 7). The error code indicates why fields are described in Section 4. Additionally, the RST_STREAM
the stream is being terminated. frame contains a single unsigned, 32-bit integer identifying the
error code (Section 7). The error code indicates why the stream is
being terminated.
The RST_STREAM frame does not define any flags. The RST_STREAM frame does not define any flags.
The RST_STREAM frame fully terminates the referenced stream and The RST_STREAM frame fully terminates the referenced stream and
causes it to enter the "closed" state. After receiving a RST_STREAM causes it to enter the "closed" state. After receiving a RST_STREAM
on a stream, the receiver MUST NOT send additional frames for that on a stream, the receiver MUST NOT send additional frames for that
stream, with the exception of PRIORITY. However, after sending the stream, with the exception of PRIORITY. However, after sending the
RST_STREAM, the sending endpoint MUST be prepared to receive and RST_STREAM, the sending endpoint MUST be prepared to receive and
process additional frames sent on the stream that might have been process additional frames sent on the stream that might have been
sent by the peer prior to the arrival of the RST_STREAM. sent by the peer prior to the arrival of the RST_STREAM.
skipping to change at page 32, line 34 skipping to change at page 33, line 26
Each parameter in a SETTINGS frame replaces any existing value for Each parameter in a SETTINGS frame replaces any existing value for
that parameter. Settings are processed in the order in which they that parameter. Settings are processed in the order in which they
appear, and a receiver of a SETTINGS frame does not need to maintain appear, and a receiver of a SETTINGS frame does not need to maintain
any state other than the current value of each setting. Therefore, any state other than the current value of each setting. Therefore,
the value of a SETTINGS parameter is the last value that is seen by a the value of a SETTINGS parameter is the last value that is seen by a
receiver. receiver.
SETTINGS frames are acknowledged by the receiving peer. To enable SETTINGS frames are acknowledged by the receiving peer. To enable
this, the SETTINGS frame defines the ACK flag: this, the SETTINGS frame defines the ACK flag:
ACK (0x1): When set, bit 0 indicates that this frame acknowledges ACK (0x1): When set, the ACK Flag indicates that this frame
receipt and application of the peer's SETTINGS frame. When this acknowledges receipt and application of the peer's SETTINGS frame.
bit is set, the frame payload of the SETTINGS frame MUST be empty. When this bit is set, the frame payload of the SETTINGS frame MUST
Receipt of a SETTINGS frame with the ACK flag set and a length be empty. Receipt of a SETTINGS frame with the ACK flag set and a
field value other than 0 MUST be treated as a connection error length field value other than 0 MUST be treated as a connection
(Section 5.4.1) of type FRAME_SIZE_ERROR. For more information, error (Section 5.4.1) of type FRAME_SIZE_ERROR. For more
see Section 6.5.3 ("Settings Synchronization"). information, see Section 6.5.3 ("Settings Synchronization").
SETTINGS frames always apply to a connection, never a single stream. SETTINGS frames always apply to a connection, never a single stream.
The stream identifier for a SETTINGS frame MUST be zero (0x0). If an The stream identifier for a SETTINGS frame MUST be zero (0x0). If an
endpoint receives a SETTINGS frame whose stream identifier field is endpoint receives a SETTINGS frame whose stream identifier field is
anything other than 0x0, the endpoint MUST respond with a connection anything other than 0x0, the endpoint MUST respond with a connection
error (Section 5.4.1) of type PROTOCOL_ERROR. error (Section 5.4.1) of type PROTOCOL_ERROR.
The SETTINGS frame affects connection state. A badly formed or The SETTINGS frame affects connection state. A badly formed or
incomplete SETTINGS frame MUST be treated as a connection error incomplete SETTINGS frame MUST be treated as a connection error
(Section 5.4.1) of type PROTOCOL_ERROR. (Section 5.4.1) of type PROTOCOL_ERROR.
skipping to change at page 33, line 15 skipping to change at page 34, line 5
A SETTINGS frame with a length other than a multiple of 6 octets MUST A SETTINGS frame with a length other than a multiple of 6 octets MUST
be treated as a connection error (Section 5.4.1) of type be treated as a connection error (Section 5.4.1) of type
FRAME_SIZE_ERROR. FRAME_SIZE_ERROR.
6.5.1. SETTINGS Format 6.5.1. SETTINGS Format
The frame payload of a SETTINGS frame consists of zero or more The frame payload of a SETTINGS frame consists of zero or more
settings, each consisting of an unsigned 16-bit setting identifier settings, each consisting of an unsigned 16-bit setting identifier
and an unsigned 32-bit value. and an unsigned 32-bit value.
+-------------------------------+ SETTINGS Frame {
| Identifier (16) | Length (24),
+-------------------------------+-------------------------------+ Type (8) = 4,
| Value (32) | Unused Flags (7),
+---------------------------------------------------------------+ ACK Flag (1),
Reserved (1),
Stream Identifier (31),
Setting (..) ...,
}
Figure 7: Setting Format Setting {
Identifier (16),
Value (32),
}
Figure 7: SETTINGS Frame Format
6.5.2. Defined Settings 6.5.2. Defined Settings
The following settings are defined: The following settings are defined:
SETTINGS_HEADER_TABLE_SIZE (0x1): Allows the sender to inform the SETTINGS_HEADER_TABLE_SIZE (0x1): Allows the sender to inform the
remote endpoint of the maximum size of the compression table used remote endpoint of the maximum size of the compression table used
to decode field blocks, in octets. The encoder can select any to decode field blocks, in octets. The encoder can select any
size equal to or less than this value by using signaling specific size equal to or less than this value by using signaling specific
to the compression format inside a field block (see to the compression format inside a field block (see
[COMPRESSION]). The initial value is 4,096 octets. [COMPRESSION]). The initial value is 4,096 octets.
SETTINGS_ENABLE_PUSH (0x2): This setting can be used to disable SETTINGS_ENABLE_PUSH (0x2): This setting can be used to disable
server push (Section 8.2). A server MUST NOT send a PUSH_PROMISE server push (Section 8.4). A server MUST NOT send a PUSH_PROMISE
frame if it receives this parameter set to a value of 0. A client frame if it receives this parameter set to a value of 0. A client
that has both set this parameter to 0 and had it acknowledged MUST that has both set this parameter to 0 and had it acknowledged MUST
treat the receipt of a PUSH_PROMISE frame as a connection error treat the receipt of a PUSH_PROMISE frame as a connection error
(Section 5.4.1) of type PROTOCOL_ERROR. (Section 5.4.1) of type PROTOCOL_ERROR.
The initial value of SETTINGS_ENABLE_PUSH is 1, which indicates The initial value of SETTINGS_ENABLE_PUSH is 1, which indicates
that server push is permitted. Any value other than 0 or 1 MUST that server push is permitted. Any value other than 0 or 1 MUST
be treated as a connection error (Section 5.4.1) of type be treated as a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
skipping to change at page 35, line 31 skipping to change at page 36, line 31
If the sender of a SETTINGS frame does not receive an acknowledgement If the sender of a SETTINGS frame does not receive an acknowledgement
within a reasonable amount of time, it MAY issue a connection error within a reasonable amount of time, it MAY issue a connection error
(Section 5.4.1) of type SETTINGS_TIMEOUT. (Section 5.4.1) of type SETTINGS_TIMEOUT.
6.6. PUSH_PROMISE 6.6. PUSH_PROMISE
The PUSH_PROMISE frame (type=0x5) is used to notify the peer endpoint The PUSH_PROMISE frame (type=0x5) is used to notify the peer endpoint
in advance of streams the sender intends to initiate. The in advance of streams the sender intends to initiate. The
PUSH_PROMISE frame includes the unsigned 31-bit identifier of the PUSH_PROMISE frame includes the unsigned 31-bit identifier of the
stream the endpoint plans to create along with a field section that stream the endpoint plans to create along with a field section that
provides additional context for the stream. Section 8.2 contains a provides additional context for the stream. Section 8.4 contains a
thorough description of the use of PUSH_PROMISE frames. thorough description of the use of PUSH_PROMISE frames.
+---------------+ PUSH_PROMISE Frame {
|Pad Length? (8)| Length (24),
+-+-------------+-----------------------------------------------+ Type (8) = 5,
|R| Promised Stream ID (31) | Unused Flags (4),
+-+-----------------------------+-------------------------------+ PADDED Flag (1),
| Field Block Fragment (*) ... END_HEADERS Flag (1),
+---------------------------------------------------------------+ Unused Flags (2),
| Padding (*) ... Reserved (1),
+---------------------------------------------------------------+ Stream Identifier (31),
[Pad Length (8)],
Reserved (1),
Promised Stream ID (31),
Field Block Fragment (..),
Padding (..),
}
Figure 8: PUSH_PROMISE Frame Payload Figure 8: PUSH_PROMISE Frame Format
The PUSH_PROMISE frame payload has the following fields: The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
fields are described in Section 4. The PUSH_PROMISE frame payload
has the following additional fields:
Pad Length: An 8-bit field containing the length of the frame Pad Length: An 8-bit field containing the length of the frame
padding in units of octets. This field is only present if the padding in units of octets. This field is only present if the
PADDED flag is set. PADDED flag is set.
R: A single reserved bit. R: A single reserved bit.
Promised Stream ID: An unsigned 31-bit integer that identifies the Promised Stream ID: An unsigned 31-bit integer that identifies the
stream that is reserved by the PUSH_PROMISE. The promised stream stream that is reserved by the PUSH_PROMISE. The promised stream
identifier MUST be a valid choice for the next stream sent by the identifier MUST be a valid choice for the next stream sent by the
sender (see "new stream identifier" in Section 5.1.1). sender (see "new stream identifier" in Section 5.1.1).
Field Block Fragment: A field block fragment (Section 4.3) Field Block Fragment: A field block fragment (Section 4.3)
containing request control data and header section. containing request control data and header section.
Padding: Padding octets. Padding: Padding octets.
The PUSH_PROMISE frame defines the following flags: The PUSH_PROMISE frame defines the following flags:
END_HEADERS (0x4): When set, bit 2 indicates that this frame PADDED (0x8): When set, the PADDED Flag indicates that the Pad
contains an entire field block (Section 4.3) and is not followed Length field and any padding that it describes are present.
by any CONTINUATION frames.
END_HEADERS (0x4): When set, the END_HEADERS Flag indicates that
this frame contains an entire field block (Section 4.3) and is not
followed by any CONTINUATION frames.
A PUSH_PROMISE frame without the END_HEADERS flag set MUST be A PUSH_PROMISE frame without the END_HEADERS flag set MUST be
followed by a CONTINUATION frame for the same stream. A receiver followed by a CONTINUATION frame for the same stream. A receiver
MUST treat the receipt of any other type of frame or a frame on a MUST treat the receipt of any other type of frame or a frame on a
different stream as a connection error (Section 5.4.1) of type different stream as a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
PADDED (0x8): When set, bit 3 indicates that the Pad Length field
and any padding that it describes are present.
PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that
is in either the "open" or "half-closed (remote)" state. The stream is in either the "open" or "half-closed (remote)" state. The stream
identifier of a PUSH_PROMISE frame indicates the stream it is identifier of a PUSH_PROMISE frame indicates the stream it is
associated with. If the stream identifier field specifies the value associated with. If the stream identifier field specifies the value
0x0, a recipient MUST respond with a connection error (Section 5.4.1) 0x0, a recipient MUST respond with a connection error (Section 5.4.1)
of type PROTOCOL_ERROR. of type PROTOCOL_ERROR.
Promised streams are not required to be used in the order they are Promised streams are not required to be used in the order they are
promised. The PUSH_PROMISE only reserves stream identifiers for promised. The PUSH_PROMISE only reserves stream identifiers for
later use. later use.
skipping to change at page 37, line 40 skipping to change at page 39, line 5
The PUSH_PROMISE frame can include padding. Padding fields and flags The PUSH_PROMISE frame can include padding. Padding fields and flags
are identical to those defined for DATA frames (Section 6.1). are identical to those defined for DATA frames (Section 6.1).
6.7. PING 6.7. PING
The PING frame (type=0x6) is a mechanism for measuring a minimal The PING frame (type=0x6) is a mechanism for measuring a minimal
round-trip time from the sender, as well as determining whether an round-trip time from the sender, as well as determining whether an
idle connection is still functional. PING frames can be sent from idle connection is still functional. PING frames can be sent from
any endpoint. any endpoint.
+---------------------------------------------------------------+ PING Frame {
| | Length (24),
| Opaque Data (64) | Type (8) = 6,
| | Unused Flags (7),
+---------------------------------------------------------------+ ACK Flag (1),
Reserved (1),
Stream Identifier (31),
Opaque Data (64),
}
Figure 9: PING Frame Payload Figure 9: PING Frame Format
The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
fields are described in Section 4.
In addition to the frame header, PING frames MUST contain 8 octets of In addition to the frame header, PING frames MUST contain 8 octets of
opaque data in the frame payload. A sender can include any value it opaque data in the frame payload. A sender can include any value it
chooses and use those octets in any fashion. chooses and use those octets in any fashion.
Receivers of a PING frame that does not include an ACK flag MUST send Receivers of a PING frame that does not include an ACK flag MUST send
a PING frame with the ACK flag set in response, with an identical a PING frame with the ACK flag set in response, with an identical
frame payload. PING responses SHOULD be given higher priority than frame payload. PING responses SHOULD be given higher priority than
any other frame. any other frame.
The PING frame defines the following flags: The PING frame defines the following flags:
ACK (0x1): When set, bit 0 indicates that this PING frame is a PING ACK (0x1): When set, the ACK Flag indicates that this PING frame is
response. An endpoint MUST set this flag in PING responses. An a PING response. An endpoint MUST set this flag in PING
endpoint MUST NOT respond to PING frames containing this flag. responses. An endpoint MUST NOT respond to PING frames containing
this flag.
PING frames are not associated with any individual stream. If a PING PING frames are not associated with any individual stream. If a PING
frame is received with a stream identifier field value other than frame is received with a stream identifier field value other than
0x0, the recipient MUST respond with a connection error 0x0, the recipient MUST respond with a connection error
(Section 5.4.1) of type PROTOCOL_ERROR. (Section 5.4.1) of type PROTOCOL_ERROR.
Receipt of a PING frame with a length field value other than 8 MUST Receipt of a PING frame with a length field value other than 8 MUST
be treated as a connection error (Section 5.4.1) of type be treated as a connection error (Section 5.4.1) of type
FRAME_SIZE_ERROR. FRAME_SIZE_ERROR.
skipping to change at page 39, line 21 skipping to change at page 40, line 42
have acted on. have acted on.
An endpoint might choose to close a connection without sending a An endpoint might choose to close a connection without sending a
GOAWAY for misbehaving peers. GOAWAY for misbehaving peers.
A GOAWAY frame might not immediately precede closing of the A GOAWAY frame might not immediately precede closing of the
connection; a receiver of a GOAWAY that has no more use for the connection; a receiver of a GOAWAY that has no more use for the
connection SHOULD still send a GOAWAY frame before terminating the connection SHOULD still send a GOAWAY frame before terminating the
connection. connection.
+-+-------------------------------------------------------------+ GOAWAY Frame {
|R| Last-Stream-ID (31) | Length (24),
+-+-------------------------------------------------------------+ Type (8) = 7,
| Error Code (32) | Unused Flags (8),
+---------------------------------------------------------------+ Reserved (1),
| Additional Debug Data (*) | Stream Identifier (31),
+---------------------------------------------------------------+ Reserved (1),
Last-Stream-ID (31),
Error Code (32),
Additional Debug Data (..),
}
Figure 10: GOAWAY Frame Format
Figure 10: GOAWAY Frame Payload The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
fields are described in Section 4.
The GOAWAY frame does not define any flags. The GOAWAY frame does not define any flags.
The GOAWAY frame applies to the connection, not a specific stream. The GOAWAY frame applies to the connection, not a specific stream.
An endpoint MUST treat a GOAWAY frame with a stream identifier other An endpoint MUST treat a GOAWAY frame with a stream identifier other
than 0x0 as a connection error (Section 5.4.1) of type than 0x0 as a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. PROTOCOL_ERROR.
The last stream identifier in the GOAWAY frame contains the highest- The last stream identifier in the GOAWAY frame contains the highest-
numbered stream identifier for which the sender of the GOAWAY frame numbered stream identifier for which the sender of the GOAWAY frame
skipping to change at page 41, line 35 skipping to change at page 43, line 14
Flow control only applies to frames that are identified as being Flow control only applies to frames that are identified as being
subject to flow control. Of the frame types defined in this subject to flow control. Of the frame types defined in this
document, this includes only DATA frames. Frames that are exempt document, this includes only DATA frames. Frames that are exempt
from flow control MUST be accepted and processed, unless the receiver from flow control MUST be accepted and processed, unless the receiver
is unable to assign resources to handling the frame. A receiver MAY is unable to assign resources to handling the frame. A receiver MAY
respond with a stream error (Section 5.4.2) or connection error respond with a stream error (Section 5.4.2) or connection error
(Section 5.4.1) of type FLOW_CONTROL_ERROR if it is unable to accept (Section 5.4.1) of type FLOW_CONTROL_ERROR if it is unable to accept
a frame. a frame.
+-+-------------------------------------------------------------+ WINDOW_UPDATE Frame {
|R| Window Size Increment (31) | Length (24),
+-+-------------------------------------------------------------+ Type (8) = 8,
Unused Flags (8),
Reserved (1),
Stream Identifier (31),
Reserved (1),
Window Size Increment (31),
}
Figure 11: WINDOW_UPDATE Frame Payload Figure 11: WINDOW_UPDATE Frame Format
The frame payload of a WINDOW_UPDATE frame is one reserved bit plus The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
an unsigned 31-bit integer indicating the number of octets that the fields are described in Section 4. The frame payload of a
sender can transmit in addition to the existing flow-control window. WINDOW_UPDATE frame is one reserved bit plus an unsigned 31-bit
The legal range for the increment to the flow-control window is 1 to integer indicating the number of octets that the sender can transmit
2^31-1 (2,147,483,647) octets. in addition to the existing flow-control window. The legal range for
the increment to the flow-control window is 1 to 2^31-1
(2,147,483,647) octets.
The WINDOW_UPDATE frame does not define any flags. The WINDOW_UPDATE frame does not define any flags.
The WINDOW_UPDATE frame can be specific to a stream or to the entire The WINDOW_UPDATE frame can be specific to a stream or to the entire
connection. In the former case, the frame's stream identifier connection. In the former case, the frame's stream identifier
indicates the affected stream; in the latter, the value "0" indicates indicates the affected stream; in the latter, the value "0" indicates
that the entire connection is the subject of the frame. that the entire connection is the subject of the frame.
A receiver MUST treat the receipt of a WINDOW_UPDATE frame with an A receiver MUST treat the receipt of a WINDOW_UPDATE frame with an
flow-control window increment of 0 as a stream error (Section 5.4.2) flow-control window increment of 0 as a stream error (Section 5.4.2)
skipping to change at page 44, line 43 skipping to change at page 46, line 43
code of FLOW_CONTROL_ERROR for the affected streams. code of FLOW_CONTROL_ERROR for the affected streams.
6.10. CONTINUATION 6.10. CONTINUATION
The CONTINUATION frame (type=0x9) is used to continue a sequence of The CONTINUATION frame (type=0x9) is used to continue a sequence of
field block fragments (Section 4.3). Any number of CONTINUATION field block fragments (Section 4.3). Any number of CONTINUATION
frames can be sent, as long as the preceding frame is on the same frames can be sent, as long as the preceding frame is on the same
stream and is a HEADERS, PUSH_PROMISE, or CONTINUATION frame without stream and is a HEADERS, PUSH_PROMISE, or CONTINUATION frame without
the END_HEADERS flag set. the END_HEADERS flag set.
+---------------------------------------------------------------+ CONTINUATION Frame {
| Field Block Fragment (*) ... Length (24),
+---------------------------------------------------------------+ Type (8) = 9,
Unused Flags (5),
Figure 12: CONTINUATION Frame Payload END_HEADERS Flag (1),
Unused Flags (2),
Reserved (1),
Stream Identifier (31),
Field Block Fragment (..),
}
Figure 12: CONTINUATION Frame Format
The CONTINUATION frame payload contains a field block fragment The Length, Type, Unused Flag(s), Reserved, and Stream Identifier
(Section 4.3). fields are described in Section 4. The CONTINUATION frame payload
contains a field block fragment (Section 4.3).
The CONTINUATION frame defines the following flag: The CONTINUATION frame defines the following flag:
END_HEADERS (0x4): When set, bit 2 indicates that this frame ends a END_HEADERS (0x4): When set, the END_HEADERS Flag indicates that
field block (Section 4.3). this frame ends a field block (Section 4.3).
If the END_HEADERS bit is not set, this frame MUST be followed by If the END_HEADERS Flag is not set, this frame MUST be followed by
another CONTINUATION frame. A receiver MUST treat the receipt of another CONTINUATION frame. A receiver MUST treat the receipt of
any other type of frame or a frame on a different stream as a any other type of frame or a frame on a different stream as a
connection error (Section 5.4.1) of type PROTOCOL_ERROR. connection error (Section 5.4.1) of type PROTOCOL_ERROR.
The CONTINUATION frame changes the connection state as defined in The CONTINUATION frame changes the connection state as defined in
Section 4.3. Section 4.3.
CONTINUATION frames MUST be associated with a stream. If a CONTINUATION frames MUST be associated with a stream. If a
CONTINUATION frame is received whose stream identifier field is 0x0, CONTINUATION frame is received whose stream identifier field is 0x0,
the recipient MUST respond with a connection error (Section 5.4.1) of the recipient MUST respond with a connection error (Section 5.4.1) of
skipping to change at page 46, line 14 skipping to change at page 48, line 22
not receive a response in a timely manner. See Section 6.5.3 not receive a response in a timely manner. See Section 6.5.3
("Settings Synchronization"). ("Settings Synchronization").
STREAM_CLOSED (0x5): The endpoint received a frame after a stream STREAM_CLOSED (0x5): The endpoint received a frame after a stream
was half-closed. was half-closed.
FRAME_SIZE_ERROR (0x6): The endpoint received a frame with an FRAME_SIZE_ERROR (0x6): The endpoint received a frame with an
invalid size. invalid size.
REFUSED_STREAM (0x7): The endpoint refused the stream prior to REFUSED_STREAM (0x7): The endpoint refused the stream prior to
performing any application processing (see Section 8.1.4 for performing any application processing (see Section 8.7 for
details). details).
CANCEL (0x8): Used by the endpoint to indicate that the stream is no CANCEL (0x8): Used by the endpoint to indicate that the stream is no
longer needed. longer needed.
COMPRESSION_ERROR (0x9): The endpoint is unable to maintain the COMPRESSION_ERROR (0x9): The endpoint is unable to maintain the
field section compression context for the connection. field section compression context for the connection.
CONNECT_ERROR (0xa): The connection established in response to a CONNECT_ERROR (0xa): The connection established in response to a
CONNECT request (Section 8.3) was reset or abnormally closed. CONNECT request (Section 8.5) was reset or abnormally closed.
ENHANCE_YOUR_CALM (0xb): The endpoint detected that its peer is ENHANCE_YOUR_CALM (0xb): The endpoint detected that its peer is
exhibiting a behavior that might be generating excessive load. exhibiting a behavior that might be generating excessive load.
INADEQUATE_SECURITY (0xc): The underlying transport has properties INADEQUATE_SECURITY (0xc): The underlying transport has properties
that do not meet minimum security requirements (see Section 9.2). that do not meet minimum security requirements (see Section 9.2).
HTTP_1_1_REQUIRED (0xd): The endpoint requires that HTTP/1.1 be used HTTP_1_1_REQUIRED (0xd): The endpoint requires that HTTP/1.1 be used
instead of HTTP/2. instead of HTTP/2.
Unknown or unsupported error codes MUST NOT trigger any special Unknown or unsupported error codes MUST NOT trigger any special
behavior. These MAY be treated by an implementation as being behavior. These MAY be treated by an implementation as being
equivalent to INTERNAL_ERROR. equivalent to INTERNAL_ERROR.
8. HTTP Message Exchanges 8. Expressing HTTP Semantics in HTTP/2
HTTP/2 defines a framing of the HTTP message abstraction (Section 6 HTTP/2 is an instantiation of the HTTP message abstraction (Section 6
of [HTTP]). of [HTTP]).
8.1. HTTP Message Framing 8.1. HTTP Message Framing
A client sends an HTTP request on a new stream, using a previously A client sends an HTTP request on a new stream, using a previously
unused stream identifier (Section 5.1.1). A server sends an HTTP unused stream identifier (Section 5.1.1). A server sends an HTTP
response on the same stream as the request. response on the same stream as the request.
An HTTP message (request or response) consists of: An HTTP message (request or response) consists of:
skipping to change at page 47, line 21 skipping to change at page 49, line 29
3. optionally, one HEADERS frame, followed by zero or more 3. optionally, one HEADERS frame, followed by zero or more
CONTINUATION frames containing the trailer-part, if present (see CONTINUATION frames containing the trailer-part, if present (see
Section 6.5 of [HTTP]). Section 6.5 of [HTTP]).
For a response only, a server MAY send any number of interim For a response only, a server MAY send any number of interim
responses before the HEADERS frame containing a final response. An responses before the HEADERS frame containing a final response. An
interim response consists of a HEADERS frames (which might be interim response consists of a HEADERS frames (which might be
followed by zero or more CONTINUATION frames) containing the control followed by zero or more CONTINUATION frames) containing the control
data and header section of an interim (1xx) HTTP response (see data and header section of an interim (1xx) HTTP response (see
Section 15 of [HTTP]). A HEADERS frame with an END_STREAM flag that Section 15 of [HTTP]). A HEADERS frame with an END_STREAM flag that
carries an informational status code is malformed (Section 8.1.2.6). carries an informational status code is malformed (Section 8.1.1).
The last frame in the sequence bears an END_STREAM flag, noting that The last frame in the sequence bears an END_STREAM flag, noting that
a HEADERS frame bearing the END_STREAM flag can be followed by a HEADERS frame bearing the END_STREAM flag can be followed by
CONTINUATION frames that carry any remaining fragments of the field CONTINUATION frames that carry any remaining fragments of the field
block. block.
Other frames (from any stream) MUST NOT occur between the HEADERS Other frames (from any stream) MUST NOT occur between the HEADERS
frame and any CONTINUATION frames that might follow. frame and any CONTINUATION frames that might follow.
HTTP/2 uses DATA frames to carry message content. The "chunked" HTTP/2 uses DATA frames to carry message content. The "chunked"
transfer encoding defined in Section 7.1 of [HTTP11] cannot be used transfer encoding defined in Section 7.1 of [HTTP11] cannot be used
in HTTP/2. in HTTP/2.
Trailer fields are carried in a field block that also terminates the Trailer fields are carried in a field block that also terminates the
stream. That is, trailer fields comprise a sequence starting with a stream. That is, trailer fields comprise a sequence starting with a
HEADERS frame, followed by zero or more CONTINUATION frames, where HEADERS frame, followed by zero or more CONTINUATION frames, where
the HEADERS frame bears an END_STREAM flag. Trailers MUST NOT the HEADERS frame bears an END_STREAM flag. Trailers MUST NOT
include pseudo-header fields (Section 8.1.2.1). An endpoint that include pseudo-header fields (Section 8.3). An endpoint that
receives pseudo-header fields in trailers MUST treat the request or receives pseudo-header fields in trailers MUST treat the request or
response as malformed (Section 8.1.2.6). response as malformed (Section 8.1.1).
An endpoint that receives a HEADERS frame without the END_STREAM flag An endpoint that receives a HEADERS frame without the END_STREAM flag
set after receiving the HEADERS frame that opens a request or after set after receiving the HEADERS frame that opens a request or after
receiving a final (non-informational) status code MUST treat the receiving a final (non-informational) status code MUST treat the
corresponding request or response as malformed (Section 8.1.2.6). corresponding request or response as malformed (Section 8.1.1).
An HTTP request/response exchange fully consumes a single stream. A An HTTP request/response exchange fully consumes a single stream. A
request starts with the HEADERS frame that puts the stream into an request starts with the HEADERS frame that puts the stream into an
"open" state. The request ends with a frame bearing END_STREAM, "open" state. The request ends with a frame bearing END_STREAM,
which causes the stream to become "half-closed (local)" for the which causes the stream to become "half-closed (local)" for the
client and "half-closed (remote)" for the server. A response stream client and "half-closed (remote)" for the server. A response stream
starts with zero or more interim responses in HEADERS frames or a starts with zero or more interim responses in HEADERS frames or a
HEADERS frame containing a final status code. HEADERS frame containing a final status code.
An HTTP response is complete after the server sends -- or the client An HTTP response is complete after the server sends -- or the client
skipping to change at page 48, line 26 skipping to change at page 50, line 31
send a complete response prior to the client sending an entire send a complete response prior to the client sending an entire
request if the response does not depend on any portion of the request request if the response does not depend on any portion of the request
that has not been sent and received. When this is true, a server MAY that has not been sent and received. When this is true, a server MAY
request that the client abort transmission of a request without error request that the client abort transmission of a request without error
by sending a RST_STREAM with an error code of NO_ERROR after sending by sending a RST_STREAM with an error code of NO_ERROR after sending
a complete response (i.e., a frame with the END_STREAM flag). a complete response (i.e., a frame with the END_STREAM flag).
Clients MUST NOT discard responses as a result of receiving such a Clients MUST NOT discard responses as a result of receiving such a
RST_STREAM, though clients can always discard responses at their RST_STREAM, though clients can always discard responses at their
discretion for other reasons. discretion for other reasons.
8.1.1. Upgrading from HTTP/2 8.1.1. Malformed Messages
HTTP/2 removes support for the 101 (Switching Protocols) A malformed request or response is one that is an otherwise valid
informational status code (Section 15.2.2 of [HTTP]). sequence of HTTP/2 frames but is invalid due to the presence of
extraneous frames, prohibited fields or pseudo-header fields, the
absence of mandatory fields or pseudo-header fields, the inclusion of
uppercase field names, or invalid field names and/or values (in
certain circumstances; see Section 8.2).
The semantics of 101 (Switching Protocols) aren't applicable to a A request or response that includes message content can include a
multiplexed protocol. Alternative protocols are able to use the same "content-length" header field. A request or response is also
mechanisms that HTTP/2 uses to negotiate their use (see Section 3). malformed if the value of a "content-length" header field does not
equal the sum of the DATA frame payload lengths that form the
content. A response that is defined to have no content, as described
in Section 6.4 of [HTTP], can have a non-zero "content-length" header
field, even though no content is included in DATA frames.
8.1.2. HTTP Fields Intermediaries that process HTTP requests or responses (i.e., any
intermediary not acting as a tunnel) MUST NOT forward a malformed
request or response. Malformed requests or responses that are
detected MUST be treated as a stream error (Section 5.4.2) of type
PROTOCOL_ERROR.
HTTP fields carry information as a series of field lines, which are For malformed requests, a server MAY send an HTTP response prior to
key-value pairs. For a listing of registered HTTP fields, see the closing or resetting the stream. Clients MUST NOT accept a malformed
"Hypertext Transfer Protocol (HTTP) Field Name Registry" registry response.
maintained at https://www.iana.org/assignments/http-fields/.
Field names are strings of ASCII characters that are compared in a Endpoints that progressively process messages might have performed
case-insensitive fashion. Field names MUST be converted to lowercase some processing before identifying a request or response as
when constructing a HTTP/2 message. A request or response containing malformed. For instance, it might be possible to generate an
an uppercase character ('A' to 'Z', ASCII 0x41 to 0x5a) in a field informational or 404 status code without having received a complete
name MUST be treated as malformed (Section 8.1.2.6). request. Similarly, intermediaries might forward incomplete messages
before detecting errors. A server MAY generate a final response
before receiving an entire request when the response does not depend
on the remainder of the request being correct. A server or
intermediary MAY use RST_STREAM -- with a code other than
REFUSED_STREAM -- to abort a stream if a malformed request or
response is received.
These requirements are intended to protect against several types of
common attacks against HTTP; they are deliberately strict because
being permissive can expose implementations to these vulnerabilities.
8.2. HTTP Fields
HTTP fields (Section 5 of [HTTP]) are conveyed by HTTP/2 in the
HEADERS, CONTINUATION, and PUSH_PROMISE frames, compressed with HPACK
[COMPRESSION].
To improve efficiency and interoperability, field names MUST be
converted to lowercase when constructing an HTTP/2 message.
8.2.1. Field Validity
HPACK is capable of carrying field names or values that are not valid HPACK is capable of carrying field names or values that are not valid
in HTTP. Though HPACK can carry any octet, fields are not valid in in HTTP. Though HPACK can carry any octet, fields are not valid in
the following cases: the following cases:
* A field name MUST NOT contain characters in the range 0x00-0x20 or * A field name MUST NOT contain characters in the ranges 0x00-0x20,
0x7F-0xFF (both ranges inclusive). This limits field names to 0x41-0x5A, or 0x7F-0xFF (all ranges inclusive). This limits field
visible ASCII characters, other than ASCII SP (0x20). names to visible ASCII characters, other than ASCII SP (0x20) and
uppercase characters ('A' to 'Z', ASCII 0x41 to 0x5a).
* With the exception of pseudo-header fields (Section 8.1.2.1), * With the exception of pseudo-header fields (Section 8.3), which
which have a name that starts with a single colon, field names have a name that starts with a single colon, field names MUST NOT
MUST NOT include a colon (ASCII COLON, 0x3a). include a colon (ASCII COLON, 0x3a).
* A field value MUST NOT contain the zero value (ASCII NUL, 0x0), * A field value MUST NOT contain the zero value (ASCII NUL, 0x0),
line feed (ASCII LF, 0xa), or carriage return (ASCII CR, 0xd) at line feed (ASCII LF, 0xa), or carriage return (ASCII CR, 0xd) at
any position. any position.
* A field value MUST NOT start or end with an ASCII whitespace * A field value MUST NOT start or end with an ASCII whitespace
character (ASCII SP or HTAB, 0x20 or 0x9). character (ASCII SP or HTAB, 0x20 or 0x9).
A request or response that contains a field that violates any of A request or response that contains a field that violates any of
these conditions MUST be treated as malformed (Section 8.1.2.6). In these conditions MUST be treated as malformed (Section 8.1.1). In
particular, an intermediary that does not process fields when particular, an intermediary that does not process fields when
forwarding messages MUST NOT forward fields that contain any of the forwarding messages MUST NOT forward fields that contain any of the
values that are listed as prohibited above. values that are listed as prohibited above.
Field values that are not valid according to the definition of the A recipient MAY treat a message that contains a field name or value
corresponding field do not cause a request to be malformed except as that includes other characters disallowed by Section 5.1 of [HTTP]
defined by the processing rules for the field. and Section 5.5 of [HTTP] as malformed (Section 8.1.1).
8.1.2.1. Pseudo-Header Fields When a request message violates one of the requirements above, it
SHOULD be responded to using the 400 (Bad Request) status code
Section 15.5.1 of [HTTP] before the stream is reset, unless a more
suitable status code is defined, or the status code cannot be sent
(e.g., because the error occurs in a trailer field).
Note that field values that are not valid according to the definition
of the corresponding field do not cause a request to be malformed;
the requirements above only apply to the generic syntax for field
values as defined in Section 5.5 of [HTTP].
8.2.2. Connection-Specific Header Fields
HTTP/2 does not use the "Connection" header field (Section 7.6.1 of
[HTTP]) to indicate connection-specific header fields; in this
protocol, connection-specific metadata is conveyed by other means.
An endpoint MUST NOT generate an HTTP/2 message containing
connection-specific header fields; any message containing connection-
specific header fields MUST be treated as malformed (Section 8.1.1).
The only exception to this is the TE header field, which MAY be
present in an HTTP/2 request; when it is, it MUST NOT contain any
value other than "trailers".
An intermediary transforming a HTTP/1.x message to HTTP/2 MUST remove
connection-specific header fields as discussed in Section 7.6.1 of
[HTTP], or their messages will be treated by other HTTP/2 endpoints
as malformed (Section 8.1.1).
| Note: HTTP/2 purposefully does not support upgrade to another
| protocol. The handshake methods described in Section 3 are
| believed sufficient to negotiate the use of alternative
| protocols.
8.2.3. Compressing the Cookie Header Field
The Cookie header field [COOKIE] uses a semi-colon (";") to delimit
cookie-pairs (or "crumbs"). This header field contains multiple
values, but does not use a COMMA (",") as a separator, which prevents
cookie-pairs from being sent on multiple field lines (see Section 5.2
of [HTTP]). This can significantly reduce compression efficiency as
updates to individual cookie-pairs would invalidate any field lines
that are stored in the HPACK table.
To allow for better compression efficiency, the Cookie header field
MAY be split into separate header fields, each with one or more
cookie-pairs. If there are multiple Cookie header fields after
decompression, these MUST be concatenated into a single octet string
using the two-octet delimiter of 0x3B, 0x20 (the ASCII string "; ")
before being passed into a non-HTTP/2 context, such as an HTTP/1.1
connection, or a generic HTTP server application.
Therefore, the following two lists of Cookie header fields are
semantically equivalent.
cookie: a=b; c=d; e=f
cookie: a=b
cookie: c=d
cookie: e=f
8.3. HTTP Control Data
HTTP/2 uses special pseudo-header fields beginning with ':' character HTTP/2 uses special pseudo-header fields beginning with ':' character
(ASCII 0x3a) to convey message control data (see Section 6.2 of (ASCII 0x3a) to convey message control data (see Section 6.2 of
[HTTP]). [HTTP]).
Pseudo-header fields are not HTTP header fields. Endpoints MUST NOT Pseudo-header fields are not HTTP header fields. Endpoints MUST NOT
generate pseudo-header fields other than those defined in this generate pseudo-header fields other than those defined in this
document. Note that an extension could negotiate the use of document. Note that an extension could negotiate the use of
additional pseudo-header fields; see Section 5.5. additional pseudo-header fields; see Section 5.5.
Pseudo-header fields are only valid in the context in which they are Pseudo-header fields are only valid in the context in which they are
defined. Pseudo-header fields defined for requests MUST NOT appear defined. Pseudo-header fields defined for requests MUST NOT appear
in responses; pseudo-header fields defined for responses MUST NOT in responses; pseudo-header fields defined for responses MUST NOT
appear in requests. Pseudo-header fields MUST NOT appear in a appear in requests. Pseudo-header fields MUST NOT appear in a
trailer section. Endpoints MUST treat a request or response that trailer section. Endpoints MUST treat a request or response that
contains undefined or invalid pseudo-header fields as malformed contains undefined or invalid pseudo-header fields as malformed
(Section 8.1.2.6). (Section 8.1.1).
All pseudo-header fields MUST appear in a field block before all All pseudo-header fields MUST appear in a field block before all
regular field lines. Any request or response that contains a pseudo- regular field lines. Any request or response that contains a pseudo-
header field that appears in a field block after a regular field line header field that appears in a field block after a regular field line
MUST be treated as malformed (Section 8.1.2.6). MUST be treated as malformed (Section 8.1.1).
8.1.2.2. Connection-Specific Header Fields
HTTP/2 does not use the "Connection" header field to indicate
connection-specific header fields; in this protocol, connection-
specific metadata is conveyed by other means. An endpoint MUST NOT
generate an HTTP/2 message containing connection-specific header
fields; any message containing connection-specific header fields MUST
be treated as malformed (Section 8.1.2.6).
The only exception to this is the TE header field, which MAY be
present in an HTTP/2 request; when it is, it MUST NOT contain any
value other than "trailers".
An intermediary transforming a HTTP/1.x message to HTTP/2 MUST remove
connection-specific header fields as discussed in Section 7.6.1 of
[HTTP], or their messages will be treated by other HTTP/2 endpoints
as malformed (Section 8.1.2.6).
| Note: HTTP/2 purposefully does not support upgrade to another
| protocol. The handshake methods described in Section 3 are
| believed sufficient to negotiate the use of alternative
| protocols.
8.1.2.3. Request Pseudo-Header Fields 8.3.1. Request Pseudo-Header Fields
The following pseudo-header fields are defined for HTTP/2 requests: The following pseudo-header fields are defined for HTTP/2 requests:
* The ":method" pseudo-header field includes the HTTP method * The ":method" pseudo-header field includes the HTTP method
(Section 9 of [HTTP]). (Section 9 of [HTTP]).
* The ":scheme" pseudo-header field includes the scheme portion of * The ":scheme" pseudo-header field includes the scheme portion of
the request target. The scheme is taken from the target URI the request target. The scheme is taken from the target URI
(Section 3.1 of [RFC3986]) when generating a request directly, or (Section 3.1 of [RFC3986]) when generating a request directly, or
from the scheme of a translated request (for example. see from the scheme of a translated request (for example. see
Section 3.3 of [HTTP11]). Scheme is omitted for CONNECT requests Section 3.3 of [HTTP11]). Scheme is omitted for CONNECT requests
(Section 8.3). (Section 8.5).
":scheme" is not restricted to "http" and "https" schemed URIs. A ":scheme" is not restricted to "http" and "https" schemed URIs. A
proxy or gateway can translate requests for non-HTTP schemes, proxy or gateway can translate requests for non-HTTP schemes,
enabling the use of HTTP to interact with non-HTTP services. enabling the use of HTTP to interact with non-HTTP services.
* The ":authority" pseudo-header field includes the authority * The ":authority" pseudo-header field includes the authority
portion of the target URI (Section 3.2 of [RFC3986]). The portion of the target URI (Section 3.2 of [RFC3986]). The
authority MUST NOT include the deprecated "userinfo" subcomponent authority MUST NOT include the deprecated "userinfo" subcomponent
for "http" or "https" schemed URIs. for "http" or "https" schemed URIs.
skipping to change at page 51, line 51 skipping to change at page 55, line 34
This pseudo-header field MUST NOT be empty for "http" or "https" This pseudo-header field MUST NOT be empty for "http" or "https"
URIs; "http" or "https" URIs that do not contain a path component URIs; "http" or "https" URIs that do not contain a path component
MUST include a value of '/'. The exception to this rule is an MUST include a value of '/'. The exception to this rule is an
OPTIONS request for an "http" or "https" URI that does not include OPTIONS request for an "http" or "https" URI that does not include
a path component; these MUST include a ":path" pseudo-header field a path component; these MUST include a ":path" pseudo-header field
with a value of '*' (see Section 7.1 of [HTTP]). with a value of '*' (see Section 7.1 of [HTTP]).
All HTTP/2 requests MUST include exactly one valid value for the All HTTP/2 requests MUST include exactly one valid value for the
":method", ":scheme", and ":path" pseudo-header fields, unless it is ":method", ":scheme", and ":path" pseudo-header fields, unless it is
a CONNECT request (Section 8.3). An HTTP request that omits a CONNECT request (Section 8.5). An HTTP request that omits
mandatory pseudo-header fields is malformed (Section 8.1.2.6). mandatory pseudo-header fields is malformed (Section 8.1.1).
Individual HTTP/2 requests do not carry an explicit indicator of Individual HTTP/2 requests do not carry an explicit indicator of
protocol version. All HTTP/2 messages implicitly have a protocol protocol version. All HTTP/2 messages implicitly have a protocol
version of "2.0" (see Section 6.2 of [HTTP]). version of "2.0" (see Section 6.2 of [HTTP]).
8.1.2.4. Response Pseudo-Header Fields 8.3.2. Response Pseudo-Header Fields
For HTTP/2 responses, a single ":status" pseudo-header field is For HTTP/2 responses, a single ":status" pseudo-header field is
defined that carries the HTTP status code field (see Section 15 of defined that carries the HTTP status code field (see Section 15 of
[HTTP]). This pseudo-header field MUST be included in all responses, [HTTP]). This pseudo-header field MUST be included in all responses,
including interim responses; otherwise, the response is malformed including interim responses; otherwise, the response is malformed
(Section 8.1.2.6). (Section 8.1.1).
HTTP/2 responses implicitly have a protocol version of "2.0". HTTP/2 responses implicitly have a protocol version of "2.0".
8.1.2.5. Compressing the Cookie Header Field 8.4. Server Push
The Cookie header field [COOKIE] uses a semi-colon (";") to delimit
cookie-pairs (or "crumbs"). This header field contains multiple
values, but does not use a COMMA (",") as a separator, which prevents
cookie-pairs from being sent on multiple field lines (see Section 5.2
of [HTTP]). This can significantly reduce compression efficiency as
updates to individual cookie-pairs would invalidate any field lines
that are stored in the HPACK table.
To allow for better compression efficiency, the Cookie header field
MAY be split into separate header fields, each with one or more
cookie-pairs. If there are multiple Cookie header fields after
decompression, these MUST be concatenated into a single octet string
using the two-octet delimiter of 0x3B, 0x20 (the ASCII string "; ")
before being passed into a non-HTTP/2 context, such as an HTTP/1.1
connection, or a generic HTTP server application.
Therefore, the following two lists of Cookie header fields are
semantically equivalent.
cookie: a=b; c=d; e=f
cookie: a=b
cookie: c=d
cookie: e=f
8.1.2.6. Malformed Requests and Responses
A malformed request or response is one that is an otherwise valid
sequence of HTTP/2 frames but is invalid due to the presence of
extraneous frames, prohibited fields or pseudo-header fields, the
absence of mandatory fields or pseudo-header fields, or the inclusion
of uppercase field names.
A request or response that includes message content can include a
"content-length" header field. A request or response is also
malformed if the value of a "content-length" header field does not
equal the sum of the DATA frame payload lengths that form the
content. A response that is defined to have no content, as described
in Section 6.4 of [HTTP], can have a non-zero "content-length" header
field, even though no content is included in DATA frames.
Intermediaries that process HTTP requests or responses (i.e., any
intermediary not acting as a tunnel) MUST NOT forward a malformed
request or response. Malformed requests or responses that are
detected MUST be treated as a stream error (Section 5.4.2) of type
PROTOCOL_ERROR.
For malformed requests, a server MAY send an HTTP response prior to
closing or resetting the stream. Clients MUST NOT accept a malformed
response.
Endpoints that progressively process messages might have performed
some processing before identifying a request or response as
malformed. For instance, it might be possible to generate an
informational or 404 status code without having received a complete
request. Similarly, intermediaries might forward incomplete messages
before detecting errors. A server MAY generate a final response
before receiving an entire request when the response does not depend
on the remainder of the request being correct. A server or
intermediary MAY use RST_STREAM -- with a code other than
REFUSED_STREAM -- to abort a stream if a malformed request or
response is received.
These requirements are intended to protect against several types of
common attacks against HTTP; they are deliberately strict because
being permissive can expose implementations to these vulnerabilities.
8.1.3. Examples
This section shows HTTP/1.1 requests and responses, with
illustrations of equivalent HTTP/2 requests and responses.
An HTTP GET request includes control data and a request header with
no message content and is therefore transmitted as a single HEADERS
frame, followed by zero or more CONTINUATION frames containing the
serialized block of request header fields. The HEADERS frame in the
following has both the END_HEADERS and END_STREAM flags set; no
CONTINUATION frames are sent.
GET /resource HTTP/1.1 HEADERS
Host: example.org ==> + END_STREAM
Accept: image/jpeg + END_HEADERS
:method = GET
:scheme = https
:path = /resource
host = example.org
accept = image/jpeg
Similarly, a response that includes only control data and a response
header is transmitted as a HEADERS frame (again, followed by zero or
more CONTINUATION frames) containing the serialized block of response
header fields.
HTTP/1.1 304 Not Modified HEADERS
ETag: "xyzzy" ==> + END_STREAM
Expires: Thu, 23 Jan ... + END_HEADERS
:status = 304
etag = "xyzzy"
expires = Thu, 23 Jan ...
An HTTP POST request that includes control data and a request header
and message content is transmitted as one HEADERS frame, followed by
zero or more CONTINUATION frames containing the request header,
followed by one or more DATA frames, with the last CONTINUATION (or
HEADERS) frame having the END_HEADERS flag set and the final DATA
frame having the END_STREAM flag set:
POST /resource HTTP/1.1 HEADERS
Host: example.org ==> - END_STREAM
Content-Type: image/jpeg - END_HEADERS
Content-Length: 123 :method = POST
:path = /resource
{binary data} :scheme = https
CONTINUATION
+ END_HEADERS
content-type = image/jpeg
host = example.org
content-length = 123
DATA
+ END_STREAM
{binary data}
Note that data contributing to any given field line could be spread
between field block fragments. The allocation of field lines to
frames in this example is illustrative only.
A response that includes control data and a response header and
message content is transmitted as a HEADERS frame, followed by zero
or more CONTINUATION frames, followed by one or more DATA frames,
with the last DATA frame in the sequence having the END_STREAM flag
set:
HTTP/1.1 200 OK HEADERS
Content-Type: image/jpeg ==> - END_STREAM
Content-Length: 123 + END_HEADERS
:status = 200
{binary data} content-type = image/jpeg
content-length = 123
DATA
+ END_STREAM
{binary data}
An informational response using a 1xx status code other than 101 is
transmitted as a HEADERS frame, followed by zero or more CONTINUATION
frames.
A trailer section is sent as a field block after both the request or
response field block and all the DATA frames have been sent. The
HEADERS frame starting the field block that comprises the trailer
section has the END_STREAM flag set.
The following example includes both a 100 (Continue) status code,
which is sent in response to a request containing a "100-continue"
token in the Expect header field, and a trailer section:
HTTP/1.1 100 Continue HEADERS
Extension-Field: bar ==> - END_STREAM
+ END_HEADERS
:status = 100
extension-field = bar
HTTP/1.1 200 OK HEADERS
Content-Type: image/jpeg ==> - END_STREAM
Transfer-Encoding: chunked + END_HEADERS
Trailer: Foo :status = 200
content-length = 123
123 content-type = image/jpeg
{binary data} trailer = Foo
0
Foo: bar DATA
- END_STREAM
{binary data}
HEADERS
+ END_STREAM
+ END_HEADERS
foo = bar
8.1.4. Request Reliability Mechanisms in HTTP/2
In general, an HTTP client is unable to retry a non-idempotent
request when an error occurs because there is no means to determine
the nature of the error. It is possible that some server processing
occurred prior to the error, which could result in undesirable
effects if the request were reattempted.
HTTP/2 provides two mechanisms for providing a guarantee to a client
that a request has not been processed:
* The GOAWAY frame indicates the highest stream number that might
have been processed. Requests on streams with higher numbers are
therefore guaranteed to be safe to retry.
* The REFUSED_STREAM error code can be included in a RST_STREAM
frame to indicate that the stream is being closed prior to any
processing having occurred. Any request that was sent on the
reset stream can be safely retried.
Requests that have not been processed have not failed; clients MAY
automatically retry them, even those with non-idempotent methods.
A server MUST NOT indicate that a stream has not been processed
unless it can guarantee that fact. If frames that are on a stream
are passed to the application layer for any stream, then
REFUSED_STREAM MUST NOT be used for that stream, and a GOAWAY frame
MUST include a stream identifier that is greater than or equal to the
given stream identifier.
In addition to these mechanisms, the PING frame provides a way for a
client to easily test a connection. Connections that remain idle can
become broken as some middleboxes (for instance, network address
translators or load balancers) silently discard connection bindings.
The PING frame allows a client to safely test whether a connection is
still active without sending a request.
8.2. Server Push
HTTP/2 allows a server to pre-emptively send (or "push") responses HTTP/2 allows a server to pre-emptively send (or "push") responses
(along with corresponding "promised" requests) to a client in (along with corresponding "promised" requests) to a client in
association with a previous client-initiated request. association with a previous client-initiated request.
Server push was designed to allow a server to improve client- Server push was designed to allow a server to improve client-
perceived performance by predicting what requests will follow those perceived performance by predicting what requests will follow those
that it receives, thereby removing a round trip for them. For that it receives, thereby removing a round trip for them. For
example, a request for HTML is often followed by requests for example, a request for HTML is often followed by requests for
stylesheets and scripts referenced by that page. When these requests stylesheets and scripts referenced by that page. When these requests
skipping to change at page 58, line 43 skipping to change at page 57, line 22
forward them on to the client. In other words, how to make use of forward them on to the client. In other words, how to make use of
the pushed information is up to that intermediary. Equally, the the pushed information is up to that intermediary. Equally, the
intermediary might choose to make additional pushes to the client, intermediary might choose to make additional pushes to the client,
without any action taken by the server. without any action taken by the server.
A client cannot push. Thus, servers MUST treat the receipt of a A client cannot push. Thus, servers MUST treat the receipt of a
PUSH_PROMISE frame as a connection error (Section 5.4.1) of type PUSH_PROMISE frame as a connection error (Section 5.4.1) of type
PROTOCOL_ERROR. A server cannot set the SETTINGS_ENABLE_PUSH setting PROTOCOL_ERROR. A server cannot set the SETTINGS_ENABLE_PUSH setting
to a value other than 0 (see Section 6.5.2). to a value other than 0 (see Section 6.5.2).
8.2.1. Push Requests 8.4.1. Push Requests
Server push is semantically equivalent to a server responding to a Server push is semantically equivalent to a server responding to a
request; however, in this case, that request is also sent by the request; however, in this case, that request is also sent by the
server, as a PUSH_PROMISE frame. server, as a PUSH_PROMISE frame.
The PUSH_PROMISE frame includes a field block that contains control The PUSH_PROMISE frame includes a field block that contains control
data and a complete set of request header fields that the server data and a complete set of request header fields that the server
attributes to the request. It is not possible to push a response to attributes to the request. It is not possible to push a response to
a request that includes message content. a request that includes message content.
Promised requests are always associated with an explicit request from Promised requests are always associated with an explicit request from
the client. The PUSH_PROMISE frames sent by the server are sent on the client. The PUSH_PROMISE frames sent by the server are sent on
that explicit request's stream. The PUSH_PROMISE frame also includes that explicit request's stream. The PUSH_PROMISE frame also includes
a promised stream identifier, chosen from the stream identifiers a promised stream identifier, chosen from the stream identifiers
available to the server (see Section 5.1.1). available to the server (see Section 5.1.1).
The header fields in PUSH_PROMISE and any subsequent CONTINUATION The header fields in PUSH_PROMISE and any subsequent CONTINUATION
frames MUST be a valid and complete set of request header fields frames MUST be a valid and complete set of request header fields
(Section 8.1.2.3). The server MUST include a method in the ":method" (Section 8.3.1). The server MUST include a method in the ":method"
pseudo-header field that is safe and cacheable. If a client receives pseudo-header field that is safe and cacheable. If a client receives
a PUSH_PROMISE that does not include a complete and valid set of a PUSH_PROMISE that does not include a complete and valid set of
header fields or the ":method" pseudo-header field identifies a header fields or the ":method" pseudo-header field identifies a
method that is not safe, it MUST respond with a stream error method that is not safe, it MUST respond with a stream error
(Section 5.4.2) of type PROTOCOL_ERROR. (Section 5.4.2) of type PROTOCOL_ERROR.
The server SHOULD send PUSH_PROMISE (Section 6.6) frames prior to The server SHOULD send PUSH_PROMISE (Section 6.6) frames prior to
sending any frames that reference the promised responses. This sending any frames that reference the promised responses. This
avoids a race where clients issue requests prior to receiving any avoids a race where clients issue requests prior to receiving any
PUSH_PROMISE frames. PUSH_PROMISE frames.
skipping to change at page 60, line 5 skipping to change at page 58, line 28
client-initiated stream, but the stream MUST be in either the "open" client-initiated stream, but the stream MUST be in either the "open"
or "half-closed (remote)" state with respect to the server. or "half-closed (remote)" state with respect to the server.
PUSH_PROMISE frames are interspersed with the frames that comprise a PUSH_PROMISE frames are interspersed with the frames that comprise a
response, though they cannot be interspersed with HEADERS and response, though they cannot be interspersed with HEADERS and
CONTINUATION frames that comprise a single field block. CONTINUATION frames that comprise a single field block.
Sending a PUSH_PROMISE frame creates a new stream and puts the stream Sending a PUSH_PROMISE frame creates a new stream and puts the stream
into the "reserved (local)" state for the server and the "reserved into the "reserved (local)" state for the server and the "reserved
(remote)" state for the client. (remote)" state for the client.
8.2.2. Push Responses 8.4.2. Push Responses
After sending the PUSH_PROMISE frame, the server can begin delivering After sending the PUSH_PROMISE frame, the server can begin delivering
the pushed response as a response (Section 8.1.2.4) on a server- the pushed response as a response (Section 8.3.2) on a server-
initiated stream that uses the promised stream identifier. The initiated stream that uses the promised stream identifier. The
server uses this stream to transmit an HTTP response, using the same server uses this stream to transmit an HTTP response, using the same
sequence of frames as defined in Section 8.1. This stream becomes sequence of frames as defined in Section 8.1. This stream becomes
"half-closed" to the client (Section 5.1) after the initial HEADERS "half-closed" to the client (Section 5.1) after the initial HEADERS
frame is sent. frame is sent.
Once a client receives a PUSH_PROMISE frame and chooses to accept the Once a client receives a PUSH_PROMISE frame and chooses to accept the
pushed response, the client SHOULD NOT issue any requests for the pushed response, the client SHOULD NOT issue any requests for the
promised response until after the promised stream has closed. promised response until after the promised stream has closed.
skipping to change at page 61, line 5 skipping to change at page 59, line 29
The response for a PUSH_PROMISE stream begins with a HEADERS frame, The response for a PUSH_PROMISE stream begins with a HEADERS frame,
which immediately puts the stream into the "half-closed (remote)" which immediately puts the stream into the "half-closed (remote)"
state for the server and "half-closed (local)" state for the client, state for the server and "half-closed (local)" state for the client,
and ends with a frame bearing END_STREAM, which places the stream in and ends with a frame bearing END_STREAM, which places the stream in
the "closed" state. the "closed" state.
| Note: The client never sends a frame with the END_STREAM flag | Note: The client never sends a frame with the END_STREAM flag
| for a server push. | for a server push.
8.3. The CONNECT Method 8.5. The CONNECT Method
In HTTP/1.x, the pseudo-method CONNECT (Section 9.3.6 of [HTTP]) is The CONNECT method (Section 9.3.6 of [HTTP]) is used to convert an
used to convert an HTTP connection into a tunnel to a remote host. HTTP connection into a tunnel to a remote host. CONNECT is primarily
CONNECT is primarily used with HTTP proxies to establish a TLS used with HTTP proxies to establish a TLS session with an origin
session with an origin server for the purposes of interacting with server for the purposes of interacting with "https" resources.
"https" resources.
In HTTP/2, the CONNECT method is used to establish a tunnel over a In HTTP/2, the CONNECT method establishes a tunnel over a single
single HTTP/2 stream to a remote host for similar purposes. A HTTP/2 stream to a remote host, rather than converting the entire
CONNECT header section is constructed as defined in Section 8.1.2.3 connection to a tunnel. A CONNECT header section is constructed as
("Request Pseudo-Header Fields"), with a few differences. defined in Section 8.3.1 ("Request Pseudo-Header Fields"), with a few
Specifically: differences. Specifically:
* The ":method" pseudo-header field is set to "CONNECT". * The ":method" pseudo-header field is set to "CONNECT".
* The ":scheme" and ":path" pseudo-header fields MUST be omitted. * The ":scheme" and ":path" pseudo-header fields MUST be omitted.
* The ":authority" pseudo-header field contains the host and port to * The ":authority" pseudo-header field contains the host and port to
connect to (equivalent to the authority-form of the request-target connect to (equivalent to the authority-form of the request-target
of CONNECT requests; see Section 3.2.3 of [HTTP11]). of CONNECT requests; see Section 3.2.3 of [HTTP11]).
A CONNECT request that does not conform to these restrictions is A CONNECT request that does not conform to these restrictions is
malformed (Section 8.1.2.6). malformed (Section 8.1.1).
A proxy that supports CONNECT establishes a TCP connection [TCP] to A proxy that supports CONNECT establishes a TCP connection [TCP] to
the host and port identified in the ":authority" pseudo-header field. the host and port identified in the ":authority" pseudo-header field.
Once this connection is successfully established, the proxy sends a Once this connection is successfully established, the proxy sends a
HEADERS frame containing a 2xx series status code to the client, as HEADERS frame containing a 2xx series status code to the client, as
defined in Section 9.3.6 of [HTTP]. defined in Section 9.3.6 of [HTTP].
After the initial HEADERS frame sent by each peer, all subsequent After the initial HEADERS frame sent by each peer, all subsequent
DATA frames correspond to data sent on the TCP connection. The frame DATA frames correspond to data sent on the TCP connection. The frame
payload of any DATA frames sent by the client is transmitted by the payload of any DATA frames sent by the client is transmitted by the
skipping to change at page 62, line 22 skipping to change at page 60, line 37
the END_STREAM flag set. Note that the final TCP segment or DATA the END_STREAM flag set. Note that the final TCP segment or DATA
frame could be empty. frame could be empty.
A TCP connection error is signaled with RST_STREAM. A proxy treats A TCP connection error is signaled with RST_STREAM. A proxy treats
any error in the TCP connection, which includes receiving a TCP any error in the TCP connection, which includes receiving a TCP
segment with the RST bit set, as a stream error (Section 5.4.2) of segment with the RST bit set, as a stream error (Section 5.4.2) of
type CONNECT_ERROR. Correspondingly, a proxy MUST send a TCP segment type CONNECT_ERROR. Correspondingly, a proxy MUST send a TCP segment
with the RST bit set if it detects an error with the stream or the with the RST bit set if it detects an error with the stream or the
HTTP/2 connection. HTTP/2 connection.
9. Additional HTTP Requirements/Considerations 8.6. The Upgrade Header Field
HTTP/2 does not support the 101 (Switching Protocols) informational
status code (Section 15.2.2 of [HTTP]).
The semantics of 101 (Switching Protocols) aren't applicable to a
multiplexed protocol. Alternative protocols are able to use the same
mechanisms that HTTP/2 uses to negotiate their use (see Section 3).
8.7. Request Reliability
In general, an HTTP client is unable to retry a non-idempotent
request when an error occurs because there is no means to determine
the nature of the error (see Section 9.2.2 of [HTTP]). It is
possible that some server processing occurred prior to the error,
which could result in undesirable effects if the request were
reattempted.
HTTP/2 provides two mechanisms for providing a guarantee to a client
that a request has not been processed:
* The GOAWAY frame indicates the highest stream number that might
have been processed. Requests on streams with higher numbers are
therefore guaranteed to be safe to retry.
* The REFUSED_STREAM error code can be included in a RST_STREAM
frame to indicate that the stream is being closed prior to any
processing having occurred. Any request that was sent on the
reset stream can be safely retried.
Requests that have not been processed have not failed; clients MAY
automatically retry them, even those with non-idempotent methods.
A server MUST NOT indicate that a stream has not been processed
unless it can guarantee that fact. If frames that are on a stream
are passed to the application layer for any stream, then
REFUSED_STREAM MUST NOT be used for that stream, and a GOAWAY frame
MUST include a stream identifier that is greater than or equal to the
given stream identifier.
In addition to these mechanisms, the PING frame provides a way for a
client to easily test a connection. Connections that remain idle can
become broken as some middleboxes (for instance, network address
translators or load balancers) silently discard connection bindings.
The PING frame allows a client to safely test whether a connection is
still active without sending a request.
8.8. Examples
This section shows HTTP/1.1 requests and responses, with
illustrations of equivalent HTTP/2 requests and responses.
An HTTP GET request includes control data and a request header with
no message content and is therefore transmitted as a single HEADERS
frame, followed by zero or more CONTINUATION frames containing the
serialized block of request header fields. The HEADERS frame in the
following has both the END_HEADERS and END_STREAM flags set; no
CONTINUATION frames are sent.
GET /resource HTTP/1.1 HEADERS
Host: example.org ==> + END_STREAM
Accept: image/jpeg + END_HEADERS
:method = GET
:scheme = https
:path = /resource
host = example.org
accept = image/jpeg
Similarly, a response that includes only control data and a response
header is transmitted as a HEADERS frame (again, followed by zero or
more CONTINUATION frames) containing the serialized block of response
header fields.
HTTP/1.1 304 Not Modified HEADERS
ETag: "xyzzy" ==> + END_STREAM
Expires: Thu, 23 Jan ... + END_HEADERS
:status = 304
etag = "xyzzy"
expires = Thu, 23 Jan ...
An HTTP POST request that includes control data and a request header
and message content is transmitted as one HEADERS frame, followed by
zero or more CONTINUATION frames containing the request header,
followed by one or more DATA frames, with the last CONTINUATION (or
HEADERS) frame having the END_HEADERS flag set and the final DATA
frame having the END_STREAM flag set:
POST /resource HTTP/1.1 HEADERS
Host: example.org ==> - END_STREAM
Content-Type: image/jpeg - END_HEADERS
Content-Length: 123 :method = POST
:path = /resource
{binary data} :scheme = https
CONTINUATION
+ END_HEADERS
content-type = image/jpeg
host = example.org
content-length = 123
DATA
+ END_STREAM
{binary data}
Note that data contributing to any given field line could be spread
between field block fragments. The allocation of field lines to
frames in this example is illustrative only.
A response that includes control data and a response header and
message content is transmitted as a HEADERS frame, followed by zero
or more CONTINUATION frames, followed by one or more DATA frames,
with the last DATA frame in the sequence having the END_STREAM flag
set:
HTTP/1.1 200 OK HEADERS
Content-Type: image/jpeg ==> - END_STREAM
Content-Length: 123 + END_HEADERS
:status = 200
{binary data} content-type = image/jpeg
content-length = 123
DATA
+ END_STREAM
{binary data}
An informational response using a 1xx status code other than 101 is
transmitted as a HEADERS frame, followed by zero or more CONTINUATION
frames.
A trailer section is sent as a field block after both the request or
response field block and all the DATA frames have been sent. The
HEADERS frame starting the field block that comprises the trailer
section has the END_STREAM flag set.
The following example includes both a 100 (Continue) status code,
which is sent in response to a request containing a "100-continue"
token in the Expect header field, and a trailer section:
HTTP/1.1 100 Continue HEADERS
Extension-Field: bar ==> - END_STREAM
+ END_HEADERS
:status = 100
extension-field = bar
HTTP/1.1 200 OK HEADERS
Content-Type: image/jpeg ==> - END_STREAM
Transfer-Encoding: chunked + END_HEADERS
Trailer: Foo :status = 200
content-length = 123
123 content-type = image/jpeg
{binary data} trailer = Foo
0
Foo: bar DATA
- END_STREAM
{binary data}
HEADERS
+ END_STREAM
+ END_HEADERS
foo = bar
9. HTTP/2 Connections
This section outlines attributes of the HTTP protocol that improve This section outlines attributes of the HTTP protocol that improve
interoperability, reduce exposure to known security vulnerabilities, interoperability, reduce exposure to known security vulnerabilities,
or reduce the potential for implementation variation. or reduce the potential for implementation variation.
9.1. Connection Management 9.1. Connection Management
HTTP/2 connections are persistent. For best performance, it is HTTP/2 connections are persistent. For best performance, it is
expected that clients will not close connections until it is expected that clients will not close connections until it is
determined that no further communication with a server is necessary determined that no further communication with a server is necessary
skipping to change at page 63, line 16 skipping to change at page 65, line 27
possible but are permitted to terminate idle connections if possible but are permitted to terminate idle connections if
necessary. When either endpoint chooses to close the transport-layer necessary. When either endpoint chooses to close the transport-layer
TCP connection, the terminating endpoint SHOULD first send a GOAWAY TCP connection, the terminating endpoint SHOULD first send a GOAWAY
(Section 6.8) frame so that both endpoints can reliably determine (Section 6.8) frame so that both endpoints can reliably determine
whether previously sent frames have been processed and gracefully whether previously sent frames have been processed and gracefully
complete or terminate any necessary remaining tasks. complete or terminate any necessary remaining tasks.
9.1.1. Connection Reuse 9.1.1. Connection Reuse
Connections that are made to an origin server, either directly or Connections that are made to an origin server, either directly or
through a tunnel created using the CONNECT method (Section 8.3), MAY through a tunnel created using the CONNECT method (Section 8.5), MAY
be reused for requests with multiple different URI authority be reused for requests with multiple different URI authority
components. A connection can be reused as long as the origin server components. A connection can be reused as long as the origin server
is authoritative (Section 10.1). For TCP connections without TLS, is authoritative (Section 10.1). For TCP connections without TLS,
this depends on the host having resolved to the same IP address. this depends on the host having resolved to the same IP address.
For "https" resources, connection reuse additionally depends on For "https" resources, connection reuse additionally depends on
having a certificate that is valid for the host in the URI. The having a certificate that is valid for the host in the URI. The
certificate presented by the server MUST satisfy any checks that the certificate presented by the server MUST satisfy any checks that the
client would perform when forming a new TLS connection for the host client would perform when forming a new TLS connection for the host
in the URI. A single certificate can be used to establish authority in the URI. A single certificate can be used to establish authority
skipping to change at page 67, line 15 skipping to change at page 69, line 34
The cleartext version of HTTP/2 has minimal protection against cross- The cleartext version of HTTP/2 has minimal protection against cross-
protocol attacks. The connection preface (Section 3.4) contains a protocol attacks. The connection preface (Section 3.4) contains a
string that is designed to confuse HTTP/1.1 servers, but no special string that is designed to confuse HTTP/1.1 servers, but no special
protection is offered for other protocols. protection is offered for other protocols.
10.3. Intermediary Encapsulation Attacks 10.3. Intermediary Encapsulation Attacks
HPACK permits encoding of field names and values that might be HPACK permits encoding of field names and values that might be
treated as delimiters in other HTTP versions. An intermediary that treated as delimiters in other HTTP versions. An intermediary that
translates an HTTP/2 request or response MUST validate fields translates an HTTP/2 request or response MUST validate fields
according to the rules in Section 8.1.2 roles before translating a according to the rules in Section 8.2 roles before translating a
message to another HTTP version. Translating a field that includes message to another HTTP version. Translating a field that includes
invalid delimiters could be used to cause recipients to incorrectly invalid delimiters could be used to cause recipients to incorrectly
interpret a message, which could be exploited by an attacker. interpret a message, which could be exploited by an attacker.
An intermediary can reject fields that contain invalid field names or An intermediary can reject fields that contain invalid field names or
values for other reasons, in particular those that do not conform to values for other reasons, in particular those that do not conform to
the HTTP ABNF grammar from Section 5 of [HTTP]. Intermediaries that the HTTP ABNF grammar from Section 5 of [HTTP]. Intermediaries that
do not perform any validation of fields other than the minimum do not perform any validation of fields other than the minimum
required by Section 8.1.2 could forward messages that contain invalid required by Section 8.2 could forward messages that contain invalid
field names or values. field names or values.
An intermediary that receives any field that requires removal before An intermediary that receives any field that requires removal before
forwarding (see Section 7.6.1 of [HTTP]) MUST remove or replace those forwarding (see Section 7.6.1 of [HTTP]) MUST remove or replace those
header fields when forwarding messages. Additionally, intermediaries header fields when forwarding messages. Additionally, intermediaries
should take care when forwarding messages containing Content-Length should take care when forwarding messages containing Content-Length
fields to ensure that the message is well-formed (Section 8.1.2.6). fields to ensure that the message is well-formed (Section 8.1.1).
This ensures that if the message is translated into HTTP/1.1 at any This ensures that if the message is translated into HTTP/1.1 at any
point the framing will be correct. point the framing will be correct.
10.4. Cacheability of Pushed Responses 10.4. Cacheability of Pushed Responses
Pushed responses do not have an explicit request from the client; the Pushed responses do not have an explicit request from the client; the
request is provided by the server in the PUSH_PROMISE frame. request is provided by the server in the PUSH_PROMISE frame.
Caching responses that are pushed is possible based on the guidance Caching responses that are pushed is possible based on the guidance
provided by the origin server in the Cache-Control header field. provided by the origin server in the Cache-Control header field.
skipping to change at page 72, line 34 skipping to change at page 74, line 51
11. IANA Considerations 11. IANA Considerations
A string for identifying HTTP/2 is entered into the "Application- A string for identifying HTTP/2 is entered into the "Application-
Layer Protocol Negotiation (ALPN) Protocol IDs" registry established Layer Protocol Negotiation (ALPN) Protocol IDs" registry established
in [TLS-ALPN]. in [TLS-ALPN].
This document establishes a registry for frame types, settings, and This document establishes a registry for frame types, settings, and
error codes. These new registries appear in the new "Hypertext error codes. These new registries appear in the new "Hypertext
Transfer Protocol version 2 (HTTP/2)" section. Transfer Protocol version 2 (HTTP/2)" section.
This document registers the "HTTP2-Settings" header field for use in This revision of the document marks the "HTTP2-Settings" header field
HTTP. registered in [RFC7540] obsolete.
This document registers the "PRI" method for use in HTTP to avoid This document registers the "PRI" method for use in HTTP to avoid
collisions with the connection preface (Section 3.4). collisions with the connection preface (Section 3.4).
11.1. Registration of HTTP/2 Identification Strings 11.1. Registration of HTTP/2 Identification Strings
This document creates two registrations for the identification of This document creates two registrations for the identification of
HTTP/2 (see Section 3.2) in the "Application-Layer Protocol HTTP/2 (see Section 3.2) in the "Application-Layer Protocol
Negotiation (ALPN) Protocol IDs" registry established in [TLS-ALPN]. Negotiation (ALPN) Protocol IDs" registry established in [TLS-ALPN].
skipping to change at page 77, line 8 skipping to change at page 79, line 8
+---------------------+------+----------------------+---------------+ +---------------------+------+----------------------+---------------+
| HTTP_1_1_REQUIRED | 0xd | Use HTTP/1.1 for | Section 7 | | HTTP_1_1_REQUIRED | 0xd | Use HTTP/1.1 for | Section 7 |
| | | the request | | | | | the request | |
+---------------------+------+----------------------+---------------+ +---------------------+------+----------------------+---------------+
Table 3 Table 3
11.5. HTTP2-Settings Header Field Registration 11.5. HTTP2-Settings Header Field Registration
This section marks the "HTTP2-Settings" header field registered in This section marks the "HTTP2-Settings" header field registered in
Section 11.5 of [RFC7540] as obsoleted. Section 11.5 of [RFC7540] as obsoleted. The registration is updated
to include the details as required by Section 18.4 of [HTTP]:
Field Name: HTTP2-Settings
Status: Standard
Ref.: Section 3.2.1 of [RFC7540]
Comments: Obsolete; see Section 11.5
11.6. PRI Method Registration 11.6. PRI Method Registration
This section registers the "PRI" method in the "HTTP Method Registry" This section registers the "PRI" method in the "HTTP Method Registry"
(Section 18.2 of [HTTP]). (Section 18.2 of [HTTP]).
Method Name: PRI Method Name: PRI
Safe: Yes Safe: Yes
skipping to change at page 77, line 40 skipping to change at page 79, line 49
registered an upgrade token. This capability has been removed: see registered an upgrade token. This capability has been removed: see
Section 3.1. Section 3.1.
12. References 12. References
12.1. Normative References 12.1. Normative References
[CACHE] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, [CACHE] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
Ed., "HTTP Caching", Work in Progress, Internet-Draft, Ed., "HTTP Caching", Work in Progress, Internet-Draft,
draft-ietf-httpbis-cache-15, 30 March 2021, draft-ietf-httpbis-cache-15, 30 March 2021,
<https://tools.ietf.org/html/draft-ietf-httpbis-cache-15>. <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-
cache-15>.
[COMPRESSION] [COMPRESSION]
Peon, R. and H. Ruellan, "HPACK: Header Compression for Peon, R. and H. Ruellan, "HPACK: Header Compression for
HTTP/2", RFC 7541, May 2015, HTTP/2", RFC 7541, May 2015,
<https://www.rfc-editor.org/rfc/rfc7541>. <https://www.rfc-editor.org/rfc/rfc7541>.
[COOKIE] Barth, A., "HTTP State Management Mechanism", RFC 6265, [COOKIE] Barth, A., "HTTP State Management Mechanism", RFC 6265,
April 2011, <https://www.rfc-editor.org/rfc/rfc6265>. April 2011, <https://www.rfc-editor.org/rfc/rfc6265>.
[FIPS186] NIST, "Digital Signature Standard (DSS)", FIPS PUB 186-4, [FIPS186] NIST, "Digital Signature Standard (DSS)", FIPS PUB 186-4,
July 2013, <http://dx.doi.org/10.6028/NIST.FIPS.186-4>. July 2013, <http://dx.doi.org/10.6028/NIST.FIPS.186-4>.
[HTTP] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, [HTTP] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
Ed., "HTTP Semantics", Work in Progress, Internet-Draft, Ed., "HTTP Semantics", Work in Progress, Internet-Draft,
draft-ietf-httpbis-semantics-15, 30 March 2021, draft-ietf-httpbis-semantics-15, 30 March 2021,
<https://tools.ietf.org/html/draft-ietf-httpbis-semantics- <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-
15>. semantics-15>.
[QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based
Multiplexed and Secure Transport", RFC 9000,
DOI 10.17487/RFC9000, May 2021,
<https://www.rfc-editor.org/info/rfc9000>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997, Requirement Levels", BCP 14, RFC 2119, March 1997,
<https://www.rfc-editor.org/rfc/rfc2119>. <https://www.rfc-editor.org/rfc/rfc2119>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, January 2005, RFC 3986, January 2005,
<https://www.rfc-editor.org/rfc/rfc3986>. <https://www.rfc-editor.org/rfc/rfc3986>.
skipping to change at page 79, line 28 skipping to change at page 81, line 41
BREACH%20-%20SSL,%20gone%20in%2030%20seconds.pdf>. BREACH%20-%20SSL,%20gone%20in%2030%20seconds.pdf>.
[DNS-TERMS] [DNS-TERMS]
Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS
Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499, Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499,
January 2019, <https://www.rfc-editor.org/rfc/rfc8499>. January 2019, <https://www.rfc-editor.org/rfc/rfc8499>.
[HTTP11] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, [HTTP11] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
Ed., "HTTP/1.1", Work in Progress, Internet-Draft, draft- Ed., "HTTP/1.1", Work in Progress, Internet-Draft, draft-
ietf-httpbis-messaging-15, 30 March 2021, ietf-httpbis-messaging-15, 30 March 2021,
<https://tools.ietf.org/html/draft-ietf-httpbis-messaging- <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-
15>. messaging-15>.
[I-D.ietf-httpbis-priority] [I-D.ietf-httpbis-priority]
Oku, K. and L. Pardue, "Extensible Prioritization Scheme Oku, K. and L. Pardue, "Extensible Prioritization Scheme
for HTTP", Work in Progress, Internet-Draft, draft-ietf- for HTTP", Work in Progress, Internet-Draft, draft-ietf-
httpbis-priority-03, 11 January 2021, httpbis-priority-03, 11 January 2021,
<https://tools.ietf.org/html/draft-ietf-httpbis-priority- <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-
03>. priority-03>.
[NFLX-2019-002] [NFLX-2019-002]
Netflix, "HTTP/2 Denial of Service Advisory", 13 August Netflix, "HTTP/2 Denial of Service Advisory", 13 August
2019, <https://github.com/Netflix/security- 2019, <https://github.com/Netflix/security-
bulletins/blob/master/advisories/third-party/2019-002.md>. bulletins/blob/master/advisories/third-party/2019-002.md>.
[PRIVACY] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., [PRIVACY] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J.,
Morris, J., Hansen, M., and R. Smith, "Privacy Morris, J., Hansen, M., and R. Smith, "Privacy
Considerations for Internet Protocols", RFC 6973, Considerations for Internet Protocols", RFC 6973,
DOI 10.17487/RFC6973, July 2013, DOI 10.17487/RFC6973, July 2013,
skipping to change at page 87, line 13 skipping to change at page 89, line 33
governing when PRIORITY frames can be sent and received, but the governing when PRIORITY frames can be sent and received, but the
semantics of these fields is only described in RFC 7540. The semantics of these fields is only described in RFC 7540. The
priority signaling scheme from RFC 7540 was not successful. Using priority signaling scheme from RFC 7540 was not successful. Using
the simpler successor signaling [I-D.ietf-httpbis-priority] is the simpler successor signaling [I-D.ietf-httpbis-priority] is
recommended. recommended.
* The HTTP/1.1 Upgrade mechanism is no longer specified in this * The HTTP/1.1 Upgrade mechanism is no longer specified in this
document. It was never widely deployed, with plaintext HTTP/2 document. It was never widely deployed, with plaintext HTTP/2
users choosing to use the prior-knowledge implementation instead. users choosing to use the prior-knowledge implementation instead.
* Validation for field names and values has been narrowed. The
validation that is mandatory for intermediaries is precisely
defined and error reporting for requests has been amended to
encourage sending 400-series status codes.
* The ranges of codepoints for settings and frame types that were * The ranges of codepoints for settings and frame types that were
reserved for "Experimental Use" are now available for general use. reserved for "Experimental Use" are now available for general use.
Contributors Contributors
The previous version of this document was authored by Mike Belshe and The previous version of this document was authored by Mike Belshe and
Roberto Peon. Roberto Peon.
Acknowledgements Acknowledgments
This document includes substantial input from the following
individuals:
* Adam Langley, Wan-Teh Chang, Jim Morrison, Mark Nottingham, Alyssa
Wilk, Costin Manolache, William Chan, Vitaliy Lvin, Joe Chan, Adam
Barth, Ryan Hamilton, Gavin Peters, Kent Alstad, Kevin Lindsay,
Paul Amer, Fan Yang, and Jonathan Leighton (SPDY contributors).
* Gabriel Montenegro and Willy Tarreau (Upgrade mechanism).
* William Chan, Salvatore Loreto, Osama Mazahir, Gabriel Montenegro,
Jitu Padhye, Roberto Peon, and Rob Trace (Flow control).
* Mike Bishop (Extensibility).
* Mark Nottingham, Julian Reschke, James Snell, Jeff Pinner, Mike
Bishop, and Hervé Ruellan (Substantial editorial contributions).
* Kari Hurtta, Tatsuhiro Tsujikawa, Greg Wilkins, Poul-Henning Kamp,
and Jonathan Thackray.
* Alexey Melnikov, who was an editor of this document in 2013.
* David Benjamin, who was author of RFC 8740, the contents of which
are integrated here.
A substantial proportion of Martin's contribution was supported by
Microsoft during his employment there.
The Japanese HTTP/2 community provided invaluable contributions, Credit for non-trivial input to this document is owed to a large
including a number of implementations as well as numerous technical number of people who have contributed to the HTTP working group over
and editorial contributions. the years. [RFC7540] contains a more extensive list of people that
deserve acknowledgment for their contributions.
Authors' Addresses Authors' Addresses
Martin Thomson (editor) Martin Thomson (editor)
Mozilla Mozilla
Australia Australia
Email: mt@lowentropy.net Email: mt@lowentropy.net
Cory Benfield (editor) Cory Benfield (editor)
 End of changes. 112 change blocks. 
567 lines changed or deleted 659 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/