idnits 2.17.1 draft-nottingham-httpbis-alt-svc-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 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 (December 11, 2013) is 3788 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-25 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p6-cache-25 == Outdated reference: A later version (-05) exists of draft-ietf-tls-applayerprotoneg-03 == Outdated reference: A later version (-17) exists of draft-ietf-httpbis-http2-08 == Outdated reference: A later version (-03) exists of draft-nottingham-http2-encryption-01 -- 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 Akamai 4 Intended status: Standards Track P. McManus 5 Expires: June 14, 2014 Mozilla 6 December 11, 2013 8 HTTP Alternate Services 9 draft-nottingham-httpbis-alt-svc-01 11 Abstract 13 This document introduces "alternate services" to allow an HTTP 14 origin's resources to be available at a separate network location, 15 possibly accessed with a different protocol configuration. 17 It also specifies one means of discovering alternate services, the 18 "Alt-Svc" header field. 20 Status of this Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on June 14, 2014. 37 Copyright Notice 39 Copyright (c) 2013 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 3 56 2. Alternate Services . . . . . . . . . . . . . . . . . . . . . . 3 57 2.1. Client Handling for Alternate Services . . . . . . . . . . 5 58 2.1.1. Host Authentication . . . . . . . . . . . . . . . . . 5 59 2.1.2. Alternate Service Caching . . . . . . . . . . . . . . 5 60 2.1.3. Alternate Service Priorities . . . . . . . . . . . . . 6 61 2.1.4. Requiring Server Name Indication . . . . . . . . . . . 6 62 2.1.5. Using Alternate Services . . . . . . . . . . . . . . . 6 63 3. The Alt-Svc HTTP Header Field . . . . . . . . . . . . . . . . 7 64 3.1. Caching Alt-Svc Header Field Values . . . . . . . . . . . 7 65 3.2. Indicating Alt-Svc Header Field Priority . . . . . . . . . 8 66 4. Security Considerations . . . . . . . . . . . . . . . . . . . 9 67 4.1. Changing Ports . . . . . . . . . . . . . . . . . . . . . . 9 68 4.2. Changing Hosts . . . . . . . . . . . . . . . . . . . . . . 9 69 4.3. Changing Protocols . . . . . . . . . . . . . . . . . . . . 10 70 5. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10 71 5.1. Normative References . . . . . . . . . . . . . . . . . . . 10 72 5.2. Informative References . . . . . . . . . . . . . . . . . . 11 73 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 11 74 Appendix B. TODO . . . . . . . . . . . . . . . . . . . . . . . . 11 75 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 12 77 1. Introduction 79 [I-D.ietf-httpbis-http2] specifies a few ways to negotiate the use of 80 HTTP/2.0 without changing existing URIs. However, several 81 deficiencies in using the "upgrade dance" for "http://" URIs have 82 become apparent. While that mechanism is still being investigated, 83 some have expressed interest in an alternate approach. 85 Furthermore, some implementers have expressed a strong desire utilize 86 HTTP/2 only in conjunction with TLS. Alternate-Services provides a 87 potential mechanism for achieving that for "http://" URIs; see 88 [I-D.nottingham-http2-encryption] for details. 90 Finally, HTTP/2.0 is designed to have longer-lived, fewer and more 91 active TCP connections. While these properties are generally 92 "friendlier" for the network, they can cause problems for servers 93 that currently exploit the short-lived flow characteristics of 94 HTTP/1.x for load balancing, session affinity and maintaining 95 locality to the user. 97 This document specifies a new concept in HTTP, the "alternate 98 service," to address these use cases. An alternate service can be 99 used to interact with the resources on an origin server at a separate 100 location on the network, possibly using a different protocol 101 configuration. 103 1.1. Notational Conventions 105 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 106 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 107 document are to be interpreted as described in [RFC2119]. 109 This document uses the Augmented BNF defined in [RFC5234] along with 110 the "OWS", "DIGIT", "parameter", "uri-host", "port" and "delta- 111 second" rules from [I-D.ietf-httpbis-p1-messaging], and uses the 112 "#rule" extension defined in Section 7 of that document. 114 2. Alternate Services 116 On the Web, a resource is accessed through a scheme (e.g., "https" or 117 "http") on a nominated host / port combination. 119 These three pieces of information collectively can be used to 120 establish the authority for ownership of the resource (its "origin"; 121 see [RFC6454]), as well as providing enough information to bootstrap 122 access to it. 124 This document introduces the notion of an "Alternate Service"; when 125 an origin's resources are accessible through a different protocol / 126 host / port combination, it is said to have an alternate service. 128 For example, an origin: 130 ("http", "www.example.com", "80") 132 might declare that its resources are also accessible at the alternate 133 service: 135 ("http2-tls", "new.example.com", "443") 137 By their nature, alternate services are explicitly at the granularity 138 of an origin; i.e., they cannot be selectively applied to resources 139 within an origin. 141 Alternate services do not replace or change the origin for any given 142 resource; in general, they are not visible to the software "above" 143 the access mechanism. The alternate service is essentially alternate 144 routing information that can also be used to reach the origin in the 145 same way that DNS CNAME or SRV records define routing information at 146 the name resolution level. 148 Furthermore, it is important to note that the first member of an 149 alternate service tuple is different from the "scheme" component of 150 an origin; it is more specific, identifying not only the major 151 version of the protocol being used, but potentially communication 152 options for that protocol. 154 This means that clients using an alternate service will change the 155 host, port and protocol that they are using to fetch resources, but 156 these changes MUST NOT be propagated to the application that is using 157 HTTP; from that standpoint, the URI being accessed and all 158 information derived from it (scheme, host, port) are the same as 159 before. 161 Importantly, this includes its security context; in particular, when 162 TLS [RFC5246] is in use, the alternate server will need to present a 163 certificate for the origin's host name, not that of the alternate. 164 Likewise, the Host header is still derived from the origin, not the 165 alternate service (just as it would if a CNAME were being used). 167 The changes MAY, however, be made visible in debugging tools, 168 consoles, etc. 170 Formally, an alternate service is identified by the combination of: 172 o An ALPN protocol, as per [I-D.ietf-tls-applayerprotoneg] 173 o A host, as per [RFC3986] 174 o A port, as per [RFC3986] 176 Additionally, each alternate service MUST have: 178 o A freshness lifetime, expressed in seconds; see Section 2.1.2 179 o A numeric priority; see Section 2.1.3 181 Potentially, there are many ways that a client could discover the 182 alternate service(s) associated with an origin; this document 183 currently defines one, the Alt-Svc HTTP Header Field (Section 3). 185 2.1. Client Handling for Alternate Services 187 2.1.1. Host Authentication 189 Clients MUST NOT use alternate services with a host other than the 190 origin's without strong server authentication; this mitigates the 191 attack described in Section 4.2. One way to achieve this is for the 192 alternate to use TLS with a certificate that is valid for that 193 origin. 195 For example, if the origin's host is "www.example.com" and an 196 alternate is offered on "other.example.com" with the "http2-tls" 197 protocol, and the certificate offered is valid for "www.example.com", 198 the client can use the alternate. However, if "other.example.com" is 199 offered with the "http2" protocol, the client cannot use it, because 200 there is no mechanism in that protocol to establish strong server 201 authentication. 203 2.1.2. Alternate Service Caching 205 Mechanisms for discovering alternate services can associate a 206 freshness lifetime with them; for example, the Alt-Svc header field 207 uses the "ma" parameter. 209 Clients MAY choose to use an alternate service instead of the origin 210 at any time when it is considered fresh; see Section 2.1.5 for 211 specific recommendations. 213 To mitigate risks associated with caching compromised values (see 214 Section 4.2 for details), user agents SHOULD examine cached alternate 215 services when they detect a change in network configuration, and 216 remove any that could be compromised (for example, those whose 217 association with the trust root is questionable). UAs that do not 218 have a means of detecting network changes SHOULD place an upper bound 219 on their lifetime. 221 2.1.3. Alternate Service Priorities 223 Mechanisms for discovering alternate services can associate a 224 priority with them; for example, the Alt-Svc header field uses the 225 "pr" parameter. 227 Priorities are numeric, with a range of 1-64, and are relative to the 228 origin server, which has a static priority of 32. Higher values are 229 preferable. 231 Therefore, an alternate with a priority of 48 will be used in 232 preference to the origin server, whereas one with a priority of 10 233 will be used only when the origin server becomes unavailable. 235 Note that priorities are not specific to the mechanism that an 236 alternate was discovered with; i.e., there is only one "pool" of 237 priorities for an origin. 239 2.1.4. Requiring Server Name Indication 241 A client must only use a TLS based alternate service if the client 242 also supports TLS Server Name Indication (SNI) [RFC6066]. This 243 supports the conservation of IP addresses on the alternate service 244 host. 246 2.1.5. Using Alternate Services 248 By their nature, alternate services are optional; clients are not 249 required to use them. However, it is advantageous for clients to 250 behave in a predictable way when they are used by servers (e.g., for 251 load balancing). 253 Therefore, if a client becomes aware of an alternate service that has 254 a higher priority than a connection currently in use, the client 255 SHOULD use that alternate service as soon as it is available, 256 provided that the security properties of the alternate service 257 protocol are desirable, as compared to the existing connection. 259 For example, if an origin advertises a "http2-tls" alternate service 260 using an "Alt-Svc" response header field, the client ought to 261 immediately establish a connection to the most preferable alternate 262 service, and use it in preference to the origin connection once 263 available. 265 The client is not required to block requests; the origin's connection 266 can be used until the alternate connection is established. However, 267 if the security properties of the existing connection are weak (e.g. 268 cleartext HTTP/1.1) then it might make sense to block until the new 269 connection is fully available in order to avoid information leakage. 271 Furthermore, if the connection to the alternate service fails or is 272 unresponsive, the client MAY fall back to using the origin, or a less 273 preferable alternate service. 275 3. The Alt-Svc HTTP Header Field 277 A HTTP(S) origin server can advertise the availability of alternate 278 services to clients by adding an Alt-Svc header field to responses. 280 Alt-Svc = 1#( alternate *( OWS ";" OWS parameter ) ) 281 alternate = protocol-id "=" [ uri-host ] ":" port 282 protocol-id = 284 For example: 286 Alt-Svc: http2=:8000 288 This indicates that the "http2" protocol on the same host using the 289 indicated port (in this case, 8000). 291 Alt-Svc can also contain a host: 293 Alt-Svc: http2-tls=other.example.com:443 295 This indicates that all resources on the origin are available using 296 the "http2-tls" profile on other.example.com port 443. 298 It can also have multiple values: 300 Alt-Svc: http2=:8000, http2-tls=other.example.com:443 302 The value(s) advertised by Alt-Svc can be used by clients to open a 303 new connection to one or more alternate services immediately, or 304 simultaneously with subsequent requests on the same connection. 306 Intermediaries MUST NOT change or append Alt-Svc values. 308 3.1. Caching Alt-Svc Header Field Values 310 When an alternate service is advertised using Alt-Svc, it is 311 considered fresh for 24 hours from generation of the message. This 312 can be modified with the 'ma' (max-age') parameter; 314 Alt-Svc: http2-tls=:443;ma=3600 315 which indicates the number of seconds since the response was 316 generated the alternate service is considered fresh for. 318 ma = delta-seconds 320 See [I-D.ietf-httpbis-p6-cache] Section 4.2.3 for details of 321 determining response age. For example, a response: 323 HTTP/1.1 200 OK 324 Content-Type: text/html 325 Cache-Control: 600 326 Age: 30 327 Alt-Svc: http2=:8000; ma=60 329 indicates that an alternate service is available and usable for the 330 next 60 seconds. However, the response has already been cached for 331 30 seconds (as per the Age header field value), so therefore the 332 alternate service is only fresh for the 30 seconds from when this 333 response was received, minus estimated transit time. 335 When an Alt-Svc response header is received from an origin, its value 336 invalidates and replaces all cached alternate services for that 337 origin. This includes the empty Alt-Svc header, which clears all 338 cached alternate services for an origin. 340 See Section 2.1.2 for general requirements on caching alternate 341 services. 343 Note that the freshness lifetime for HTTP caching (here, 600 seconds) 344 does not affect caching of Alt-Svc values. 346 3.2. Indicating Alt-Svc Header Field Priority 348 Finally, an explicit priority can be associated with an Alt-Svc 349 header field value by using the "pr" parameter: 351 Alt-Svc: http2-tls:8000 ;pr=64 353 See Section 2.1.3 for details of the priority mechanism. 355 pr = 1*2DIGIT 357 If the "pr" parameter is not present or is invalid, the default 358 priority for alternate services discovered with the Alt-Svc header 359 field is 48. 361 4. Security Considerations 363 4.1. Changing Ports 365 Using an alternate service implies accessing an origin's resources on 366 an alternate port, at a minimum. An attacker that can inject 367 alternate services and listen at the advertised port is therefore 368 able to hijack an origin. 370 For example, an attacker that can add HTTP response header fields can 371 redirect traffic to a different port on the same host using the Alt- 372 Svc header field; if that port is under the attacker's control, they 373 can thus masquerade as the HTTP server. 375 This risk can be mitigated by restricting the ability to set the Alt- 376 Svc response header field on the origin, and restricting who can open 377 a port for listening on that host. 379 4.2. Changing Hosts 381 When the host is changed due to the use of an alternate service, it 382 presents an opportunity for attackers to hijack communication to an 383 origin. 385 For example, if an attacker can convince a user agent to send all 386 traffic for "innocent.example.org" to "evil.example.com" by 387 successfully associating it as an alternate service, they can 388 masquerade as that origin. This can be done locally (see mitigations 389 above) or remotely (e.g., by an intermediary as a man-in-the-middle 390 attack). 392 This is the reason for the requirement in Section 2.1.1 that any 393 alternate service with a host different to the origin's be strongly 394 authenticated with the origin's identity; i.e., presenting a 395 certificate for the origin proves that the alternate service is 396 authorized to serve traffic for the origin. 398 However, this authorization is only as strong as the method used to 399 authenticate the alternate service. In particular, there are well- 400 known exploits to make an attacker's certificate appear as 401 legitimate. 403 Alternate services could be used to persist such an attack; for 404 example, an intermediary could man-in-the-middle TLS-protected 405 communication to a target, and then direct all traffic to an 406 alternate service with a large freshness lifetime, so that the user 407 agent still directs traffic to the attacker even when not using the 408 intermediary. 410 As a result, there is a requirement in Section 2.1.2 to examine 411 cached alternate services when a network change is detected. 413 4.3. Changing Protocols 415 When the ALPN protocol is changed due to the use of an alternate 416 service, the security properties of the new connection to the origin 417 can be different from that of the "normal" connection to the origin, 418 because the protocol identifier itself implies this. 420 For example, if a "https://" URI had a protocol advertised that does 421 not use some form of end-to-end encryption (most likely, TLS), it 422 violates the expectations for security that the URI scheme implies. 424 Therefore, clients cannot blindly use alternate services, but instead 425 evaluate the option(s) presented to assure that security requirements 426 and expectations (of specifications, implementations and end users) 427 are met. 429 5. References 431 5.1. Normative References 433 [I-D.ietf-httpbis-p1-messaging] 434 Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 435 (HTTP/1.1): Message Syntax and Routing", 436 draft-ietf-httpbis-p1-messaging-25 (work in progress), 437 November 2013. 439 [I-D.ietf-httpbis-p6-cache] 440 Fielding, R., Nottingham, M., and J. Reschke, "Hypertext 441 Transfer Protocol (HTTP/1.1): Caching", 442 draft-ietf-httpbis-p6-cache-25 (work in progress), 443 November 2013. 445 [I-D.ietf-tls-applayerprotoneg] 446 Friedl, S., Popov, A., Langley, A., and S. Emile, 447 "Transport Layer Security (TLS) Application Layer Protocol 448 Negotiation Extension", draft-ietf-tls-applayerprotoneg-03 449 (work in progress), October 2013. 451 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 452 Requirement Levels", BCP 14, RFC 2119, March 1997. 454 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 455 Resource Identifier (URI): Generic Syntax", STD 66, 456 RFC 3986, January 2005. 458 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 459 Specifications: ABNF", STD 68, RFC 5234, January 2008. 461 [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: 462 Extension Definitions", RFC 6066, January 2011. 464 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 465 December 2011. 467 5.2. Informative References 469 [I-D.ietf-httpbis-http2] 470 Belshe, M., Peon, R., Thomson, M., and A. Melnikov, 471 "Hypertext Transfer Protocol version 2.0", 472 draft-ietf-httpbis-http2-08 (work in progress), 473 November 2013. 475 [I-D.nottingham-http2-encryption] 476 Nottingham, M., "Opportunistic Encryption for HTTP URIs", 477 draft-nottingham-http2-encryption-01 (work in progress), 478 October 2013. 480 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 481 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 483 [RFC6555] Wing, D. and A. Yourtchenko, "Happy Eyeballs: Success with 484 Dual-Stack Hosts", RFC 6555, April 2012. 486 Appendix A. Acknowledgements 488 Thanks to Eliot Lear, Stephen Farrell, Guy Podjarny, Stephen Ludin, 489 Erik Nygren, Paul Hoffman, Adam Langley and Will Chan for their 490 feedback and suggestions. 492 The Alt-Svc header field was influenced by the design of the 493 Alternate-Protocol header in SPDY. 495 Appendix B. TODO 497 o GOAWAY: A GOAWAY-like frame (or just a GOAWAY modification) that 498 allows an alternate service to be switched to might be suggested 499 in a future revision. 500 o DNS: Alternate services are also amenable to DNS-based discovery. 501 If there is sufficient interest, a future revision may include a 502 proposal for that. 504 o Indicating Chosen Service: It's likely necessary for the server to 505 know which protocol the user agent has chosen, and perhaps even 506 the hostname (for load balancing). This could be conveyed as part 507 of the "magic", or as a request header. 508 o IPV6: The intersection between Alternate Services and Happy 509 Eyeballs [RFC6555] should be investigated. 510 o ALPN strings: all of the ALPN strings in this document are 511 fictional; they need to be updated based upon that specification's 512 progress (and the registry, eventually). 513 o Advice for setting headers: guidelines for servers that use the 514 Alt-Svc header field. 516 Authors' Addresses 518 Mark Nottingham 519 Akamai 521 Email: mnot@mnot.net 522 URI: http://www.mnot.net/ 524 Patrick McManus 525 Mozilla 527 Email: mcmanus@ducksong.com 528 URI: https://mozillians.org/u/pmcmanus/