| draft-ietf-httpbis-http2-01.txt | draft-ietf-httpbis-http2-02.txt | |||
|---|---|---|---|---|
| HTTPbis Working Group M. Belshe | HTTPbis Working Group M. Belshe | |||
| Internet-Draft Twist | Internet-Draft Twist | |||
| Expires: July 26, 2013 R. Peon | Intended status: Standards Track R. Peon | |||
| Google, Inc | Expires: October 5, 2013 Google, Inc | |||
| M. Thomson, Ed. | M. Thomson, Ed. | |||
| Microsoft | Microsoft | |||
| A. Melnikov, Ed. | A. Melnikov, Ed. | |||
| Isode Ltd | Isode Ltd | |||
| January 22, 2013 | April 3, 2013 | |||
| Hypertext Transfer Protocol version 2.0 | Hypertext Transfer Protocol version 2.0 | |||
| draft-ietf-httpbis-http2-01 | draft-ietf-httpbis-http2-02 | |||
| Abstract | Abstract | |||
| This document describes an optimised expression of the semantics of | This specification describes an optimised expression of the syntax of | |||
| the HTTP protocol. The HTTP/2.0 encapsulation enables more efficient | the Hypertext Transfer Protocol (HTTP). The HTTP/2.0 encapsulation | |||
| transfer of resources over HTTP by providing compressed headers, | enables more efficient transfer of representations by providing | |||
| simultaneous requests, and unsolicited push of resources from server | compressed header fields, simultaneous requests, and also introduces | |||
| to client. | unsolicited push of representations from server to client. | |||
| This document is an alternative to, but does not obsolete | This document is an alternative to, but does not obsolete the HTTP | |||
| RFC{http-p1}. The HTTP protocol semantics described in RFC{http- | message format. HTTP semantics remain unchanged. | |||
| p2..p7} are unmodified. | ||||
| Editorial Note (To be removed by RFC Editor) | Editorial Note (To be removed by RFC Editor) | |||
| This draft is a work-in-progress, and does not yet reflect Working | ||||
| Group consensus. | ||||
| This draft contains features from the SPDY Protocol as a starting | ||||
| point, as per the Working Group's charter. Future drafts will add, | ||||
| remove and change text, based upon the Working Group's decisions. | ||||
| Discussion of this draft takes place on the HTTPBIS working group | Discussion of this draft takes place on the HTTPBIS working group | |||
| mailing list (ietf-http-wg@w3.org), which is archived at | mailing list (ietf-http-wg@w3.org), which is archived at | |||
| <http://lists.w3.org/Archives/Public/ietf-http-wg/>. | <http://lists.w3.org/Archives/Public/ietf-http-wg/>. | |||
| The current issues list is at | Working Group information and related documents can be found at | |||
| <http://tools.ietf.org/wg/httpbis/trac/report/21> and related | <http://tools.ietf.org/wg/httpbis/> (Wiki) and | |||
| documents (including fancy diffs) can be found at | <https://github.com/http2/http2-spec> (source code and issues | |||
| <http://tools.ietf.org/wg/httpbis/>. | tracker). | |||
| The changes in this draft are summarized in Appendix A.1. | The changes in this draft are summarized in Appendix A.1. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| 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 http://datatracker.ietf.org/drafts/current/. | Drafts is at http://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 July 26, 2013. | This Internet-Draft will expire on October 5, 2013. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2013 IETF Trust and the persons identified as the | Copyright (c) 2013 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 | Provisions Relating to IETF Documents | |||
| (http://trustee.ietf.org/license-info) in effect on the date of | (http://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| described in the Simplified BSD License. | described in the Simplified BSD License. | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 1.1. Document Organization . . . . . . . . . . . . . . . . . . 5 | 1.1. Document Organization . . . . . . . . . . . . . . . . . . 5 | |||
| 1.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 6 | 1.2. Conventions and Terminology . . . . . . . . . . . . . . . 6 | |||
| 2. Starting HTTP/2.0 . . . . . . . . . . . . . . . . . . . . . . 6 | 2. Starting HTTP/2.0 . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 2.1. HTTP/2.0 Version Identification . . . . . . . . . . . . . 6 | 2.1. HTTP/2.0 Version Identification . . . . . . . . . . . . . 7 | |||
| 2.2. Starting HTTP/2.0 for "http:" URIs . . . . . . . . . . . . 7 | 2.2. Starting HTTP/2.0 for "http:" URIs . . . . . . . . . . . . 8 | |||
| 2.3. Starting HTTP/2.0 for "https:" URIs . . . . . . . . . . . 8 | 2.3. Starting HTTP/2.0 for "https:" URIs . . . . . . . . . . . 8 | |||
| 3. HTTP/2.0 Framing Layer . . . . . . . . . . . . . . . . . . . . 8 | 2.4. Starting HTTP/2.0 with Prior Knowledge . . . . . . . . . . 9 | |||
| 3.1. Session (Connections) . . . . . . . . . . . . . . . . . . 8 | 3. HTTP/2.0 Framing Layer . . . . . . . . . . . . . . . . . . . . 9 | |||
| 3.2. Framing . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 3.1. Session . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
| 3.2.1. Control frames . . . . . . . . . . . . . . . . . . . . 9 | 3.2. Session Header . . . . . . . . . . . . . . . . . . . . . . 9 | |||
| 3.2.2. Data frames . . . . . . . . . . . . . . . . . . . . . 10 | 3.3. Framing . . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 3.3. Streams . . . . . . . . . . . . . . . . . . . . . . . . . 11 | 3.3.1. Frame Header . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 3.3.1. Stream frames . . . . . . . . . . . . . . . . . . . . 11 | 3.3.2. Frame Processing . . . . . . . . . . . . . . . . . . . 11 | |||
| 3.3.2. Stream creation . . . . . . . . . . . . . . . . . . . 11 | 3.4. Streams . . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 3.3.3. Stream priority . . . . . . . . . . . . . . . . . . . 12 | 3.4.1. Stream Creation . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.3.4. Stream headers . . . . . . . . . . . . . . . . . . . . 12 | 3.4.2. Stream priority . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.3.5. Stream data exchange . . . . . . . . . . . . . . . . . 13 | 3.4.3. Stream headers . . . . . . . . . . . . . . . . . . . . 13 | |||
| 3.3.6. Stream half-close . . . . . . . . . . . . . . . . . . 13 | 3.4.4. Stream data exchange . . . . . . . . . . . . . . . . . 13 | |||
| 3.3.7. Stream close . . . . . . . . . . . . . . . . . . . . . 13 | 3.4.5. Stream half-close . . . . . . . . . . . . . . . . . . 13 | |||
| 3.4. Error Handling . . . . . . . . . . . . . . . . . . . . . . 14 | 3.4.6. Stream close . . . . . . . . . . . . . . . . . . . . . 13 | |||
| 3.4.1. Session Error Handling . . . . . . . . . . . . . . . . 14 | 3.5. Error Handling . . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 3.4.2. Stream Error Handling . . . . . . . . . . . . . . . . 14 | 3.5.1. Session Error Handling . . . . . . . . . . . . . . . . 14 | |||
| 3.5. Stream Flow Control . . . . . . . . . . . . . . . . . . . 15 | 3.5.2. Stream Error Handling . . . . . . . . . . . . . . . . 15 | |||
| 3.5.1. Flow Control Principles . . . . . . . . . . . . . . . 15 | 3.5.3. Error Codes . . . . . . . . . . . . . . . . . . . . . 15 | |||
| 3.5.2. Basic Flow Control Algorithm . . . . . . . . . . . . . 16 | 3.6. Stream Flow Control . . . . . . . . . . . . . . . . . . . 16 | |||
| 3.6. Control frame types . . . . . . . . . . . . . . . . . . . 16 | 3.6.1. Flow Control Principles . . . . . . . . . . . . . . . 16 | |||
| 3.6.1. SYN_STREAM . . . . . . . . . . . . . . . . . . . . . . 16 | 3.6.2. Appropriate Use of Flow Control . . . . . . . . . . . 17 | |||
| 3.6.2. SYN_REPLY . . . . . . . . . . . . . . . . . . . . . . 18 | 3.7. Frame Types . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
| 3.6.3. RST_STREAM . . . . . . . . . . . . . . . . . . . . . . 19 | 3.7.1. DATA Frames . . . . . . . . . . . . . . . . . . . . . 18 | |||
| 3.6.4. SETTINGS . . . . . . . . . . . . . . . . . . . . . . . 20 | 3.7.2. HEADERS+PRIORITY . . . . . . . . . . . . . . . . . . . 18 | |||
| 3.6.5. PING . . . . . . . . . . . . . . . . . . . . . . . . . 23 | 3.7.3. RST_STREAM . . . . . . . . . . . . . . . . . . . . . . 18 | |||
| 3.6.6. GOAWAY . . . . . . . . . . . . . . . . . . . . . . . . 24 | 3.7.4. SETTINGS . . . . . . . . . . . . . . . . . . . . . . . 19 | |||
| 3.6.7. HEADERS . . . . . . . . . . . . . . . . . . . . . . . 25 | 3.7.5. PUSH_PROMISE . . . . . . . . . . . . . . . . . . . . . 22 | |||
| 3.6.8. WINDOW_UPDATE . . . . . . . . . . . . . . . . . . . . 26 | 3.7.6. PING . . . . . . . . . . . . . . . . . . . . . . . . . 23 | |||
| 3.6.9. CREDENTIAL . . . . . . . . . . . . . . . . . . . . . . 28 | 3.7.7. GOAWAY . . . . . . . . . . . . . . . . . . . . . . . . 23 | |||
| 3.6.10. Name/Value Header Block . . . . . . . . . . . . . . . 30 | 3.7.8. HEADERS . . . . . . . . . . . . . . . . . . . . . . . 24 | |||
| 4. HTTP Layering over HTTP/2.0 . . . . . . . . . . . . . . . . . 36 | 3.7.9. WINDOW_UPDATE . . . . . . . . . . . . . . . . . . . . 25 | |||
| 4.1. Connection Management . . . . . . . . . . . . . . . . . . 36 | 3.7.10. Header Block . . . . . . . . . . . . . . . . . . . . . 28 | |||
| 4.1.1. Use of GOAWAY . . . . . . . . . . . . . . . . . . . . 36 | 4. HTTP Message Exchanges . . . . . . . . . . . . . . . . . . . . 28 | |||
| 4.2. HTTP Request/Response . . . . . . . . . . . . . . . . . . 37 | 4.1. Connection Management . . . . . . . . . . . . . . . . . . 28 | |||
| 4.2.1. Request . . . . . . . . . . . . . . . . . . . . . . . 37 | 4.1.1. Use of GOAWAY . . . . . . . . . . . . . . . . . . . . 29 | |||
| 4.2.2. Response . . . . . . . . . . . . . . . . . . . . . . . 39 | 4.2. HTTP Request/Response . . . . . . . . . . . . . . . . . . 29 | |||
| 4.2.3. Authentication . . . . . . . . . . . . . . . . . . . . 39 | 4.2.1. HTTP Header Fields and HTTP/2.0 Headers . . . . . . . 29 | |||
| 4.3. Server Push Transactions . . . . . . . . . . . . . . . . . 40 | 4.2.2. Request . . . . . . . . . . . . . . . . . . . . . . . 29 | |||
| 4.3.1. Server implementation . . . . . . . . . . . . . . . . 41 | 4.2.3. Response . . . . . . . . . . . . . . . . . . . . . . . 31 | |||
| 4.3.2. Client implementation . . . . . . . . . . . . . . . . 42 | 4.3. Server Push Transactions . . . . . . . . . . . . . . . . . 32 | |||
| 5. Design Rationale and Notes . . . . . . . . . . . . . . . . . . 43 | 4.3.1. Server implementation . . . . . . . . . . . . . . . . 33 | |||
| 5.1. Separation of Framing Layer and Application Layer . . . . 43 | 4.3.2. Client implementation . . . . . . . . . . . . . . . . 34 | |||
| 5.2. Error handling - Framing Layer . . . . . . . . . . . . . . 43 | 5. Design Rationale and Notes . . . . . . . . . . . . . . . . . . 35 | |||
| 5.3. One Connection Per Domain . . . . . . . . . . . . . . . . 44 | 5.1. Separation of Framing Layer and Application Layer . . . . 35 | |||
| 5.4. Fixed vs Variable Length Fields . . . . . . . . . . . . . 44 | 5.2. Error handling - Framing Layer . . . . . . . . . . . . . . 35 | |||
| 5.5. Compression Context(s) . . . . . . . . . . . . . . . . . . 45 | 5.3. One Connection Per Domain . . . . . . . . . . . . . . . . 36 | |||
| 5.6. Unidirectional streams . . . . . . . . . . . . . . . . . . 45 | 5.4. Fixed vs Variable Length Fields . . . . . . . . . . . . . 36 | |||
| 5.7. Data Compression . . . . . . . . . . . . . . . . . . . . . 45 | 5.5. Server Push . . . . . . . . . . . . . . . . . . . . . . . 36 | |||
| 5.8. Server Push . . . . . . . . . . . . . . . . . . . . . . . 46 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 37 | |||
| 6. Security Considerations . . . . . . . . . . . . . . . . . . . 46 | 6.1. Use of Same-origin constraints . . . . . . . . . . . . . . 37 | |||
| 6.1. Use of Same-origin constraints . . . . . . . . . . . . . . 46 | 6.2. Cross-Protocol Attacks . . . . . . . . . . . . . . . . . . 37 | |||
| 6.2. HTTP Headers and HTTP/2.0 Headers . . . . . . . . . . . . 46 | 6.3. Cacheability of Pushed Resources . . . . . . . . . . . . . 37 | |||
| 6.3. Cross-Protocol Attacks . . . . . . . . . . . . . . . . . . 46 | 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . . 37 | |||
| 6.4. Server Push Implicit Headers . . . . . . . . . . . . . . . 46 | 7.1. Long Lived Connections . . . . . . . . . . . . . . . . . . 38 | |||
| 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . . 47 | 7.2. SETTINGS frame . . . . . . . . . . . . . . . . . . . . . . 38 | |||
| 7.1. Long Lived Connections . . . . . . . . . . . . . . . . . . 47 | 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 | |||
| 7.2. SETTINGS frame . . . . . . . . . . . . . . . . . . . . . . 47 | 8.1. Frame Type Registry . . . . . . . . . . . . . . . . . . . 38 | |||
| 8.2. Error Code Registry . . . . . . . . . . . . . . . . . . . 39 | ||||
| 8. Requirements Notation . . . . . . . . . . . . . . . . . . . . 47 | 8.3. Settings Registry . . . . . . . . . . . . . . . . . . . . 39 | |||
| 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47 | 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 40 | |||
| 10. Normative References . . . . . . . . . . . . . . . . . . . . . 48 | 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 41 | |||
| 10.1. Normative References . . . . . . . . . . . . . . . . . . . 41 | ||||
| 10.2. Informative References . . . . . . . . . . . . . . . . . . 42 | ||||
| Appendix A. Change Log (to be removed by RFC Editor before | Appendix A. Change Log (to be removed by RFC Editor before | |||
| publication) . . . . . . . . . . . . . . . . . . . . 49 | publication) . . . . . . . . . . . . . . . . . . . . 42 | |||
| A.1. Since draft-ietf-httpbis-http2-00 . . . . . . . . . . . . 49 | ||||
| A.2. Since draft-mbelshe-httpbis-spdy-00 . . . . . . . . . . . 49 | A.1. Since draft-ietf-httpbis-http2-01 . . . . . . . . . . . . 42 | |||
| A.2. Since draft-ietf-httpbis-http2-00 . . . . . . . . . . . . 43 | ||||
| A.3. Since draft-mbelshe-httpbis-spdy-00 . . . . . . . . . . . 43 | ||||
| 1. Introduction | 1. Introduction | |||
| HTTP is a wildly successful protocol. HTTP/1.1 message encapsulation | The Hypertext Transfer Protocol (HTTP) is a wildly successful | |||
| [HTTP-p1] is optimized for implementation simplicity and | protocol. The HTTP/1.1 message encapsulation ([HTTP-p1], Section 3) | |||
| accessibility, not application performance. As such it has several | is optimized for implementation simplicity and accessibility, not | |||
| characteristics that have a negative overall effect on application | application performance. As such it has several characteristics that | |||
| performance. | have a negative overall effect on application performance. | |||
| The HTTP/1.1 encapsulation ensures that only one request can be | The HTTP/1.1 encapsulation ensures that only one request can be | |||
| delivered at a time on a given connection. HTTP/1.1 pipelining, | delivered at a time on a given connection. HTTP/1.1 pipelining, | |||
| which is not widely deployed, only partially addresses these | which is not widely deployed, only partially addresses these | |||
| concerns. Clients that need to make multiple requests therefore use | concerns. Clients that need to make multiple requests therefore use | |||
| commonly multiple connections to a server or servers in order to | commonly multiple connections to a server or servers in order to | |||
| reduce the overall latency of those requests. | reduce the overall latency of those requests. [[anchor1: Need to tune | |||
| the anti-pipelining comments here.]] | ||||
| Furthermore, HTTP/1.1 headers are represented in an inefficient | Furthermore, HTTP/1.1 header fields are represented in an inefficient | |||
| fashion, which, in addition to generating more or larger network | fashion, which, in addition to generating more or larger network | |||
| packets, can cause the small initial TCP window to fill more quickly | packets, can cause the small initial TCP window to fill more quickly | |||
| than is ideal. This results in excessive latency where multiple | than is ideal. This results in excessive latency where multiple | |||
| requests are made on a new TCP connection. | requests are made on a new TCP connection. | |||
| This document defines an optimized mapping of the HTTP semantics to a | This document defines an optimized mapping of the HTTP semantics to a | |||
| TCP connection. This optimization reduces the latency costs of HTTP | TCP connection. This optimization reduces the latency costs of HTTP | |||
| by allowing parallel requests on the same connection and by using an | by allowing parallel requests on the same connection and by using an | |||
| efficient coding for HTTP headers. Prioritization of requests lets | efficient coding for HTTP header fields. Prioritization of requests | |||
| more important requests complete faster, further improving | lets more important requests complete faster, further improving | |||
| application performance. | application performance. | |||
| HTTP/2.0 applications have an improved impact on network congestion | HTTP/2.0 applications have an improved impact on network congestion | |||
| due to the use of fewer TCP connections to achieve the same effect. | due to the use of fewer TCP connections to achieve the same effect. | |||
| Fewer TCP connections compete more fairly with other flows. Long- | Fewer TCP connections compete more fairly with other flows. Long- | |||
| lived connections are also more able to take better advantage of the | lived connections are also more able to take better advantage of the | |||
| available network capacity, rather than operating in the slow start | available network capacity, rather than operating in the slow start | |||
| phase of TCP. | phase of TCP. | |||
| The HTTP/2.0 encapsulation also enables more efficient processing of | The HTTP/2.0 encapsulation also enables more efficient processing of | |||
| messages by providing efficient message framing. Processing of | messages by providing efficient message framing. Processing of | |||
| headers in HTTP/2.0 messages is more efficient (for entities that | header fields in HTTP/2.0 messages is more efficient (for entities | |||
| process many messages). | that process many messages). | |||
| 1.1. Document Organization | 1.1. Document Organization | |||
| The HTTP/2.0 Specification is split into three parts: starting | The HTTP/2.0 Specification is split into three parts: starting | |||
| HTTP/2.0 (Section 2), which covers how a HTTP/2.0 is started; a | HTTP/2.0 (Section 2), which covers how a HTTP/2.0 is started; a | |||
| framing layer (Section 3), which multiplexes a TCP connection into | framing layer (Section 3), which multiplexes a TCP connection into | |||
| independent, length-prefixed frames; and an HTTP layer (Section 4), | independent, length-prefixed frames; and an HTTP layer (Section 4), | |||
| which specifies the mechanism for overlaying HTTP request/response | which specifies the mechanism for overlaying HTTP request/response | |||
| pairs on top of the framing layer. While some of the framing layer | pairs on top of the framing layer. While some of the framing layer | |||
| concepts are isolated from the HTTP layer, building a generic framing | concepts are isolated from the HTTP layer, building a generic framing | |||
| layer has not been a goal. The framing layer is tailored to the | layer has not been a goal. The framing layer is tailored to the | |||
| needs of the HTTP protocol and server push. | needs of the HTTP protocol and server push. | |||
| 1.2. Definitions | 1.2. Conventions and Terminology | |||
| client: The endpoint initiating the HTTP/2.0 session. | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | ||||
| document are to be interpreted as described in RFC 2119 [RFC2119]. | ||||
| connection: A transport-level connection between two endpoints. | All numeric values are in network byte order. Values are unsigned | |||
| unless otherwise indicated. Literal values are provided in decimal | ||||
| or hexadecimal as appropriate. Hexadecimal literals are prefixed | ||||
| with "0x" to distinguish them from decimal literals. | ||||
| endpoint: Either the client or server of a connection. | The following terms are used: | |||
| frame: A header-prefixed sequence of bytes sent over a HTTP/2.0 | client: The endpoint initiating the HTTP/2.0 session. | |||
| session. | ||||
| server: The endpoint which did not initiate the HTTP/2.0 session. | connection: A transport-level connection between two endpoints. | |||
| session: A synonym for a connection. | endpoint: Either the client or server of a connection. | |||
| session error: An error on the HTTP/2.0 session. | frame: The smallest unit of communication, each containing a frame | |||
| header. | ||||
| stream: A bi-directional flow of bytes across a virtual channel | message: A complete sequence of frames. | |||
| receiver: An endpoint that is receiving frames. | ||||
| sender: An endpoint that is transmitting frames. | ||||
| server: The endpoint which did not initiate the HTTP/2.0 session. | ||||
| session: A synonym for a connection. | ||||
| session error: An error on the HTTP/2.0 session. | ||||
| stream: A bi-directional flow of bytes across a virtual channel | ||||
| within a HTTP/2.0 session. | within a HTTP/2.0 session. | |||
| stream error: An error on an individual HTTP/2.0 stream. | stream error: An error on an individual HTTP/2.0 stream. | |||
| 2. Starting HTTP/2.0 | 2. Starting HTTP/2.0 | |||
| Just as HTTP/1.1 does, HTTP/2.0 uses the "http:" and "https:" URI | Just as HTTP/1.1 does, HTTP/2.0 uses the "http:" and "https:" URI | |||
| schemes. An HTTP/2.0-capable client is therefore required to | schemes. An HTTP/2.0-capable client is therefore required to | |||
| discover whether a server (or intermediary) supports HTTP/2.0. | discover whether a server (or intermediary) supports HTTP/2.0. | |||
| Different discovery mechanisms are defined for "http:" and "https:" | Different discovery mechanisms are defined for "http:" and "https:" | |||
| URIs. Discovery for "http:" URIs is described in Section 2.2; | URIs. Discovery for "http:" URIs is described in Section 2.2; | |||
| discovery for "https:" URIs is described in Section 2.3. | discovery for "https:" URIs is described in Section 2.3. | |||
| 2.1. HTTP/2.0 Version Identification | 2.1. HTTP/2.0 Version Identification | |||
| HTTP/2.0 is identified in using the string "HTTP/2.0". This | HTTP/2.0 is identified using the string "HTTP/2.0". This | |||
| identification is used in the HTTP/1.1 Upgrade header, in the TLS-NPN | identification is used in the HTTP/1.1 Upgrade header field, in the | |||
| [TLSNPN] [[TBD]] field and other places where protocol identification | TLS-NPN [TLSNPN] [[anchor4: TBD]] field and other places where | |||
| is required. | protocol identification is required. | |||
| [[Editor's Note: please remove the following text prior to the | Negotiating "HTTP/2.0" implies the use of the transport, security, | |||
| publication of a final version of this document.]] | framing and message semantics described in this document. | |||
| [[anchor5: Editor's Note: please remove the following text prior to | ||||
| the publication of a final version of this document.]] | ||||
| Only implementations of the final, published RFC can identify | Only implementations of the final, published RFC can identify | |||
| themselves as "HTTP/2.0". Until such an RFC exists, implementations | themselves as "HTTP/2.0". Until such an RFC exists, implementations | |||
| MUST NOT identify themselves using "HTTP/2.0". | MUST NOT identify themselves using "HTTP/2.0". | |||
| Examples and text throughout the rest of this document use "HTTP/2.0" | Examples and text throughout the rest of this document use "HTTP/2.0" | |||
| as a matter of editorial convenience only. Implementations of draft | as a matter of editorial convenience only. Implementations of draft | |||
| versions MUST NOT identify using this string. | versions MUST NOT identify using this string. | |||
| Implementations of draft versions of the protocol MUST add the | Implementations of draft versions of the protocol MUST add the string | |||
| corresponding draft number to the identifier before the separator | "-draft-" and the corresponding draft number to the identifier before | |||
| ('/'). For example, draft-ietf-httpbis-http2-03 is identified using | the separator ('/'). For example, draft-ietf-httpbis-http2-03 is | |||
| the string "HTTP-03/2.0". | identified using the string "HTTP-draft-03/2.0". | |||
| Non-compatible experiments that are based on these draft versions | Non-compatible experiments that are based on these draft versions | |||
| MUST include a further identifier. For example, an experimental | MUST instead replace the string "draft" with a different identifier. | |||
| implementation of packet mood-based encoding based on | For example, an experimental implementation of packet mood-based | |||
| draft-ietf-httpbis-http2-07 might identify itself as "HTTP-07- | encoding based on draft-ietf-httpbis-http2-07 might identify itself | |||
| emo/2.0". Note that any label MUST conform with the "token" syntax | as "HTTP-emo-07/2.0". Note that any label MUST conform with the | |||
| defined in Section 3.2.4 of [HTTP-p1]. Experimenters are encouraged | "token" syntax defined in Section 3.2.6 of [HTTP-p1]. Experimenters | |||
| to coordinate their experiments on the ietf-http-wg@w3.org mailing | are encouraged to coordinate their experiments on the | |||
| list. | ietf-http-wg@w3.org mailing list. | |||
| 2.2. Starting HTTP/2.0 for "http:" URIs | 2.2. Starting HTTP/2.0 for "http:" URIs | |||
| A client that makes a request to an "http:" URI without prior | A client that makes a request to an "http:" URI without prior | |||
| knowledge about support for HTTP/2.0 uses the HTTP Upgrade mechanism | knowledge about support for HTTP/2.0 uses the HTTP Upgrade mechanism | |||
| [HTTP-p2]. The client makes an HTTP/1.1 request that includes an | (Section 6.7 of [HTTP-p1]). The client makes an HTTP/1.1 request | |||
| Upgrade header field identifying HTTP/2.0. | that includes an Upgrade header field identifying HTTP/2.0. | |||
| For example: | For example: | |||
| GET /default.htm HTTP/1.1 | GET /default.htm HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Connection: Upgrade | Connection: Upgrade | |||
| Upgrade: HTTP/2.0 | Upgrade: HTTP/2.0 | |||
| A server that does not support HTTP/2.0 can respond to the request as | A server that does not support HTTP/2.0 can respond to the request as | |||
| though the Upgrade header field were absent: | though the Upgrade header field were absent: | |||
| HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
| Content-length: 243 | Content-length: 243 | |||
| Content-type: text/html | Content-type: text/html | |||
| ... | ... | |||
| A server that supports HTTP/2.0 can accept the upgrade with a 101 | A server that supports HTTP/2.0 can accept the upgrade with a 101 | |||
| (Switching Protocols) status code. After the empty line that | (Switching Protocols) status code. After the empty line that | |||
| terminates the 101 response, the server can begin sending HTTP/2.0 | terminates the 101 response, the server can begin sending HTTP/2.0 | |||
| frames. These frames MUST include a response to the request that | frames. These frames MUST include a response to the request that | |||
| initiated the Upgrade. | initiated the Upgrade. | |||
| HTTP/1.1 101 Switching Protocols | HTTP/1.1 101 Switching Protocols | |||
| Connection: Upgrade | Connection: Upgrade | |||
| Upgrade: HTTP/2.0 | Upgrade: HTTP/2.0 | |||
| [ HTTP/2.0 frames ... | [ HTTP/2.0 session ... | |||
| A client can learn that a particular server supports HTTP/2.0 by | Once the server returns the 101 response, both the client and the | |||
| other means. A client MAY immediately send HTTP/2.0 frames to a | server send a session header (Section 3.2). | |||
| server that is known to support HTTP/2.0. [[Open Issue: This is not | ||||
| definite. We may yet choose to perform negotiation for every | ||||
| connection. Reasons include intermediaries; phased upgrade of load- | ||||
| balanced server farms; etc...]] [[Open Issue: We need to enumerate | ||||
| the ways that clients can learn of HTTP/2.0 support.]] | ||||
| 2.3. Starting HTTP/2.0 for "https:" URIs | 2.3. Starting HTTP/2.0 for "https:" URIs | |||
| [[TBD, maybe NPN]] | A client that makes a request to an "https:" URI without prior | |||
| knowledge about support for HTTP/2.0 uses TLS [RFC5246] with TLS-NPN | ||||
| [TLSNPN] extension. [[anchor6: TBD, maybe ALPN]] | ||||
| Once TLS negotiation is complete, both the client and the server send | ||||
| a session header (Section 3.2). | ||||
| 2.4. Starting HTTP/2.0 with Prior Knowledge | ||||
| A client can learn that a particular server supports HTTP/2.0 by | ||||
| other means. A client MAY immediately send HTTP/2.0 frames to a | ||||
| server that is known to support HTTP/2.0. This only affects the | ||||
| resolution of "http:" URIs, servers supporting HTTP/2.0 are required | ||||
| to support protocol negotiation in TLS [TLSNPN]. | ||||
| Prior support for HTTP/2.0 is not a strong signal that a given server | ||||
| will support HTTP/2.0 for future sessions. It is possible for server | ||||
| configurations to change or for configurations to differ between | ||||
| instances in clustered server. Different "transparent" | ||||
| intermediaries - intermediaries that are not explicitly selected by | ||||
| either client or server - are another source of variability. | ||||
| 3. HTTP/2.0 Framing Layer | 3. HTTP/2.0 Framing Layer | |||
| 3.1. Session (Connections) | 3.1. Session | |||
| The HTTP/2.0 framing layer (or "session") runs atop a reliable | The HTTP/2.0 session runs atop TCP ([RFC0793]). The client is the | |||
| transport layer such as TCP [RFC0793]. The client is the TCP | TCP connection initiator. | |||
| connection initiator. HTTP/2.0 connections are persistent | ||||
| connections. | ||||
| For best performance, it is expected that clients will not close open | HTTP/2.0 connections are persistent connections. For best | |||
| performance, it is expected that clients will not close open | ||||
| connections until the user navigates away from all web pages | connections until the user navigates away from all web pages | |||
| referencing a connection, or until the server closes the connection. | referencing a connection, or until the server closes the connection. | |||
| Servers are encouraged to leave connections open for as long as | Servers are encouraged to leave connections open for as long as | |||
| possible, but can terminate idle connections if necessary. When | possible, but can terminate idle connections if necessary. When | |||
| either endpoint closes the transport-level connection, it MUST first | either endpoint closes the transport-level connection, it MUST first | |||
| send a GOAWAY (Section 3.6.6) frame so that the endpoints can | send a GOAWAY (Section 3.7.7) frame so that the endpoints can | |||
| reliably determine if requests finished before the close. | reliably determine if requests finished before the close. | |||
| 3.2. Framing | 3.2. Session Header | |||
| Once the connection is established, clients and servers exchange | ||||
| framed messages. There are two types of frames: control frames | ||||
| (Section 3.2.1) and data frames (Section 3.2.2). Frames always have | ||||
| a common header which is 8 bytes in length. | ||||
| The first bit is a control bit indicating whether a frame is a | After opening a TCP connection and performing either an HTTP/1.1 | |||
| control frame or data frame. Control frames carry a version number, | Upgrade or TLS handshake, the client sends the client session header. | |||
| a frame type, flags, and a length. Data frames contain the stream | The server replies with a server session header. | |||
| ID, flags, and the length for the payload carried after the common | ||||
| header. The simple header is designed to make reading and writing of | ||||
| frames easy. | ||||
| All integer values, including length, version, and type, are in | The session header provides a final confirmation that both peers | |||
| network byte order. HTTP/2.0 does not enforce alignment of types in | agree to use the HTTP/2.0 protocol. The SETTINGS frame ensures that | |||
| dynamically sized frames. | client or server configuration is known as quickly as possible. | |||
| 3.2.1. Control frames | The client session header is the 25 byte sequence | |||
| 0x464f4f202a20485454502f322e300d0a0d0a4241520d0a0d0a (the string "FOO | ||||
| * HTTP/2.0\r\n\r\nBAR\r\n\r\n") followed by a SETTINGS frame | ||||
| (Section 3.7.4). The client sends the client session header | ||||
| immediately after receiving an HTTP/1.1 Upgrade, or after receiving a | ||||
| TLS Finished message from the server. | ||||
| +----------------------------------+ | The client session header is selected so that a large proportion | |||
| |C| Version(15bits) | Type(16bits) | | of HTTP/1.1 or HTTP/1.0 servers and intermediaries do not attempt | |||
| +----------------------------------+ | to process further frames. This doesn't address the concerns | |||
| | Flags (8) | Length (24 bits) | | raised in [TALKING]. | |||
| +----------------------------------+ | ||||
| | Data | | ||||
| +----------------------------------+ | ||||
| Control bit: The 'C' bit is a single bit indicating if this is a | The server session header is a SETTINGS frame (Section 3.7.4). The | |||
| control message. For control frames this value is always 1. | server sends the server session header immediately after receiving | |||
| and validating the client session header. | ||||
| Version: The version number of the HTTP/2.0 protocol. This document | The client sends requests immediately after sending the session | |||
| describes HTTP/2.0 version 3. | header, without waiting to receive a server session header. This | |||
| ensures that confirming session headers does not add latency. | ||||
| Type: The type of control frame. See Control Frames for the complete | Both client and server MUST close the connection if it does not begin | |||
| list of control frames. | with a valid session header. A GOAWAY frame (Section 3.7.7) MAY be | |||
| omitted if it is clear that the peer is not using HTTP/2.0. | ||||
| Flags: Flags related to this frame. Flags for control frames and | 3.3. Framing | |||
| data frames are different. | ||||
| Length: An unsigned 24-bit value representing the number of bytes | Once the connection is established, clients and servers exchange | |||
| after the length field. | HTTP/2.0 frames. Frames are the basic unit of communication. | |||
| Data: data associated with this control frame. The format and length | 3.3.1. Frame Header | |||
| of this data is controlled by the control frame type. | ||||
| Control frame processing requirements: | HTTP/2.0 frames share a common header format. Frames have an 8 byte | |||
| header with between 0 and 65535 bytes of data. | ||||
| Note that full length control frames (16MB) can be large for | 0 1 2 3 | |||
| implementations running on resource-limited hardware. In such | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| cases, implementations MAY limit the maximum length frame | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| supported. However, all implementations MUST be able to receive | | Length (16) | Type (8) | Flags (8) | | |||
| control frames of at least 8192 octets in length. | +-+-------------+---------------+-------------------------------+ | |||
| |R| Stream Identifier (31) | | ||||
| +-+-------------------------------------------------------------+ | ||||
| | Frame Data (0...) ... | ||||
| +---------------------------------------------------------------+ | ||||
| 3.2.2. Data frames | Frame Header | |||
| +----------------------------------+ | The fields of the frame header are defined as: | |||
| |C| Stream-ID (31bits) | | ||||
| +----------------------------------+ | ||||
| | Flags (8) | Length (24 bits) | | ||||
| +----------------------------------+ | ||||
| | Data | | ||||
| +----------------------------------+ | ||||
| Control bit: For data frames this value is always 0. | Length: The 16-bit length of the frame payload in bytes. The length | |||
| of the frame header is not included in this sum. | ||||
| Stream-ID: A 31-bit value identifying the stream. | Type: The 8-bit type of the frame. The frame type determines how | |||
| the remainder of the frame header and payload are interpreted. | ||||
| Implementations MUST ignore frames that use types that they do not | ||||
| support. | ||||
| Flags: Flags related to this frame. Valid flags are: | Flags: An 8-bit field reserved for flags. Bits that have undefined | |||
| semantics are reserved. The following flags are defined for all | ||||
| frame types: | ||||
| 0x01 = FLAG_FIN - signifies that this frame represents the last | FINAL (0x1): Bit 1 (the least significant bit) indicates that | |||
| frame to be transmitted on this stream. See Stream Close | this is the last frame in a stream. This places the stream | |||
| (Section 3.3.7) below. | into a half-closed state (Section 3.4.5). No further frames | |||
| follow in the direction of the carrying frame. | ||||
| 0x02 = FLAG_COMPRESS - indicates that the data in this frame has | Frame types can define semantics for frame-specific flags. | |||
| been compressed. | ||||
| Length: An unsigned 24-bit value representing the number of bytes | R: A reserved 1-bit field. The semantics of this bit are not | |||
| after the length field. The total size of a data frame is 8 bytes + | defined. | |||
| length. It is valid to have a zero-length data frame. | ||||
| Data: The variable-length data payload; the length was defined in the | Stream Identifier: A 31-bit stream identifier (see Section 3.4.1). | |||
| length field. | A value 0 is reserved for frames that are directed at the session | |||
| as a whole instead of a single stream. | ||||
| Data frame processing requirements: | Frame Data: Frames contain between 0 and 65535 bytes of data. | |||
| If an endpoint receives a data frame for a stream-id which is not | Reserved bits in the frame header MUST be set to zero when sending | |||
| open and the endpoint has not sent a GOAWAY (Section 3.6.6) frame, | and MUST be ignored when receiving frames, unless the semantics of | |||
| it MUST send issue a stream error (Section 3.4.2) with the error | the bit are known. | |||
| code INVALID_STREAM for the stream-id. | ||||
| If the endpoint which created the stream receives a data frame | 3.3.2. Frame Processing | |||
| before receiving a SYN_REPLY on that stream, it is a protocol | ||||
| error, and the recipient MUST issue a stream error (Section 3.4.2) | ||||
| with the status code PROTOCOL_ERROR for the stream-id. | ||||
| Implementors note: If an endpoint receives multiple data frames | A frame of the maximum size might be too large for implementations | |||
| for invalid stream-ids, it MAY close the session. | with limited resources to process. Implementations MAY choose to | |||
| support frames smaller than the maximum possible size. However, | ||||
| implementations MUST be able to receive frames containing at least | ||||
| 8192 octets of payload. | ||||
| All HTTP/2.0 endpoints MUST accept compressed data frames. | An implementation MUST immediately close a stream if it is unable to | |||
| Compression of data frames is always done using zlib compression. | process a frame related to that stream due to it exceeding a size | |||
| Each stream initializes and uses its own compression context | limit. The implementation MUST send a RST_STREAM frame | |||
| dedicated to use within that stream. Endpoints are encouraged to | (Section 3.7.3) containing FRAME_TOO_LARGE error code if the frame | |||
| use application level compression rather than HTTP/2.0 stream | size limit is exceeded. | |||
| level compression. | ||||
| Each HTTP/2.0 stream sending compressed frames creates its own | [[anchor9: <https://github.com/http2/http2-spec/issues/28>: Need a | |||
| zlib context for that stream, and these compression contexts MUST | way to signal the maximum frame size; no way to RST_STREAM on non- | |||
| be distinct from the compression contexts used with SYN_STREAM/ | stream-related frames.]] | |||
| SYN_REPLY/HEADER compression. (Thus, if both endpoints of a | ||||
| stream are compressing data on the stream, there will be two zlib | ||||
| contexts, one for sending and one for receiving). | ||||
| 3.3. Streams | 3.4. Streams | |||
| Streams are independent sequences of bi-directional data divided into | Streams are independent sequences of bi-directional data divided into | |||
| frames with several properties: | frames with several properties: | |||
| Streams may be created by either the client or server. | o Streams can be created by either the client or server. | |||
| Streams optionally carry a set of name/value header pairs. | ||||
| Streams can concurrently send data interleaved with other streams. | ||||
| Streams may be cancelled. | ||||
| 3.3.1. Stream frames | ||||
| HTTP/2.0 defines 3 control frames to manage the lifecycle of a | ||||
| stream: | ||||
| SYN_STREAM - Open a new stream | ||||
| SYN_REPLY - Remote acknowledgement of a new, open stream | ||||
| RST_STREAM - Close a stream | ||||
| 3.3.2. Stream creation | o Streams optionally carry a set of name-value header pairs. | |||
| A stream is created by sending a control frame with the type set to | o Streams can concurrently send data interleaved with other streams. | |||
| SYN_STREAM (Section 3.6.1). If the server is initiating the stream, | ||||
| the Stream-ID must be even. If the client is initiating the stream, | ||||
| the Stream-ID must be odd. 0 is not a valid Stream-ID. Stream-IDs | ||||
| from each side of the connection must increase monotonically as new | ||||
| streams are created. E.g. Stream 2 may be created after stream 3, | ||||
| but stream 7 must not be created after stream 9. Stream IDs do not | ||||
| wrap: when a client or server cannot create a new stream id without | ||||
| exceeding a 31 bit value, it MUST NOT create a new stream. | ||||
| The stream-id MUST increase with each new stream. If an endpoint | o Streams can be established and used unilaterally. | |||
| receives a SYN_STREAM with a stream id which is less than any | ||||
| previously received SYN_STREAM, it MUST issue a session error | ||||
| (Section 3.4.1) with the status PROTOCOL_ERROR. | ||||
| It is a protocol error to send two SYN_STREAMs with the same | o Streams can be cancelled. | |||
| stream-id. If a recipient receives a second SYN_STREAM for the same | ||||
| stream, it MUST issue a stream error (Section 3.4.2) with the status | ||||
| code PROTOCOL_ERROR. | ||||
| Upon receipt of a SYN_STREAM, the recipient can reject the stream by | 3.4.1. Stream Creation | |||
| sending a stream error (Section 3.4.2) with the error code | ||||
| REFUSED_STREAM. Note, however, that the creating endpoint may have | ||||
| already sent additional frames for that stream which cannot be | ||||
| immediately stopped. | ||||
| Once the stream is created, the creator may immediately send HEADERS | Use of streams does not require negotiation. A stream is not | |||
| or DATA frames for that stream, without needing to wait for the | created, streams are used by sending a frame on the stream. | |||
| recipient to acknowledge. | ||||
| 3.3.2.1. Unidirectional streams | Streams are identified by a 31-bit numeric identifier. Streams | |||
| initiated by a client use odd numbered stream identifiers. Streams | ||||
| initiated by the server use odd numbered stream identifiers. A | ||||
| stream identifier of zero MUST NOT be used to create a new stream. | ||||
| When an endpoint creates a stream with the FLAG_UNIDIRECTIONAL flag | The stream identifier of a new stream MUST be greater than all other | |||
| set, it creates a unidirectional stream which the creating endpoint | streams from that endpoint, unless the stream identifier was | |||
| can use to send frames, but the receiving endpoint cannot. The | previously reserved (such as the promised stream identifier in a | |||
| receiving endpoint is implicitly already in the half-closed | PUSH_PROMISE (Section 3.7.5) frame). An endpoint that receives an | |||
| (Section 3.3.6) state. | unexpected stream identifier MUST treat this as a session error | |||
| (Section 3.5.1) of type PROTOCOL_ERROR. | ||||
| 3.3.2.2. Bidirectional streams | A long-lived session can result in available stream identifiers being | |||
| exhausted. An endpoint that is unable to create a new stream | ||||
| identifier can establish a new session for any new streams. | ||||
| SYN_STREAM frames which do not use the FLAG_UNIDIRECTIONAL flag are | An endpoint cannot prevent the creation of a new stream, but it can | |||
| bidirectional streams. Both endpoints can send data on a bi- | request the early termination of an unwanted stream. Upon receipt of | |||
| directional stream. | a frame, the recipient can terminate the corresponding stream by | |||
| sending a stream error (Section 3.5.2) of type REFUSED_STREAM. This | ||||
| cannot prevent the initiating endpoint from sending frames for that | ||||
| stream prior to receiving this request. | ||||
| 3.3.3. Stream priority | 3.4.2. Stream priority | |||
| The creator of a stream assigns a priority for that stream. Priority | The creator of a stream assigns a priority for that stream. Priority | |||
| is represented as an integer from 0 to 7. 0 represents the highest | is represented as a 31 bit integer. 0 represents the highest priority | |||
| priority and 7 represents the lowest priority. | and 2^31-1 represents the lowest priority. | |||
| The sender and recipient SHOULD use best-effort to process streams in | The sender and recipient SHOULD use best-effort to process streams in | |||
| the order of highest priority to lowest priority. | the order of highest priority to lowest priority. [[anchor11: ED: | |||
| toothless, useless "SHOULD": reword]] | ||||
| 3.3.4. Stream headers | 3.4.3. Stream headers | |||
| Streams carry optional sets of name/value pair headers which carry | Streams carry optional sets of header fields which carry metadata | |||
| metadata about the stream. After the stream has been created, and as | about the stream. After the stream has been created, and as long as | |||
| long as the sender is not closed (Section 3.3.7) or half-closed | the sender is not closed (Section 3.4.6) or half-closed | |||
| (Section 3.3.6), each side may send HEADERS frame(s) containing the | (Section 3.4.5), each side may send HEADERS frame(s) containing the | |||
| header data. Header data can be sent in multiple HEADERS frames, and | header data. Header data can be sent in multiple HEADERS frames, and | |||
| HEADERS frames may be interleaved with data frames. | HEADERS frames may be interleaved with data frames. | |||
| 3.3.5. Stream data exchange | 3.4.4. Stream data exchange | |||
| Once a stream is created, it can be used to send arbitrary amounts of | Once a stream is created, it can be used to send arbitrary amounts of | |||
| data. Generally this means that a series of data frames will be sent | data. Generally this means that a series of data frames will be sent | |||
| on the stream until a frame containing the FLAG_FIN flag is set. The | on the stream until a frame containing the FINAL flag (Section 3.3.1) | |||
| FLAG_FIN can be set on a SYN_STREAM (Section 3.6.1), SYN_REPLY | is set. Once the FINAL flag has been set on any frame, the stream is | |||
| (Section 3.6.2), HEADERS (Section 3.6.7) or a DATA (Section 3.2.2) | considered to be half-closed. | |||
| frame. Once the FLAG_FIN has been sent, the stream is considered to | ||||
| be half-closed. | ||||
| 3.3.6. Stream half-close | 3.4.5. Stream half-close | |||
| When one side of the stream sends a frame with the FLAG_FIN flag set, | When one side of the stream sends a frame with the FINAL flag set, | |||
| the stream is half-closed from that endpoint. The sender of the | the stream is half-closed from that endpoint. The sender of the | |||
| FLAG_FIN MUST NOT send further frames on that stream. When both | FINAL flag MUST NOT send further frames on that stream. When both | |||
| sides have half-closed, the stream is closed. | sides have half-closed, the stream is closed. | |||
| If an endpoint receives a data frame after the stream is half-closed | An endpoint MUST treat the receipt of a data frame on a half-closed | |||
| from the sender (e.g. the endpoint has already received a prior frame | stream as a stream error (Section 3.5.2) of type STREAM_CLOSED. | |||
| for the stream with the FIN flag set), it MUST send a RST_STREAM to | ||||
| the sender with the status STREAM_ALREADY_CLOSED. | ||||
| 3.3.7. Stream close | Streams that have never received packets can be considered to be | |||
| half-closed in the direction that is silent. This allows either peer | ||||
| to create a unidirectional stream, which does not require an explicit | ||||
| close from the peer that does not transmit frames. | ||||
| There are 3 ways that streams can be terminated: | 3.4.6. Stream close | |||
| Normal termination: Normal stream termination occurs when both | Streams can be terminated in the following ways: | |||
| Normal termination: Normal stream termination occurs when both | ||||
| sender and recipient have half-closed the stream by sending a | sender and recipient have half-closed the stream by sending a | |||
| FLAG_FIN. | frame containing a FINAL flag (Section 3.3.1). | |||
| Abrupt termination: Either the client or server can send a | Half-close on unidirectional stream: A stream that only has frames | |||
| RST_STREAM control frame at any time. A RST_STREAM contains an | sent in one direction can be tentatively considered to be closed | |||
| error code to indicate the reason for failure. When a RST_STREAM | once a frame containing a FINAL flag is sent. The active sender | |||
| is sent from the stream originator, it indicates a failure to | on the stream MUST be prepared to receive frames after closing the | |||
| complete the stream and that no further data will be sent on the | stream. | |||
| stream. When a RST_STREAM is sent from the stream recipient, the | ||||
| sender, upon receipt, should stop sending any data on the stream. | ||||
| The stream recipient should be aware that there is a race between | ||||
| data already in transit from the sender and the time the | ||||
| RST_STREAM is received. See Stream Error Handling (Section 3.4.2) | ||||
| TCP connection teardown: If the TCP connection is torn down while | Abrupt termination: Either the peer can send a RST_STREAM control | |||
| frame at any time to terminate an active stream. RST_STREAM | ||||
| contains an error code to indicate the reason for termination. A | ||||
| RST_STREAM indicates that the sender will transmit no further data | ||||
| on the stream and that the receiver is requested to cease | ||||
| transmission. | ||||
| The sender of a RST_STREAM frame MUST allow for frames that have | ||||
| already been sent by the peer prior to the RST_STREAM being | ||||
| processed. If in-transit frames alter session state, these frames | ||||
| cannot be safely discarded. See Stream Error Handling | ||||
| (Section 3.5.2) for more details. | ||||
| TCP connection teardown: If the TCP connection is torn down while | ||||
| un-closed streams exist, then the endpoint must assume that the | un-closed streams exist, then the endpoint must assume that the | |||
| stream was abnormally interrupted and may be incomplete. | stream was abnormally interrupted and may be incomplete. | |||
| If an endpoint receives a data frame after the stream is closed, it | If an endpoint receives a data frame after the stream is closed, it | |||
| must send a RST_STREAM to the sender with the status PROTOCOL_ERROR. | MAY send a RST_STREAM to the sender with the status PROTOCOL_ERROR. | |||
| 3.4. Error Handling | 3.5. Error Handling | |||
| The HTTP/2.0 framing layer has only two types of errors, and they are | HTTP/2.0 framing permits two classes of error: | |||
| always handled consistently. Any reference in this specification to | ||||
| "issue a session error" refers to Section 3.4.1. Any reference to | ||||
| "issue a stream error" refers to Section 3.4.2. | ||||
| 3.4.1. Session Error Handling | o An error condition that renders the entire session unusable is a | |||
| session error. | ||||
| o An error in an individual stream is a stream error. | ||||
| 3.5.1. Session Error Handling | ||||
| A session error is any error which prevents further processing of the | A session error is any error which prevents further processing of the | |||
| framing layer or which corrupts the session compression state. When | framing layer or which corrupts any session state. | |||
| a session error occurs, the endpoint encountering the error MUST | ||||
| first send a GOAWAY (Section 3.6.6) frame with the stream id of most | ||||
| recently received stream from the remote endpoint, and the error code | ||||
| for why the session is terminating. After sending the GOAWAY frame, | ||||
| the endpoint MUST close the TCP connection. | ||||
| Note that the session compression state is dependent upon both | An endpoint that encounters a session error MUST first send a GOAWAY | |||
| endpoints always processing all compressed data. If an endpoint | (Section 3.7.7) frame with the stream identifier of the last stream | |||
| partially processes a frame containing compressed data without | that it successfully received from its peer. The GOAWAY frame | |||
| updating compression state properly, future control frames which use | includes an error code that indicates why the session is terminating. | |||
| compression will be always be errored. Implementations SHOULD always | After sending the GOAWAY frame, the endpoint MUST close the TCP | |||
| try to process compressed data so that errors which could be handled | connection. | |||
| as stream errors do not become session errors. | ||||
| Note that because this GOAWAY is sent during a session error case, it | It is possible that the GOAWAY will not be reliably received by the | |||
| is possible that the GOAWAY will not be reliably received by the | receiving endpoint. In the event of a session error, GOAWAY only | |||
| receiving endpoint. It is a best-effort attempt to communicate with | provides a best-effort attempt to communicate with the peer about why | |||
| the remote about why the session is going down. | the session is going down. | |||
| 3.4.2. Stream Error Handling | An endpoint can end a session at any time. In particular, an | |||
| endpoint MAY choose to treat a stream error as a session error if the | ||||
| error is recurrent. Endpoints SHOULD send a GOAWAY frame when ending | ||||
| a session, as long as circumstances permit it. | ||||
| A stream error is an error related to a specific stream-id which does | 3.5.2. Stream Error Handling | |||
| not affect processing of other streams at the framing layer. Upon a | ||||
| stream error, the endpoint MUST send a RST_STREAM (Section 3.6.3) | ||||
| frame which contains the stream id of the stream where the error | ||||
| occurred and the error status which caused the error. After sending | ||||
| the RST_STREAM, the stream is closed to the sending endpoint. After | ||||
| sending the RST_STREAM, if the sender receives any frames other than | ||||
| a RST_STREAM for that stream id, it will result in sending additional | ||||
| RST_STREAM frames. An endpoint MUST NOT send a RST_STREAM in | ||||
| response to an RST_STREAM, as doing so would lead to RST_STREAM | ||||
| loops. Sending a RST_STREAM does not cause the HTTP/2.0 session to | ||||
| be closed. | ||||
| If an endpoint has multiple RST_STREAM frames to send in succession | A stream error is an error related to a specific stream identifier | |||
| for the same stream-id and the same error code, it MAY coalesce them | that does not affect processing of other streams at the framing | |||
| into a single RST_STREAM frame. (This can happen if a stream is | layer. | |||
| closed, but the remote sends multiple data frames. There is no | ||||
| reason to send a RST_STREAM for each frame in succession). | ||||
| 3.5. Stream Flow Control | An endpoint that detects a stream error sends a RST_STREAM | |||
| (Section 3.7.3) frame that contains the stream identifier of the | ||||
| stream where the error occurred. The RST_STREAM frame includes an | ||||
| error code that indicates the type of error. | ||||
| A RST_STREAM is the last frame that an endpoint can send on a stream. | ||||
| The peer that sends the RST_STREAM frame MUST be prepared to receive | ||||
| any frames that were sent or enqueued for sending by the remote peer. | ||||
| These frames can be ignored, except where they modify session state | ||||
| (such as the header compression state). | ||||
| An endpoint SHOULD NOT send more than one RST_STREAM frame for any | ||||
| stream. An endpoint MAY send additional RST_STREAM frames if it | ||||
| receives frames on a closed stream after more than a round trip time. | ||||
| This behaviour is permitted to deal with misbehaving implementations | ||||
| where treating this as a session error is inappropriate. | ||||
| An endpoint MUST NOT send a RST_STREAM in response to an RST_STREAM | ||||
| frame. This could trigger infinite loops of RST_STREAM frames. | ||||
| 3.5.3. Error Codes | ||||
| Error codes are 32-bit fields that are used in RST_STREAM and GOAWAY | ||||
| frames to convey the reasons for the stream or session error. | ||||
| Error codes share a common code space. Some error codes only apply | ||||
| to specific conditions and have no defined semantics in certain frame | ||||
| types. | ||||
| The following error codes are defined: | ||||
| NO_ERROR (0): The associated condition is not as a result of an | ||||
| error. For example, a GOAWAY might include this code to indicate | ||||
| graceful shutdown of a session. | ||||
| PROTOCOL_ERROR (1): An unspecific protocol error was detected. This | ||||
| error is for use when a more specific error code is not available. | ||||
| INTERNAL_ERROR (2): The implementation encountered an unexpected | ||||
| internal error. | ||||
| FLOW_CONTROL_ERROR (3): The endpoint detected that its peer violated | ||||
| the flow control protocol. | ||||
| INVALID_STREAM (4): A frame was received for an inactive stream. | ||||
| STREAM_CLOSED (5): The endpoint received a frame after a stream was | ||||
| half-closed. | ||||
| FRAME_TOO_LARGE (6): The endpoint received a frame that was larger | ||||
| than the maximum size that it supports. | ||||
| REFUSED_STREAM (7): Indicates that the stream was refused before any | ||||
| processing has been done on the stream. | ||||
| CANCEL (8): Used by the creator of a stream to indicate that the | ||||
| stream is no longer needed. | ||||
| 3.6. Stream Flow Control | ||||
| Multiplexing streams introduces contention for access to the shared | Multiplexing streams introduces contention for access to the shared | |||
| TCP connection. Stream contention can result in streams being | TCP connection. Stream contention can result in streams being | |||
| blocked by other streams. A flow control scheme ensures that streams | blocked by other streams. A flow control scheme ensures that streams | |||
| do not destructively interfere with other streams on the same TCP | do not destructively interfere with other streams on the same TCP | |||
| connection. | connection. | |||
| 3.5.1. Flow Control Principles | 3.6.1. Flow Control Principles | |||
| Experience with TCP congestion control has shown that algorithms can | Experience with TCP congestion control has shown that algorithms can | |||
| evolve over time to become more sophisticated without requiring | evolve over time to become more sophisticated without requiring | |||
| protocol changes. TCP congestion control and its evolution is | protocol changes. TCP congestion control and its evolution is | |||
| clearly different from HTTP/2.0 flow control, though the evolution of | clearly different from HTTP/2.0 flow control, though the evolution of | |||
| TCP congestion control algorithms shows that a similar approach could | TCP congestion control algorithms shows that a similar approach could | |||
| be feasible for HTTP/2.0 flow control. | be feasible for HTTP/2.0 flow control. | |||
| HTTP/2.0 stream flow control aims to allow for future improvements to | HTTP/2.0 stream flow control aims to allow for future improvements to | |||
| flow control algorithms without requiring protocol changes. The | flow control algorithms without requiring protocol changes. Flow | |||
| following principles guide the HTTP/2.0 design: | control in HTTP/2.0 has the following characteristics: | |||
| 1. Flow control is hop-by-hop, not end-to-end. | 1. Flow control is hop-by-hop, not end-to-end. | |||
| 2. Flow control is based on window update messages. Receivers | 2. Flow control is based on window update messages. Receivers | |||
| advertise how many octets they are prepared to receive on a | advertise how many octets they are prepared to receive on a | |||
| stream. This is a credit-based scheme. | stream. This is a credit-based scheme. | |||
| 3. Flow control is directional with overall control provided by the | 3. Flow control is directional with overall control provided by the | |||
| receiver. A receiver MAY choose to set any window size that it | receiver. A receiver MAY choose to set any window size that it | |||
| desires for each stream [[TBD: ... and for the overall | desires for each stream and for the entire connection. A sender | |||
| connection]]. A sender MUST respect flow control limits imposed | MUST respect flow control limits imposed by a receiver. Clients, | |||
| by a receiver. Clients, servers and intermediaries all | servers and intermediaries all independently advertise their flow | |||
| independently advertise their flow control preferences as a | control preferences as a receiver and abide by the flow control | |||
| receiver and abide by the flow control limits set by their peer | limits set by their peer when sending. | |||
| when sending. | ||||
| 4. Flow control can be disabled by a receiver. A receiver can | 4. The initial value for the flow control window is 65536 bytes for | |||
| choose to either disable flow control, or to declare an infinite | both new streams and the overall connection. | |||
| flow control limit. [[TBD: determine whether just one mechanism | ||||
| is sufficient, and then which alternative]] | ||||
| 5. HTTP/2.0 standardizes only the format of the window update | 5. The frame type determines whether flow control applies to a | |||
| message (Section 3.6.8). This does not stipulate how a receiver | frame. Of the frames specified in this document, only data | |||
| frames are subject to flow control; all other frame types do not | ||||
| consume space in the advertised flow control window. This | ||||
| ensures that important control frames are not blocked by flow | ||||
| control. | ||||
| 6. Flow control can be disabled by a receiver. A receiver can | ||||
| choose to either disable flow control for a stream or connection | ||||
| by declaring an infinite flow control limit. | ||||
| 7. HTTP/2.0 standardizes only the format of the window update | ||||
| message (Section 3.7.9). This does not stipulate how a receiver | ||||
| decides when to send this message or the value that it sends. | decides when to send this message or the value that it sends. | |||
| Nor does it specify how a sender chooses to send packets. | Nor does it specify how a sender chooses to send packets. | |||
| Implementations are able to select any algorithm that suits their | Implementations are able to select any algorithm that suits their | |||
| needs. An example flow control algorithm is described in | needs. | |||
| Section 3.5.2. | ||||
| Implementations are also responsible for managing how requests and | Implementations are also responsible for managing how requests and | |||
| responses are sent based on priority; choosing how to avoid head of | responses are sent based on priority; choosing how to avoid head of | |||
| line blocking for requests; and managing the creation of new streams. | line blocking for requests; and managing the creation of new streams. | |||
| Algorithm choices for these could interact with any flow control | Algorithm choices for these could interact with any flow control | |||
| algorithm. | algorithm. | |||
| 3.5.2. Basic Flow Control Algorithm | 3.6.2. Appropriate Use of Flow Control | |||
| This section describes a basic flow control algorithm. This | ||||
| algorithm is provided as an example, implementations can use any | ||||
| algorithm that complies with flow control requirements. | ||||
| [[Algorithm TBD]] | ||||
| 3.6. Control frame types | ||||
| 3.6.1. SYN_STREAM | ||||
| The SYN_STREAM control frame allows the sender to asynchronously | ||||
| create a stream between the endpoints. See Stream Creation | ||||
| (Section 3.3.2) | ||||
| +------------------------------------+ | ||||
| |1| version | 1 | | ||||
| +------------------------------------+ | ||||
| | Flags (8) | Length (24 bits) | | ||||
| +------------------------------------+ | ||||
| |X| Stream-ID (31bits) | | ||||
| +------------------------------------+ | ||||
| |X| Associated-To-Stream-ID (31bits) | | ||||
| +------------------------------------+ | ||||
| | Pri|Unused | Slot | | | ||||
| +-------------------+ | | ||||
| | Number of Name/Value pairs (int32) | <+ | ||||
| +------------------------------------+ | | ||||
| | Length of name (int32) | | This section is the | ||||
| +------------------------------------+ | "Name/Value Header | ||||
| | Name (string) | | Block", and is | ||||
| +------------------------------------+ | compressed. | ||||
| | Length of value (int32) | | | ||||
| +------------------------------------+ | | ||||
| | Value (string) | | | ||||
| +------------------------------------+ | | ||||
| | (repeats) | <+ | ||||
| Flags: Flags related to this frame. Valid flags are: | ||||
| 0x01 = FLAG_FIN - marks this frame as the last frame to be | ||||
| transmitted on this stream and puts the sender in the half-closed | ||||
| (Section 3.3.6) state. | ||||
| 0x02 = FLAG_UNIDIRECTIONAL - a stream created with this flag puts | ||||
| the recipient in the half-closed (Section 3.3.6) state. | ||||
| Length: The length is the number of bytes which follow the length | ||||
| field in the frame. For SYN_STREAM frames, this is 10 bytes plus the | ||||
| length of the compressed Name/Value block. | ||||
| Stream-ID: The 31-bit identifier for this stream. This stream-id | ||||
| will be used in frames which are part of this stream. | ||||
| Associated-To-Stream-ID: The 31-bit identifier for a stream which | ||||
| this stream is associated to. If this stream is independent of all | ||||
| other streams, it should be 0. | ||||
| Priority: A 3-bit priority (Section 3.3.3) field. | ||||
| Unused: 5 bits of unused space, reserved for future use. | ||||
| Slot: An 8 bit unsigned integer specifying the index in the server's | ||||
| CREDENTIAL vector of the client certificate to be used for this | ||||
| request. see CREDENTIAL frame (Section 3.6.9). The value 0 means no | ||||
| client certificate should be associated with this stream. | ||||
| Name/Value Header Block: A set of name/value pairs carried as part of | ||||
| the SYN_STREAM. see Name/Value Header Block (Section 3.6.10). | ||||
| If an endpoint receives a SYN_STREAM which is larger than the | ||||
| implementation supports, it MAY send a RST_STREAM with error code | ||||
| FRAME_TOO_LARGE. All implementations MUST support the minimum size | ||||
| limits defined in the Control Frames section (Section 3.2.1). | ||||
| 3.6.2. SYN_REPLY | ||||
| SYN_REPLY indicates the acceptance of a stream creation by the | ||||
| recipient of a SYN_STREAM frame. | ||||
| +------------------------------------+ | ||||
| |1| version | 2 | | ||||
| +------------------------------------+ | ||||
| | Flags (8) | Length (24 bits) | | ||||
| +------------------------------------+ | ||||
| |X| Stream-ID (31bits) | | ||||
| +------------------------------------+ | ||||
| | Number of Name/Value pairs (int32) | <+ | ||||
| +------------------------------------+ | | ||||
| | Length of name (int32) | | This section is the | ||||
| +------------------------------------+ | "Name/Value Header | ||||
| | Name (string) | | Block", and is | ||||
| +------------------------------------+ | compressed. | ||||
| | Length of value (int32) | | | ||||
| +------------------------------------+ | | ||||
| | Value (string) | | | ||||
| +------------------------------------+ | | ||||
| | (repeats) | <+ | ||||
| Flags: Flags related to this frame. Valid flags are: | ||||
| 0x01 = FLAG_FIN - marks this frame as the last frame to be | ||||
| transmitted on this stream and puts the sender in the half-closed | ||||
| (Section 3.3.6) state. | ||||
| Length: The length is the number of bytes which follow the length | Flow control is defined to protect deployments (client, server or | |||
| field in the frame. For SYN_REPLY frames, this is 4 bytes plus the | intermediary) that are operating under constraints. For example, a | |||
| length of the compressed Name/Value block. | proxy must share memory between many connections. Flow control | |||
| addresses cases where the receiver is unable process data on one | ||||
| stream, yet wants to be continue to process other streams. | ||||
| Stream-ID: The 31-bit identifier for this stream. | Deployments that do not rely on this capability SHOULD disable flow | |||
| control for data that is being received. Note that flow control | ||||
| cannot be disabled for sending. Sending data is always subject to | ||||
| the flow control window advertised by the receiver. | ||||
| If an endpoint receives multiple SYN_REPLY frames for the same active | Deployments with constrained resources (for example, memory), MAY | |||
| stream ID, it MUST issue a stream error (Section 3.4.2) with the | employ flow control to limit the amount of memory a peer can consume. | |||
| error code STREAM_IN_USE. | This can lead to suboptimal use of available network resources if | |||
| flow control is enabled without knowledge of the bandwidth-delay | ||||
| product (see [RFC1323]). | ||||
| Name/Value Header Block: A set of name/value pairs carried as part of | Implementation of flow control in full awareness of the current | |||
| the SYN_STREAM. see Name/Value Header Block (Section 3.6.10). | bandwidth-delay product is difficult, but it can ensure that | |||
| constrained resources are protected without any reduction in | ||||
| connection utilization. | ||||
| If an endpoint receives a SYN_REPLY which is larger than the | 3.7. Frame Types | |||
| implementation supports, it MAY send a RST_STREAM with error code | ||||
| FRAME_TOO_LARGE. All implementations MUST support the minimum size | ||||
| limits defined in the Control Frames section (Section 3.2.1). | ||||
| 3.6.3. RST_STREAM | 3.7.1. DATA Frames | |||
| The RST_STREAM frame allows for abnormal termination of a stream. | DATA frames (type=0) are used to convey HTTP message bodies. The | |||
| When sent by the creator of a stream, it indicates the creator wishes | payload of a data frame contains either a request or response body. | |||
| to cancel the stream. When sent by the recipient of a stream, it | ||||
| indicates an error or that the recipient did not want to accept the | ||||
| stream, so the stream should be closed. | ||||
| +----------------------------------+ | No frame-specific flags are defined for DATA frames. | |||
| |1| version | 3 | | ||||
| +----------------------------------+ | ||||
| | Flags (8) | 8 | | ||||
| +----------------------------------+ | ||||
| |X| Stream-ID (31bits) | | ||||
| +----------------------------------+ | ||||
| | Status code | | ||||
| +----------------------------------+ | ||||
| Flags: Flags related to this frame. RST_STREAM does not define any | 3.7.2. HEADERS+PRIORITY | |||
| flags. This value must be 0. | ||||
| Length: An unsigned 24-bit value representing the number of bytes | The HEADERS+PRIORITY frame (type=1) allows the sender to set header | |||
| after the length field. For RST_STREAM control frames, this value is | fields and stream priority at the same time. This MUST be used for | |||
| always 8. | each stream that is created. | |||
| Stream-ID: The 31-bit identifier for this stream. | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |X| Priority (31) | | ||||
| +-+-------------------------------------------------------------+ | ||||
| | Header Block (*) ... | ||||
| +---------------------------------------------------------------+ | ||||
| Status code: (32 bits) An indicator for why the stream is being | HEADERS+PRIORITY Frame Payload | |||
| terminated.The following status codes are defined: | ||||
| 1 - PROTOCOL_ERROR. This is a generic error, and should only be | The HEADERS+PRIORITY frame is identical to the HEADERS frame | |||
| used if a more specific error is not available. | (Section 3.7.8), with a 32-bit field containing priority included | |||
| before the header block. | ||||
| 2 - INVALID_STREAM. This is returned when a frame is received for | The most significant bit of the priority is reserved. The 31-bit | |||
| a stream which is not active. | priority indicates the priority for the stream, as assigned by the | |||
| sender, see Section 3.4.2. | ||||
| 3 - REFUSED_STREAM. Indicates that the stream was refused before | 3.7.3. RST_STREAM | |||
| any processing has been done on the stream. | ||||
| 4 - UNSUPPORTED_VERSION. Indicates that the recipient of a stream | The RST_STREAM frame (type=3) allows for abnormal termination of a | |||
| does not support the HTTP/2.0 version requested. | stream. When sent by the creator of a stream, it indicates the | |||
| creator wishes to cancel the stream. When sent by the recipient of a | ||||
| stream, it indicates an error or that the recipient did not want to | ||||
| accept the stream, so the stream should be closed. | ||||
| 5 - CANCEL. Used by the creator of a stream to indicate that the | 0 1 2 3 | |||
| stream is no longer needed. | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| | Error Code (32) | | ||||
| +---------------------------------------------------------------+ | ||||
| 6 - INTERNAL_ERROR. This is a generic error which can be used | RST_STREAM Frame Payload | |||
| when the implementation has internally failed, not due to anything | ||||
| in the protocol. | ||||
| 7 - FLOW_CONTROL_ERROR. The endpoint detected that its peer | The RST_STREAM frame does not define any valid flags. | |||
| violated the flow control protocol. | ||||
| 8 - STREAM_IN_USE. The endpoint received a SYN_REPLY for a stream | The RST_STREAM frame contains a single 32-bit error code | |||
| already open. | (Section 3.5.3). The error code indicates why the stream is being | |||
| terminated. | ||||
| 9 - STREAM_ALREADY_CLOSED. The endpoint received a data or | After receiving a RST_STREAM on a stream, the recipient must not send | |||
| SYN_REPLY frame for a stream which is half closed. | additional frames for that stream, and the stream moves into the | |||
| closed state. | ||||
| 10 - INVALID_CREDENTIALS. The server received a request for a | 3.7.4. SETTINGS | |||
| resource whose origin does not have valid credentials in the | ||||
| client certificate vector. | ||||
| 11 - FRAME_TOO_LARGE. The endpoint received a frame which this | A SETTINGS frame (type=4) contains a set of id/value pairs for | |||
| implementation could not support. If FRAME_TOO_LARGE is sent for | communicating configuration data about how the two endpoints may | |||
| a SYN_STREAM, HEADERS, or SYN_REPLY frame without fully processing | communicate. SETTINGS frames MUST be sent at the start of a session, | |||
| the compressed portion of those frames, then the compression state | but they can be sent at any other time by either endpoint. Settings | |||
| will be out-of-sync with the other endpoint. In this case, | are declarative, not negotiated, each peer indicates their own | |||
| senders of FRAME_TOO_LARGE MUST close the session. | configuration. | |||
| Note: 0 is not a valid status code for a RST_STREAM. | [[anchor17: Note that persistence of settings is under discussion in | |||
| the WG and might be removed in a future version of this document.]] | ||||
| After receiving a RST_STREAM on a stream, the recipient must not send | When the server is the sender, the sender can request that | |||
| additional frames for that stream, and the stream moves into the | configuration data be persisted by the client across HTTP/2.0 | |||
| closed state. | sessions and returned to the server in future communications. | |||
| 3.6.4. SETTINGS | Clients persist settings on a per origin basis (see [RFC6454] for a | |||
| definition of web origins). That is, when a client connects to a | ||||
| server, and the server persists settings within the client, the | ||||
| client SHOULD return the persisted settings on future connections to | ||||
| the same origin AND IP address and TCP port. Clients MUST NOT | ||||
| request servers to use the persistence features of the SETTINGS | ||||
| frames, and servers MUST ignore persistence related flags sent by a | ||||
| client. | ||||
| A SETTINGS frame contains a set of id/value pairs for communicating | Valid frame-specific flags for the SETTINGS frame are: | |||
| configuration data about how the two endpoints may communicate. | ||||
| SETTINGS frames can be sent at any time by either endpoint, are | ||||
| optionally sent, and are fully asynchronous. When the server is the | ||||
| sender, the sender can request that configuration data be persisted | ||||
| by the client across HTTP/2.0 sessions and returned to the server in | ||||
| future communications. | ||||
| Persistence of SETTINGS ID/Value pairs is done on a per origin/IP | CLEAR_PERSISTED (0x2): Bit 2 being set indicates a request to clear | |||
| pair (the "origin" is the set of scheme, host, and port from the URI. | any previously persisted settings before processing the settings. | |||
| See [RFC6454]). That is, when a client connects to a server, and the | Clients MUST NOT set this flag. | |||
| server persists settings within the client, the client SHOULD return | ||||
| the persisted settings on future connections to the same origin AND | ||||
| IP address and TCP port. Clients MUST NOT request servers to use the | ||||
| persistence features of the SETTINGS frames, and servers MUST ignore | ||||
| persistence related flags sent by a client. | ||||
| +----------------------------------+ | SETTINGS frames always apply to a session, never a single stream. | |||
| |1| version | 4 | | The stream identifier for a settings frame MUST be zero. | |||
| +----------------------------------+ | ||||
| | Flags (8) | Length (24 bits) | | ||||
| +----------------------------------+ | ||||
| | Number of entries | | ||||
| +----------------------------------+ | ||||
| | ID/Value Pairs | | ||||
| | ... | | ||||
| Control bit: The control bit is always 1 for this message. | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |SettingFlags(8)| Setting Identifier (24) | | ||||
| +---------------+-----------------------------------------------+ | ||||
| | Value (32) | | ||||
| +---------------------------------------------------------------+ | ||||
| Version: The HTTP/2.0 version number. | SETTINGS ID/Value Pair | |||
| Type: The message type for a SETTINGS message is 4. | The payload of a SETTINGS frame contains zero or more settings. Each | |||
| setting is comprised of the following | ||||
| Flags: FLAG_SETTINGS_CLEAR_SETTINGS (0x1): When set, the client | Settings Flags: An 8-bit flags field containing per-setting | |||
| should clear any previously persisted SETTINGS ID/Value pairs. If | instructions. The following flags are valid: | |||
| this frame contains ID/Value pairs with the | ||||
| FLAG_SETTINGS_PERSIST_VALUE set, then the client will first clear its | ||||
| existing, persisted settings, and then persist the values with the | ||||
| flag set which are contained within this frame. Because persistence | ||||
| is only implemented on the client, this flag can only be used when | ||||
| the sender is the server. | ||||
| Length: An unsigned 24-bit value representing the number of bytes | PERSIST_VALUE (0x1): Bit 1 (the least significant bit) being set | |||
| after the length field. The total size of a SETTINGS frame is 8 | indicates a request from the server to the client to persist | |||
| bytes + length. | this setting. A client MUST NOT set this flag. | |||
| Number of entries: A 32-bit value representing the number of ID/value | PERSISTED (0x2): Bit 2 being set indicates that this setting is a | |||
| pairs in this message. | persisted setting being returned by the client to the server. | |||
| This also indicates that this setting is not a client setting, | ||||
| but a value previously set by the server. A server MUST NOT | ||||
| set this flag. | ||||
| ID: A 32-bit ID number, comprised of 8 bits of flags and 24 bits of | All other settings flags are reserved. | |||
| unique ID. | ||||
| ID.flags: | Setting Identifier: A 24-bit field that identifies the setting. | |||
| FLAG_SETTINGS_PERSIST_VALUE (0x1): When set, the sender of this | Value: A 32-bit value for the setting. | |||
| SETTINGS frame is requesting that the recipient persist the ID/ | ||||
| Value and return it in future SETTINGS frames sent from the | ||||
| sender to this recipient. Because persistence is only | ||||
| implemented on the client, this flag is only sent by the | ||||
| server. | ||||
| FLAG_SETTINGS_PERSISTED (0x2): When set, the sender is | The following settings are defined: | |||
| notifying the recipient that this ID/Value pair was previously | ||||
| sent to the sender by the recipient with the | ||||
| FLAG_SETTINGS_PERSIST_VALUE, and the sender is returning it. | ||||
| Because persistence is only implemented on the client, this | ||||
| flag is only sent by the client. | ||||
| Defined IDs: | SETTINGS_UPLOAD_BANDWIDTH (1): allows the sender to send its | |||
| expected upload bandwidth on this channel. This number is an | ||||
| estimate. The value should be the integral number of kilobytes | ||||
| per second that the sender predicts as an expected maximum upload | ||||
| channel capacity. | ||||
| 1 - SETTINGS_UPLOAD_BANDWIDTH allows the sender to send its | SETTINGS_DOWNLOAD_BANDWIDTH (2): allows the sender to send its | |||
| expected upload bandwidth on this channel. This number is an | expected download bandwidth on this channel. This number is an | |||
| estimate. The value should be the integral number of kilobytes | estimate. The value should be the integral number of kilobytes | |||
| per second that the sender predicts as an expected maximum | per second that the sender predicts as an expected maximum | |||
| upload channel capacity. | download channel capacity. | |||
| 2 - SETTINGS_DOWNLOAD_BANDWIDTH allows the sender to send its | SETTINGS_ROUND_TRIP_TIME (3): allows the sender to send its expected | |||
| expected download bandwidth on this channel. This number is an | round-trip-time on this channel. The round trip time is defined | |||
| estimate. The value should be the integral number of kilobytes | as the minimum amount of time to send a control frame from this | |||
| per second that the sender predicts as an expected maximum | client to the remote and receive a response. The value is | |||
| download channel capacity. | represented in milliseconds. | |||
| 3 - SETTINGS_ROUND_TRIP_TIME allows the sender to send its | SETTINGS_MAX_CONCURRENT_STREAMS (4): allows the sender to inform the | |||
| expected round-trip-time on this channel. The round trip time | remote endpoint the maximum number of concurrent streams which it | |||
| is defined as the minimum amount of time to send a control | will allow. This limit is directional: it applies to the number | |||
| frame from this client to the remote and receive a response. | of streams that the sender permits the receiver to create. By | |||
| The value is represented in milliseconds. | default there is no limit. For implementers it is recommended | |||
| that this value be no smaller than 100, so as to not unnecessarily | ||||
| limit parallelism. | ||||
| 4 - SETTINGS_MAX_CONCURRENT_STREAMS allows the sender to inform | SETTINGS_CURRENT_CWND (5): allows the sender to inform the remote | |||
| the remote endpoint the maximum number of concurrent streams | endpoint of the current TCP CWND value. | |||
| which it will allow. By default there is no limit. For | ||||
| implementors it is recommended that this value be no smaller | ||||
| than 100. | ||||
| 5 - SETTINGS_CURRENT_CWND allows the sender to inform the | SETTINGS_DOWNLOAD_RETRANS_RATE (6): allows the sender to inform the | |||
| remote endpoint of the current TCP CWND value. | remote endpoint the retransmission rate (bytes retransmitted / | |||
| total bytes transmitted). | ||||
| 6 - SETTINGS_DOWNLOAD_RETRANS_RATE allows the sender to inform | SETTINGS_INITIAL_WINDOW_SIZE (7): allows the sender to inform the | |||
| the remote endpoint the retransmission rate (bytes | remote endpoint the initial window size (in bytes) for new | |||
| retransmitted / total bytes transmitted). | streams. | |||
| 7 - SETTINGS_INITIAL_WINDOW_SIZE allows the sender to inform | SETTINGS_FLOW_CONTROL_OPTIONS (10): This setting allows an endpoint | |||
| the remote endpoint the initial window size (in bytes) for new | to indicate that streams directed to them will not be subject to | |||
| streams. | flow control. The least significant bit (0x1) is set to indicate | |||
| that new streams are not flow controlled. Bit 2 (0x2) is set to | ||||
| indicate that the session is not flow controlled. All other bits | ||||
| are reserved. | ||||
| 8 - SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE allows the server | This setting applies to all streams, including existing streams. | |||
| to inform the client of the new size of the client certificate | ||||
| vector. | ||||
| Value: A 32-bit value. | These bits cannot be cleared once set, see Section 3.7.9.4. | |||
| The message is intentionally extensible for future information which | The message is intentionally extensible for future information which | |||
| may improve client-server communications. The sender does not need | may improve client-server communications. The sender does not need | |||
| to send every type of ID/value. It must only send those for which it | to send every type of ID/value. It must only send those for which it | |||
| has accurate values to convey. When multiple ID/value pairs are | has accurate values to convey. When multiple ID/value pairs are | |||
| sent, they should be sent in order of lowest id to highest id. A | sent, they should be sent in order of lowest id to highest id. A | |||
| single SETTINGS frame MUST not contain multiple values for the same | single SETTINGS frame MUST not contain multiple values for the same | |||
| ID. If the recipient of a SETTINGS frame discovers multiple values | ID. If the recipient of a SETTINGS frame discovers multiple values | |||
| for the same ID, it MUST ignore all values except the first one. | for the same ID, it MUST ignore all values except the first one. | |||
| A server may send multiple SETTINGS frames containing different ID/ | A server may send multiple SETTINGS frames containing different ID/ | |||
| Value pairs. When the same ID/Value is sent twice, the most recent | Value pairs. When the same ID/Value is sent twice, the most recent | |||
| value overrides any previously sent values. If the server sends IDs | value overrides any previously sent values. If the server sends IDs | |||
| 1, 2, and 3 with the FLAG_SETTINGS_PERSIST_VALUE in a first SETTINGS | 1, 2, and 3 with the FLAG_SETTINGS_PERSIST_VALUE in a first SETTINGS | |||
| frame, and then sends IDs 4 and 5 with the | frame, and then sends IDs 4 and 5 with the | |||
| FLAG_SETTINGS_PERSIST_VALUE, when the client returns the persisted | FLAG_SETTINGS_PERSIST_VALUE, when the client returns the persisted | |||
| state on its next SETTINGS frame, it SHOULD send all 5 settings (1, | state on its next SETTINGS frame, it SHOULD send all 5 settings (1, | |||
| 2, 3, 4, and 5 in this example) to the server. | 2, 3, 4, and 5 in this example) to the server. | |||
| 3.6.5. PING | 3.7.5. PUSH_PROMISE | |||
| The PING control frame is a mechanism for measuring a minimal round- | The PUSH_PROMISE frame (type=5) allows the sender to signal a promise | |||
| trip time from the sender. It can be sent from the client or the | to create a stream and serve the referenced resource. Minimal data | |||
| server. Recipients of a PING frame should send an identical frame to | allowing the receiver to understand which resource(s) are to be | |||
| the sender as soon as possible (if there is other pending data | pushed are to be included. | |||
| waiting to be sent, PING should take highest priority). Each ping | ||||
| sent by a sender should use a unique ID. | ||||
| +----------------------------------+ | PUSH_PROMISE frames are sent on an existing stream. They declare the | |||
| |1| version | 6 | | intent to use another stream for the pushing of a resource. The | |||
| +----------------------------------+ | PUSH_PROMISE allows the client an opportunity to reject pushed | |||
| | 0 (flags) | 4 (length) | | resources. | |||
| +----------------------------------| | ||||
| | 32-bit ID | | ||||
| +----------------------------------+ | ||||
| Control bit: The control bit is always 1 for this message. | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |X| Promised-Stream-ID (31) | | ||||
| +-+-------------------------------------------------------------+ | ||||
| | Header Block (*) ... | ||||
| +---------------------------------------------------------------+ | ||||
| Version: The HTTP/2.0 version number. | PUSH_PROMISE Payload Format | |||
| Type: The message type for a PING message is 6. | There are no frame-specific flags for the PUSH_PROMISE frame. | |||
| Length: This frame is always 4 bytes long. | The body of a PUSH_PROMISE includes a "Promised-Stream-ID". This 31- | |||
| bit identifier indicates the stream on which the resource will be | ||||
| pushed. The promised stream identifier MUST be a valid choice for | ||||
| the next stream sent by the sender (see new stream identifier | ||||
| (Section 3.4.1)). | ||||
| ID: A unique ID for this ping, represented as an unsigned 32 bit | There is no requirement that the streams referred to by this frame | |||
| value. When the client initiates a ping, it must use an odd numbered | are created in the order referenced. The PUSH_PROMISE reserves | |||
| ID. When the server initiates a ping, it must use an even numbered | stream identifiers for later use; these reserved identifiers can be | |||
| ping. Use of odd/even IDs is required in order to avoid accidental | used as prioritization needs dictate. | |||
| looping on PINGs (where each side initiates an identical PING at the | ||||
| same time). | ||||
| Note: If a sender uses all possible PING ids (e.g. has sent all 2^31 | The PUSH_PROMISE also includes a header block (Section 3.7.10), which | |||
| possible IDs), it can wrap and start re-using IDs. | describes the resource that will be pushed. | |||
| If a server receives an even numbered PING which it did not initiate, | 3.7.6. PING | |||
| it must ignore the PING. If a client receives an odd numbered PING | ||||
| which it did not initiate, it must ignore the PING. | ||||
| 3.6.6. GOAWAY | The PING frame (type=6) is a mechanism for measuring a minimal round- | |||
| trip time from the sender. PING frames can be sent from the client | ||||
| or the server. | ||||
| The GOAWAY control frame is a mechanism to tell the remote side of | Recipients of a PING frame send an identical frame to the sender as | |||
| the connection to stop creating streams on this session. It can be | soon as possible. PING should take highest priority if there is | |||
| sent from the client or the server. Once sent, the sender will not | other data waiting to be sent. | |||
| respond to any new SYN_STREAMs on this session. Recipients of a | ||||
| GOAWAY frame must not send additional streams on this session, | The PING frame defines a frame-specific flag: | |||
| PONG (0x2): Bit 2 being set indicates that this ping frame is a ping | ||||
| response. An endpoint MUST set this flag in ping responses. An | ||||
| endpoint MUST NOT respond to ping frames containing this flag. | ||||
| The payload of a PING frame contains any value. A PING response MUST | ||||
| contain the contents of the PING request. | ||||
| 3.7.7. GOAWAY | ||||
| The GOAWAY frame (type=7) informs the remote side of the connection | ||||
| to stop creating streams on this session. It can be sent from the | ||||
| client or the server. Once sent, the sender will ignore frames sent | ||||
| on new streams for the remainder of the session. Recipients of a | ||||
| GOAWAY frame MUST NOT open additional streams on the session, | ||||
| although a new session can be established for new streams. The | although a new session can be established for new streams. The | |||
| purpose of this message is to allow an endpoint to gracefully stop | purpose of this message is to allow an endpoint to gracefully stop | |||
| accepting new streams (perhaps for a reboot or maintenance), while | accepting new streams (perhaps for a reboot or maintenance), while | |||
| still finishing processing of previously established streams. | still finishing processing of previously established streams. | |||
| There is an inherent race condition between an endpoint sending | There is an inherent race condition between an endpoint starting new | |||
| SYN_STREAMs and the remote sending a GOAWAY message. To deal with | streams and the remote sending a GOAWAY message. To deal with this | |||
| this case, the GOAWAY contains a last-stream-id indicating the | case, the GOAWAY contains the stream identifier of the last stream | |||
| stream-id of the last stream which was created on the sending | which was processed on the sending endpoint in this session. If the | |||
| endpoint in this session. If the receiver of the GOAWAY sent new | receiver of the GOAWAY used streams that are newer than the indicated | |||
| SYN_STREAMs for sessions after this last-stream-id, they were not | stream identifier, they were not processed by the sender and the | |||
| processed by the server and the receiver may treat the stream as | receiver may treat the streams as though they had never been created | |||
| though it had never been created at all (hence the receiver may want | at all (hence the receiver may want to re-create the streams later on | |||
| to re-create the stream later on a new session). | a new session). | |||
| Endpoints should always send a GOAWAY message before closing a | Endpoints should always send a GOAWAY message before closing a | |||
| connection so that the remote can know whether a stream has been | connection so that the remote can know whether a stream has been | |||
| partially processed or not. (For example, if an HTTP client sends a | partially processed or not. (For example, if an HTTP client sends a | |||
| POST at the same time that a server closes a connection, the client | POST at the same time that a server closes a connection, the client | |||
| cannot know if the server started to process that POST request if the | cannot know if the server started to process that POST request if the | |||
| server does not send a GOAWAY frame to indicate where it stopped | server does not send a GOAWAY frame to indicate where it stopped | |||
| working). | working). | |||
| After sending a GOAWAY message, the sender must ignore all SYN_STREAM | After sending a GOAWAY message, the sender can ignore frames for new | |||
| frames for new streams. | streams. | |||
| +----------------------------------+ | ||||
| |1| version | 7 | | ||||
| +----------------------------------+ | ||||
| | 0 (flags) | 8 (length) | | ||||
| +----------------------------------| | ||||
| |X| Last-good-stream-ID (31 bits) | | ||||
| +----------------------------------+ | ||||
| | Status code | | ||||
| +----------------------------------+ | ||||
| Control bit: The control bit is always 1 for this message. | ||||
| Version: The HTTP/2.0 version number. | ||||
| Type: The message type for a GOAWAY message is 7. | [[anchor18: Issue: session state that is established by those | |||
| "ignored" messages cannot be ignored without the state in the two | ||||
| peers becoming unsynchronized.]] | ||||
| Length: This frame is always 8 bytes long. | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |X| Last-Stream-ID (31) | | ||||
| +-+-------------------------------------------------------------+ | ||||
| | Error Code (32) | | ||||
| +---------------------------------------------------------------+ | ||||
| Last-good-stream-Id: The last stream id which was replied to (with | GOAWAY Payload Format | |||
| either a SYN_REPLY or RST_STREAM) by the sender of the GOAWAY | ||||
| message. If no streams were replied to, this value MUST be 0. | ||||
| Status: The reason for closing the session. | The GOAWAY frame does not define any valid flags. | |||
| 0 - OK. This is a normal session teardown. | The GOAWAY frame applies to the session, not a specific stream. The | |||
| stream identifier MUST be zero. | ||||
| 1 - PROTOCOL_ERROR. This is a generic error, and should only be | The GOAWAY frame contains an identifier of the last stream that the | |||
| used if a more specific error is not available. | sender of the GOAWAY is prepared to act upon, which can include | |||
| processing and replies. This allows an endpoint to discover what | ||||
| streams might have had some effect or what might be safe to | ||||
| automatically retry. If no streams were acted upon, the last stream | ||||
| ID MUST be 0. | ||||
| 2 - INTERNAL_ERROR. This is a generic error which can be used | The GOAWAY frame contains a 32-bit error code (Section 3.5.3) that | |||
| when the implementation has internally failed, not due to anything | contains the reason for closing the session. | |||
| in the protocol. | ||||
| 3.6.7. HEADERS | 3.7.8. HEADERS | |||
| The HEADERS frame augments a stream with additional headers. It may | The HEADERS frame (type=8) provides header fields for a stream. It | |||
| be optionally sent on an existing stream at any time. Specific | may be optionally sent on an existing stream at any time. Specific | |||
| application of the headers in this frame is application-dependent. | application of the headers in this frame is application-dependent. | |||
| The name/value header block within this frame is compressed. | ||||
| +------------------------------------+ | No frame-specific flags are defined for the HEADERS frame. | |||
| |1| version | 8 | | ||||
| +------------------------------------+ | ||||
| | Flags (8) | Length (24 bits) | | ||||
| +------------------------------------+ | ||||
| |X| Stream-ID (31bits) | | ||||
| +------------------------------------+ | ||||
| | Number of Name/Value pairs (int32) | <+ | ||||
| +------------------------------------+ | | ||||
| | Length of name (int32) | | This section is the | ||||
| +------------------------------------+ | "Name/Value Header | ||||
| | Name (string) | | Block", and is | ||||
| +------------------------------------+ | compressed. | ||||
| | Length of value (int32) | | | ||||
| +------------------------------------+ | | ||||
| | Value (string) | | | ||||
| +------------------------------------+ | | ||||
| | (repeats) | <+ | ||||
| Flags: Flags related to this frame. Valid flags are: | ||||
| 0x01 = FLAG_FIN - marks this frame as the last frame to be | ||||
| transmitted on this stream and puts the sender in the half-closed | ||||
| (Section 3.3.6) state. | ||||
| Length: An unsigned 24 bit value representing the number of bytes | ||||
| after the length field. The minimum length of the length field is 4 | ||||
| (when the number of name value pairs is 0). | ||||
| Stream-ID: The stream this HEADERS block is associated with. | ||||
| Name/Value Header Block: A set of name/value pairs carried as part of | ||||
| the SYN_STREAM. see Name/Value Header Block (Section 3.6.10). | ||||
| 3.6.8. WINDOW_UPDATE | ||||
| The WINDOW_UPDATE control frame is used to implement per stream flow | ||||
| control in HTTP/2.0. Flow control in HTTP/2.0 is per hop, that is, | ||||
| only between the two endpoints of a HTTP/2.0 connection. If there | ||||
| are one or more intermediaries between the client and the origin | ||||
| server, flow control signals are not explicitly forwarded by the | ||||
| intermediaries. (However, throttling of data transfer by any | ||||
| recipient may have the effect of indirectly propagating flow control | ||||
| information upstream back to the original sender.) Flow control only | ||||
| applies to the data portion of data frames. Recipients must buffer | ||||
| all control frames. If a recipient fails to buffer an entire control | ||||
| frame, it MUST issue a stream error (Section 3.4.2) with the status | ||||
| code FLOW_CONTROL_ERROR for the stream. | ||||
| Flow control in HTTP/2.0 is implemented by a data transfer window | ||||
| kept by the sender of each stream. The data transfer window is a | ||||
| simple uint32 that indicates how many bytes of data the sender can | ||||
| transmit. After a stream is created, but before any data frames have | ||||
| been transmitted, the sender begins with the initial window size. | ||||
| This window size is a measure of the buffering capability of the | ||||
| recipient. The sender must not send a data frame with data length | ||||
| greater than the transfer window size. After sending each data | ||||
| frame, the sender decrements its transfer window size by the amount | ||||
| of data transmitted. When the window size becomes less than or equal | ||||
| to 0, the sender must pause transmitting data frames. At the other | ||||
| end of the stream, the recipient sends a WINDOW_UPDATE control back | ||||
| to notify the sender that it has consumed some data and freed up | ||||
| buffer space to receive more data. | ||||
| +----------------------------------+ | ||||
| |1| version | 9 | | ||||
| +----------------------------------+ | ||||
| | 0 (flags) | 8 (length) | | ||||
| +----------------------------------+ | ||||
| |X| Stream-ID (31-bits) | | ||||
| +----------------------------------+ | ||||
| |X| Delta-Window-Size (31-bits) | | ||||
| +----------------------------------+ | ||||
| Control bit: The control bit is always 1 for this message. | ||||
| Version: The HTTP/2.0 version number. | ||||
| Type: The message type for a WINDOW_UPDATE message is 9. | ||||
| Length: The length field is always 8 for this frame (there are 8 | The body of a HEADERS frame contains a Headers Block | |||
| bytes after the length field). | (Section 3.7.10). | |||
| Stream-ID: The stream ID that this WINDOW_UPDATE control frame is | 3.7.9. WINDOW_UPDATE | |||
| for. | ||||
| Delta-Window-Size: The additional number of bytes that the sender can | The WINDOW_UPDATE frame (type=9) is used to implement flow control in | |||
| transmit in addition to existing remaining window size. The legal | HTTP/2.0. | |||
| range for this field is 1 to 2^31 - 1 (0x7fffffff) bytes. | ||||
| The window size as kept by the sender must never exceed 2^31 | Flow control in HTTP/2.0 operates at two levels: on each individual | |||
| (although it can become negative in one special case). If a sender | stream and on the entire session. | |||
| receives a WINDOW_UPDATE that causes the its window size to exceed | ||||
| this limit, it must send RST_STREAM with status code | ||||
| FLOW_CONTROL_ERROR to terminate the stream. | ||||
| When a HTTP/2.0 connection is first established, the default initial | Flow control in HTTP/2.0 is hop by hop, that is, only between the two | |||
| window size for all streams is 64KB. An endpoint can use the | endpoints of a HTTP/2.0 connection. Intermediaries do not forward | |||
| SETTINGS control frame to adjust the initial window size for the | WINDOW_UPDATE messages between dependent sessions. However, | |||
| connection. That is, its peer can start out using the 64KB default | throttling of data transfer by any recipient can indirectly cause the | |||
| initial window size when sending data frames before receiving the | propagation of flow control information toward the original sender. | |||
| SETTINGS. Because SETTINGS is asynchronous, there may be a race | ||||
| condition if the recipient wants to decrease the initial window size, | ||||
| but its peer immediately sends 64KB on the creation of a new | ||||
| connection, before waiting for the SETTINGS to arrive. This is one | ||||
| case where the window size kept by the sender will become negative. | ||||
| Once the sender detects this condition, it must stop sending data | ||||
| frames and wait for the recipient to catch up. The recipient has two | ||||
| choices: | ||||
| immediately send RST_STREAM with FLOW_CONTROL_ERROR status code. | Flow control only applies to frames that are identified as being | |||
| subject to flow control. Of the frames defined in this document, | ||||
| only data frames are subject to flow control. Receivers MUST either | ||||
| buffer or process all other frames, terminate the corresponding | ||||
| stream, or terminate the session. The stream or session is | ||||
| terminated with a FLOW_CONTROL_ERROR code. | ||||
| allow the head of line blocking (as there is only one stream for | Valid flags for the WINDOW_UPDATE frame are: | |||
| the session and the amount of data in flight is bounded by the | ||||
| default initial window size), and send WINDOW_UPDATE as it | ||||
| consumes data. | ||||
| In the case of option 2, both sides must compute the window size | END_FLOW_CONTROL (0x2): Bit 2 being set indicates that flow control | |||
| based on the initial window size in the SETTINGS. For example, if | for the identified stream or session is ended and subsequent | |||
| the recipient sets the initial window size to be 16KB, and the sender | frames do not need to be flow controlled. | |||
| sends 64KB immediately on connection establishment, the sender will | ||||
| discover its window size is -48KB on receipt of the SETTINGS. As the | ||||
| recipient consumes the first 16KB, it must send a WINDOW_UPDATE of | ||||
| 16KB back to the sender. This interaction continues until the | ||||
| sender's window size becomes positive again, and it can resume | ||||
| transmitting data frames. | ||||
| After the recipient reads in a data frame with FLAG_FIN that marks | The WINDOW_UPDATE frame can be stream related or session related. | |||
| the end of the data stream, it should not send WINDOW_UPDATE frames | The stream identifier in the WINDOW_UPDATE frame header identifies | |||
| as it consumes the last data frame. A sender should ignore all the | the affected stream, or includes a value of 0 to indicate that the | |||
| WINDOW_UPDATE frames associated with the stream after it send the | session flow control window is updated. | |||
| last frame for the stream. | ||||
| The data frames from the sender and the WINDOW_UPDATE frames from the | The payload of a WINDOW_UPDATE frame contains a 32-bit value. This | |||
| recipient are completely asynchronous with respect to each other. | value is the additional number of bytes that the sender can transmit | |||
| This property allows a recipient to aggressively update the window | in addition to the existing flow control window. The legal range for | |||
| size kept by the sender to prevent the stream from stalling. | this field is 1 to 2^31 - 1 (0x7fffffff) bytes; the most significant | |||
| bit of this value is reserved. | ||||
| 3.6.9. CREDENTIAL | 3.7.9.1. The Flow Control Window | |||
| The CREDENTIAL control frame is used by the client to send additional | Flow control in HTTP/2.0 is implemented by a flow control window kept | |||
| client certificates to the server. A HTTP/2.0 client may decide to | by the sender of each stream. The flow control window is a simple | |||
| send requests for resources from different origins on the same | integer value that indicates how many bytes of data the sender is | |||
| HTTP/2.0 session if it decides that that server handles both origins. | permitted to transmit. The flow control window size is a measure of | |||
| For example if the IP address associated with both hostnames matches | the buffering capability of the recipient. | |||
| and the SSL server certificate presented in the initial handshake is | ||||
| valid for both hostnames. However, because the SSL connection can | ||||
| contain at most one client certificate, the client needs a mechanism | ||||
| to send additional client certificates to the server. | ||||
| The server is required to maintain a vector of client certificates | Two flow control windows apply to the sending of every message: the | |||
| associated with a HTTP/2.0 session. When the client needs to send a | stream flow control window and the session flow control window. The | |||
| client certificate to the server, it will send a CREDENTIAL frame | sender MUST NOT send a flow controlled frame with a length that | |||
| that specifies the index of the slot in which to store the | exceeds the space available in either of the flow control windows | |||
| certificate as well as proof that the client posesses the | advertised by the receiver. Frames with zero length with the FINAL | |||
| corresponding private key. The initial size of this vector must be | flag set (for example, an empty data frame) MAY be sent if there is | |||
| 8. If the client provides a client certificate during the first TLS | no available space in either flow control window. | |||
| handshake, the contents of this certificate must be copied into the | ||||
| first slot (index 1) in the CREDENTIAL vector, though it may be | ||||
| overwritten by subsequent CREDENTIAL frames. The server must | ||||
| exclusively use the CREDENTIAL vector when evaluating the client | ||||
| certificates associated with an origin. The server may change the | ||||
| size of this vector by sending a SETTINGS frame with the setting | ||||
| SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE value specified. In the | ||||
| event that the new size is smaller than the current size, truncation | ||||
| occurs preserving lower-index slots as possible. | ||||
| TLS renegotiation with client authentication is incompatible with | For flow control calculations, the 8 byte frame header is not | |||
| HTTP/2.0 given the multiplexed nature of HTTP/2.0. Specifically, | counted. | |||
| imagine that the client has 2 requests outstanding to the server for | ||||
| two different pages (in different tabs). When the renegotiation + | ||||
| client certificate request comes in, the browser is unable to | ||||
| determine which resource triggered the client certificate request, in | ||||
| order to prompt the user accordingly. | ||||
| +----------------------------------+ | After sending a flow controlled frame, the sender reduces the space | |||
| |1|000000000000001|0000000000001011| | available in both windows by the length of the transmitted frame. | |||
| +----------------------------------+ | ||||
| | flags (8) | Length (24 bits) | | ||||
| +----------------------------------+ | ||||
| | Slot (16 bits) | | | ||||
| +-----------------+ | | ||||
| | Proof Length (32 bits) | | ||||
| +----------------------------------+ | ||||
| | Proof | | ||||
| +----------------------------------+ <+ | ||||
| | Certificate Length (32 bits) | | | ||||
| +----------------------------------+ | Repeated until end of frame | ||||
| | Certificate | | | ||||
| +----------------------------------+ <+ | ||||
| Slot: The index in the server's client certificate vector where this | The receiver of a message sends a WINDOW_UPDATE frame as it consumes | |||
| certificate should be stored. If there is already a certificate | data and frees up space in flow control windows. Separate | |||
| stored at this index, it will be overwritten. The index is one | WINDOW_UPDATE messages are sent for the stream and session level flow | |||
| based, not zero based; zero is an invalid slot index. | control windows. | |||
| Proof: Cryptographic proof that the client has possession of the | A sender that receives a WINDOW_UPDATE frame updates the | |||
| private key associated with the certificate. The format is a TLS | corresponding window by the amount specified in the frame. | |||
| digitally-signed element ([RFC5246], Section 4.7). The signature | ||||
| algorithm must be the same as that used in the CertificateVerify | ||||
| message. However, since the MD5+SHA1 signature type used in TLS 1.0 | ||||
| connections can not be correctly encoded in a digitally-signed | ||||
| element, SHA1 must be used when MD5+SHA1 was used in the SSL | ||||
| connection. The signature is calculated over a 32 byte TLS extractor | ||||
| value (http://tools.ietf.org/html/rfc5705) with a label of "EXPORTER | ||||
| HTTP/2.0 certificate proof" using the empty string as context. | ||||
| ForRSA certificates the signature would be a PKCS#1 v1.5 signature. | ||||
| For ECDSA, it would be an ECDSA-Sig-Value | ||||
| (http://tools.ietf.org/html/rfc5480#appendix-A). For a 1024-bit RSA | ||||
| key, the CREDENTIAL message would be ~500 bytes. | ||||
| Certificate: The certificate chain, starting with the leaf | A sender MUST NOT allow a flow control window to exceed 2^31 - 1 | |||
| certificate. Each certificate must be encoded as a 32 bit length, | bytes. If a sender receives a WINDOW_UPDATE that causes a flow | |||
| followed by a DER encoded certificate. The certificate must be of | control window to exceed this maximum it MUST terminate either the | |||
| the same type (RSA, ECDSA, etc) as the client certificate associated | stream or the session, as appropriate. For streams, the sender sends | |||
| with the SSL connection. | a RST_STREAM with the error code of FLOW_CONTROL_ERROR code; for the | |||
| session, a GOAWAY message with a FLOW_CONTROL_ERROR code. | ||||
| If the server receives a request for a resource with unacceptable | Flow controlled frames from the sender and WINDOW_UPDATE frames from | |||
| credential (either missing or invalid), it must reply with a | the receiver are completely asynchronous with respect to each other. | |||
| RST_STREAM frame with the status code INVALID_CREDENTIALS. Upon | This property allows a receiver to aggressively update the window | |||
| receipt of a RST_STREAM frame with INVALID_CREDENTIALS, the client | size kept by the sender to prevent streams from stalling. | |||
| should initiate a new stream directly to the requested origin and | ||||
| resend the request. Note, HTTP/2.0 does not allow the server to | ||||
| request different client authentication for different resources in | ||||
| the same origin. | ||||
| If the server receives an invalid CREDENTIAL frame, it MUST respond | 3.7.9.2. Initial Flow Control Window Size | |||
| with a GOAWAY frame and shutdown the session. | ||||
| 3.6.10. Name/Value Header Block | When a HTTP/2.0 connection is first established, new streams are | |||
| created with an initial flow control window size of 65535 bytes. The | ||||
| session flow control window is 65536 bytes. Both endpoints can | ||||
| adjust the initial window size for new streams by including a value | ||||
| for SETTINGS_INITIAL_WINDOW_SIZE in the SETTINGS frame that forms | ||||
| part of the session header. | ||||
| The Name/Value Header Block is found in the SYN_STREAM, SYN_REPLY and | Prior to receiving a SETTINGS frame that sets a value for | |||
| HEADERS control frames, and shares a common format: | SETTINGS_INITIAL_WINDOW_SIZE, a client can only use the default | |||
| initial window size when sending flow controlled frames. Similarly, | ||||
| the session flow control window is set to the default initial window | ||||
| size until a WINDOW_UPDATE message is received. | ||||
| +------------------------------------+ | A SETTINGS frame can alter the initial flow control window size for | |||
| | Number of Name/Value pairs (int32) | | all current streams. When the value of SETTINGS_INITIAL_WINDOW_SIZE | |||
| +------------------------------------+ | changes, a receiver MUST adjust the size of all flow control windows | |||
| | Length of name (int32) | | that it maintains by the difference between the new value and the old | |||
| +------------------------------------+ | value. | |||
| | Name (string) | | ||||
| +------------------------------------+ | ||||
| | Length of value (int32) | | ||||
| +------------------------------------+ | ||||
| | Value (string) | | ||||
| +------------------------------------+ | ||||
| | (repeats) | | ||||
| Number of Name/Value pairs: The number of repeating name/value pairs | A change to SETTINGS_INITIAL_WINDOW_SIZE could cause the available | |||
| following this field. | space in a flow control window to become negative. A sender MUST | |||
| track the negative flow control window and not send new flow | ||||
| controlled frames until it receives WINDOW_UPDATE messages that cause | ||||
| the flow control window to become positive. | ||||
| List of Name/Value pairs: | For example, if the server sets the initial window size to be 16KB, | |||
| and the client sends 64KB immediately on connection establishment, | ||||
| the client will recalculate the available flow control window to be | ||||
| -48KB on receipt of the SETTINGS frame. The client retains a | ||||
| negative flow control window until WINDOW_UPDATE frames restore the | ||||
| window to being positive, after which the client can resume sending. | ||||
| Length of Name: a 32-bit value containing the number of octets in | 3.7.9.3. Reducing the Stream Window Size | |||
| the name field. Note that in practice, this length must not | ||||
| exceed 2^24, as that is the maximum size of a HTTP/2.0 frame. | ||||
| Name: 0 or more octets, 8-bit sequences of data, excluding 0. | A receiver that wishes to use a smaller flow control window than the | |||
| current size sends a new SETTINGS frame. However, the receiver MUST | ||||
| be prepared to receive data that exceeds this window size, since the | ||||
| sender might send data that exceeds the lower limit prior to | ||||
| processing the SETTINGS frame. | ||||
| Length of Value: a 32-bit value containing the number of octets in | A receiver has two options for handling streams that exceed flow | |||
| the value field. Note that in practice, this length must not | control limits: | |||
| exceed 2^24, as that is the maximum size of a HTTP/2.0 frame. | ||||
| Value: 0 or more octets, 8-bit sequences of data, excluding 0. | 1. The receiver can immediately send RST_STREAM with | |||
| FLOW_CONTROL_ERROR error code for the affected streams. | ||||
| Each header name must have at least one value. Header names are | 2. The receiver can accept the streams and tolerate the resulting | |||
| encoded using the US-ASCII character set [ASCII] and must be all | head of line blocking, sending WINDOW_UPDATE messages as it | |||
| lower case. The length of each name must be greater than zero. A | consumes data. | |||
| recipient of a zero-length name MUST issue a stream error | ||||
| (Section 3.4.2) with the status code PROTOCOL_ERROR for the | ||||
| stream-id. | ||||
| Duplicate header names are not allowed. To send two identically | If a receiver decides to accept streams, both sides must recompute | |||
| named headers, send a header with two values, where the values are | the available flow control window based on the initial window size | |||
| separated by a single NUL (0) byte. A header value can either be | sent in the SETTINGS. | |||
| empty (e.g. the length is zero) or it can contain multiple, NUL- | ||||
| separated values, each with length greater than zero. The value | ||||
| never starts nor ends with a NUL character. Recipients of illegal | ||||
| value fields MUST issue a stream error (Section 3.4.2) with the | ||||
| status code PROTOCOL_ERROR for the stream-id. | ||||
| 3.6.10.1. Compression | 3.7.9.4. Ending Flow Control | |||
| The Name/Value Header Block is a section of the SYN_STREAM, | After a recipient reads in a frame that marks the end of a stream | |||
| SYN_REPLY, and HEADERS frames used to carry header meta-data. This | (for example, a data stream with a FINAL flag set), it ceases | |||
| block is always compressed using zlib compression. Within this | transmission of WINDOW_UPDATE frames. A sender is not required to | |||
| specification, any reference to 'zlib' is referring to the ZLIB | maintain the available flow control window for streams that it is no | |||
| Compressed Data Format Specification Version 3.3 as part of RFC1950. | longer sending on. | |||
| [RFC1950] | ||||
| For each HEADERS compression instance, the initial state is | Flow control can be disabled for all streams or the session using the | |||
| initialized using the following dictionary [UDELCOMPRESSION]: | SETTINGS_FLOW_CONTROL_OPTIONS setting. An implementation that does | |||
| not wish to perform flow control can use this in the initial SETTINGS | ||||
| exchange. | ||||
| <CODE BEGINS> | Flow control can be disabled for an individual stream or the overall | |||
| session by sending a WINDOW_UPDATE with the END_FLOW_CONTROL flag | ||||
| set. The payload of a WINDOW_UPDATE frame that has the | ||||
| END_FLOW_CONTROL flag set is ignored. | ||||
| const unsigned char http2_dictionary_txt[] = { | Flow control cannot be enabled again once disabled. Any attempt to | |||
| 0x00, 0x00, 0x00, 0x07, 0x6f, 0x70, 0x74, 0x69, \\ - - - - o p t i | re-enable flow control - by sending a WINDOW_UPDATE or by clearing | |||
| 0x6f, 0x6e, 0x73, 0x00, 0x00, 0x00, 0x04, 0x68, \\ o n s - - - - h | the bits on the SETTINGS_FLOW_CONTROL_OPTIONS setting - MUST be | |||
| 0x65, 0x61, 0x64, 0x00, 0x00, 0x00, 0x04, 0x70, \\ e a d - - - - p | rejected with a FLOW_CONTROL_ERROR error code. | |||
| 0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x03, 0x70, \\ o s t - - - - p | ||||
| 0x75, 0x74, 0x00, 0x00, 0x00, 0x06, 0x64, 0x65, \\ u t - - - - d e | ||||
| 0x6c, 0x65, 0x74, 0x65, 0x00, 0x00, 0x00, 0x05, \\ l e t e - - - - | ||||
| 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x00, 0x00, \\ t r a c e - - - | ||||
| 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x00, \\ - a c c e p t - | ||||
| 0x00, 0x00, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x70, \\ - - - a c c e p | ||||
| 0x74, 0x2d, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, \\ t - c h a r s e | ||||
| 0x74, 0x00, 0x00, 0x00, 0x0f, 0x61, 0x63, 0x63, \\ t - - - - a c c | ||||
| 0x65, 0x70, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f, \\ e p t - e n c o | ||||
| 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x0f, \\ d i n g - - - - | ||||
| 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x6c, \\ a c c e p t - l | ||||
| 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, \\ a n g u a g e - | ||||
| 0x00, 0x00, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x70, \\ - - - a c c e p | ||||
| 0x74, 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, \\ t - r a n g e s | ||||
| 0x00, 0x00, 0x00, 0x03, 0x61, 0x67, 0x65, 0x00, \\ - - - - a g e - | ||||
| 0x00, 0x00, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, \\ - - - a l l o w | ||||
| 0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x68, \\ - - - - a u t h | ||||
| 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, \\ o r i z a t i o | ||||
| 0x6e, 0x00, 0x00, 0x00, 0x0d, 0x63, 0x61, 0x63, \\ n - - - - c a c | ||||
| 0x68, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, \\ h e - c o n t r | ||||
| 0x6f, 0x6c, 0x00, 0x00, 0x00, 0x0a, 0x63, 0x6f, \\ o l - - - - c o | ||||
| 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, \\ n n e c t i o n | ||||
| 0x00, 0x00, 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, \\ - - - - c o n t | ||||
| 0x65, 0x6e, 0x74, 0x2d, 0x62, 0x61, 0x73, 0x65, \\ e n t - b a s e | ||||
| 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, 0x6e, 0x74, \\ - - - - c o n t | ||||
| 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f, \\ e n t - e n c o | ||||
| 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10, \\ d i n g - - - - | ||||
| 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, \\ c o n t e n t - | ||||
| 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, \\ l a n g u a g e | ||||
| 0x00, 0x00, 0x00, 0x0e, 0x63, 0x6f, 0x6e, 0x74, \\ - - - - c o n t | ||||
| 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x65, 0x6e, 0x67, \\ e n t - l e n g | ||||
| 0x74, 0x68, 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, \\ t h - - - - c o | ||||
| 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x6f, \\ n t e n t - l o | ||||
| 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, \\ c a t i o n - - | ||||
| 0x00, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, \\ - - c o n t e n | ||||
| 0x74, 0x2d, 0x6d, 0x64, 0x35, 0x00, 0x00, 0x00, \\ t - m d 5 - - - | ||||
| 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, \\ - c o n t e n t | ||||
| 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, \\ - r a n g e - - | ||||
| 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, \\ - - c o n t e n | ||||
| 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x00, 0x00, \\ t - t y p e - - | ||||
| 0x00, 0x04, 0x64, 0x61, 0x74, 0x65, 0x00, 0x00, \\ - - d a t e - - | ||||
| 0x00, 0x04, 0x65, 0x74, 0x61, 0x67, 0x00, 0x00, \\ - - e t a g - - | ||||
| 0x00, 0x06, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, \\ - - e x p e c t | ||||
| 0x00, 0x00, 0x00, 0x07, 0x65, 0x78, 0x70, 0x69, \\ - - - - e x p i | ||||
| 0x72, 0x65, 0x73, 0x00, 0x00, 0x00, 0x04, 0x66, \\ r e s - - - - f | ||||
| 0x72, 0x6f, 0x6d, 0x00, 0x00, 0x00, 0x04, 0x68, \\ r o m - - - - h | ||||
| 0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x08, 0x69, \\ o s t - - - - i | ||||
| 0x66, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00, \\ f - m a t c h - | ||||
| 0x00, 0x00, 0x11, 0x69, 0x66, 0x2d, 0x6d, 0x6f, \\ - - - i f - m o | ||||
| 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x73, \\ d i f i e d - s | ||||
| 0x69, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x00, 0x0d, \\ i n c e - - - - | ||||
| 0x69, 0x66, 0x2d, 0x6e, 0x6f, 0x6e, 0x65, 0x2d, \\ i f - n o n e - | ||||
| 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00, 0x00, 0x00, \\ m a t c h - - - | ||||
| 0x08, 0x69, 0x66, 0x2d, 0x72, 0x61, 0x6e, 0x67, \\ - i f - r a n g | ||||
| 0x65, 0x00, 0x00, 0x00, 0x13, 0x69, 0x66, 0x2d, \\ e - - - - i f - | ||||
| 0x75, 0x6e, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, \\ u n m o d i f i | ||||
| 0x65, 0x64, 0x2d, 0x73, 0x69, 0x6e, 0x63, 0x65, \\ e d - s i n c e | ||||
| 0x00, 0x00, 0x00, 0x0d, 0x6c, 0x61, 0x73, 0x74, \\ - - - - l a s t | ||||
| 0x2d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, \\ - m o d i f i e | ||||
| 0x64, 0x00, 0x00, 0x00, 0x08, 0x6c, 0x6f, 0x63, \\ d - - - - l o c | ||||
| 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, \\ a t i o n - - - | ||||
| 0x0c, 0x6d, 0x61, 0x78, 0x2d, 0x66, 0x6f, 0x72, \\ - m a x - f o r | ||||
| 0x77, 0x61, 0x72, 0x64, 0x73, 0x00, 0x00, 0x00, \\ w a r d s - - - | ||||
| 0x06, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x00, \\ - p r a g m a - | ||||
| 0x00, 0x00, 0x12, 0x70, 0x72, 0x6f, 0x78, 0x79, \\ - - - p r o x y | ||||
| 0x2d, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, \\ - a u t h e n t | ||||
| 0x69, 0x63, 0x61, 0x74, 0x65, 0x00, 0x00, 0x00, \\ i c a t e - - - | ||||
| 0x13, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, \\ - p r o x y - a | ||||
| 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, \\ u t h o r i z a | ||||
| 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, \\ t i o n - - - - | ||||
| 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, 0x00, \\ r a n g e - - - | ||||
| 0x07, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, \\ - r e f e r e r | ||||
| 0x00, 0x00, 0x00, 0x0b, 0x72, 0x65, 0x74, 0x72, \\ - - - - r e t r | ||||
| 0x79, 0x2d, 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, \\ y - a f t e r - | ||||
| 0x00, 0x00, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, \\ - - - s e r v e | ||||
| 0x72, 0x00, 0x00, 0x00, 0x02, 0x74, 0x65, 0x00, \\ r - - - - t e - | ||||
| 0x00, 0x00, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6c, \\ - - - t r a i l | ||||
| 0x65, 0x72, 0x00, 0x00, 0x00, 0x11, 0x74, 0x72, \\ e r - - - - t r | ||||
| 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x65, \\ a n s f e r - e | ||||
| 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x00, \\ n c o d i n g - | ||||
| 0x00, 0x00, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, \\ - - - u p g r a | ||||
| 0x64, 0x65, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x73, \\ d e - - - - u s | ||||
| 0x65, 0x72, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, \\ e r - a g e n t | ||||
| 0x00, 0x00, 0x00, 0x04, 0x76, 0x61, 0x72, 0x79, \\ - - - - v a r y | ||||
| 0x00, 0x00, 0x00, 0x03, 0x76, 0x69, 0x61, 0x00, \\ - - - - v i a - | ||||
| 0x00, 0x00, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, \\ - - - w a r n i | ||||
| 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10, 0x77, 0x77, \\ n g - - - - w w | ||||
| 0x77, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, \\ w - a u t h e n | ||||
| 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x00, 0x00, \\ t i c a t e - - | ||||
| 0x00, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, \\ - - m e t h o d | ||||
| 0x00, 0x00, 0x00, 0x03, 0x67, 0x65, 0x74, 0x00, \\ - - - - g e t - | ||||
| 0x00, 0x00, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, \\ - - - s t a t u | ||||
| 0x73, 0x00, 0x00, 0x00, 0x06, 0x32, 0x30, 0x30, \\ s - - - - 2 0 0 | ||||
| 0x20, 0x4f, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x76, \\ - O K - - - - v | ||||
| 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x00, \\ e r s i o n - - | ||||
| 0x00, 0x08, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, \\ - - H T T P - 1 | ||||
| 0x2e, 0x31, 0x00, 0x00, 0x00, 0x03, 0x75, 0x72, \\ - 1 - - - - u r | ||||
| 0x6c, 0x00, 0x00, 0x00, 0x06, 0x70, 0x75, 0x62, \\ l - - - - p u b | ||||
| 0x6c, 0x69, 0x63, 0x00, 0x00, 0x00, 0x0a, 0x73, \\ l i c - - - - s | ||||
| 0x65, 0x74, 0x2d, 0x63, 0x6f, 0x6f, 0x6b, 0x69, \\ e t - c o o k i | ||||
| 0x65, 0x00, 0x00, 0x00, 0x0a, 0x6b, 0x65, 0x65, \\ e - - - - k e e | ||||
| 0x70, 0x2d, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x00, \\ p - a l i v e - | ||||
| 0x00, 0x00, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, \\ - - - o r i g i | ||||
| 0x6e, 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x32, \\ n 1 0 0 1 0 1 2 | ||||
| 0x30, 0x31, 0x32, 0x30, 0x32, 0x32, 0x30, 0x35, \\ 0 1 2 0 2 2 0 5 | ||||
| 0x32, 0x30, 0x36, 0x33, 0x30, 0x30, 0x33, 0x30, \\ 2 0 6 3 0 0 3 0 | ||||
| 0x32, 0x33, 0x30, 0x33, 0x33, 0x30, 0x34, 0x33, \\ 2 3 0 3 3 0 4 3 | ||||
| 0x30, 0x35, 0x33, 0x30, 0x36, 0x33, 0x30, 0x37, \\ 0 5 3 0 6 3 0 7 | ||||
| 0x34, 0x30, 0x32, 0x34, 0x30, 0x35, 0x34, 0x30, \\ 4 0 2 4 0 5 4 0 | ||||
| 0x36, 0x34, 0x30, 0x37, 0x34, 0x30, 0x38, 0x34, \\ 6 4 0 7 4 0 8 4 | ||||
| 0x30, 0x39, 0x34, 0x31, 0x30, 0x34, 0x31, 0x31, \\ 0 9 4 1 0 4 1 1 | ||||
| 0x34, 0x31, 0x32, 0x34, 0x31, 0x33, 0x34, 0x31, \\ 4 1 2 4 1 3 4 1 | ||||
| 0x34, 0x34, 0x31, 0x35, 0x34, 0x31, 0x36, 0x34, \\ 4 4 1 5 4 1 6 4 | ||||
| 0x31, 0x37, 0x35, 0x30, 0x32, 0x35, 0x30, 0x34, \\ 1 7 5 0 2 5 0 4 | ||||
| 0x35, 0x30, 0x35, 0x32, 0x30, 0x33, 0x20, 0x4e, \\ 5 0 5 2 0 3 - N | ||||
| 0x6f, 0x6e, 0x2d, 0x41, 0x75, 0x74, 0x68, 0x6f, \\ o n - A u t h o | ||||
| 0x72, 0x69, 0x74, 0x61, 0x74, 0x69, 0x76, 0x65, \\ r i t a t i v e | ||||
| 0x20, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, \\ - I n f o r m a | ||||
| 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x30, 0x34, 0x20, \\ t i o n 2 0 4 - | ||||
| 0x4e, 0x6f, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, \\ N o - C o n t e | ||||
| 0x6e, 0x74, 0x33, 0x30, 0x31, 0x20, 0x4d, 0x6f, \\ n t 3 0 1 - M o | ||||
| 0x76, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x6d, \\ v e d - P e r m | ||||
| 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x34, \\ a n e n t l y 4 | ||||
| 0x30, 0x30, 0x20, 0x42, 0x61, 0x64, 0x20, 0x52, \\ 0 0 - B a d - R | ||||
| 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x34, 0x30, \\ e q u e s t 4 0 | ||||
| 0x31, 0x20, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, \\ 1 - U n a u t h | ||||
| 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x34, 0x30, \\ o r i z e d 4 0 | ||||
| 0x33, 0x20, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, \\ 3 - F o r b i d | ||||
| 0x64, 0x65, 0x6e, 0x34, 0x30, 0x34, 0x20, 0x4e, \\ d e n 4 0 4 - N | ||||
| 0x6f, 0x74, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, \\ o t - F o u n d | ||||
| 0x35, 0x30, 0x30, 0x20, 0x49, 0x6e, 0x74, 0x65, \\ 5 0 0 - I n t e | ||||
| 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, \\ r n a l - S e r | ||||
| 0x76, 0x65, 0x72, 0x20, 0x45, 0x72, 0x72, 0x6f, \\ v e r - E r r o | ||||
| 0x72, 0x35, 0x30, 0x31, 0x20, 0x4e, 0x6f, 0x74, \\ r 5 0 1 - N o t | ||||
| 0x20, 0x49, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, \\ - I m p l e m e | ||||
| 0x6e, 0x74, 0x65, 0x64, 0x35, 0x30, 0x33, 0x20, \\ n t e d 5 0 3 - | ||||
| 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, \\ S e r v i c e - | ||||
| 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, \\ U n a v a i l a | ||||
| 0x62, 0x6c, 0x65, 0x4a, 0x61, 0x6e, 0x20, 0x46, \\ b l e J a n - F | ||||
| 0x65, 0x62, 0x20, 0x4d, 0x61, 0x72, 0x20, 0x41, \\ e b - M a r - A | ||||
| 0x70, 0x72, 0x20, 0x4d, 0x61, 0x79, 0x20, 0x4a, \\ p r - M a y - J | ||||
| 0x75, 0x6e, 0x20, 0x4a, 0x75, 0x6c, 0x20, 0x41, \\ u n - J u l - A | ||||
| 0x75, 0x67, 0x20, 0x53, 0x65, 0x70, 0x74, 0x20, \\ u g - S e p t - | ||||
| 0x4f, 0x63, 0x74, 0x20, 0x4e, 0x6f, 0x76, 0x20, \\ O c t - N o v - | ||||
| 0x44, 0x65, 0x63, 0x20, 0x30, 0x30, 0x3a, 0x30, \\ D e c - 0 0 - 0 | ||||
| 0x30, 0x3a, 0x30, 0x30, 0x20, 0x4d, 0x6f, 0x6e, \\ 0 - 0 0 - M o n | ||||
| 0x2c, 0x20, 0x54, 0x75, 0x65, 0x2c, 0x20, 0x57, \\ - - T u e - - W | ||||
| 0x65, 0x64, 0x2c, 0x20, 0x54, 0x68, 0x75, 0x2c, \\ e d - - T h u - | ||||
| 0x20, 0x46, 0x72, 0x69, 0x2c, 0x20, 0x53, 0x61, \\ - F r i - - S a | ||||
| 0x74, 0x2c, 0x20, 0x53, 0x75, 0x6e, 0x2c, 0x20, \\ t - - S u n - - | ||||
| 0x47, 0x4d, 0x54, 0x63, 0x68, 0x75, 0x6e, 0x6b, \\ G M T c h u n k | ||||
| 0x65, 0x64, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x2f, \\ e d - t e x t - | ||||
| 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x69, 0x6d, 0x61, \\ h t m l - i m a | ||||
| 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x2c, 0x69, \\ g e - p n g - i | ||||
| 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x67, \\ m a g e - j p g | ||||
| 0x2c, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, \\ - i m a g e - g | ||||
| 0x69, 0x66, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, \\ i f - a p p l i | ||||
| 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, \\ c a t i o n - x | ||||
| 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, \\ m l - a p p l i | ||||
| 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, \\ c a t i o n - x | ||||
| 0x68, 0x74, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, \\ h t m l - x m l | ||||
| 0x2c, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, \\ - t e x t - p l | ||||
| 0x61, 0x69, 0x6e, 0x2c, 0x74, 0x65, 0x78, 0x74, \\ a i n - t e x t | ||||
| 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, \\ - j a v a s c r | ||||
| 0x69, 0x70, 0x74, 0x2c, 0x70, 0x75, 0x62, 0x6c, \\ i p t - p u b l | ||||
| 0x69, 0x63, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, \\ i c p r i v a t | ||||
| 0x65, 0x6d, 0x61, 0x78, 0x2d, 0x61, 0x67, 0x65, \\ e m a x - a g e | ||||
| 0x3d, 0x67, 0x7a, 0x69, 0x70, 0x2c, 0x64, 0x65, \\ - g z i p - d e | ||||
| 0x66, 0x6c, 0x61, 0x74, 0x65, 0x2c, 0x73, 0x64, \\ f l a t e - s d | ||||
| 0x63, 0x68, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, \\ c h c h a r s e | ||||
| 0x74, 0x3d, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x63, \\ t - u t f - 8 c | ||||
| 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, 0x69, \\ h a r s e t - i | ||||
| 0x73, 0x6f, 0x2d, 0x38, 0x38, 0x35, 0x39, 0x2d, \\ s o - 8 8 5 9 - | ||||
| 0x31, 0x2c, 0x75, 0x74, 0x66, 0x2d, 0x2c, 0x2a, \\ 1 - u t f - - - | ||||
| 0x2c, 0x65, 0x6e, 0x71, 0x3d, 0x30, 0x2e \\ - e n q - 0 - | ||||
| }; | ||||
| <CODE ENDS> | 3.7.10. Header Block | |||
| The entire contents of the name/value header block is compressed | The header block is found in the HEADERS, HEADERS+PRIORITY and | |||
| using zlib. There is a single zlib stream for all name value pairs | PUSH_PROMISE frames. The header block consists of a set of header | |||
| in one direction on a connection. HTTP/2.0 uses a SYNC_FLUSH between | fields, which are name-value pairs. Headers are compressed using | |||
| each compressed frame. | black magic. | |||
| Implementation notes: the compression engine can be tuned to favor | Compression of header fields is a work in progress, as is the format | |||
| speed or size. Optimizing for size increases memory use and CPU | of this block. | |||
| consumption. Because header blocks are generally small, implementors | ||||
| may want to reduce the window-size of the compression engine from the | ||||
| default 15bits (a 32KB window) to more like 11bits (a 2KB window). | ||||
| The exact setting is chosen by the compressor, the decompressor will | ||||
| work with any setting. | ||||
| 4. HTTP Layering over HTTP/2.0 | 4. HTTP Message Exchanges | |||
| HTTP/2.0 is intended to be as compatible as possible with current | HTTP/2.0 is intended to be as compatible as possible with current | |||
| web-based applications. This means that, from the perspective of the | web-based applications. This means that, from the perspective of the | |||
| server business logic or application API, the features of HTTP are | server business logic or application API, the features of HTTP are | |||
| unchanged. To achieve this, all of the application request and | unchanged. To achieve this, all of the application request and | |||
| response header semantics are preserved, although the syntax of | response header semantics are preserved, although the syntax of | |||
| conveying those semantics has changed. Thus, the rules from the | conveying those semantics has changed. Thus, the rules from HTTP/1.1 | |||
| HTTP/1.1 specification in RFC2616 [RFC2616] apply with the changes in | ([HTTP-p1], [HTTP-p2], [HTTP-p4], [HTTP-p5], [HTTP-p6], and | |||
| the sections below. | [HTTP-p7]) apply with the changes in the sections below. | |||
| 4.1. Connection Management | 4.1. Connection Management | |||
| Clients SHOULD NOT open more than one HTTP/2.0 session to a given | Clients SHOULD NOT open more than one HTTP/2.0 session to a given | |||
| origin [RFC6454] concurrently. | origin ([RFC6454]) concurrently. | |||
| Note that it is possible for one HTTP/2.0 session to be finishing | Note that it is possible for one HTTP/2.0 session to be finishing | |||
| (e.g. a GOAWAY message has been sent, but not all streams have | (e.g. a GOAWAY message has been sent, but not all streams have | |||
| finished), while another HTTP/2.0 session is starting. | finished), while another HTTP/2.0 session is starting. | |||
| 4.1.1. Use of GOAWAY | 4.1.1. Use of GOAWAY | |||
| HTTP/2.0 provides a GOAWAY message which can be used when closing a | HTTP/2.0 provides a GOAWAY message which can be used when closing a | |||
| connection from either the client or server. Without a server GOAWAY | connection from either the client or server. Without a server GOAWAY | |||
| message, HTTP has a race condition where the client sends a request | message, HTTP has a race condition where the client sends a request | |||
| (a new SYN_STREAM) just as the server is closing the connection, and | just as the server is closing the connection, and the client cannot | |||
| the client cannot know if the server received the stream or not. By | know if the server received the stream or not. By using the last- | |||
| using the last-stream-id in the GOAWAY, servers can indicate to the | stream-id in the GOAWAY, servers can indicate to the client if a | |||
| client if a request was processed or not. | request was processed or not. | |||
| Note that some servers will choose to send the GOAWAY and immediately | Note that some servers will choose to send the GOAWAY and immediately | |||
| terminate the connection without waiting for active streams to | terminate the connection without waiting for active streams to | |||
| finish. The client will be able to determine this because HTTP/2.0 | finish. The client will be able to determine this because HTTP/2.0 | |||
| streams are determinstically closed. This abrupt termination will | streams are deterministically closed. This abrupt termination will | |||
| force the client to heuristically decide whether to retry the pending | force the client to heuristically decide whether to retry the pending | |||
| requests. Clients always need to be capable of dealing with this | requests. Clients always need to be capable of dealing with this | |||
| case because they must deal with accidental connection termination | case because they must deal with accidental connection termination | |||
| cases, which are the same as the server never having sent a GOAWAY. | cases, which are the same as the server never having sent a GOAWAY. | |||
| More sophisticated servers will use GOAWAY to implement a graceful | More sophisticated servers will use GOAWAY to implement a graceful | |||
| teardown. They will send the GOAWAY and provide some time for the | teardown. They will send the GOAWAY and provide some time for the | |||
| active streams to finish before terminating the connection. | active streams to finish before terminating the connection. | |||
| If a HTTP/2.0 client closes the connection, it should also send a | If a HTTP/2.0 client closes the connection, it should also send a | |||
| GOAWAY message. This allows the server to know if any server-push | GOAWAY message. This allows the server to know if any server-push | |||
| streams were received by the client. | streams were received by the client. | |||
| If the endpoint closing the connection has not received any | If the endpoint closing the connection has not received frames on any | |||
| SYN_STREAMs from the remote, the GOAWAY will contain a last-stream-id | stream, the GOAWAY will contain a last-stream-id of 0. | |||
| of 0. | ||||
| 4.2. HTTP Request/Response | 4.2. HTTP Request/Response | |||
| 4.2.1. Request | 4.2.1. HTTP Header Fields and HTTP/2.0 Headers | |||
| The client initiates a request by sending a SYN_STREAM frame. For | At the application level, HTTP uses name-value pairs in its header | |||
| requests which do not contain a body, the SYN_STREAM frame MUST set | fields. Because HTTP/2.0 merges the existing HTTP header fields with | |||
| the FLAG_FIN, indicating that the client intends to send no further | HTTP/2.0 headers, there is a possibility that some HTTP applications | |||
| data on this stream. For requests which do contain a body, the | already use a particular header field name. To avoid any conflicts, | |||
| SYN_STREAM will not contain the FLAG_FIN, and the body will follow | all header fields introduced for layering HTTP over HTTP/2.0 are | |||
| the SYN_STREAM in a series of DATA frames. The last DATA frame will | prefixed with ":". ":" is not a valid sequence in HTTP/1.* header | |||
| set the FLAG_FIN to indicate the end of the body. | field naming, preventing any possible conflict. | |||
| The SYN_STREAM Name/Value section will contain all of the HTTP | 4.2.2. Request | |||
| headers which are associated with an HTTP request. The header block | ||||
| in HTTP/2.0 is mostly unchanged from today's HTTP header block, with | ||||
| the following differences: | ||||
| The first line of the request is unfolded into name/value pairs | The client initiates a request by sending a HEADERS+PRIORITY frame. | |||
| like other HTTP headers and MUST be present: | Requests that do not contain a body MUST set the FINAL flag, | |||
| indicating that the client intends to send no further data on this | ||||
| stream, unless the server intends to push resources (see | ||||
| Section 4.3). HEADERS+PRIORITY frame does not contain the FINAL flag | ||||
| for requests that contain a body. The body of a request follows as a | ||||
| series of DATA frames. The last DATA frame sets the FINAL flag to | ||||
| indicate the end of the body. | ||||
| ":method" - the HTTP method for this request (e.g. "GET", | The header fields included in the HEADERS+PRIORITY frame contain all | |||
| "POST", "HEAD", etc) | of the HTTP header fields that are associated with an HTTP request. | |||
| The header block in HTTP/2.0 is mostly unchanged from today's HTTP | ||||
| header block, with the following differences: | ||||
| ":path" - the url-path for this url with "/" prefixed. (See | The following fields that are carried in the request line in | |||
| RFC1738 [RFC1738]). For example, for | HTTP/1.1 ([HTTP-p1], Section 3.1.1) are defined as special-valued | |||
| name-value pairs: | ||||
| ":method": the HTTP method for this request (e.g. "GET", "POST", | ||||
| "HEAD", etc) ([HTTP-p2], Section 4) | ||||
| ":path": ":path" - the request-target for this URI with "/" | ||||
| prefixed (see [HTTP-p1], Section 3.1.1). For example, for | ||||
| "http://www.google.com/search?q=dogs" the path would be | "http://www.google.com/search?q=dogs" the path would be | |||
| "/search?q=dogs". | "/search?q=dogs". [[anchor26: what forms of the HTTPbis | |||
| request-target are allowed here?]] | ||||
| ":version" - the HTTP version of this request (e.g. | These header fields MUST be present in HTTP requests. | |||
| "HTTP/1.1") | ||||
| In addition, the following two name/value pairs must also be | In addition, the following two name-value pairs MUST be present in | |||
| present in every request: | every request: | |||
| ":host" - the hostport (See RFC1738 [RFC1738]) portion of the | ":host": the host and optional port portions (see [RFC3986], | |||
| URL for this request (e.g. "www.google.com:1234"). This header | Section 3.2) of the URI for this request (e.g. "www.google.com: | |||
| is the same as the HTTP 'Host' header. | 1234"). This header field is the same as the HTTP 'Host' | |||
| header field ([HTTP-p1], Section 5.4). | ||||
| ":scheme" - the scheme portion of the URL for this request | ":scheme": the scheme portion of the URI for this request (e.g. | |||
| (e.g. "https")) | "https") | |||
| Header names are all lowercase. | All header field names starting with ":" (whether defined in this | |||
| document or future extensions to this document) MUST appear before | ||||
| any other header fields. | ||||
| Header field names MUST be all lowercase. | ||||
| The Connection, Host, Keep-Alive, Proxy-Connection, and Transfer- | The Connection, Host, Keep-Alive, Proxy-Connection, and Transfer- | |||
| Encoding headers are not valid and MUST not be sent. | Encoding header fields are not valid and MUST not be sent. | |||
| User-agents MUST support gzip compression. Regardless of the | User-agents MUST support gzip compression. Regardless of the | |||
| Accept-Encoding sent by the user-agent, the server may always send | Accept-Encoding sent by the user-agent, the server may always send | |||
| content encoded with gzip or deflate encoding. | content encoded with gzip or deflate encoding. [[anchor27: Still | |||
| valid?]] | ||||
| If a server receives a request where the sum of the data frame | If a server receives a request where the sum of the data frame | |||
| payload lengths does not equal the size of the Content-Length | payload lengths does not equal the size of the Content-Length | |||
| header, the server MUST return a 400 (Bad Request) error. | header field, the server MUST return a 400 (Bad Request) error. | |||
| POST-specific changes: | ||||
| Although POSTs are inherently chunked, POST requests SHOULD | Although POSTs are inherently chunked, POST requests SHOULD also | |||
| also be accompanied by a Content-Length header. There are two | be accompanied by a Content-Length header field. First, it | |||
| reasons for this: First, it assists with upload progress meters | informs the server of how much data to expect, which the server | |||
| for an improved user experience. But second, we know from | can used to track overall progress and provide appropriate user | |||
| early versions of HTTP/2.0 that failure to send a content | feedback. More importantly, some HTTP server implementations fail | |||
| length header is incompatible with many existing HTTP server | to correctly process requests that omit the Content-Length header | |||
| implementations. Existing user-agents do not omit the Content- | field. Many existing clients send a Content-Length header field, | |||
| Length header, and server implementations have come to depend | which caused server implementations have come to depend upon its | |||
| upon this. | presence. | |||
| The user-agent is free to prioritize requests as it sees fit. If the | The user-agent is free to prioritize requests as it sees fit. If the | |||
| user-agent cannot make progress without receiving a resource, it | user-agent cannot make progress without receiving a resource, it | |||
| should attempt to raise the priority of that resource. Resources | should attempt to raise the priority of that resource. Resources | |||
| such as images, SHOULD generally use the lowest priority. | such as images, SHOULD generally use the lowest priority. | |||
| If a client sends a SYN_STREAM without all of the method, host, path, | If a client sends a HEADERS+PRIORITY frame that omits a mandatory | |||
| scheme, and version headers, the server MUST reply with a HTTP 400 | header, the server MUST reply with a HTTP 400 Bad Request reply. | |||
| Bad Request reply. | [[anchor28: Ed: why PROTOCOL_ERROR on missing ":status" in the | |||
| response, but HTTP 400 here?]] | ||||
| 4.2.2. Response | If the server receives a data frame prior to a HEADERS or HEADERS+ | |||
| PRIORITY frame the server MUST treat this as a stream error | ||||
| (Section 3.5.2) of type PROTOCOL_ERROR. | ||||
| The server responds to a client request with a SYN_REPLY frame. | 4.2.3. Response | |||
| Symmetric to the client's upload stream, server will send data after | ||||
| the SYN_REPLY frame via a series of DATA frames, and the last data | ||||
| frame will contain the FLAG_FIN to indicate successful end-of-stream. | ||||
| If a response (like a 202 or 204 response) contains no body, the | ||||
| SYN_REPLY frame may contain the FLAG_FIN flag to indicate no further | ||||
| data will be sent on the stream. | ||||
| The response status line is unfolded into name/value pairs like | The server responds to a client request with a HEADERS frame. | |||
| other HTTP headers and must be present: | Symmetric to the client's upload stream, server will send any | |||
| response body in a series of DATA frames. The last data frame will | ||||
| contain the FINAL flag to indicate the end of the stream and the end | ||||
| of the response. A response that contains no body (such as a 204 or | ||||
| 304 response) consists only of a HEADERS frame that contains the | ||||
| FINAL flag to indicate no further data will be sent on the stream. | ||||
| ":status" - The HTTP response status code (e.g. "200" or "200 | The response status line is unfolded into name-value pairs like | |||
| OK") | other HTTP header fields and must be present: | |||
| ":version" - The HTTP response version (e.g. "HTTP/1.1") | ":status": The HTTP response status code (e.g. "200" or "200 OK") | |||
| All header names must be lowercase. | All header field names starting with ":" (whether defined in this | |||
| document or future extensions to this document) MUST appear before | ||||
| any other header fields. | ||||
| All header field names MUST be all lowercase. | ||||
| The Connection, Keep-Alive, Proxy-Connection, and Transfer- | The Connection, Keep-Alive, Proxy-Connection, and Transfer- | |||
| Encoding headers are not valid and MUST not be sent. | Encoding header fields are not valid and MUST not be sent. | |||
| Responses MAY be accompanied by a Content-Length header for | Responses MAY be accompanied by a Content-Length header field for | |||
| advisory purposes. (e.g. for UI progress meters) | advisory purposes. This allows clients to learn the full size of | |||
| an entity prior to receiving all the data frames. This can help | ||||
| in, for example, reporting progress. | ||||
| If a client receives a response where the sum of the data frame | If a client receives a response where the sum of the data frame | |||
| payload lengths does not equal the size of the Content-Length | payload length does not equal the size of the Content-Length | |||
| header, the client MUST ignore the content length header. | header field, the client MUST ignore the content length header | |||
| field. [[anchor29: Ed: See | ||||
| If a client receives a SYN_REPLY without a status or without a | <https://github.com/http2/http2-spec/issues/46>.]] | |||
| version header, the client must reply with a RST_STREAM frame | ||||
| indicating a PROTOCOL ERROR. | ||||
| 4.2.3. Authentication | ||||
| When a client sends a request to an origin server that requires | ||||
| authentication, the server can reply with a "401 Unauthorized" | ||||
| response, and include a WWW-Authenticate challenge header that | ||||
| defines the authentication scheme to be used. The client then | ||||
| retries the request with an Authorization header appropriate to the | ||||
| specified authentication scheme. | ||||
| There are four options for proxy authentication, Basic, Digest, NTLM | ||||
| and Negotiate (SPNEGO). The first two options were defined in | ||||
| RFC2617 [RFC2617], and are stateless. The second two options were | ||||
| developed by Microsoft and specified in RFC4559 [RFC4559], and are | ||||
| stateful; otherwise known as multi-round authentication, or | ||||
| connection authentication. | ||||
| 4.2.3.1. Stateless Authentication | ||||
| Stateless Authentication over HTTP/2.0 is identical to how it is | ||||
| performed over HTTP. If multiple HTTP/2.0 streams are concurrently | ||||
| sent to a single server, each will authenticate independently, | ||||
| similar to how two HTTP connections would independently authenticate | ||||
| to a proxy server. | ||||
| 4.2.3.2. Stateful Authentication | ||||
| Unfortunately, the stateful authentication mechanisms were | ||||
| implemented and defined in a such a way that directly violates | ||||
| RFC2617 - they do not include a "realm" as part of the request. This | ||||
| is problematic in HTTP/2.0 because it makes it impossible for a | ||||
| client to disambiguate two concurrent server authentication | ||||
| challenges. | ||||
| To deal with this case, HTTP/2.0 servers using Stateful | ||||
| Authentication MUST implement one of two changes: | ||||
| Servers can add a "realm=<desired realm>" header so that the two | If a client receives a response with an absent or duplicated status | |||
| authentication requests can be disambiguated and run concurrently. | header, the client MUST treat this as a stream error (Section 3.5.2) | |||
| Unfortunately, given how these mechanisms work, this is probably | of type PROTOCOL_ERROR. | |||
| not practical. | ||||
| Upon sending the first stateful challenge response, the server | If the client receives a data frame prior to a HEADERS or HEADERS+ | |||
| MUST buffer and defer all further frames which are not part of | PRIORITY frame the client MUST treat this as a stream error | |||
| completing the challenge until the challenge has completed. | (Section 3.5.2) of type PROTOCOL_ERROR. | |||
| Completing the authentication challenge may take multiple round | ||||
| trips. Once the client receives a "401 Authenticate" response for | ||||
| a stateful authentication type, it MUST stop sending new requests | ||||
| to the server until the authentication has completed by receiving | ||||
| a non-401 response on at least one stream. | ||||
| 4.3. Server Push Transactions | 4.3. Server Push Transactions | |||
| HTTP/2.0 enables a server to send multiple replies to a client for a | HTTP/2.0 enables a server to send multiple replies to a client for a | |||
| single request. The rationale for this feature is that sometimes a | single request. The rationale for this feature is that sometimes a | |||
| server knows that it will need to send multiple resources in response | server knows that it will need to send multiple resources in response | |||
| to a single request. Without server push features, the client must | to a single request. Without server push features, the client must | |||
| first download the primary resource, then discover the secondary | first download the primary resource, then discover the secondary | |||
| resource(s), and request them. Pushing of resources avoids the | resource(s), and request them. Pushing of resources avoids the | |||
| round-trip delay, but also creates a potential race where a server | round-trip delay, but also creates a potential race where a server | |||
| can be pushing content which a user-agent is in the process of | can be pushing content which a user-agent is in the process of | |||
| requesting. The following mechanics attempt to prevent the race | requesting. The following mechanics attempt to prevent the race | |||
| condition while enabling the performance benefit. | condition while enabling the performance benefit. | |||
| Server push is an optional feature. Server push can be disabled by | ||||
| clients that do not wish to receive pushed resources by advertising a | ||||
| SETTINGS_MAX_CONCURRENT_STREAMS SETTING (Section 3.7.4) of zero. | ||||
| This prevents servers from creating the streams necessary to push | ||||
| resources. | ||||
| Browsers receiving a pushed response MUST validate that the server is | Browsers receiving a pushed response MUST validate that the server is | |||
| authorized to push the URL using the browser same-origin [RFC6454] | authorized to push the resource using the same-origin policy | |||
| policy. For example, a HTTP/2.0 connection to www.foo.com is | ([RFC6454], Section 3). For example, a HTTP/2.0 connection to | |||
| generally not permitted to push a response for www.evil.com. | "example.com" is generally [[anchor30: Ed: weaselly use of | |||
| "generally", needs better definition]] not permitted to push a | ||||
| response for "www.example.org". | ||||
| If the browser accepts a pushed response (e.g. it does not send a | A client that accepts pushed resources caches those resources as | |||
| RST_STREAM), the browser MUST attempt to cache the pushed response in | though they were responses to GET requests. | |||
| same way that it would cache any other response. This means | ||||
| validating the response headers and inserting into the disk cache. | ||||
| Because pushed responses have no request, they have no request | Pushed responses are associated with a request at the HTTP/2.0 | |||
| headers associated with them. At the framing layer, HTTP/2.0 pushed | framing layer. The PUSH_PROMISE includes a stream identifier for an | |||
| streams contain an "associated-stream-id" which indicates the | associated request/response exchange that supplies request header | |||
| requested stream for which the pushed stream is related. The pushed | fields. The pushed stream inherits all of the request header fields | |||
| stream inherits all of the headers from the associated-stream-id with | from the associated stream with the exception of resource | |||
| the exception of ":host", ":scheme", and ":path", which are provided | identification header fields (":host", ":scheme", and ":path"), which | |||
| as part of the pushed response stream headers. The browser MUST | are provided as part of the PUSH_PROMISE frame. Pushed resources | |||
| store these inherited and implied request headers with the cached | always have an associated ":method" of "GET". A cache MUST store | |||
| these inherited and implied request header fields with the cached | ||||
| resource. | resource. | |||
| Implementation note: With server push, it is theoretically possible | Implementation note: With server push, it is theoretically possible | |||
| for servers to push unreasonable amounts of content or resources to | for servers to push unreasonable amounts of content or resources to | |||
| the user-agent. Browsers MUST implement throttles to protect against | the user-agent. Browsers MUST implement throttles to protect against | |||
| unreasonable push attacks. | unreasonable push attacks. [[anchor31: Ed: insufficiently specified | |||
| to implement; would like to remove]] | ||||
| 4.3.1. Server implementation | 4.3.1. Server implementation | |||
| When the server intends to push a resource to the user-agent, it | A server pushes resources in association with a request from the | |||
| opens a new stream by sending a unidirectional SYN_STREAM. The | client. Prior to closing the response stream, the server sends a | |||
| SYN_STREAM MUST include an Associated-To-Stream-ID, and MUST set the | PUSH_PROMISE for each resource that it intends to push. The | |||
| FLAG_UNIDIRECTIONAL flag. The SYN_STREAM MUST include headers for | PUSH_PROMISE includes header fields that allow the client to identify | |||
| ":scheme", ":host", ":path", which represent the URL for the resource | the resource (":scheme", ":host", and ":port"). | |||
| being pushed. Subsequent headers may follow in HEADERS frames. The | ||||
| purpose of the association is so that the user-agent can | ||||
| differentiate which request induced the pushed stream; without it, if | ||||
| the user-agent had two tabs open to the same page, each pushing | ||||
| unique content under a fixed URL, the user-agent would not be able to | ||||
| differentiate the requests. | ||||
| The Associated-To-Stream-ID must be the ID of an existing, open | A server can push multiple resources in response to a request, but | |||
| stream. The reason for this restriction is to have a clear endpoint | these can only be sent while the response stream remains open. A | |||
| for pushed content. If the user-agent requested a resource on stream | server MUST NOT send a PUSH_PROMISE on a half-closed stream. | |||
| 11, the server replies on stream 11. It can push any number of | ||||
| additional streams to the client before sending a FLAG_FIN on stream | ||||
| 11. However, once the originating stream is closed no further push | ||||
| streams may be associated with it. The pushed streams do not need to | ||||
| be closed (FIN set) before the originating stream is closed, they | ||||
| only need to be created before the originating stream closes. | ||||
| It is illegal for a server to push a resource with the Associated-To- | The server SHOULD include any header fields in a PUSH_PROMISE that | |||
| Stream-ID of 0. | would allow a cache to determine if the resource is already cached | |||
| (see [HTTP-p6], Section 4). | ||||
| To minimize race conditions with the client, the SYN_STREAM for the | After sending a PUSH_PROMISE, the server commences transmission of a | |||
| pushed resources MUST be sent prior to sending any content which | pushed resource. A pushed resource uses a server-initiated stream. | |||
| could allow the client to discover the pushed resource and request | The server sends frames on this stream in the same order as an HTTP | |||
| response (Section 4.2.3): a HEADERS frame followed by DATA frames. | ||||
| Many uses of server push are to send content that a client is likely | ||||
| to discover a need for based on the content of a response | ||||
| representation. To minimize the chances that a client will make a | ||||
| request for resources that are being pushed - causing duplicate | ||||
| copies of a resource to be sent by the server - a PUSH_PROMISE frame | ||||
| SHOULD be sent prior to any content in the response representation | ||||
| that might allow a client to discover the pushed resource and request | ||||
| it. | it. | |||
| The server MUST only push resources which would have been returned | The server MUST only push resources that could have been returned | |||
| from a GET request. | from a GET request. | |||
| Note: If the server does not have all of the Name/Value Response | Note: A server does not need to have all response header fields | |||
| headers available at the time it issues the HEADERS frame for the | available at the time it issues a PUSH_PROMISE frame. All remaining | |||
| pushed resource, it may later use an additional HEADERS frame to | header fields are included in the HEADERS frame. The HEADERS frame | |||
| augment the name/value pairs to be associated with the pushed stream. | MUST NOT duplicate header fields from the PUSH_PROMISE frames. | |||
| The subsequent HEADERS frame(s) must not contain a header for | ||||
| ':host', ':scheme', or ':path' (e.g. the server can't change the | ||||
| identity of the resource to be pushed). The HEADERS frame must not | ||||
| contain duplicate headers with a previously sent HEADERS frame. The | ||||
| server must send a HEADERS frame including the scheme/host/port | ||||
| headers before sending any data frames on the stream. | ||||
| 4.3.2. Client implementation | 4.3.2. Client implementation | |||
| When fetching a resource the client has 3 possibilities: | When fetching a resource the client has 3 possibilities: | |||
| the resource is not being pushed | 1. the resource is not being pushed | |||
| the resource is being pushed, but the data has not yet arrived | 2. the resource is being pushed, but the data has not yet arrived | |||
| the resource is being pushed, and the data has started to arrive | 3. the resource is being pushed, and the data has started to arrive | |||
| When a SYN_STREAM and HEADERS frame which contains an Associated-To- | When a HEADERS+PRIORITY frame that contains an | |||
| Stream-ID is received, the client must not issue GET requests for the | Associated-To-Stream-ID is received, the client MUST NOT[[anchor34: | |||
| resource in the pushed stream, and instead wait for the pushed stream | SHOULD NOT?]] issue GET requests for the resource in the pushed | |||
| to arrive. | stream, and instead wait for the pushed stream to arrive. | |||
| If a client receives a server push stream with stream-id 0, it MUST | A server MUST NOT push a resource with an Associated-To-Stream-ID of | |||
| issue a session error (Section 3.4.1) with the status code | 0. Clients MUST treat this as a session error (Section 3.5.1) of | |||
| PROTOCOL_ERROR. | type PROTOCOL_ERROR. | |||
| When a client receives a SYN_STREAM from the server without a the | When a client receives a PUSH_PROMISE frame from the server without a | |||
| ':host', ':scheme', and ':path' headers in the Name/Value section, it | the ":host", ":scheme", and ":path" header fields, it MUST treat this | |||
| MUST reply with a RST_STREAM with error code HTTP_PROTOCOL_ERROR. | as a stream error (Section 3.5.2) of type PROTOCOL_ERROR. | |||
| To cancel individual server push streams, the client can issue a | To cancel individual server push streams, the client can issue a | |||
| stream error (Section 3.4.2) with error code CANCEL. Upon receipt, | stream error (Section 3.5.2) of type CANCEL. Upon receipt, the | |||
| the server MUST stop sending on this stream immediately (this is an | server ceases transmission of the pushed data. | |||
| Abrupt termination). | ||||
| To cancel all server push streams related to a request, the client | To cancel all server push streams related to a request, the client | |||
| may issue a stream error (Section 3.4.2) with error code CANCEL on | may issue a stream error (Section 3.5.2) of type CANCEL on the | |||
| the associated-stream-id. By cancelling that stream, the server MUST | associated-stream-id. By cancelling that stream, the server MUST | |||
| immediately stop sending frames for any streams with | immediately stop sending frames for any streams with | |||
| in-association-to for the original stream. | in-association-to for the original stream. [[anchor35: Ed: Triggering | |||
| side-effects on stream reset is going to be problematic for the | ||||
| If the server sends a HEADER frame containing duplicate headers with | framing layer. Purely from a design perspective, it's a layering | |||
| a previous HEADERS frame for the same stream, the client must issue a | violation. More practically speaking, the base request stream might | |||
| stream error (Section 3.4.2) with error code PROTOCOL ERROR. | already be removed. Special handling logic would be required.]] | |||
| If the server sends a HEADERS frame containing header fields that | ||||
| duplicate values on a previous HEADERS or PUSH_PROMISE frames on the | ||||
| same stream, the client MUST treat this as a stream error | ||||
| (Section 3.5.2) of type PROTOCOL_ERROR. | ||||
| If the server sends a HEADERS frame after sending a data frame for | If the server sends a HEADERS frame after sending a data frame for | |||
| the same stream, the client MAY ignore the HEADERS frame. Ignoring | the same stream, the client MAY ignore the HEADERS frame. Ignoring | |||
| the HEADERS frame after a data frame prevents handling of HTTP's | the HEADERS frame after a data frame prevents handling of HTTP's | |||
| trailing headers | trailing header fields (Section 4.1.1 of [HTTP-p1]). | |||
| (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.40). | ||||
| 5. Design Rationale and Notes | 5. Design Rationale and Notes | |||
| Authors' notes: The notes in this section have no bearing on the | Authors' notes: The notes in this section have no bearing on the | |||
| HTTP/2.0 protocol as specified within this document, and none of | HTTP/2.0 protocol as specified within this document, and none of | |||
| these notes should be considered authoritative about how the protocol | these notes should be considered authoritative about how the protocol | |||
| works. However, these notes may prove useful in future debates about | works. However, these notes may prove useful in future debates about | |||
| how to resolve protocol ambiguities or how to evolve the protocol | how to resolve protocol ambiguities or how to evolve the protocol | |||
| going forward. They may be removed before the final draft. | going forward. They may be removed before the final draft. | |||
| 5.1. Separation of Framing Layer and Application Layer | 5.1. Separation of Framing Layer and Application Layer | |||
| Readers may note that this specification sometimes blends the framing | Readers may note that this specification sometimes blends the framing | |||
| layer (Section 3) with requirements of a specific application - HTTP | layer (Section 3) with requirements of a specific application - HTTP | |||
| (Section 4). This is reflected in the request/response nature of the | (Section 4). This is reflected in the request/response nature of the | |||
| streams, the definition of the HEADERS and compression contexts which | streams and the definition of the HEADERS which are very similar to | |||
| are very similar to HTTP, and other areas as well. | HTTP, and other areas as well. | |||
| This blending is intentional - the primary goal of this protocol is | This blending is intentional - the primary goal of this protocol is | |||
| to create a low-latency protocol for use with HTTP. Isolating the | to create a low-latency protocol for use with HTTP. Isolating the | |||
| two layers is convenient for description of the protocol and how it | two layers is convenient for description of the protocol and how it | |||
| relates to existing HTTP implementations. However, the ability to | relates to existing HTTP implementations. However, the ability to | |||
| reuse the HTTP/2.0 framing layer is a non goal. | reuse the HTTP/2.0 framing layer is a non goal. | |||
| 5.2. Error handling - Framing Layer | 5.2. Error handling - Framing Layer | |||
| Error handling at the HTTP/2.0 layer splits errors into two groups: | Error handling at the HTTP/2.0 layer splits errors into two groups: | |||
| Those that affect an individual HTTP/2.0 stream, and those that do | Those that affect an individual HTTP/2.0 stream, and those that do | |||
| not. | not. | |||
| When an error is confined to a single stream, but general framing is | When an error is confined to a single stream, but general framing is | |||
| in tact, HTTP/2.0 attempts to use the RST_STREAM as a mechanism to | in tact, HTTP/2.0 attempts to use the RST_STREAM as a mechanism to | |||
| invalidate the stream but move forward without aborting the | invalidate the stream but move forward without aborting the | |||
| connection altogether. | connection altogether. | |||
| For errors occuring outside of a single stream context, HTTP/2.0 | For errors occurring outside of a single stream context, HTTP/2.0 | |||
| assumes the entire session is hosed. In this case, the endpoint | assumes the entire session is hosed. In this case, the endpoint | |||
| detecting the error should initiate a connection close. | detecting the error should initiate a connection close. | |||
| 5.3. One Connection Per Domain | 5.3. One Connection Per Domain | |||
| HTTP/2.0 attempts to use fewer connections than other protocols have | HTTP/2.0 attempts to use fewer connections than other protocols have | |||
| traditionally used. The rationale for this behavior is because it is | traditionally used. The rationale for this behavior is because it is | |||
| very difficult to provide a consistent level of service (e.g. TCP | very difficult to provide a consistent level of service (e.g. TCP | |||
| slow-start), prioritization, or optimal compression when the client | slow-start), prioritization, or optimal compression when the client | |||
| is connecting to the server through multiple channels. | is connecting to the server through multiple channels. | |||
| skipping to change at page 44, line 38 ¶ | skipping to change at page 36, line 31 ¶ | |||
| single stream, it creates a potential for head-of-line blocking | single stream, it creates a potential for head-of-line blocking | |||
| problems at the transport level. In tests so far, the negative | problems at the transport level. In tests so far, the negative | |||
| effects of head-of-line blocking (especially in the presence of | effects of head-of-line blocking (especially in the presence of | |||
| packet loss) is outweighed by the benefits of compression and | packet loss) is outweighed by the benefits of compression and | |||
| prioritization. | prioritization. | |||
| 5.4. Fixed vs Variable Length Fields | 5.4. Fixed vs Variable Length Fields | |||
| HTTP/2.0 favors use of fixed length 32bit fields in cases where | HTTP/2.0 favors use of fixed length 32bit fields in cases where | |||
| smaller, variable length encodings could have been used. To some, | smaller, variable length encodings could have been used. To some, | |||
| this seems like a tragic waste of bandwidth. HTTP/2.0 choses the | this seems like a tragic waste of bandwidth. HTTP/2.0 chooses the | |||
| simple encoding for speed and simplicity. | simple encoding for speed and simplicity. | |||
| The goal of HTTP/2.0 is to reduce latency on the network. The | The goal of HTTP/2.0 is to reduce latency on the network. The | |||
| overhead of HTTP/2.0 frames is generally quite low. Each data frame | overhead of HTTP/2.0 frames is generally quite low. Each data frame | |||
| is only an 8 byte overhead for a 1452 byte payload (~0.6%). At the | is only an 8 byte overhead for a 1452 byte payload (~0.6%). At the | |||
| time of this writing, bandwidth is already plentiful, and there is a | time of this writing, bandwidth is already plentiful, and there is a | |||
| strong trend indicating that bandwidth will continue to increase. | strong trend indicating that bandwidth will continue to increase. | |||
| With an average worldwide bandwidth of 1Mbps, and assuming that a | With an average worldwide bandwidth of 1Mbps, and assuming that a | |||
| variable length encoding could reduce the overhead by 50%, the | variable length encoding could reduce the overhead by 50%, the | |||
| latency saved by using a variable length encoding would be less than | latency saved by using a variable length encoding would be less than | |||
| 100 nanoseconds. More interesting are the effects when the larger | 100 nanoseconds. More interesting are the effects when the larger | |||
| encodings force a packet boundary, in which case a round-trip could | encodings force a packet boundary, in which case a round-trip could | |||
| be induced. However, by addressing other aspects of HTTP/2.0 and TCP | be induced. However, by addressing other aspects of HTTP/2.0 and TCP | |||
| interactions, we believe this is completely mitigated. | interactions, we believe this is completely mitigated. | |||
| 5.5. Compression Context(s) | 5.5. Server Push | |||
| When isolating the compression contexts used for communicating with | ||||
| multiple origins, we had a few choices to make. We could have | ||||
| maintained a map (or list) of compression contexts usable for each | ||||
| origin. The basic case is easy - each HEADERS frame would need to | ||||
| identify the context to use for that frame. However, compression | ||||
| contexts are not cheap, so the lifecycle of each context would need | ||||
| to be bounded. For proxy servers, where we could churn through many | ||||
| contexts, this would be a concern. We considered using a static set | ||||
| of contexts, say 16 of them, which would bound the memory use. We | ||||
| also considered dynamic contexts, which could be created on the fly, | ||||
| and would need to be subsequently destroyed. All of these are | ||||
| complicated, and ultimately we decided that such a mechanism creates | ||||
| too many problems to solve. | ||||
| Alternatively, we've chosen the simple approach, which is to simply | ||||
| provide a flag for resetting the compression context. For the common | ||||
| case (no proxy), this fine because most requests are to the same | ||||
| origin and we never need to reset the context. For cases where we | ||||
| are using two different origins over a single HTTP/2.0 session, we | ||||
| simply reset the compression state between each transition. | ||||
| 5.6. Unidirectional streams | ||||
| Many readers notice that unidirectional streams are both a bit | ||||
| confusing in concept and also somewhat redundant. If the recipient | ||||
| of a stream doesn't wish to send data on a stream, it could simply | ||||
| send a SYN_REPLY with the FLAG_FIN bit set. The FLAG_UNIDIRECTIONAL | ||||
| is, therefore, not necessary. | ||||
| It is true that we don't need the UNIDIRECTIONAL markings. It is | ||||
| added because it avoids the recipient of pushed streams from needing | ||||
| to send a set of empty frames (e.g. the SYN_STREAM w/ FLAG_FIN) which | ||||
| otherwise serve no purpose. | ||||
| 5.7. Data Compression | ||||
| Generic compression of data portion of the streams (as opposed to | ||||
| compression of the headers) without knowing the content of the stream | ||||
| is redundant. There is no value in compressing a stream which is | ||||
| already compressed. Because of this, HTTP/2.0 does allow data | ||||
| compression to be optional. We included it because study of existing | ||||
| websites shows that many sites are not using compression as they | ||||
| should, and users suffer because of it. We wanted a mechanism where, | ||||
| at the HTTP/2.0 layer, site administrators could simply force | ||||
| compression - it is better to compress twice than to not compress. | ||||
| Overall, however, with this feature being optional and sometimes | ||||
| redundant, it is unclear if it is useful at all. We will likely | ||||
| remove it from the specification. | ||||
| 5.8. Server Push | ||||
| A subtle but important point is that server push streams must be | A subtle but important point is that server push streams must be | |||
| declared before the associated stream is closed. The reason for this | declared before the associated stream is closed. The reason for this | |||
| is so that proxies have a lifetime for which they can discard | is so that proxies have a lifetime for which they can discard | |||
| information about previous streams. If a pushed stream could | information about previous streams. If a pushed stream could | |||
| associate itself with an already-closed stream, then endpoints would | associate itself with an already-closed stream, then endpoints would | |||
| not have a specific lifecycle for when they could disavow knowledge | not have a specific lifecycle for when they could disavow knowledge | |||
| of the streams which went before. | of the streams which went before. | |||
| 6. Security Considerations | 6. Security Considerations | |||
| 6.1. Use of Same-origin constraints | 6.1. Use of Same-origin constraints | |||
| This specification uses the same-origin policy [RFC6454] in all cases | This specification uses the same-origin policy ([RFC6454], Section 3) | |||
| where verification of content is required. | in all cases where verification of content is required. | |||
| 6.2. HTTP Headers and HTTP/2.0 Headers | ||||
| At the application level, HTTP uses name/value pairs in its headers. | ||||
| Because HTTP/2.0 merges the existing HTTP headers with HTTP/2.0 | ||||
| headers, there is a possibility that some HTTP applications already | ||||
| use a particular header name. To avoid any conflicts, all headers | ||||
| introduced for layering HTTP over HTTP/2.0 are prefixed with ":". ":" | ||||
| is not a valid sequence in HTTP header naming, preventing any | ||||
| possible conflict. | ||||
| 6.3. Cross-Protocol Attacks | 6.2. Cross-Protocol Attacks | |||
| By utilizing TLS, we believe that HTTP/2.0 introduces no new cross- | By utilizing TLS, we believe that HTTP/2.0 introduces no new cross- | |||
| protocol attacks. TLS encrypts the contents of all transmission | protocol attacks. TLS encrypts the contents of all transmission | |||
| (except the handshake itself), making it difficult for attackers to | (except the handshake itself), making it difficult for attackers to | |||
| control the data which could be used in a cross-protocol attack. | control the data which could be used in a cross-protocol attack. | |||
| [[anchor45: Issue: This is no longer true]] | ||||
| 6.4. Server Push Implicit Headers | 6.3. Cacheability of Pushed Resources | |||
| Pushed resources do not have an associated request. In order for | Pushed resources do not have an associated request. In order for | |||
| existing HTTP cache control validations (such as the Vary header) to | existing HTTP cache control validations (such as the Vary header | |||
| work, however, all cached resources must have a set of request | field) to work, all cached resources must have a set of request | |||
| headers. For this reason, browsers MUST be careful to inherit | header fields. For this reason, caches MUST be careful to inherit | |||
| request headers from the associated stream for the push. This | request header fields from the associated stream for the push. This | |||
| includes the 'Cookie' header. | includes the Cookie header field. | |||
| 7. Privacy Considerations | Caching resources that are pushed is possible, based on the guidance | |||
| provided by the origin server in the Cache-Control header field. | ||||
| However, this can cause issues if a single server hosts more than one | ||||
| tenant. For example, a server might offer multiple users each a | ||||
| small portion of its URI space. | ||||
| Where multiple tenants share space on the same server, that server | ||||
| MUST ensure that tenants are not able to push representations of | ||||
| resources that they do not have authority over. Failure to enforce | ||||
| this would allow a tenant to provide a representation that would be | ||||
| served out of cache, overriding the actual representation that the | ||||
| authoritative tenant provides. | ||||
| Pushed resources for which an origin server is not authoritative are | ||||
| never cached or used. | ||||
| 7. Privacy Considerations | ||||
| 7.1. Long Lived Connections | 7.1. Long Lived Connections | |||
| HTTP/2.0 aims to keep connections open longer between clients and | HTTP/2.0 aims to keep connections open longer between clients and | |||
| servers in order to reduce the latency when a user makes a request. | servers in order to reduce the latency when a user makes a request. | |||
| The maintenance of these connections over time could be used to | The maintenance of these connections over time could be used to | |||
| expose private information. For example, a user using a browser | expose private information. For example, a user using a browser | |||
| hours after the previous user stopped using that browser may be able | hours after the previous user stopped using that browser may be able | |||
| to learn about what the previous user was doing. This is a problem | to learn about what the previous user was doing. This is a problem | |||
| with HTTP in its current form as well, however the short lived | with HTTP in its current form as well, however the short lived | |||
| connections make it less of a risk. | connections make it less of a risk. | |||
| 7.2. SETTINGS frame | 7.2. SETTINGS frame | |||
| The HTTP/2.0 SETTINGS frame allows servers to store out-of-band | The HTTP/2.0 SETTINGS frame allows servers to store out-of-band | |||
| transmitted information about the communication between client and | transmitted information about the communication between client and | |||
| server on the client. Although this is intended only to be used to | server on the client. Although this is intended only to be used to | |||
| reduce latency, renegade servers could use it as a mechanism to store | reduce latency, renegade servers could use it as a mechanism to store | |||
| identifying information about the client in future requests. | identifying information about the client in future requests. | |||
| Clients implementing privacy modes, such as Google Chrome's | Clients implementing privacy modes can disable client-persisted | |||
| "incognito mode", may wish to disable client-persisted SETTINGS | SETTINGS storage. | |||
| storage. | ||||
| Clients MUST clear persisted SETTINGS information when clearing the | Clients MUST clear persisted SETTINGS information when clearing the | |||
| cookies. | cookies. | |||
| TODO: Put range maximums on each type of setting to limit | 8. IANA Considerations | |||
| inappropriate uses. | ||||
| 8. Requirements Notation | This document establishes registries for frame types, error codes and | |||
| settings. | ||||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | 8.1. Frame Type Registry | |||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | ||||
| document are to be interpreted as described in RFC 2119 [RFC2119]. | This document establishes a registry for HTTP/2.0 frame types. The | |||
| "HTTP/2.0 Frame Type" registry operates under the "IETF Review" | ||||
| policy [RFC5226]. | ||||
| Frame types are an 8-bit value. When reviewing new frame type | ||||
| registrations, special attention is advised for any frame type- | ||||
| specific flags that are defined. Frame flags can interact with | ||||
| existing flags and could prevent the creation of globally applicable | ||||
| flags. | ||||
| Initial values for the "HTTP/2.0 Frame Type" registry are shown in | ||||
| Table 1. | ||||
| +------------+------------------+---------------------+ | ||||
| | Frame Type | Name | Flags | | ||||
| +------------+------------------+---------------------+ | ||||
| | 0 | DATA | - | | ||||
| | 1 | HEADERS+PRIORITY | - | | ||||
| | 3 | RST_STREAM | - | | ||||
| | 4 | SETTINGS | CLEAR_PERSISTED(2) | | ||||
| | 5 | PUSH_PROMISE | - | | ||||
| | 6 | PING | PONG(2) | | ||||
| | 7 | GOAWAY | - | | ||||
| | 8 | HEADERS | - | | ||||
| | 9 | WINDOW_UPDATE | END_FLOW_CONTROL(2) | | ||||
| +------------+------------------+---------------------+ | ||||
| Table 1 | ||||
| 8.2. Error Code Registry | ||||
| This document establishes a registry for HTTP/2.0 error codes. The | ||||
| "HTTP/2.0 Error Code" registry manages a 32-bit space. The "HTTP/2.0 | ||||
| Error Code" registry operates under the "Expert Review" policy | ||||
| [RFC5226]. | ||||
| Registrations for error codes are required to include a description | ||||
| of the error code. An expert reviewer is advised to examine new | ||||
| registrations for possible duplication with existing error codes. | ||||
| Use of existing registrations is to be encouraged, but not mandated. | ||||
| New registrations are advised to provide the following information: | ||||
| Error Code: The 32-bit error code value. | ||||
| Name: A name for the error code. Specifying an error code name is | ||||
| optional. | ||||
| Description: A description of the conditions where the error code is | ||||
| applicable. | ||||
| Specification: An optional reference for a specification that | ||||
| defines the error code. | ||||
| An initial set of error code registrations can be found in | ||||
| Section 3.5.3. | ||||
| 8.3. Settings Registry | ||||
| This document establishes a registry for HTTP/2.0 settings. The | ||||
| "HTTP/2.0 Settings" registry manages a 24-bit space. The "HTTP/2.0 | ||||
| Settings" registry operates under the "Expert Review" policy | ||||
| [RFC5226]. | ||||
| Registrations for settings are required to include a description of | ||||
| the setting. An expert reviewer is advised to examine new | ||||
| registrations for possible duplication with existing settings. Use | ||||
| of existing registrations is to be encouraged, but not mandated. | ||||
| New registrations are advised to provide the following information: | ||||
| Setting: The 24-bit setting value. | ||||
| Name: A name for the setting. Specifying a name is optional. | ||||
| Flags: Any setting-specific flags that apply, including their value | ||||
| and semantics. | ||||
| Description: A description of the setting. This might include the | ||||
| range of values, any applicable units and how to act upon a value | ||||
| when it is provided. | ||||
| Specification: An optional reference for a specification that | ||||
| defines the setting. | ||||
| An initial set of settings registrations can be found in | ||||
| Section 3.7.4. | ||||
| 9. Acknowledgements | 9. Acknowledgements | |||
| This document includes substantial input from the following | This document includes substantial input from the following | |||
| individuals: | individuals: | |||
| o Adam Langley, Wan-Teh Chang, Jim Morrison, Mark Nottingham, Alyssa | o Adam Langley, Wan-Teh Chang, Jim Morrison, Mark Nottingham, Alyssa | |||
| Wilk, Costin Manolache, William Chan, Vitaliy Lvin, Joe Chan, Adam | Wilk, Costin Manolache, William Chan, Vitaliy Lvin, Joe Chan, Adam | |||
| Barth, Ryan Hamilton, Gavin Peters, Kent Alstad, Kevin Lindsay, | Barth, Ryan Hamilton, Gavin Peters, Kent Alstad, Kevin Lindsay, | |||
| Paul Amer, Fan Yang, Jonathan Leighton (SPDY contributors). | Paul Amer, Fan Yang, Jonathan Leighton (SPDY contributors). | |||
| o Gabriel Montenegro and Willy Tarreau (Upgrade mechanism) | o Gabriel Montenegro and Willy Tarreau (Upgrade mechanism) | |||
| o William Chan, Salvatore Loreto, Osama Mazahir, Gabriel Montenegro, | o William Chan, Salvatore Loreto, Osama Mazahir, Gabriel Montenegro, | |||
| Jitu Padhye, Roberto Peon, Rob Trace (Flow control principles) | Jitu Padhye, Roberto Peon, Rob Trace (Flow control) | |||
| o Mark Nottingham and Julian Reschke | o Mark Nottingham and Julian Reschke | |||
| 10. Normative References | 10. References | |||
| 10.1. Normative References | ||||
| [ASCII] "US-ASCII. Coded Character Set - 7-Bit American | [HTTP-p1] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol | |||
| Standard Code for Information Interchange. | (HTTP/1.1): Message Syntax and Routing", | |||
| Standard ANSI X3.4-1986, ANSI, 1986.". | draft-ietf-httpbis-p1-messaging-22 (work in progress), | |||
| February 2013. | ||||
| [HTTP-p1] Fielding, R. and J. Reschke, "Hypertext Transfer | [HTTP-p2] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol | |||
| Protocol (HTTP/1.1): Message Syntax and Routing", | (HTTP/1.1): Semantics and Content", | |||
| draft-ietf-httpbis-p1-messaging-21 (work in | draft-ietf-httpbis-p2-semantics-22 (work in progress), | |||
| progress), October 2012. | February 2013. | |||
| [HTTP-p2] Fielding, R. and J. Reschke, "Hypertext Transfer | [HTTP-p4] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | |||
| Protocol (HTTP/1.1): Semantics and Content", | Protocol (HTTP/1.1): Conditional Requests", | |||
| draft-ietf-httpbis-p2-semantics-21 (work in | draft-ietf-httpbis-p4-conditional-22 (work in progress), | |||
| progress), October 2012. | February 2013. | |||
| [RFC0793] Postel, J., "Transmission Control Protocol", | [HTTP-p5] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., | |||
| STD 7, RFC 793, September 1981. | "Hypertext Transfer Protocol (HTTP/1.1): Range Requests", | |||
| draft-ietf-httpbis-p5-range-22 (work in progress), | ||||
| February 2013. | ||||
| [RFC1738] Berners-Lee, T., Masinter, L., and M. McCahill, | [HTTP-p6] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, | |||
| "Uniform Resource Locators (URL)", RFC 1738, | Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", | |||
| December 1994. | draft-ietf-httpbis-p6-cache-22 (work in progress), | |||
| February 2013. | ||||
| [RFC1950] Deutsch, L. and J. Gailly, "ZLIB Compressed Data | [HTTP-p7] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | |||
| Format Specification version 3.3", RFC 1950, | Protocol (HTTP/1.1): Authentication", | |||
| May 1996. | draft-ietf-httpbis-p7-auth-22 (work in progress), | |||
| February 2013. | ||||
| [RFC2119] Bradner, S., "Key words for use in RFCs to | [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, | |||
| Indicate Requirement Levels", BCP 14, RFC 2119, | RFC 793, September 1981. | |||
| March 1997. | ||||
| [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Masinter, L., Leach, P., and T. Berners-Lee, | Requirement Levels", BCP 14, RFC 2119, March 1997. | |||
| "Hypertext Transfer Protocol -- HTTP/1.1", | ||||
| RFC 2616, June 1999. | ||||
| [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., | [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | |||
| Lawrence, S., Leach, P., Luotonen, A., and L. | Resource Identifier (URI): Generic Syntax", STD 66, | |||
| Stewart, "HTTP Authentication: Basic and Digest | RFC 3986, January 2005. | |||
| Access Authentication", RFC 2617, June 1999. | ||||
| [RFC4559] Jaganathan, K., Zhu, L., and J. Brezak, "SPNEGO- | [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an | |||
| based Kerberos and NTLM HTTP Authentication in | IANA Considerations Section in RFCs", BCP 26, RFC 5226, | |||
| Microsoft Windows", RFC 4559, June 2006. | May 2008. | |||
| [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer | [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security | |||
| Security (TLS) Protocol Version 1.2", RFC 5246, | (TLS) Protocol Version 1.2", RFC 5246, August 2008. | |||
| August 2008. | ||||
| [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, | [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, | |||
| December 2011. | December 2011. | |||
| [TLSNPN] Langley, A., "TLS Next Protocol Negotiation", | [TLSNPN] Langley, A., "Transport Layer Security (TLS) Next Protocol | |||
| draft-agl-tls-nextprotoneg-01 (work in progress), | Negotiation Extension", draft-agl-tls-nextprotoneg-04 | |||
| August 2010. | (work in progress), May 2012. | |||
| [UDELCOMPRESSION] Yang, F., Amer, P., and J. Leighton, "A | 10.2. Informative References | |||
| Methodology to Derive SPDY's Initial Dictionary | ||||
| for Zlib Compression", <http://www.eecis.udel.edu/ | [RFC1323] Jacobson, V., Braden, B., and D. Borman, "TCP Extensions | |||
| ~amer/PEL/poc/pdf/SPDY-Fan.pdf>. | for High Performance", RFC 1323, May 1992. | |||
| [TALKING] Huang, L-S., Chen, E., Barth, A., Rescorla, E., and C. | ||||
| Jackson, "Talking to Yourself for Fun and Profit", 2011, | ||||
| <http://w2spconf.com/2011/papers/websocket.pdf>. | ||||
| Appendix A. Change Log (to be removed by RFC Editor before publication) | Appendix A. Change Log (to be removed by RFC Editor before publication) | |||
| A.1. Since draft-ietf-httpbis-http2-00 | A.1. Since draft-ietf-httpbis-http2-01 | |||
| Added IANA considerations section for frame types, error codes and | ||||
| settings. | ||||
| Removed data frame compression. | ||||
| Added PUSH_PROMISE. | ||||
| Added globally applicable flags to framing. | ||||
| Removed zlib-based header compression mechanism. | ||||
| Updated references. | ||||
| Clarified stream identifier reuse. | ||||
| Removed CREDENTIALS frame and associated mechanisms. | ||||
| Added advice against naive implementation of flow control. | ||||
| Added session header section. | ||||
| Restructured frame header. Removed distinction between data and | ||||
| control frames. | ||||
| Altered flow control properties to include session-level limits. | ||||
| Added note on cacheability of pushed resources and multiple tenant | ||||
| servers. | ||||
| Changed protocol label form based on discussions. | ||||
| A.2. Since draft-ietf-httpbis-http2-00 | ||||
| Changed title throughout. | Changed title throughout. | |||
| Removed section on Incompatibilities with SPDY draft#2. | Removed section on Incompatibilities with SPDY draft#2. | |||
| Changed INTERNAL_ERROR on GOAWAY to have a value of 2 <https:// | Changed INTERNAL_ERROR on GOAWAY to have a value of 2 <https:// | |||
| groups.google.com/forum/?fromgroups#!topic/spdy-dev/cfUef2gL3iU>. | groups.google.com/forum/?fromgroups#!topic/spdy-dev/cfUef2gL3iU>. | |||
| Replaced abstract and introduction. | Replaced abstract and introduction. | |||
| Added section on starting HTTP/2.0, including upgrade mechanism. | Added section on starting HTTP/2.0, including upgrade mechanism. | |||
| Removed unused references. | Removed unused references. | |||
| Added flow control principles (Section 3.5.1) based on <http:// | Added flow control principles (Section 3.6.1) based on <http:// | |||
| tools.ietf.org/html/draft-montenegro-httpbis-http2-fc-principles-01>. | tools.ietf.org/html/draft-montenegro-httpbis-http2-fc-principles-01>. | |||
| A.2. Since draft-mbelshe-httpbis-spdy-00 | A.3. Since draft-mbelshe-httpbis-spdy-00 | |||
| Adopted as base for draft-ietf-httpbis-http2. | Adopted as base for draft-ietf-httpbis-http2. | |||
| Updated authors/editors list. | Updated authors/editors list. | |||
| Added status note. | Added status note. | |||
| Authors' Addresses | Authors' Addresses | |||
| Mike Belshe | Mike Belshe | |||
| End of changes. 319 change blocks. | ||||
| 1527 lines changed or deleted | 1231 lines changed or added | |||
This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||