idnits 2.17.1 draft-nottingham-httpbis-alt-svc-00.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 an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 14, 2013) is 3848 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) == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-24 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p6-cache-24 == Outdated reference: A later version (-05) exists of draft-ietf-tls-applayerprotoneg-02 == Outdated reference: A later version (-17) exists of draft-ietf-httpbis-http2-06 == Outdated reference: A later version (-03) exists of draft-nottingham-http2-encryption-00 -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 6555 (Obsoleted by RFC 8305) Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Nottingham 3 Internet-Draft October 14, 2013 4 Intended status: Standards Track 5 Expires: April 17, 2014 7 HTTP Alternate Services 8 draft-nottingham-httpbis-alt-svc-00 10 Abstract 12 This document introduces "alternate services" to allow an HTTP 13 origin's resources to be available at a seperate network location, 14 possibly accessed with a different protocol configuration. 16 It also specifies one means of discovering alternate services, the 17 "Alt-Svc" header field. 19 Status of this Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on April 17, 2014. 36 Copyright Notice 38 Copyright (c) 2013 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 3 55 2. Alternate Services . . . . . . . . . . . . . . . . . . . . . . 3 56 2.1. Client Handling for Alternate Services . . . . . . . . . . 5 57 2.1.1. Host Authentication . . . . . . . . . . . . . . . . . 5 58 2.1.2. Alternate Service Caching . . . . . . . . . . . . . . 5 59 2.1.3. Alternate Service Priorities . . . . . . . . . . . . . 6 60 2.1.4. Using Alternate Services . . . . . . . . . . . . . . . 6 61 3. The Alt-Svc HTTP Header Field . . . . . . . . . . . . . . . . 7 62 3.1. Caching Alt-Svc Header Field Values . . . . . . . . . . . 7 63 3.2. Indicating Alt-Svc Header Field Priority . . . . . . . . . 8 64 4. Security Considerations . . . . . . . . . . . . . . . . . . . 8 65 4.1. Changing Ports . . . . . . . . . . . . . . . . . . . . . . 8 66 4.2. Changing Hosts . . . . . . . . . . . . . . . . . . . . . . 9 67 4.3. Changing Protocols . . . . . . . . . . . . . . . . . . . . 10 68 5. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10 69 5.1. Normative References . . . . . . . . . . . . . . . . . . . 10 70 5.2. Informative References . . . . . . . . . . . . . . . . . . 11 71 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 11 72 Appendix B. Implementation Status . . . . . . . . . . . . . . . . 11 73 Appendix C. TODO . . . . . . . . . . . . . . . . . . . . . . . . 12 74 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 12 76 1. Introduction 78 [I-D.ietf-httpbis-http2] specifies a few ways to negotiate the use of 79 HTTP/2.0 without changing existing URIs. However, several 80 deficiencies in using the "upgrade dance" for "http://" URIs have 81 become apparent. While that mechanism is still being investigated, 82 some have expressed interest in an alternate approach. 84 Furthermore, some implementers have expressed a strong desire to 85 optimistically upgrade to TLS for "http://" URIs when using HTTP/2.0; 86 see [I-D.nottingham-http2-encryption] for details. 88 Finally, HTTP/2.0 is designed to have longer-lived, fewer and more 89 active TCP connections. While these properties are generally 90 "friendlier" for the network, they can cause problems for servers 91 that currently exploit the short-lived flow characteristics of 92 HTTP/1.x for load balancing, session affinity and maintaining 93 locality to the user. 95 This document specifies a new concept in HTTP, the "alternate 96 service," to address these use cases. An alternate service can be 97 used to interact with the resources on an origin server at a separate 98 location on the network, possibly using a different protocol 99 configuration. 101 1.1. Notational Conventions 103 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 104 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 105 document are to be interpreted as described in [RFC2119]. 107 This document uses the Augmented BNF defined in [RFC5234] along with 108 the "OWS", "DIGIT", "parameter", "uri-host", "port" and "delta- 109 second" rules from [I-D.ietf-httpbis-p1-messaging], and uses the 110 "#rule" extension defined in Section 7 of that document. 112 2. Alternate Services 114 On the Web, a resource is accessed through a scheme (e.g., "https" or 115 "http") on a nominated host / port combination. 117 These three pieces of information collectively can be used to 118 establish the authority for ownership of the resource (its "origin"; 119 see [RFC6454]), as well as providing enough information to bootstrap 120 access to it. 122 This document introduces the notion of an "Alternate Service"; when 123 an origin's resources are accessible through a different protocol / 124 host / port combination, it is said to have an alternate service. 126 For example, an origin: 128 ("http", "www.example.com", "80") 130 might declare that its resources are also accessible at the alternate 131 service: 133 ("http2", "new.example.com", "443") 135 By their nature, alternate services are explicitly at the granularity 136 of an origin; i.e., they cannot be selectively applied to resources 137 within an origin. 139 Alternate services do not replace or change the origin for any given 140 resource; in general, they are not visible to the software "above" 141 the access mechanism. 143 Furthermore, it is important to note that the first member of an 144 alternate service tuple is different from the "scheme" component of 145 an origin; it is more specific, identifying not only the major 146 version of the protocol being used, but potentially communication 147 options for that protocol. 149 This means that clients using an alternate service will change the 150 host, port and protocol that they are using to fetch resources, but 151 these changes MUST NOT be propagated to the application that is using 152 HTTP; from that standpoint, the URI being accessed and all 153 information derived from it (scheme, host, port) are the same as 154 before. 156 Importantly, this includes its security context; in particular, when 157 TLS [RFC5246] is in use, the alternate server will need to present a 158 certificate for the origin's host name, not that of the alternate. 159 Likewise, the Host header is still derived from the origin, not the 160 alternate service. 162 The changes SHOULD, however, be made visible in debugging tools, 163 consoles, etc. 165 Formally, an alternate service is identified by the combination of: 167 o An ALPN protocol, as per [I-D.ietf-tls-applayerprotoneg] 168 o A host, as per [RFC3986] 169 o A port, as per [RFC3986] 171 Additionally, each alternate service can have: 173 o A freshness lifetime, expressed in seconds; see Section 2.1.2 174 o A numeric priority; see Section 2.1.3 176 Potentially, there are many ways that a client could discover the 177 alternate service(s) associated with an origin; this document 178 currently defines one, the Alt-Svc HTTP Header Field (Section 3). 180 2.1. Client Handling for Alternate Services 182 2.1.1. Host Authentication 184 Clients MUST NOT use alternate services with a host other than the 185 origin's without strong server authentication; this mitigates the 186 attack described in Section 4.2. One way to achieve this is for the 187 alternate to use TLS with a certificate that is valid for that 188 origin. 190 For example, if the origin's host is "www.example.com" and an 191 alternate is offered on "other.example.com" with the "http2-tls" 192 protocol, and the certificate offered is valid for "www.example.com", 193 the client can use the alternate. However, if "other.example.com" is 194 offered with the "http2" protocol, the client cannot use it, because 195 there is no mechanism in that protocol to establish strong server 196 authentication. 198 2.1.2. Alternate Service Caching 200 Mechanisms for discovering alternate services can associate a 201 freshness lifetime with them; for example, the Alt-Svc header field 202 uses the "ma" parameter. 204 Clients MAY choose to use an alternate service instead of the origin 205 at any time when it is considered fresh; see Section 2.1.4 for 206 specific reccommendations. 208 To mitigate risks associated with caching compromised values (see 209 Section 4.2 for details), user agents SHOULD examine cached alternate 210 services when they detect a change in network configuration, and 211 remove any that could be compromised (for example, those whose 212 association with the trust root is questionable). UAs that do not 213 have a means of detecting network changes SHOULD place an upper bound 214 on their lifetime. 216 2.1.3. Alternate Service Priorities 218 Mechanisms for discovering alternate services can associate a 219 priority with them; for example, the Alt-Svc header field uses the 220 "pr" parameter. 222 Priorities are numeric, with a range of 1-64, and are relative to the 223 origin server, which has a static priority of 32. Higher values are 224 preferable. 226 Therefore, an alternate with a priority of 48 will be used in 227 preference to the origin server, whereas one with a priority of 10 228 will be used only when the origin server becomes unavailable. 230 Note that priorities are not specific to the mechanism that an 231 alternate was discovered with; i.e., there is only one "pool" of 232 priorities for an origin. 234 2.1.4. Using Alternate Services 236 By their nature, alternate services are optional; clients are not 237 required to use them. However, it is advantageous for clients to 238 behave in a predictable way when they are used. 240 Therefore, if a client becomes aware of an alternate service that has 241 a higher priority than a connection currently in use, the client 242 SHOULD use that alternate service as soon as it is available, 243 provided that the security properties of the alternate service's 244 protocol are equivalent to the existing connection. 246 For example, if an origin advertises a "http2" alternate service 247 using an "Alt-Svc" response header field, the client ought to 248 immediately establish a connection to the most preferable alternate 249 service, and use it in preference to the origin connection once 250 available. The client is not required to block requests; the 251 origin's connection can be used until the alternate connection is 252 established. 254 Furthermore, if the connection to the alternate service fails or is 255 unresponsive, the client MAY fall back to using the origin, or a less 256 preferable alternate service. 258 When the client becomes aware of an alternate service whose protocol 259 is known to have improved security properties as compared to the 260 existing connection, it SHOULD abstain from using the existing 261 connection until the alternate service is available, or connection to 262 it has failed. This will result in blocking requests, but avoids 263 information leakage. 265 Clients SHOULD NOT fall back to a service (whether an alternate or 266 the origin) that has inferior security properties without notifying 267 the user. 269 3. The Alt-Svc HTTP Header Field 271 A HTTP(S) origin server can advertise the availability of alternate 272 services to HTTP/1.1 and HTTP/2.0 clients by adding an Alt-Svc header 273 field to responses. 275 Alt-Svc = 1#( alternate *( OWS ";" OWS parameter ) ) 276 alternate = protocol-id "=" [ uri-host ] ":" port 277 protocol-id = 279 For example: 281 Alt-Svc: http2=:8000 283 This indicates that the "http2" protocol on the same host using the 284 indicated port (in this case, 8000). 286 Alt-Svc can also contain a host: 288 Alt-Svc: http2-tls=other.example.com:443 290 This indicates that all resources on the origin are available using 291 the "http2-tls" profile on other.example.com port 443. 293 It can also have multiple values: 295 Alt-Svc: http2=:8000, http2-tls=other.example.com:443 297 The value(s) advertised by Alt-Svc can be used by clients to open a 298 new connection to one or more alternate services immediately, or 299 simultaneously with subsequent requests on the same connection. 301 Intermediaries MUST NOT change or append Alt-Svc values. 303 3.1. Caching Alt-Svc Header Field Values 305 When an alternate service is advertised using Alt-Svc, it is 306 considered fresh for 24 hours from generation of the message. This 307 can be modified with the 'ma' (max-age') parameter; 309 Alt-Svc: http2-tls=:443;ma=3600 311 which indicates the number of seconds since the response was 312 generated the alternate service is considered fresh for. 314 ma = delta-seconds 316 See [I-D.ietf-httpbis-p6-cache] Section 4.2.3 for details of 317 determining response age. For example, a response: 319 HTTP/1.1 200 OK 320 Content-Type: text/html 321 Cache-Control: 600 322 Age: 30 323 Alt-Svc: http2=:8000; ma=60 325 indicates that an alternate service is available and usable for the 326 next 60 seconds. However, the response has already been cached for 327 30 seconds (as per the Age header field value), so therefore the 328 alternate service is only fresh for the 30 seconds from when this 329 response was received, minus estimated transit time. 331 See Section 2.1.2 for general requirements on caching alternate 332 services. 334 Note that the freshness lifetime for HTTP caching (here, 600 seconds) 335 does not affect caching of Alt-Svc values. 337 3.2. Indicating Alt-Svc Header Field Priority 339 Finally, an explicit priority can be associated with an Alt-Svc 340 header field value by using the "pr" parameter: 342 Alt-Svc: http2:8000 ;pr=64 344 See Section 2.1.3 for details of the priority mechanism. 346 pr = 1*2DIGIT 348 If the "pr" parameter is not present or is invalid, the default 349 priority for alternate services discovered with the Alt-Svc header 350 field is 48. 352 4. Security Considerations 354 4.1. Changing Ports 356 Using an alternate service implies accessing an origin's resources on 357 an alternate port, at a minimum. An attacker that can inject 358 alternate services and listen at the advertised port is therefore 359 able to hijack an origin. 361 For example, an attacker that can add HTTP response header fields can 362 redirect traffic to a different port on the same host using the Alt- 363 Svc header field; if that port is under the attacker's control, they 364 can thus masquerade as the HTTP server. 366 This risk can be mitigated by restricting the ability to set the Alt- 367 Svc response header field on the origin, and restricting who can open 368 a port for listening on that host. 370 4.2. Changing Hosts 372 When the host is changed due to the use of an alternate service, it 373 presents an opportunity for attackers to hijack communication to an 374 origin. 376 For example, if an attacker can convince a user agent to send all 377 traffic for "innocent.example.org" to "evil.example.com" by 378 successfully associating it as an alternate service, they can 379 masquarade as that origin. This can be done locally (see mitigations 380 above) or remotely (e.g., by an intermediary as a man-in-the-middle 381 attack). 383 This is the reason for the requiremenet in Section 2.1.1 that any 384 alternate service with a host different to the origin's be strongly 385 authenticated with the origin's identity; i.e., presenting a 386 certificate for the origin proves that the alternate service is 387 authorized to serve traffic for the origin. 389 However, this authorization is only as strong as the method used to 390 authenticate the alternate service. In particular, there are well- 391 known exploits to make an attacker's certificate appear as 392 legitimate. 394 Alternate services could be used to persist such an attack; for 395 example, an intermediary could man-in-the-middle TLS-protected 396 communication to a target, and then direct all traffic to an 397 alternate service with a large freshness lifetime, so that the user 398 agent still directs traffic to the attacker even when not using the 399 intermediary. 401 As a result, there is a requirement in Section 2.1.2 to examine 402 cached alternate services when a network change is detected. 404 4.3. Changing Protocols 406 When the ALPN protocol is changed due to the use of an alternate 407 service, the security properties of the new connection to the origin 408 can be different from that of the "normal" connection to the origin, 409 because the protocol identifier itself implies this. 411 For example, if a "https://" URI had a protocol advertised that does 412 not use some form of end-to-end encryption (most likely, TLS), it 413 violates the expectations for security that the URI scheme implies. 415 Therefore, clients cannot blindly use alternate services, but instead 416 evaluate the option(s) presented to assure that security requirements 417 and expectations (of specifications, implementations and end users) 418 are met. 420 5. References 422 5.1. Normative References 424 [I-D.ietf-httpbis-p1-messaging] 425 Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 426 (HTTP/1.1): Message Syntax and Routing", 427 draft-ietf-httpbis-p1-messaging-24 (work in progress), 428 September 2013. 430 [I-D.ietf-httpbis-p6-cache] 431 Fielding, R., Nottingham, M., and J. Reschke, "Hypertext 432 Transfer Protocol (HTTP/1.1): Caching", 433 draft-ietf-httpbis-p6-cache-24 (work in progress), 434 September 2013. 436 [I-D.ietf-tls-applayerprotoneg] 437 Friedl, S., Popov, A., Langley, A., and S. Emile, 438 "Transport Layer Security (TLS) Application Layer Protocol 439 Negotiation Extension", draft-ietf-tls-applayerprotoneg-02 440 (work in progress), September 2013. 442 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 443 Requirement Levels", BCP 14, RFC 2119, March 1997. 445 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 446 Resource Identifier (URI): Generic Syntax", STD 66, 447 RFC 3986, January 2005. 449 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 450 Specifications: ABNF", STD 68, RFC 5234, January 2008. 452 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 453 December 2011. 455 5.2. Informative References 457 [I-D.ietf-httpbis-http2] 458 Belshe, M., Peon, R., Thomson, M., and A. Melnikov, 459 "Hypertext Transfer Protocol version 2.0", 460 draft-ietf-httpbis-http2-06 (work in progress), 461 August 2013. 463 [I-D.nottingham-http2-encryption] 464 Nottingham, M., "Encryption for HTTP URIs Using Alternate 465 Services", draft-nottingham-http2-encryption-00 (work in 466 progress), September 2013. 468 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 469 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 471 [RFC6555] Wing, D. and A. Yourtchenko, "Happy Eyeballs: Success with 472 Dual-Stack Hosts", RFC 6555, April 2012. 474 Appendix A. Acknowledgements 476 Thanks to Patrick McManus, Eliot Lear, Stephen Farrell, Guy Podjarny, 477 Stephen Ludin, Erik Nygren, Paul Hoffman, Adam Langley and Will Chan 478 for their feedback and suggestions. 480 The Alt-Svc header field was influenced by the design of the 481 Alternate-Protocol header in SPDY. 483 Appendix B. Implementation Status 485 No existing implementations. 487 To bootstrap interop, first round testing is proposed as: 489 1. Alt-Svc header field in a random response on an HTTP/1 connection 490 with a "http://" URL; might be first response, might be later 491 2. Advertised service is http2 (draft) ALPN token on same host, 492 different port without TLS 494 Expected behaviour is that the client will, upon learning about the 495 alternate service, start a connection to it and use it once 496 established. 498 Second round testing is proposed to focus on changing protocols: 500 1. Alt-Svc header field in a random response on an HTTP/1 connection 501 with a "http://" URL; might be first response, might be later 502 2. Advertised service is http2 (draft) ALPN token on same host, 503 different port using TLS; see [I-D.nottingham-http2-encryption]) 505 Expected behaviour is that the client will, upon learning about the 506 alternate service, start a connection to it and block requests until 507 it is established. 509 Third round testing is proposed to focus on changing host: 511 1. Alt-Svc header field in a random response on a HTTP/2 connection 512 with a "http://" URL; might be first response, might be later 513 2. Advertised service is http2 (draft) ALPN token on a different 514 host, using TLS. 516 Expected behaviour is that the client will, upon learning about the 517 alternate service, start a connection to it and use it once 518 established. 520 Detailed test plans TBD. 522 Appendix C. TODO 524 o GOAWAY: A GOAWAY-like frame (or just a GOAWAY modification) that 525 allows an alternate service to be switched to might be suggested 526 in a future revision. 527 o DNS: Alternate services are also amenable to DNS-based discovery. 528 If there is sufficient interest, a future revision may include a 529 proposal for that. 530 o Indicating Chosen Service: It's likely necessary for the server to 531 know which protocol the user agent has chosen, and perhaps even 532 the hostname (for load balancing). This could be conveyed as part 533 of the "magic", or as a request header. 534 o IPV6: The intersection between Alternate Services and Happy 535 Eyeballs [RFC6555] should be investigated. 536 o ALPN strings: all of the ALPN strings in this document are 537 fictional; they need to be updated based upon that specification's 538 progress (and the registry, eventually). 539 o Advice for setting headers: guidelines for servers that use the 540 Alt-Svc header field. 542 Author's Address 544 Mark Nottingham 546 Email: mnot@mnot.net 547 URI: http://www.mnot.net/