HTTP 2.0 Negotiation
Author(s): Gabriel Montenegro, Willy Tarreau, Stephan Emile
This document describes an Upgrade-based protocol negotiation proposal for HTTP 2.0....
Network Working Group W. Tarreau Internet-Draft Exceliance Expires: July 20, 2013 E. Stephan Orange G. Montenegro Microsoft January 16, 2013 HTTP 2.0 Negotiation draft-montenegro-httpbis-http2-negotiation-01 Abstract This document describes an Upgrade-based protocol negotiation proposal for HTTP 2.0. Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on July 20, 2013. Copyright Notice Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Tarreau, et al. Expires July 20, 2013 [Page 1] Internet-Draft HTTP 2.0 Negotiation January 2013 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Negotiation . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Optimizing the Handshake . . . . . . . . . . . . . . . . . . . 5 4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 5. Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 6.1. Normative References . . . . . . . . . . . . . . . . . . . 8 6.2. Informative References . . . . . . . . . . . . . . . . . . 8 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9 Tarreau, et al. Expires July 20, 2013 [Page 2] Internet-Draft HTTP 2.0 Negotiation January 2013 1. Introduction User agents interact with numerous servers from different domains using different versions of HTTP. In particular, the co-existence of HTTP/1.x and HTTP/2.x requires a protocol negotiation mechanism transparent to the user agents. This document specifies an Upgrade- based HTTP 2.0 connection negotiation. HTTP/2.0 will have the capability (but not the requirement) to use the same ports as HTTP/1.X, typically, but not limited to, 80 (in the clear) and 443 (when over TLS/SSL). Of course, it is possible for a client to somehow acquire knowledge that a server implements HTTP/2.0 at a given port. In such a case, the client can immediately begin sending HTTP/2.0 binary frames to the server, and the server can immediately respond with the corresponding HTTP/2.0 frames. How that knowledge is acquired is not the subject of this note. It could be acquired by some out-of-band means such as using the DNS, or by some configuration prior to the HTTP/2.0 exchange. Or it could have been aquired earlier in-band in a previous exchange using, for example, the Upgrade-based mechanism specified in this document. It could have also been acquired at an earlier phase of this same exchange, for example, at a lower protocol layer that precedes the overall HTTP sequence, such as in the TLS handshake (if using TLS). Nevertheless, there may be some situations, in which the client can only assume that a server speaks HTTP/1.X. In such cases, a connection upgrade mechanism to opportunistically attempt switching to HTTP/2.0 is essential. Otherwise, the exchange will remain at HTTP/1.X despite both client and server being willing to speak HTTP/2.0. This document specifies such a connection upgrade for HTTP/2.0. This handshake does not incur any extra delay in obtaining a response in HTTP/2.0, as the protocol switch is immediate and effective within the first round trip. There is no delay either if there is no protocol switch, as the server is capable to respond via HTTP/1.1 also within the first initial round trip. This handshake uses the Upgrade header defined in HTTP/1.1 [I-D.ietf-httpbis-p1-messaging]. This Upgrade header is also in wide use by the WebSocket protocol for similar purposes [RFC6455]. The goal of this document is to propose additional text to the HTTP/2.0 specification. The starting point for HTTP/2.0, the initial version of [I-D.ietf-httpbis-http2], has no language with respect to a connection upgrade procedure. Hence, the text below could be incorporated as a new section or sections within the HTTP/2.0 document. Tarreau, et al. Expires July 20, 2013 [Page 3] Internet-Draft HTTP 2.0 Negotiation January 2013 2. Negotiation If a client has no knowledge about a server's support for HTTP/2.0, it starts with HTTP/1.1 and attempt an upgrade to HTTP/2.0 as follows: GET /default.htm HTTP/1.1 Host: server.example.com Connection: Upgrade Upgrade: HTTP/2.0 If the server does not support the new protocol, it will simply respond to the client using HTTP/1.1: HTTP/1.1 200 OK Content-length: 243 Content-type: text/html ... If the server switches to the new protocol, it will signal so via a 101 response. The server switches to HTTP/2.0 immediately after the empty line which terminates the 101 response [I-D.ietf-httpbis-p2-semantics]. HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: HTTP/2.0 [ HTTP/2.0 frame ] In the above, the string "HTTP/2.0" represents the final version of the protocol defined in [I-D.ietf-httpbis-http2]. However, per guidance in that document, preliminary revisions of that document (either draft or experimental) are denoted by adding the corresponding version or revision number. For example, if the above handshake were negotiating the use of the 03 version of the draft (draft-ietf-httpbis-http2-03), then, instead of using "HTTP/2.0" above, the handshake would use "HTTP-03/2.0" instead. Tarreau, et al. Expires July 20, 2013 [Page 4] Internet-Draft HTTP 2.0 Negotiation January 2013 3. Optimizing the Handshake This handshake may be further optimized by the definition of HTTP headers of the form "HTTP2-header_name". These "HTTP2" headers would be meant to be interpreted exclusively by HTTP/2.0 servers and applied upon a successful Upgrade to further optimize or proactively configure the subsequent HTTP/2.0 exchanges. These headers would be ignored by HTTP/1.1 servers. The HTTP2 headers are for future revisions of this document. Tarreau, et al. Expires July 20, 2013 [Page 5] Internet-Draft HTTP 2.0 Negotiation January 2013 4. Acknowledgements This document incorporates material from [I-D.tarreau-httpbis-network-friendly] and [I-D.montenegro-httpbis-speed-mobility]. This document was produced using the xml2rfc tool [RFC2629]. Tarreau, et al. Expires July 20, 2013 [Page 6] Internet-Draft HTTP 2.0 Negotiation January 2013 5. Appendix This Upgrade-based handshake may have issues with certain proxies and intermediaries, particularly those that are not aware of its use and don't obey its semantics. Some heuristics that have been observed to help in this respect is to turn off caching by adding the following to the client request: Pragma: no-cache Cache-Control: no-cache Tarreau, et al. Expires July 20, 2013 [Page 7] Internet-Draft HTTP 2.0 Negotiation January 2013 6. References 6.1. Normative References [RFC 2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC2616, June 1999. [I-D.ietf-httpbis-p1-messaging] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", draft-ietf-httpbis-p1-messaging-21 (work in progress), October 2012. [I-D.ietf-httpbis-p2-semantics] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", draft-ietf-httpbis-p2-semantics-21 (work in progress), October 2012. 6.2. Informative References [RFC2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC2629, June 1999. [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC6455, December 2011. [I-D.ietf-httpbis-http2] Belshe, M., Peon, R., Thomson, M., and A. Melnikov, "SPDY Protocol", draft-ietf-httpbis-http2-00 (work in progress), November 2012. [I-D.montenegro-httpbis-speed-mobility] Trace, R., Foresti, A., Singhal, S., Mazahir, O., Nielsen, H., Raymor, B., Rao, R., and G. Montenegro, "HTTP Speed+ Mobility", draft-montenegro-httpbis-speed-mobility-02 (work in progress), June 2012. [I-D.tarreau-httpbis-network-friendly] Tarreau, W., Jeffries, A., and A. Croy, "Proposal for a Network-Friendly HTTP Upgrade", draft-tarreau-httpbis-network-friendly-00 (work in progress), March 2012. Tarreau, et al. Expires July 20, 2013 [Page 8] Internet-Draft HTTP 2.0 Negotiation January 2013 Authors' Addresses Willy Tarreau Exceliance Email: firstname.lastname@example.org Emile Stephan Orange Email: email@example.com Gabriel Montenegro Microsoft Email: Gabriel.Montenegro@microsoft.com Tarreau, et al. Expires July 20, 2013 [Page 9]