<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.30 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc tocindent="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>

<rfc ipr="trust200902" docName="draft-ietf-httpbis-origin-frame-latest" category="std">

  <feedback xmlns='http://purl.org/net/xml2rfc/ext' template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=%3c{ref}%3e:"/><front>
    <title abbrev="ORIGIN Frames">The ORIGIN HTTP/2 Frame</title>

    <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
      <organization>Akamai</organization>
      <address>
        <email>mnot@mnot.net</email>
        <uri>https://www.mnot.net/</uri>
      </address>
    </author>
    <author initials="E." surname="Nygren" fullname="Erik Nygren">
      <organization>Akamai</organization>
      <address>
        <email>nygren@akamai.com</email>
      </address>
    </author>

    <date year="2016" month="9" day="28"/>

    <area>General</area>
    <workgroup>HTTP</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This document specifies the ORIGIN frame for HTTP/2, to indicate what origins are available on a
given connection.</t>



    </abstract>


    <note title="Note to Readers">


<t>Discussion of this draft takes place on the HTTP working group mailing list 
(ietf-http-wg@w3.org), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/">https://lists.w3.org/Archives/Public/ietf-http-wg/</eref>.</t>

<t>Working Group information can be found at <eref target="http://httpwg.github.io/">http://httpwg.github.io/</eref>; source 
code and issues list for this draft can be found at <eref target="https://github.com/httpwg/http-extensions/labels/origin-frame">https://github.com/httpwg/http-extensions/labels/origin-frame</eref>.</t>


    </note>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>HTTP/2 <xref target="RFC7540"/> allows clients to coalesce different origins <xref target="RFC6454"/> onto the same
connection when certain conditions are met. However, in certain cases, a connection is is not
usable for a coalesced origin, so the 421 (Misdirected Request) status code (<xref target="RFC7540"/>, Section
9.1.2) was defined.</t>

<t>Using a status code in this manner allows clients to recover from misdirected requests, but at the
penalty of adding latency. To address that, this specification defines a new HTTP/2 frame type,
“ORIGIN”, to allow servers to indicate what origins a connection is usable for.</t>

<section anchor="notational-conventions" title="Notational Conventions">

<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>

</section>
</section>
<section anchor="the-origin-http2-frame" title="The ORIGIN HTTP/2 Frame">

<t>The ORIGIN HTTP/2 frame (<xref target="RFC7540"/>, Section 4) allows a server to indicate what origin(s)
<xref target="RFC6454"/> the server would like the client to consider as members of the Origin Set (<xref target="set"/>)
for the connection it occurs within.</t>

<t>The ORIGIN frame type is 0xb (decimal 11).</t>

<figure><artwork><![CDATA[
+-------------------------------+-------------------------------+
|         Origin-Len (16)       | Origin? (*)                 ...
+-------------------------------+-------------------------------+
]]></artwork></figure>

<t>The ORIGIN frame’s payload contains the following fields, sets of which may be repeated within the
frame to indicate multiple origins:</t>

<t><list style="hanging">
  <t hangText='Origin-Len:'>
  An unsigned, 16-bit integer indicating the length, in octets, of the Origin field.</t>
  <t hangText='Origin:'>
  An optional sequence of characters containing the ASCII serialization of an origin (<xref target="RFC6454"/>, Section 6.2) that the sender believes this connection is or could be authoritative for.</t>
</list></t>

<t>The ORIGIN frame defines the following flags:</t>

<t><list style="hanging">
  <t hangText='CLEAR (0x1):'>
  Indicates that the Origin Set MUST be reset to an empty set before processing the contents of the frame it occurs upon.</t>
  <t hangText='REMOVE (0x2):'>
  Indicates that the origin(s) carried in the payload must be removed from the Origin Set, if present; if not present, it/they have no effect.</t>
</list></t>

<section anchor="set" title="The Origin Set">

<t>The set of origins (as per <xref target="RFC6454"/>) that a given connection might be used for is known in this
specification as the Origin Set.</t>

<t>When a connection is first established, its Origin Set is defined to be those origins that the client would normally consider the connection authoritative for; see <xref target="RFC7540"/>, Section 10.1.</t>

<t>The ORIGIN frame allows the server to modify the Origin Set. In particular:</t>

<t><list style="numbers">
  <t>A server can add to its members by sending an ORIGIN frame (without any flags set);</t>
  <t>A server can prune one or more origins from it by sending an ORIGIN frame with the REMOVE flag set;</t>
  <t>A server can remove all its members and then add zero or more members by sending an ORIGIN frame with the CLEAR flag set and a payload containing the new origins.</t>
</list></t>

<t>Adding to the Origin Set (cases 1 and 3 above) does not imply that the connection is authoritative
for the added origins (in the sense of <xref target="RFC7540"/>, Section 10.1) on its own; this MUST be
established by some other mechanism.</t>

<t>A client that implements this specification MUST NOT use a connection for a given origin unless that origin appears in the Origin Set for the connection, regardless of whether or not it believes that the connection is authoritative for that origin.</t>

</section>
<section anchor="processing-origin-frames" title="Processing ORIGIN Frames">

<t>The ORIGIN frame is a non-critical extension to HTTP/2. Endpoints that do not support this frame
can safely ignore it upon receipt.</t>

<t>When received by a client, it can be used to inform HTTP/2 connection coalescing (see <xref target="set"/>), but
does not relax the requirement there that the server is authoritative.</t>

<t>The origin frame MUST be sent on stream 0; an ORIGIN frame on any other stream is invalid and MUST be ignored.</t>

<t>The ORIGIN frame is processed hop-by-hop. An intermediary MUST NOT forward ORIGIN frames. Clients
configured to use a proxy MUST ignore any ORIGIN frames received from it.</t>

<t>The following algorithm illustrates how a client can handle received ORIGIN frames:</t>

<t><list style="numbers">
  <t>If the client is configured to use a proxy, ignore the frame and stop processing.</t>
  <t>If the frame occurs upon any stream except stream 0, ignore the frame and stop processing.</t>
  <t>If the CLEAR flag is set, remove all members from the Origin Set.</t>
  <t>For each Origin field <spanx style="verb">origin_raw</spanx> in the frame payload:
  <list style="numbers">
      <t>Parse <spanx style="verb">origin_raw</spanx> as an ASCII serialization of an origin (<xref target="RFC6454"/>, Section 6.2) and let the result be <spanx style="verb">parsed_origin</spanx>.</t>
      <t>If the REMOVE flag is set, remove any member of the Origin Set that is the same as <spanx style="verb">parsed_origin</spanx> (as per <xref target="RFC6454"/>, Section 5), and continue to the next <spanx style="verb">parsed_origin</spanx>.</t>
      <t>Otherwise, add <spanx style="verb">parsed_origin</spanx> to the Origin Set.</t>
    </list></t>
</list></t>

</section>
</section>
<section anchor="security-considerations" title="Security Considerations">

<t>Clients that blindly trust the ORIGIN frame’s contents will be vulnerable to a large number of
attacks; hence the reinforcement that this specification does not relax the requirement for server
authority in <xref target="RFC7540"/>, Section 10.1.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor='RFC2119' target='http://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference  anchor='RFC7540' target='http://www.rfc-editor.org/info/rfc7540'>
<front>
<title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
<author initials='M.' surname='Belshe' fullname='M. Belshe'><organization /></author>
<author initials='R.' surname='Peon' fullname='R. Peon'><organization /></author>
<author initials='M.' surname='Thomson' fullname='M. Thomson' role='editor'><organization /></author>
<date year='2015' month='May' />
<abstract><t>This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2).  HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection.  It also introduces unsolicited push of representations from servers to clients.</t><t>This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax.  HTTP's existing semantics remain unchanged.</t></abstract>
</front>
<seriesInfo name='RFC' value='7540'/>
<seriesInfo name='DOI' value='10.17487/RFC7540'/>
</reference>



<reference  anchor='RFC6454' target='http://www.rfc-editor.org/info/rfc6454'>
<front>
<title>The Web Origin Concept</title>
<author initials='A.' surname='Barth' fullname='A. Barth'><organization /></author>
<date year='2011' month='December' />
<abstract><t>This document defines the concept of an &quot;origin&quot;, which is often used as the scope of authority or privilege by user agents.  Typically, user agents isolate content retrieved from different origins to prevent malicious web site operators from interfering with the operation of benign web sites.  In addition to outlining the principles that underlie the concept of origin, this document details how to determine the origin of a URI and how to serialize an origin into a string.  It also defines an HTTP header field, named &quot;Origin&quot;, that indicates which origins are associated with an HTTP request.   [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6454'/>
<seriesInfo name='DOI' value='10.17487/RFC6454'/>
</reference>




    </references>




  </back>
</rfc>

