<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.29 (Ruby 3.2.2) -->
<?rfc-ext allow-markup-in-artwork="yes"?>
<?rfc-ext html-pretty-print="prettyprint https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"?>
<rfc xmlns:x="http://purl.org/net/xml2rfc/ext"
     category="std"
     consensus="true"
     docName="draft-ietf-httpbis-rfc7838bis-latest"
     ipr="trust200902"
     sortRefs="true"
     symRefs="true"
     tocInclude="true">
   <x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22\&amp;amp;body=%3c{ref}%3e:"/>
   <front>
      <title abbrev="HTTP Alternative Services">HTTP Alternative Services</title>
      <author fullname="Mike Bishop"
              initials="M."
              role="editor"
              surname="Bishop">
         <organization>Akamai Technologies</organization>
         <address>
            <email>mbishop@evequefou.be</email>
         </address>
      </author>
      <author fullname="Martin Thomson"
              initials="M."
              role="editor"
              surname="Thomson">
         <organization>Mozilla</organization>
         <address>
            <email>mt@lowentropy.net</email>
         </address>
      </author>
      <date day="06" month="November" year="2025"/>
      <area>General</area>
      <workgroup>HTTP Working Group</workgroup>
      <keyword>Internet-Draft</keyword>
      <abstract><?line 61?>
         <t>This document specifies "Alternative Services" for HTTP, which allow an origin's resources to be authoritatively available at a separate network location, possibly accessed with a different protocol configuration.</t>
      </abstract>
      <note removeInRFC="true" title="About This Document">
         <t>Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-rfc7838bis/"/>.</t>
         <t>Discussion of this document takes place on the HTTP Working Group mailing list (<eref target="mailto:ietf-http-wg@w3.org"/>), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>. Working Group information can be found at <eref target="https://httpwg.org/"/>.</t>
         <t>Source for this draft and an issue tracker can be found at <eref target="https://github.com/httpwg/http-extensions/labels/alt-svc"/>.</t>
      </note>
   </front>
   <middle><?line 68?>
      <section anchor="introduction">
         <name>Introduction</name>
         <t>HTTP <xref target="HTTP"/> conflates the identification of resources with their location. In other words, "http://" and "https://" URIs are used to both name and find things to interact with.</t>
         <t>In some cases, it is desirable to separate identification and location in HTTP; keeping the same identifier for a resource, but interacting with it at a different location on the network.</t>
         <t>For example:</t>
         <t>
            <list style="symbols">
               <t>An origin server might wish to redirect a client to a different server when it is under load, or it has found a server in a location that is more local to the client.</t>
               <t>An origin server might wish to offer access to its resources using a new protocol, such as HTTP/3 <xref target="HTTP3"/>, or one using improved security, such as Transport Layer Security (TLS) <xref target="RFC8446"/>.</t>
               <t>An origin server might wish to segment its clients into groups of capabilities, such as those supporting Server Name Indication (SNI) (<xref section="3" sectionFormat="of" target="RFC6066"/>), for operational purposes.</t>
            </list>
         </t>
         <t>This specification defines a new concept in HTTP, "Alternative Services", that allows an origin server to nominate additional means of interacting with it on the network. It defines a general framework for this in <xref target="concepts"/>, along with specific mechanisms for advertising their existence using HTTP header fields (<xref target="alt-svc-field"/>) or HTTP/2 frames (<xref target="ALTSVC-frame"/>), plus a way to indicate that an alternative service was used (<xref target="alt-used-field"/>).</t>
         <t>It also endorses the status code 421 (Misdirected Request) (<xref target="status-code"/>) that origin servers or their nominated alternatives can use to indicate that they are not authoritative for a given origin, in cases where the wrong location is used.</t>
         <section anchor="changes-from-rfc-7838">
            <name>Changes from RFC 7838</name>
            <t>
               <list style="symbols">
                  <t>Added an ALTSVC frame for HTTP/3.</t>
               </list>
            </t>
         </section>
         <section anchor="notational-conventions">
            <name>Notational Conventions</name>
            <t>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 <xref target="RFC2119"/>.</t>
            <t>This document uses the Augmented BNF defined in <xref target="RFC5234"/> and updated by <xref target="RFC7405"/> along with the "#rule" extension defined in <xref section="5.6.1" sectionFormat="of" target="HTTP"/>. The rules below are defined in <xref target="RFC5234"/>, <xref target="HTTP"/>, and <xref target="Caching"/>:</t>
            <figure>
               <sourcecode type="abnf">
OWS           = &lt;OWS, see <xref target="HTTP" x:fmt="," x:sec="5.6.3"/>&gt;
delta-seconds = &lt;delta-seconds; see <xref target="Caching" x:fmt="," x:sec="1.2.2"/>&gt;
port          = &lt;port, see <xref target="HTTP" x:fmt="," x:sec="4.1"/>&gt;
quoted-string = &lt;quoted-string, see <xref target="HTTP" x:fmt="," x:sec="5.6.4"/>&gt;
token         = &lt;token, see <xref target="HTTP" x:fmt="," x:sec="5.6.2"/>&gt;
uri-host      = &lt;uri-host, see <xref target="HTTP" x:fmt="," x:sec="4.1"/>&gt;
</sourcecode>
            </figure>
         </section>
      </section>
      <section anchor="concepts">
         <name>Alternative Services Concepts</name>
         <t>This specification defines a new concept in HTTP, the "Alternative Service". When an origin <xref target="RFC6454"/> has resources that are accessible through a different protocol/host/port combination, it is said to have an alternative service available.</t>
         <t>An alternative service can be used to interact with the resources on an origin server at a separate location on the network, possibly using a different protocol configuration. Alternative services are considered authoritative for an origin's resources, in the sense of <xref section="4.3" sectionFormat="of" target="HTTP"/>.</t>
         <t>For example, an origin:</t>
         <figure>
            <sourcecode type="example">
("http", "www.example.com", "80")
</sourcecode>
         </figure>
         <t>might declare that its resources are also accessible at the alternative service:</t>
         <figure>
            <sourcecode type="example">
("h2", "new.example.com", "81")
</sourcecode>
         </figure>
         <t>By their nature, alternative services are explicitly at the granularity of an origin; they cannot be selectively applied to resources within an origin.</t>
         <t>Alternative services do not replace or change the origin for any given resource; in general, they are not visible to the software "above" the access mechanism. The alternative service is essentially alternative routing information that can also be used to reach the origin in the same way that DNS CNAME or SRV records define routing information at the name resolution level. Each origin maps to a set of these routes -- the default route is derived from the origin itself and the other routes are introduced based on alternative- service information.</t>
         <t>Furthermore, it is important to note that the first member of an alternative service tuple is different from the "scheme" component of an origin; it is more specific, identifying not only the major version of the protocol being used, but potentially the communication options for that protocol as well.</t>
         <t>This means that clients using an alternative service can change the host, port, and protocol that they are using to fetch resources, but these changes MUST NOT be propagated to the application that is using HTTP; from that standpoint, the URI being accessed and all information derived from it (scheme, host, and port) are the same as before.</t>
         <t>Importantly, this includes its security context; in particular, when TLS <xref target="RFC8446"/> is used to authenticate, the alternative service will need to present a certificate for the origin's host name, not that of the alternative. Likewise, the Host header field (<xref section="7.2" sectionFormat="of" target="HTTP"/>) is still derived from the origin, not the alternative service (just as it would if a CNAME were being used).</t>
         <t>The changes MAY, however, be made visible in debugging tools, consoles, etc.</t>
         <t>Formally, an alternative service is identified by the combination of:</t>
         <t>
            <list style="symbols">
               <t>An Application-Layer Protocol Negotiation (ALPN) protocol name, as per <xref target="RFC7301"/>
               </t>
               <t>A host, as per <xref section="3.2.2"
                        sectionFormat="of"
                        target="RFC3986"
                        x:title="Host"><?aug-anchor host?></xref>
               </t>
               <t>A port, as per <xref section="3.2.3"
                        sectionFormat="of"
                        target="RFC3986"
                        x:title="Port"><?aug-anchor port?></xref>
               </t>
            </list>
         </t>
         <t>The ALPN protocol name is used to identify the application protocol or suite of protocols used by the alternative service. Note that for the purpose of this specification, an ALPN protocol name implicitly includes TLS in the suite of protocols it identifies, unless specified otherwise in its definition. In particular, the ALPN name "http/1.1", registered by <xref section="6" sectionFormat="of" target="RFC7301"/>, identifies HTTP/1.1 over TLS.</t>
         <t>Additionally, each alternative service MUST have a freshness lifetime, expressed in seconds (see <xref target="caching"/>).</t>
         <t>There are many ways that a client could discover the alternative service(s) associated with an origin. This document describes two such mechanisms: the "Alt-Svc" HTTP header field (<xref target="alt-svc-field"/>) and the "ALTSVC" frame type for HTTP/2 and HTTP/3 (<xref target="ALTSVC-frame"/>).</t>
         <t>The remainder of this section describes requirements that are common to alternative services, regardless of how they are discovered.</t>
         <section anchor="host-authentication">
            <name>Host Authentication</name>
            <t>Clients MUST have reasonable assurances that the alternative service is under control of and valid for the whole origin. This mitigates the attack described in <xref target="changing-hosts"/>.</t>
            <t>For the purposes of this document, "reasonable assurances" can be established through use of a TLS-based protocol with the certificate checks defined in <xref target="RFC2818"/>. Clients MAY impose additional criteria for establishing reasonable assurances.</t>
            <t>For example, if the origin's host is "www.example.com" and an alternative is offered on "other.example.com" with the "h2" protocol, and the certificate offered is valid for "www.example.com", the client can use the alternative. However, if either is offered with the "h2c" protocol, the client cannot use it, because there is no mechanism (at the time of the publication of this specification) in that protocol to establish the relationship between the origin and the alternative.</t>
         </section>
         <section anchor="caching">
            <name>Alternative Service Caching</name>
            <t>Mechanisms for discovering alternative services also associate a freshness lifetime with them; for example, the Alt-Svc header field uses the "ma" parameter.</t>
            <t>Clients can choose to use an alternative service instead of the origin at any time when it is considered fresh; see <xref target="using"/> for specific recommendations.</t>
            <t>Clients with existing connections to an alternative service do not need to stop using it when its freshness lifetime ends; the caching mechanism is intended for limiting how long an alternative service can be used for establishing new connections, not limiting the use of existing ones.</t>
            <t>Alternative services are fully authoritative for the origin in question, including the ability to clear or update cached alternative service entries, extend freshness lifetimes, and any other authority the origin server would have.</t>
            <t>When alternative services are used to send a client to the most optimal server, a change in network configuration can result in cached values becoming suboptimal. Therefore, clients SHOULD remove from cache all alternative services that lack the "persist" flag with the value "1" when they detect such a change, when information about network state is available.</t>
         </section>
         <section anchor="requiring-server-name-indication">
            <name>Requiring Server Name Indication</name>
            <t>A client MUST NOT use a TLS-based alternative service unless the client supports TLS Server Name Indication (SNI). This supports the conservation of IP addresses on the alternative service host.</t>
            <t>Note that the SNI information provided in TLS by the client will be that of the origin, not the alternative (as will the Host HTTP header field value).</t>
         </section>
         <section anchor="using">
            <name>Using Alternative Services</name>
            <t>By their nature, alternative services are OPTIONAL: clients do not need to use them. However, it is advantageous for clients to behave in a predictable way when alternative services are used by servers, to aid in purposes like load balancing.</t>
            <t>Therefore, if a client supporting this specification becomes aware of an alternative service, the client SHOULD use that alternative service for all requests to the associated origin as soon as it is available, provided the alternative service information is fresh (<xref target="caching"/>) and the security properties of the alternative service protocol are desirable, as compared to the existing connection. A viable alternative service is then treated in every way as the origin; this includes the ability to advertise alternative services.</t>
            <t>If a client becomes aware of multiple alternative services, it chooses the most suitable according to its own criteria, keeping security properties in mind. For example, an origin might advertise multiple alternative services to notify clients of support for multiple versions of HTTP.</t>
            <t>A client configured to use a proxy for a given request SHOULD NOT directly connect to an alternative service for this request, but instead route it through that proxy.</t>
            <t>When a client uses an alternative service for a request, it can indicate this to the server using the Alt-Used header field (<xref target="alt-used-field"/>).</t>
            <t>The client does not need to block requests on any existing connection; it can be used until the alternative connection is established. However, if the security properties of the existing connection are weak (for example, cleartext HTTP/1.1), then it might make sense to block until the new connection is fully available in order to avoid information leakage.</t>
            <t>Furthermore, if the connection to the alternative service fails or is unresponsive, the client MAY fall back to using the origin or another alternative service. Note, however, that this could be the basis of a downgrade attack, thus losing any enhanced security properties of the alternative service. If the connection to the alternative service does not negotiate the expected protocol (for example, ALPN fails to negotiate h2, or an Upgrade request to h2c is not accepted), the connection to the alternative service MUST be considered to have failed.</t>
         </section>
      </section>
      <section anchor="alt-svc-field">
         <name>The Alt-Svc HTTP Header Field</name>
         <t>An HTTP(S) origin server can advertise the availability of alternative services to clients by adding an Alt-Svc header field to responses.</t>
         <figure>
            <sourcecode type="abnf">
Alt-Svc       = clear / 1#alt-value
clear         = %s"clear"; "clear", case-sensitive
alt-value     = alternative *( OWS ";" OWS parameter )
alternative   = protocol-id "=" alt-authority
protocol-id   = token ; percent-encoded ALPN protocol name
alt-authority = quoted-string ; containing [ uri-host ] ":" port
parameter     = token "=" ( token / quoted-string )
</sourcecode>
         </figure>
         <t>The field value consists either of a list of values, each of which indicates one alternative service, or the keyword "clear".</t>
         <t>A field value containing the special value "clear" indicates that the origin requests all alternatives for that origin to be invalidated (including those specified in the same response, in case of an invalid reply containing both "clear" and alternative services).</t>
         <t>ALPN protocol names are octet sequences with no additional constraints on format. Octets not allowed in tokens (<xref section="5.6.2" sectionFormat="of" target="HTTP"/>) MUST be percent-encoded as per <xref section="2.1"
                  sectionFormat="of"
                  target="RFC3986"
                  x:title="Percent-Encoding"><?aug-anchor percent-encoding?></xref>. Consequently, the octet representing the percent character "%" (hex 25) MUST be percent-encoded as well.</t>
         <t>In order to have precisely one way to represent any ALPN protocol name, the following additional constraints apply:</t>
         <t>
            <list style="numbers">
               <t>Octets in the ALPN protocol name MUST NOT be percent-encoded if they are valid token characters except "%", and</t>
               <t>When using percent-encoding, uppercase hex digits MUST be used.</t>
            </list>
         </t>
         <t>With these constraints, recipients can apply simple string comparison to match protocol identifiers.</t>
         <t>The "alt-authority" component consists of an OPTIONAL uri-host ("host" in <xref section="3.2.2"
                  sectionFormat="of"
                  target="RFC3986"
                  x:title="Host"><?aug-anchor host?></xref>), a colon (":"), and a port number.</t>
         <t>For example:</t>
         <figure>
            <sourcecode type="example">
Alt-Svc: h2=":8000"
</sourcecode>
         </figure>
         <t>This indicates the "h2" protocol (<xref target="HTTP2"/>) on the same host using the indicated port 8000.</t>
         <t>An example involving a change of host:</t>
         <figure>
            <sourcecode type="example">
Alt-Svc: h2="new.example.org:80"
</sourcecode>
         </figure>
         <t>This indicates the "h2" protocol on the host "new.example.org", running on port 80. Note that the "quoted-string" syntax needs to be used because ":" is not an allowed character in "token".</t>
         <t>Examples for protocol name escaping:</t>
         <texttable>
            <ttcol align="left">ALPN protocol name</ttcol>
            <ttcol align="left">protocol-id</ttcol>
            <ttcol align="left">Note</ttcol>
            <c>h2</c>
            <c>h2</c>
            <c>No escaping needed</c>
            <c>w=x:y#z</c>
            <c>w%3Dx%3Ay#z</c>
            <c>"=" and ":" escaped</c>
            <c>x%y</c>
            <c>x%25y</c>
            <c>"%" needs escaping</c>
         </texttable>
         <t>Alt-Svc MAY occur in any HTTP response message, regardless of the status code. Note that recipients of Alt-Svc can ignore the header field (and are required to in some situations; see <xref target="host-authentication"/> and <xref target="status-code"/>).</t>
         <t>The Alt-Svc field value can have multiple values:</t>
         <figure>
            <sourcecode type="example">
Alt-Svc: h2="alt.example.com:8000", h2=":443"
</sourcecode>
         </figure>
         <t>When multiple values are present, the order of the values reflects the server's preference (with the first value being the most preferred alternative).</t>
         <t>The value(s) advertised by Alt-Svc can be used by clients to open a new connection to an alternative service. Subsequent requests can start using this new connection immediately or can continue using the existing connection while the new connection is created.</t>
         <t>When using HTTP/2 (<xref target="HTTP2"/>), servers SHOULD instead send an ALTSVC frame (<xref target="ALTSVC-frame"/>). A single ALTSVC frame can be sent for a connection; a new frame is not needed for every request. Note that, despite this recommendation, Alt-Svc header fields remain valid in responses delivered over HTTP/2.</t>
         <t>Each "alt-value" is followed by an OPTIONAL semicolon-separated list of additional parameters, each such "parameter" comprising a name and a value.</t>
         <t>This specification defines two parameters: "ma" and "persist", defined in <xref target="header-caching"/>. Unknown parameters MUST be ignored. That is, the values (alt-value) they appear in MUST be processed as if the unknown parameter was not present.</t>
         <t>New parameters can be defined in extension specifications (see <xref target="registry"/> for registration details).</t>
         <t>Note that all field elements that allow "quoted-string" syntax MUST be processed as per <xref section="5.6.4" sectionFormat="of" target="HTTP"/>.</t>
         <section anchor="header-caching">
            <name>Caching Alt-Svc Header Field Values</name>
            <t>When an alternative service is advertised using Alt-Svc, it is considered fresh for 24 hours from generation of the message. This can be modified with the "ma" (max-age) parameter.</t>
            <t>Syntax:</t>
            <figure>
               <sourcecode type="abnf">
ma = delta-seconds; see <xref target="Caching" x:fmt="," x:sec="1.2.2"/>
               </sourcecode>
            </figure>
            <t>The delta-seconds value indicates the number of seconds since the response was generated for which the alternative service is considered fresh.</t>
            <figure>
               <sourcecode type="example">
Alt-Svc: h2=":443"; ma=3600
</sourcecode>
            </figure>
            <t>See <xref section="4.2.3" sectionFormat="of" target="Caching"/> for details on determining the response age.</t>
            <t>For example, a response:</t>
            <figure>
               <sourcecode type="example">
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: max-age=600
Age: 30
Alt-Svc: h2=":8000"; ma=60
</sourcecode>
            </figure>
            <t>indicates that an alternative service is available and usable for the next 60 seconds. However, the response has already been cached for 30 seconds (as per the Age header field value); therefore, the alternative service is only fresh for the 30 seconds from when this response was received, minus estimated transit time.</t>
            <t>Note that the freshness lifetime for HTTP caching (here, 600 seconds) does not affect caching of Alt-Svc values.</t>
            <t>When an Alt-Svc response header field is received from an origin, its value invalidates and replaces all cached alternative services for that origin.</t>
            <t>By default, cached alternative services will be cleared when the client detects a network change. Alternative services that are intended to be longer lived (such as those that are not specific to the client access network) can carry the "persist" parameter with a value "1" as a hint that the service is potentially useful beyond a network configuration change.</t>
            <t>Syntax:</t>
            <figure>
               <sourcecode type="abnf">
persist = "1"
</sourcecode>
            </figure>
            <t>For example:</t>
            <figure>
               <sourcecode type="example">
Alt-Svc: h2=":443"; ma=2592000; persist=1
</sourcecode>
            </figure>
            <t>This specification only defines a single value for "persist". Clients MUST ignore "persist" parameters with values other than "1".</t>
            <t>See <xref target="caching"/> for general requirements on caching alternative services.</t>
         </section>
      </section>
      <section anchor="ALTSVC-frame">
         <name>The ALTSVC Extension Frame</name>
         <t>The ALTSVC frame advertises the availability of an alternative service to an HTTP/2 or HTTP/3 client.</t>
         <t>The ALTSVC frame is a separate non-critical extension in each protocol. Endpoints that do not support this frame will ignore it (as per the extensibility rules defined in <xref section="4.1" sectionFormat="of" target="HTTP2"/> and <xref section="4.1" sectionFormat="of" target="HTTP3"/>).</t>
         <t>An ALTSVC frame from a server to a client on a request stream or a push stream indicates that the conveyed alternative service is associated with the origin of that stream.</t>
         <t>An ALTSVC frame from a server to a client on the control stream (stream 0 in HTTP/2 or a stream of type 0 in HTTP/3) indicates that the conveyed alternative service is associated with the origin contained in the Origin field of the frame. An association with an origin that the client does not consider authoritative for the current connection MUST be ignored.</t>
         <t>The ALTSVC frame type is 0xa (decimal 10) in both protocols.</t>
         <figure title="ALTSVC Frame Payload">
            <artwork>
+-------------------------------+-------------------------------+
|         Origin-Len (16)       | Origin? (*)                 ...
+-------------------------------+-------------------------------+
|                   Alt-Svc-Field-Value (*)                   ...
+---------------------------------------------------------------+
</artwork>
         </figure>
         <t>The ALTSVC frame contains the following fields:</t>
         <dl>
            <dt>Origin-Len:</dt>
            <dd>
               <t>An unsigned, 16-bit integer indicating the length, in octets, of the Origin field.</t>
            </dd>
            <dt>Origin:</dt>
            <dd>
               <t>An OPTIONAL sequence of characters containing the ASCII serialization of an origin (<xref section="6.2" sectionFormat="of" target="RFC6454"/>) to which the alternative service is applicable.</t>
            </dd>
            <dt>Alt-Svc-Field-Value:</dt>
            <dd>
               <t>A sequence of octets (length determined by subtracting the length of all preceding fields from the frame length) containing a value identical to the Alt-Svc field value defined in <xref target="alt-svc-field"/> (ABNF production "Alt-Svc").</t>
            </dd>
         </dl>
         <t>The ALTSVC frame does not define any flags in HTTP/2; there is no generic flag field for HTTP/3 frames.</t>
         <t>The ALTSVC frame is intended for receipt by clients. A device acting as a server MUST ignore it.</t>
         <t>An ALTSVC frame on the control stream with empty (length 0) "Origin" information is invalid and MUST be ignored. An ALTSVC frame on a request or push stream containing non-empty "Origin" information is invalid and MUST be ignored.</t>
         <t>The ALTSVC frame is processed hop-by-hop. An intermediary MUST NOT forward ALTSVC frames, though it can use the information contained in ALTSVC frames in forming new ALTSVC frames to send to its own clients.</t>
         <t>Receiving an ALTSVC frame is semantically equivalent to receiving an Alt-Svc header field. As a result, the ALTSVC frame causes alternative services for the corresponding origin to be replaced. Note that it would be unwise to mix the use of Alt-Svc header fields with the use of ALTSVC frames, as the sequence of receipt might be hard to predict.</t>
      </section>
      <section anchor="alt-used-field">
         <name>The Alt-Used HTTP Header Field</name>
         <t>The Alt-Used header field is used in requests to identify the alternative service in use, just as the Host header field (<xref section="7.2" sectionFormat="of" target="HTTP"/>) identifies the host and port of the origin.</t>
         <figure>
            <sourcecode type="abnf">
Alt-Used     = uri-host [ ":" port ]
</sourcecode>
         </figure>
         <t>Alt-Used is intended to allow alternative services to detect loops, differentiate traffic for purposes of load balancing, and generally to ensure that it is possible to identify the intended destination of traffic, since introducing this information after a protocol is in use has proven to be problematic.</t>
         <t>When using an alternative service, clients SHOULD include an Alt-Used header field in all requests.</t>
         <t>For example:</t>
         <figure>
            <sourcecode type="example">
GET /thing HTTP/1.1
Host: origin.example.com
Alt-Used: alternate.example.net
</sourcecode>
         </figure>
      </section>
      <section anchor="status-code">
         <name>The 421 (Misdirected Request) HTTP Status Code</name>
         <t>The 421 (Misdirected Request) status code is defined in <xref section="15.5.20" sectionFormat="of" target="HTTP"/> to indicate that the current server instance is not authoritative for the requested resource. This can be used to indicate that an alternative service is not authoritative; see <xref target="concepts"/>).</t>
         <t>Clients receiving 421 (Misdirected Request) from an alternative service MUST remove the corresponding entry from its alternative service cache (see <xref target="caching"/>) for that origin. Regardless of the idempotency of the request method, they MAY retry the request, either at another alternative server, or at the origin.</t>
         <t>An Alt-Svc header field in a 421 (Misdirected Request) response MUST be ignored.</t>
      </section>
      <section anchor="iana-considerations">
         <name>IANA Considerations</name>
         <section anchor="header-field-registrations">
            <name>Header Field Registrations</name>
            <t>HTTP header fields are registered within the "Message Headers" registry maintained at &lt;https://www.iana.org/assignments/message- headers/&gt;.</t>
            <t>This document defines the following HTTP header fields, so their associated registry entries have been added according to the permanent registrations below (see <xref target="BCP90"/>):</t>
            <texttable>
               <ttcol align="left">Header Field Name</ttcol>
               <ttcol align="left">Protocol</ttcol>
               <ttcol align="left">Status</ttcol>
               <ttcol align="left">Reference</ttcol>
               <c>Alt-Svc</c>
               <c>http</c>
               <c>standard</c>
               <c>
                  <xref target="alt-svc-field"/>
               </c>
               <c>Alt-Used</c>
               <c>http</c>
               <c>standard</c>
               <c>
                  <xref target="alt-used-field"/>
               </c>
            </texttable>
            <t>The change controller is: "IETF (iesg@ietf.org) -- Internet Engineering Task Force".</t>
         </section>
         <section anchor="the-altsvc-http2-frame-type">
            <name>The ALTSVC HTTP/2 Frame Type</name>
            <t>This document registers the ALTSVC frame type in the "HTTP/2 Frame Type" registry (<xref section="11.2" sectionFormat="of" target="HTTP2"/>).</t>
            <dl>
               <dt>Frame Type:</dt>
               <dd>
                  <t>ALTSVC</t>
               </dd>
               <dt>Code:</dt>
               <dd>
                  <t>0xa</t>
               </dd>
               <dt>Specification:</dt>
               <dd>
                  <t>
                     <xref target="ALTSVC-frame"/> of this document</t>
               </dd>
            </dl>
         </section>
         <section anchor="the-altsvc-http3-frame-type">
            <name>The ALTSVC HTTP/3 Frame Type</name>
            <t>This document registers the ALTSVC frame type in the "HTTP/3 Frame Type" registry (<xref section="11.2.1" sectionFormat="of" target="HTTP3"/>).</t>
            <dl>
               <dt>Frame Type:</dt>
               <dd>
                  <t>ALTSVC</t>
               </dd>
               <dt>Value:</dt>
               <dd>
                  <t>0xa</t>
               </dd>
               <dt>Specification:</dt>
               <dd>
                  <t>
                     <xref target="ALTSVC-frame"/> of this document</t>
               </dd>
            </dl>
         </section>
         <section anchor="registry">
            <name>Alt-Svc Parameter Registry</name>
            <t>The "Hypertext Transfer Protocol (HTTP) Alt-Svc Parameter Registry" defines the name space for parameters. It has been created and will be maintained at &lt;http://www.iana.org/assignments/http-alt-svc- parameters&gt;.</t>
            <section anchor="procedure">
               <name>Procedure</name>
               <t>A registration MUST include the following fields:</t>
               <t>
                  <list style="symbols">
                     <t>Parameter Name</t>
                     <t>Pointer to specification text</t>
                  </list>
               </t>
               <t>Values to be added to this name space require Expert Review (see <xref section="4.1" sectionFormat="of" target="RFC5226"/>).</t>
            </section>
            <section anchor="registrations">
               <name>Registrations</name>
               <t>The "Hypertext Transfer Protocol (HTTP) Alt-Svc Parameter Registry" has been populated with the registrations below:</t>
               <texttable>
                  <ttcol align="left">Alt-Svc Parameter</ttcol>
                  <ttcol align="left">Reference</ttcol>
                  <c>ma</c>
                  <c>
                     <xref target="header-caching"/>
                  </c>
                  <c>persist</c>
                  <c>
                     <xref target="header-caching"/>
                  </c>
               </texttable>
            </section>
         </section>
      </section>
      <section anchor="internationalization-considerations">
         <name>Internationalization Considerations</name>
         <t>An internationalized domain name that appears in either the header field (<xref target="alt-svc-field"/>) or the HTTP/2 frame (<xref target="ALTSVC-frame"/>) MUST be expressed using A-labels (<xref section="2.3.2.1" sectionFormat="of" target="RFC5890"/>).</t>
      </section>
      <section anchor="security-considerations">
         <name>Security Considerations</name>
         <section anchor="changing-ports">
            <name>Changing Ports</name>
            <t>Using an alternative service implies accessing an origin's resources on an alternative port, at a minimum. Therefore, an attacker that can inject alternative services and listen at the advertised port is able to hijack an origin. On certain servers, it is normal for users to be able to control some personal pages available on a shared port and also to accept requests on less-privileged ports.</t>
            <t>For example, an attacker that can add HTTP response header fields to some pages can redirect traffic for an entire origin to a different port on the same host using the Alt-Svc header field; if that port is under the attacker's control, they can thus masquerade as the HTTP server.</t>
            <t>This risk is mitigated by the requirements in <xref target="host-authentication"/>.</t>
            <t>On servers, this risk can also be reduced by restricting the ability to advertise alternative services, and restricting who can open a port for listening on that host.</t>
         </section>
         <section anchor="changing-hosts">
            <name>Changing Hosts</name>
            <t>When the host is changed due to the use of an alternative service, this presents an opportunity for attackers to hijack communication to an origin.</t>
            <t>For example, if an attacker can convince a user agent to send all traffic for "innocent.example.org" to "evil.example.com" by successfully associating it as an alternative service, they can masquerade as that origin. This can be done locally (see mitigations in <xref target="changing-ports"/>) or remotely (e.g., by an intermediary as a man-in- the-middle attack).</t>
            <t>This is the reason for the requirement in <xref target="host-authentication"/> that clients have reasonable assurances that the alternative service is under control of and valid for the whole origin; for example, presenting a certificate for the origin proves that the alternative service is authorized to serve traffic for the origin.</t>
            <t>Note that this assurance is only as strong as the method used to authenticate the alternative service. In particular, when TLS authentication is used to do so, there are well-known exploits to make an attacker's certificate appear as legitimate.</t>
            <t>Alternative services could be used to persist such an attack. For example, an intermediary could man-in-the-middle TLS-protected communication to a target and then direct all traffic to an alternative service with a large freshness lifetime so that the user agent still directs traffic to the attacker even when not using the intermediary.</t>
            <t>Implementations MUST perform any certificate-pinning validation (such as <xref target="RFC7469"/>) on alternative services just as they would on direct connections to the origin. Implementations might also choose to add other requirements around which certificates are acceptable for alternative services.</t>
         </section>
         <section anchor="changing-protocols">
            <name>Changing Protocols</name>
            <t>When the ALPN protocol is changed due to the use of an alternative service, the security properties of the new connection to the origin can be different from that of the "normal" connection to the origin, because the protocol identifier itself implies this.</t>
            <t>For example, if an "https://" URI has a protocol advertised that does not use some form of end-to-end encryption (most likely, TLS), this violates the expectations for security that the URI scheme implies. Therefore, clients cannot use alternative services blindly, but instead evaluate the option(s) presented to ensure that security requirements and expectations of specifications, implementations, and end users are met.</t>
         </section>
         <section anchor="tracking-clients-using-alternative-services">
            <name>Tracking Clients Using Alternative Services</name>
            <t>Choosing an alternative service implies connecting to a new, server- supplied host name. By using unique names, servers could conceivably track client requests. Such tracking could follow users across multiple networks, when the "persist" flag is used.</t>
            <t>Clients that wish to prevent requests from being correlated can decide not to use alternative services for multiple requests that would not otherwise be allowed to be correlated.</t>
            <t>In a user agent, any alternative service information MUST be removed when origin-specific data is cleared (typically, when cookies <xref target="RFC6265"/> are cleared).</t>
         </section>
         <section anchor="confusion-regarding-request-scheme">
            <name>Confusion regarding Request Scheme</name>
            <t>Some server-side HTTP applications make assumptions about security based upon connection context; for example, equating being served upon port 443 with the use of an "https://" URI and the various security properties that implies.</t>
            <t>This affects not only the security properties of the connection itself, but also the state of the client at the other end of it; for example, a Web browser treats "https://" URIs differently than "http://" URIs in many ways, not just for purposes of protocol handling.</t>
            <t>Since one of the uses of Alternative Services is to allow a connection to be migrated to a different protocol and port, these applications can become confused about the security properties of a given connection, sending information (for example, cookies and content) that is intended for a secure context (such as an "https://" URI) to a client that is not treating it as one.</t>
            <t>This risk can be mitigated in servers by using the URI scheme explicitly carried by the protocol (such as ":scheme" in HTTP/2 or the "absolute form" of the request target in HTTP/1.1) as an indication of security context, instead of other connection properties (<xref section="8.3.1" sectionFormat="of" target="HTTP2"/> and <xref section="3.2.2" sectionFormat="of" target="HTTP11"/>).</t>
            <t>When the protocol does not explicitly carry the scheme (as is usually the case for HTTP/1.1 over TLS), servers can mitigate this risk by either assuming that all requests have an insecure context, or by refraining from advertising alternative services for insecure schemes (for example, HTTP).</t>
         </section>
      </section>
   </middle>
   <back>
      <references anchor="sec-combined-references" title="References">
         <references anchor="sec-normative-references" title="Normative References">
            <reference anchor="RFC3986">
               <front>
                  <title>Uniform Resource Identifier (URI): Generic Syntax</title>
                  <author fullname="T. Berners-Lee" initials="T." surname="Berners-Lee"/>
                  <author fullname="R. Fielding" initials="R." surname="Fielding"/>
                  <author fullname="L. Masinter" initials="L." surname="Masinter"/>
                  <date month="January" year="2005"/>
               </front>
               <seriesInfo name="STD" value="66"/>
               <seriesInfo name="RFC" value="3986"/>
               <seriesInfo name="DOI" value="10.17487/RFC3986"/>
               <x:source basename="rfc3986" href="rfc3986.xml"/>
            </reference>
            <reference anchor="RFC5226">
               <front>
                  <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
                  <author fullname="T. Narten" initials="T." surname="Narten"/>
                  <author fullname="H. Alvestrand" initials="H." surname="Alvestrand"/>
                  <date month="May" year="2008"/>
               </front>
               <seriesInfo name="RFC" value="5226"/>
               <seriesInfo name="DOI" value="10.17487/RFC5226"/>
            </reference>
            <reference anchor="RFC5890">
               <front>
                  <title>Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework</title>
                  <author fullname="J. Klensin" initials="J." surname="Klensin"/>
                  <date month="August" year="2010"/>
               </front>
               <seriesInfo name="RFC" value="5890"/>
               <seriesInfo name="DOI" value="10.17487/RFC5890"/>
            </reference>
            <reference anchor="RFC6066">
               <front>
                  <title>Transport Layer Security (TLS) Extensions: Extension Definitions</title>
                  <author fullname="D. Eastlake 3rd" initials="D." surname="Eastlake 3rd"/>
                  <date month="January" year="2011"/>
               </front>
               <seriesInfo name="RFC" value="6066"/>
               <seriesInfo name="DOI" value="10.17487/RFC6066"/>
            </reference>
            <reference anchor="HTTP">
               <front>
                  <title>HTTP Semantics</title>
                  <author fullname="Roy T. Fielding" initials="R. T." surname="Fielding">
                     <organization>Adobe</organization>
                  </author>
                  <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
                     <organization>Fastly</organization>
                  </author>
                  <author fullname="Julian Reschke" initials="J." surname="Reschke">
                     <organization>greenbytes GmbH</organization>
                  </author>
                  <date day="12" month="September" year="2021"/>
               </front>
               <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-semantics-19"/>
            </reference>
            <reference anchor="HTTP11">
               <front>
                  <title>HTTP/1.1</title>
                  <author fullname="Roy T. Fielding" initials="R. T." surname="Fielding">
                     <organization>Adobe</organization>
                  </author>
                  <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
                     <organization>Fastly</organization>
                  </author>
                  <author fullname="Julian Reschke" initials="J." surname="Reschke">
                     <organization>greenbytes GmbH</organization>
                  </author>
                  <date day="12" month="September" year="2021"/>
               </front>
               <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-messaging-19"/>
            </reference>
            <reference anchor="Caching">
               <front>
                  <title>HTTP Caching</title>
                  <author fullname="Roy T. Fielding" initials="R. T." surname="Fielding">
                     <organization>Adobe</organization>
                  </author>
                  <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
                     <organization>Fastly</organization>
                  </author>
                  <author fullname="Julian Reschke" initials="J." surname="Reschke">
                     <organization>greenbytes GmbH</organization>
                  </author>
                  <date day="12" month="September" year="2021"/>
               </front>
               <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-cache-19"/>
            </reference>
            <reference anchor="RFC7301">
               <front>
                  <title>Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension</title>
                  <author fullname="S. Friedl" initials="S." surname="Friedl"/>
                  <author fullname="A. Popov" initials="A." surname="Popov"/>
                  <author fullname="A. Langley" initials="A." surname="Langley"/>
                  <author fullname="E. Stephan" initials="E." surname="Stephan"/>
                  <date month="July" year="2014"/>
               </front>
               <seriesInfo name="RFC" value="7301"/>
               <seriesInfo name="DOI" value="10.17487/RFC7301"/>
            </reference>
            <reference anchor="HTTP2">
               <front>
                  <title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
                  <author fullname="Mike Belshe" initials="M." surname="Belshe">
                     <organization>BitGo</organization>
                  </author>
                  <author fullname="Roberto Peon" initials="R." surname="Peon">
                     <organization>Google, Inc</organization>
                  </author>
                  <author fullname="Martin Thomson" initials="M." surname="Thomson">
                     <organization>Mozilla</organization>
                  </author>
                  <date day="10" month="February" year="2015"/>
               </front>
               <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-http2-17"/>
            </reference>
            <reference anchor="HTTP3">
               <front>
                  <title>HTTP/3</title>
                  <author fullname="Mike Bishop" initials="M." surname="Bishop">
                     <organization>Akamai</organization>
                  </author>
                  <date day="2" month="February" year="2021"/>
               </front>
               <seriesInfo name="Internet-Draft" value="draft-ietf-quic-http-34"/>
            </reference>
            <reference anchor="RFC2119">
               <front>
                  <title>Key words for use in RFCs to Indicate Requirement Levels</title>
                  <author fullname="S. Bradner" initials="S." surname="Bradner"/>
                  <date month="March" year="1997"/>
               </front>
               <seriesInfo name="BCP" value="14"/>
               <seriesInfo name="RFC" value="2119"/>
               <seriesInfo name="DOI" value="10.17487/RFC2119"/>
            </reference>
            <reference anchor="RFC5234">
               <front>
                  <title>Augmented BNF for Syntax Specifications: ABNF</title>
                  <author fullname="D. Crocker"
                          initials="D."
                          role="editor"
                          surname="Crocker"/>
                  <author fullname="P. Overell" initials="P." surname="Overell"/>
                  <date month="January" year="2008"/>
               </front>
               <seriesInfo name="STD" value="68"/>
               <seriesInfo name="RFC" value="5234"/>
               <seriesInfo name="DOI" value="10.17487/RFC5234"/>
            </reference>
            <reference anchor="RFC7405">
               <front>
                  <title>Case-Sensitive String Support in ABNF</title>
                  <author fullname="P. Kyzivat" initials="P." surname="Kyzivat"/>
                  <date month="December" year="2014"/>
               </front>
               <seriesInfo name="RFC" value="7405"/>
               <seriesInfo name="DOI" value="10.17487/RFC7405"/>
            </reference>
            <reference anchor="RFC6454">
               <front>
                  <title>The Web Origin Concept</title>
                  <author fullname="A. Barth" initials="A." surname="Barth"/>
                  <date month="December" year="2011"/>
               </front>
               <seriesInfo name="RFC" value="6454"/>
               <seriesInfo name="DOI" value="10.17487/RFC6454"/>
            </reference>
            <reference anchor="RFC2818">
               <front>
                  <title>HTTP Over TLS</title>
                  <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
                  <date month="May" year="2000"/>
               </front>
               <seriesInfo name="RFC" value="2818"/>
               <seriesInfo name="DOI" value="10.17487/RFC2818"/>
            </reference>
         </references>
         <references anchor="sec-informative-references" title="Informative References">
            <reference anchor="RFC8446">
               <front>
                  <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
                  <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
                  <date month="August" year="2018"/>
               </front>
               <seriesInfo name="RFC" value="8446"/>
               <seriesInfo name="DOI" value="10.17487/RFC8446"/>
            </reference>
            <referencegroup anchor="BCP90" target="https://www.rfc-editor.org/info/bcp90">
               <reference anchor="RFC3864">
                  <front>
                     <title>Registration Procedures for Message Header Fields</title>
                     <author fullname="G. Klyne" initials="G." surname="Klyne"/>
                     <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
                     <author fullname="J. Mogul" initials="J." surname="Mogul"/>
                     <date month="September" year="2004"/>
                  </front>
                  <seriesInfo name="BCP" value="90"/>
                  <seriesInfo name="RFC" value="3864"/>
                  <seriesInfo name="DOI" value="10.17487/RFC3864"/>
               </reference>
            </referencegroup>
            <reference anchor="RFC7469">
               <front>
                  <title>Public Key Pinning Extension for HTTP</title>
                  <author fullname="C. Evans" initials="C." surname="Evans"/>
                  <author fullname="C. Palmer" initials="C." surname="Palmer"/>
                  <author fullname="R. Sleevi" initials="R." surname="Sleevi"/>
                  <date month="April" year="2015"/>
               </front>
               <seriesInfo name="RFC" value="7469"/>
               <seriesInfo name="DOI" value="10.17487/RFC7469"/>
            </reference>
            <reference anchor="RFC6265">
               <front>
                  <title>HTTP State Management Mechanism</title>
                  <author fullname="A. Barth" initials="A." surname="Barth"/>
                  <date month="April" year="2011"/>
               </front>
               <seriesInfo name="RFC" value="6265"/>
               <seriesInfo name="DOI" value="10.17487/RFC6265"/>
            </reference>
            <reference anchor="RFC7838">
               <front>
                  <title>HTTP Alternative Services</title>
                  <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
                  <author fullname="P. McManus" initials="P." surname="McManus"/>
                  <author fullname="J. Reschke" initials="J." surname="Reschke"/>
                  <date month="April" year="2016"/>
               </front>
               <seriesInfo name="RFC" value="7838"/>
               <seriesInfo name="DOI" value="10.17487/RFC7838"/>
            </reference>
         </references>
      </references>
      <?line 835?>
      <section anchor="acknowledgments" numbered="false">
         <name>Acknowledgments</name>
         <t>The previous version of this document was authored by Mark Nottingham, Patrick McManus, and Julian F. Reschke. <xref target="RFC7838"/> contains a more extensive list of people who contributed to that document.</t>
      </section>
   </back>
</rfc>
