idnits 2.17.1 draft-benfield-http2-p2p-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 26, 2015) is 3168 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7540 (Obsoleted by RFC 9113) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Hypertext Transfer Protocol Working Group C. Benfield 3 Internet-Draft July 26, 2015 4 Intended status: Standards Track 5 Expires: January 27, 2016 7 Peer-to-peer Extension to HTTP/2 8 draft-benfield-http2-p2p-01 10 Abstract 12 This document introduces a negotiated extension to HTTP/2 that turns 13 a single HTTP/2 connection into a bi-directional communication 14 channel. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on January 27, 2016. 33 Copyright Notice 35 Copyright (c) 2015 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 52 2. Additions to HTTP/2 . . . . . . . . . . . . . . . . . . . . . 3 53 2.1. SETTINGS_PEER_TO_PEER Setting . . . . . . . . . . . . . . 3 54 2.2. CLIENT_AUTHORITY Frame . . . . . . . . . . . . . . . . . 3 55 2.2.1. Payload . . . . . . . . . . . . . . . . . . . . . . . 4 56 2.2.2. Semantics . . . . . . . . . . . . . . . . . . . . . . 4 57 2.3. HTTP Changes . . . . . . . . . . . . . . . . . . . . . . 4 58 2.4. Client Behavioral Changes . . . . . . . . . . . . . . . . 5 59 2.5. Server Behavioral Changes . . . . . . . . . . . . . . . . 5 60 2.6. Other Extensions . . . . . . . . . . . . . . . . . . . . 5 61 3. Authority Validation . . . . . . . . . . . . . . . . . . . . 6 62 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 63 4.1. HTTP/2 Frame Type Registry Update . . . . . . . . . . . . 6 64 4.2. HTTP/2 Settings Registry Update . . . . . . . . . . . . . 6 65 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 66 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 67 6.1. Normative References . . . . . . . . . . . . . . . . . . 7 68 6.2. Informative References . . . . . . . . . . . . . . . . . 7 69 Appendix A. Changelog . . . . . . . . . . . . . . . . . . . . . 8 70 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 72 1. Introduction 74 The HTTP/2 [RFC7540] specification provides an alternative framing 75 layer for the semantics of HTTP/1.1 [RFC7231]. This framing layer in 76 principle allows for both parties in a HTTP/2 session to send 77 requests and responses. However, the HTTP/2 specification also 78 requires that the semantics of HTTP/1.1 be preserved. This means 79 that one party of the conversation is considered the client, and one 80 the server. Only the client may send requests, and only the server 81 may send responses. 83 This document introduces an extension that can be advertised by a 84 HTTP/2 client. This extension allows both the client and the server 85 to send requests and responses. Essentially, this extension changes 86 the protocol such that the notion of 'client' and 'server' are 87 defined on a per-stream basis, rather than a per-connection basis. 89 The principle of this extension is similar to the Reverse HTTP 90 [I-D.lentczner-rhttp] proposal made in 2009. HTTP/2's framing makes 91 this a substantially more flexible extension than Reverse HTTP by 92 allowing the client and server to vary on a per-stream basis, rather 93 than affecting the whole connection. 95 1.1. Notational Conventions 97 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 98 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 99 document are to be interpreted as described in RFC 2119 [RFC2119]. 101 2. Additions to HTTP/2 103 This document introduces a new HTTP/2 setting ([RFC7540], 104 Section 11.3) and a new HTTP/2 frame type ([RFC7540], Section 11.2), 105 to allow for a HTTP/2 client to advertise its support for receiving 106 server-initiated streams, and to allow a server to advertise its 107 support for receiving client-initiated pushed streams. 109 The setting, SETTINGS_PEER_TO_PEER, is a negotiated setting 110 ([RFC7540], Section 5.5). 112 2.1. SETTINGS_PEER_TO_PEER Setting 114 The following new SETTINGS parameters ([RFC7540], Section 6.5.2) are 115 defined: 117 o SETTINGS_PEER_TO_PEER (0xTBA): Informs the remote endpoint of 118 whether the sender supports the peer-to-peer extension to HTTP/2. 119 A value of 1 indicates that the peer-to-peer extension is 120 supported. Any other value, or the absence of this setting, 121 indicates that the peer-to-peer extension is not supported. 123 This setting MUST NOT be emitted by the server on the HTTP/2 124 connection. If the client receives this setting from the server 125 it MUST respond with a connection error ([RFC7540] Section 5.4.1) 126 of type PROTOCOL_ERROR. 128 2.2. CLIENT_AUTHORITY Frame 130 This document introduces the CLIENT_AUTHORITY frame. This frame MUST 131 be emitted by a client after it sends a value of 132 SETTINGS_PEER_TO_PEER of 1, and MAY be emitted by a client any time 133 after. The purpose of this frame is to allow a client to advertise 134 the authority or authorities for which it is prepared to accept 135 requests. 137 This frame always applies to a whole connection. Therefore, the 138 stream identifier for CLIENT_AUTHORITY frames MUST be 0. If a server 139 receives a CLIENT_AUTHORITY frame whose stream identifier field is 140 anything other than 0, it MUST respond with a connection error 141 ([RFC7540] Section 5.4.1) of type PROTOCOL_ERROR. 143 2.2.1. Payload 145 Each CLIENT_AUTHORITY frame is made up of one or more of the 146 following authority segments: 148 +----------------------+ 149 | Authority Length (8) | 150 +----------------------+----------------------------------+ 151 | Authority (*) | 152 +---------------------------------------------------------+ 154 Figure 1: Client Authority Frame Payload 156 Each segment begins with a one-byte field indicating the length of 157 the authority string the client is asserting. That field is then 158 followed by a single authority field. The authority MUST be sent in 159 whatever character encoding is going to be expected by the client on 160 receipt of the :authority pseudo-header field. 162 2.2.2. Semantics 164 Generally speaking, a server or coalescing intermediary has no in- 165 band method of validating that a client's authority claims are valid. 166 Therefore, a conforming server MUST confirm a client's authority 167 claims using some out-of-band method: see Section 3 for more. 169 A client MAY send a CLIENT_AUTHORITY frame at any time after the 170 HTTP/2 preamble is complete. Each CLIENT_AUTHORITY frame is 171 considered to be a complete list of authorities: therefore, a server 172 MUST disregard all prior CLIENT_AUTHORITY frames when a new one is 173 received. Also, servers MUST validate the asserted authorities for 174 all CLIENT_AUTHORITY frames, not just the first one. 176 2.3. HTTP Changes 178 From the perspective of other HTTP RFCs, such as RFC 7231 [RFC7231] 179 and RFC 7540 [RFC7540], this extension changes whether a peer is 180 considered a 'client' or a 'server' on a per-stream basis, instead of 181 a per-connection basis, based on which peer opened the stream and how 182 they did so. If a stream is initiated by a HEADERS frame, the peer 183 that sent the HEADERS frame is considered the 'client' for the 184 remainder of the lifetime of that stream, while the other peer is 185 considered the 'server'. 187 Otherwise, the new definition of 'client' and 'server' is preserved 188 for the purposes of the PUSH_PROMISE frame ([RFC7540], Section 6.6). 189 As a result, whichever peer is considered the 'server' for a given 190 stream can push other streams to the 'client' peer. 192 The rest of the requirements of RFC 7231 [RFC7231] are preserved. 194 2.4. Client Behavioral Changes 196 When a client emits the SETTINGS_PEER_TO_PEER setting with a value of 197 1, it is informing the server that it is willing to accept HTTP 198 requests from the server, allowing the server to open streams with 199 HEADERS frames. This lifts some of the restrictions of RFC 7540 200 [RFC7540] Section 8. 202 If a client has sent the SETTINGS_PEER_TO_PEER setting with a value 203 of 1, the client MUST NOT reject an attempt by the server to change 204 the value of SETTINGS_ENABLE_PUSH to 1. 206 If the client, subsequent to sending SETTINGS_PEER_TO_PEER with value 207 1, receives from the server a value of SETTINGS_ENABLE_PUSH of 1, it 208 MAY open streams by sending PUSH_PROMISE frames. The client MUST NOT 209 send a PUSH_PROMISE frame on a stream that it opened by means of a 210 HEADERS frame: only server-initiated streams may be used for sending 211 PUSH_PROMISE frames. All other limitations about PUSH_PROMISE frames 212 in RFC 7540 [RFC7540] continue to apply, except that the words 213 'server' and 'client' are defined on a per-stream basis. 215 2.5. Server Behavioral Changes 217 When a server receives the SETTINGS_PEER_TO_PEER setting from the 218 client with a value of 1, it MAY at any point afterwards issue a non- 219 zero value for SETTINGS_ENABLE_PUSH. This allows clients to open 220 streams with PUSH_PROMISE and also lifts some of the restrictions of 221 RFC 7540 [RFC7540] Section 8: specifically those sections that only 222 allow servers to send PUSH_PROMISE frames, and only allow clients to 223 receive them. 225 If the client attempts to send a PUSH_PROMISE frame on a stream that 226 was opened by the client (by sending a HEADERS frame), the server 227 MUST treat this event as a connection error ([RFC7540] Section 5.4.1) 228 of type PROTOCOL_ERROR. 230 2.6. Other Extensions 232 When this extension is deployed with other extensions to HTTP/2, the 233 behaviour of this extension does not change. All other extensions 234 that refer to 'client' or 'server' SHOULD be treated as though those 235 terms apply on a per-stream basis. 237 If other extensions apply 'server' or 'client' to the whole 238 connection (e.g. for settings in SETTINGS frames, which are sent on 239 stream 0), then both peers SHOULD be considered clients and both 240 peers should be considered servers. 242 3. Authority Validation 244 Generally speaking, a server or coalescing intermediary has no in- 245 band method of validating that a client's authority claims are valid. 246 Therefore, a conforming server MUST confirm a client's authority 247 claims using some out-of-band method. 249 This specification does not lay out in detail any proposed mechanism 250 for doing this validation, as the best approach may vary from 251 deployment to deployment. However, some options include: 253 o validating authorities against a TLS certificate presented by the 254 client during TLS handshake. 256 o confirming that a reverse DNS lookup for the client IP returns the 257 authority asserted by the client. 259 o a static list of IP addresses trusted for a given authority. 261 The only requirement is that a server MUST implement some form of 262 validation, and then MUST treat any attempt by a client to assert an 263 authority that it cannot validate as a connection error ([RFC7540] 264 Section 5.4.1) of type PROTOCOL_ERROR. 266 4. IANA Considerations 268 4.1. HTTP/2 Frame Type Registry Update 270 This document updates the HTTP/2 Frame Type registry ([RFC7540], 271 Section 11.2). The entries in the following table are registered by 272 this document. 274 +------------------+------+-------------+ 275 | Name | Code | Section | 276 +------------------+------+-------------+ 277 | CLIENT_AUTHORITY | TBD | Section 2.2 | 278 +------------------+------+-------------+ 280 4.2. HTTP/2 Settings Registry Update 282 This document updates the registry for HTTP/2 Settings ([RFC7540], 283 Section 11.4). The entries in the following table are registered by 284 this document. 286 +--------------+------+---------------+-------------+ 287 | Name | Code | Initial Value | Section | 288 +--------------+------+---------------+-------------+ 289 | PEER_TO_PEER | TBD | 0 | Section 2.1 | 290 +--------------+------+---------------+-------------+ 292 5. Acknowledgements 294 Thanks to Fedor Indutny for the original idea, and Amos Jeffries, 295 Mike Bishop, and Ilari Liusvaara for their follow-up. 297 Thanks also to Tyrel Souza, Donald Stufft, and Paul Kehrer for 298 proofreading. 300 Thanks to David Reid for pointing out the Reverse HTTP proposal 301 [I-D.lentczner-rhttp]. 303 Thanks to Amos Jeffries for proposing an advertised extension, rather 304 than a negotiated one. 306 6. References 308 6.1. Normative References 310 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 311 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 312 RFC2119, March 1997, 313 . 315 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 316 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 317 10.17487/RFC7231, June 2014, 318 . 320 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 321 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 322 10.17487/RFC7540, May 2015, 323 . 325 6.2. Informative References 327 [I-D.lentczner-rhttp] 328 Lentczner, M. and D. Preston, "Reverse HTTP", draft- 329 lentczner-rhttp-00 (work in progress), March 2009. 331 Appendix A. Changelog 333 (This appendix to be deleted by the RFC Editor.) 335 Since -00: 337 o Clarified the semantics behind multiple CLIENT_AUTHORITY frames. 339 o Removed the requirement for servers to issue 340 SETTINGS_PEER_TO_PEER, instead allowing the extension to be purely 341 client-advertised. 343 Author's Address 345 Cory Benfield 347 Email: cory@lukasa.co.uk