<?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 sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr="trust200902" docName="draft-bishop-httpbis-extended-settings-00" category="std">

  <front>
    <title abbrev="EXTENDED_SETTINGS">HTTP/2 Extended SETTINGS Extension</title>

    <author initials="M." surname="Bishop" fullname="Mike Bishop">
      <organization>Microsoft</organization>
      <address>
        <email>michael.bishop@microsoft.com</email>
      </address>
    </author>

    <date year="2016"/>

    <area>General</area>
    <workgroup>HTTP</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>HTTP/2 defines the SETTINGS frame to contain a single 32-bit value per 
setting. While this is sufficient to convey everything used in the core 
HTTP/2 specification, some protocols will require more complex values, 
such as arrays of code-points or strings.</t>

<t>For such protocols, this extension defines a parallel to the SETTINGS 
frame, EXTENDED_SETTINGS, where the value of a setting is not a 32-bit 
value, but a variable-length opaque data blob whose interpretation is 
subject entirely to the definition of the protocol using it.</t>



    </abstract>


  </front>

  <middle>


<section anchor="problems" title="Introduction">

<t>In <xref target="I-D.bishop-httpbis-http2-additional-certs"></xref>, values
for which IANA registries already exist must be communicated between
two HTTP/2 implementations.  Since the SETTINGS frame constrains
setting values to a 32-bit value, the existing version of that
draft divides the 32-bit value into halves and dedicates bits
to each currently-known value.  This requires the creation
of two duplicative IANA registries, and enormously constrains
future extensibility since each future supported value will consume
one of only sixteen bits.  It also causes divergence from other
places in the protocol where a bitmask is not required and a
more sensible value can be used.</t>

<t><xref target="MS-HTTP2E"></xref>, likewise, defines a very limited bitmap in the 32-bit
value – two bits are defined, all others are reserved (and not useful).
The setting fits easily in a single byte, and need not consume a four-byte
value every time it is transferred.  With minor changes to semantics,
a simple flag would have been sufficient – the primary requirement is
communication to the remote endpoint that an extension is supported.</t>

<t>Alternately, a number of recent and in-progress HTTP/2 extensions 
describe properties of the connection that are informative to the peer 
(<xref target="RFC7838"></xref>, <xref target="I-D.ietf-httpbis-origin-frame"></xref>). These can be viewed as 
connection properties that do not fit into a 32-bit value and therefore
have new frame types defined to carry them instead.</t>

<t>Each extension could define its own SETTINGS-equivalent frame to carry 
this data, as some extensions already have, but to do so every time 
a new extension might require such a capability seems similarly 
wasteful, given the limited frame type space (also an IANA registry).</t>

<t>Instead, this draft proposes a unified EXTENDED_SETTINGS frame (and 
accompanying settings synchronization logic) which permits values of 
lengths other than 32 bits. These values are interpreted as defined by 
the specification defining them, operate under similar semantics to the 
original SETTINGS frame, and should make development of future 
extensions much simpler.</t>

</section>
<section anchor="setting" title="Detection of Support">

<t>An HTTP/2 peer that supports the EXTENDED_SETTINGS frame indicates this 
using the HTTP/2 <spanx style="verb">SETTINGS_EXTENDED_SETTINGS</spanx> (0xSETTING-TBD) setting.</t>

<t>The initial value for the <spanx style="verb">SETTINGS_EXTENDED_SETTINGS</spanx> setting is 0 
(0x00), indicating that the peer does not support the EXTENDED_SETTINGS 
frame. A peer that is able to parse the EXTENDED_SETTINGS frame MUST set 
this value to 1 (0x01).</t>

<t>This setting MUST be sent before any of the frame types in <xref target="frames"/> 
are sent, but those frames MAY be sent before the setting is 
acknowledged and MAY be sent regardless of whether the peer has sent 
this setting.</t>

</section>
<section anchor="frames" title="Extension Frame Types">

<section anchor="settings-frame" title="EXTENDED_SETTINGS Frame">

<t>The EXTENDED_SETTINGS frame (type=0xFRAME-TBD1) conveys configuration 
parameters that affect how endpoints communicate, such as preferences 
and constraints on peer behavior which occur in a form other than a 
32-bit value. Individually, an EXTENDED_SETTINGS parameter can also be 
referred to as a “setting”.</t>

<t>EXTENDED_SETTINGS parameters are not negotiated; they describe 
characteristics of the sending peer, which are used by the receiving 
peer. However, a negotiation can be implied by the use of 
EXTENDED_SETTINGS – a peer uses EXTENDED_SETTINGS to advertise a set of 
supported values. The recipient can then choose which entries from this 
list are also acceptable and proceed with the value it has chosen. (This 
choice could be announced in a field of an extension frame, or in a 
different setting.)</t>

<t>Different values for the same parameter can be advertised by each peer. 
For example, a server might support many different signing algorithms, 
while a resource constrained client has only one or two that it can 
validate.</t>

<t>An EXTENDED_SETTINGS frame MAY be sent at any time by either endpoint 
over the lifetime of the connection.</t>

<t>Each parameter in an EXTENDED_SETTINGS frame replaces any existing value 
for that parameter. Parameters are processed in the order in which they 
appear, and a receiver of an EXTENDED_SETTINGS frame does not need to 
maintain any state other than the current value of its parameters. 
Therefore, the value of a EXTENDED_SETTINGS parameter is the last value 
that is seen by a receiver.</t>

<t>EXTENDED_SETTINGS parameters can request acknowledgement by the 
receiving peer. To enable this, the EXTENDED_SETTINGS frame defines the 
following flag:</t>

<t><list style="hanging">
  <t hangText='REQUEST_ACK (0x1):'>
  When set, bit 0 indicates that this frame contains values which the 
sender wants to know were understood and applied. For more information,
see <xref target="synchronization"/>.</t>
</list></t>

<t>Like SETTINGS frames, EXTENDED_SETTINGS frames always apply to a 
connection, never a single stream. The stream identifier for an 
EXTENDED_SETTINGS frame MUST be zero (0x0). If an endpoint receives an 
EXTENDED_SETTINGS frame whose stream identifier field is anything other 
than 0x0, the endpoint MUST respond with a connection error (<xref target="RFC7540"></xref>, 
section 5.4.1) of type PROTOCOL_ERROR.</t>

<t>The EXTENDED_SETTINGS frame affects connection state. A badly formed or 
incomplete EXTENDED_SETTINGS frame MUST be treated as a connection error 
(<xref target="RFC7540"></xref>, section 5.4.1) of type PROTOCOL_ERROR.</t>

<section anchor="extendedsettings-format" title="EXTENDED_SETTINGS Format">

<t>The payload of an EXTENDED_SETTINGS frame consists of zero or more 
parameters, each consisting of an unsigned 16-bit setting identifier and 
a length-prefixed binary value.</t>

<figure title="EXTENDED_SETTINGS frame payload" anchor="fig-ext-settings"><artwork><![CDATA[
0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-------------------------------+---------------+---------------+
|        Identifier (16)        |         Length (16)           |
+-----------------------------------------------+---------------+
|                          Contents (?)                       ...
+---------------------------------------------------------------+
]]></artwork></figure>

<t>In some cases (e.g. indications of feature support), the presence and 
acknowledgement of a setting may be sufficient, and a value superfluous. 
In order to accomodate such cases, implementations MUST track 
identifiers with zero-length values differently from never-seen 
identifiers. The initial value of each setting is “never-seen.”</t>

<t>An implementation MUST ignore the contents for any EXTENDED_SETTINGS 
identifier it does not understand.</t>

</section>
</section>
<section anchor="ack" title="EXTENDED_SETTINGS_ACK Frame">

<t>The EXTENDED_SETTINGS_ACK frame (type=0xFRAME-TBD2) acknowledges receipt 
and application of specific values in the peer’s SETTINGS frame. It 
contains a list of EXTENDED_SETTINGS identifiers which the sender has 
understood and applied. This list MAY be empty.</t>

<t>Any EXTENDED_SETTINGS_ACK frame whose length is not a multiple of two 
bytes MUST be treated as a connection error (<xref target="RFC7540"></xref> section 5.4.1) of 
type <spanx style="verb">FRAME_SIZE_ERROR</spanx>.</t>

</section>
</section>
<section anchor="synchronization" title="Settings Synchronization">

<t>Some values in EXTENDED_SETTINGS benefit from or require an 
understanding of when the peer has received and applied the changed 
parameter values. In order to provide such synchronization timepoints, 
the recipient of a EXTENDED_SETTINGS frame MUST apply the updated 
parameters as soon as possible upon receipt. The values in the 
EXTENDED_SETTINGS frame MUST be processed in the order they appear, with 
no other frame processing between values. Unsupported parameters MUST be 
ignored.</t>

<t>Once all values have been processed, if the REQUEST_ACK flag was set, 
the recipient MUST immediately emit a EXTENDED_SETTINGS_ACK frame 
listing the identifiers whose values were understood and applied. (If 
none of the values were understood, the EXTENDED_SETTINGS_ACK frame will 
be empty, but MUST still be sent.) Upon receiving an 
EXTENDED_SETTINGS_ACK frame, the sender of the altered parameters can 
know which settings were understood and can rely on that subset having 
been applied.</t>

<t>If the sender of an EXTENDED_SETTINGS frame with the <spanx style="verb">REQUEST_ACK</spanx> flag 
set does not receive an acknowledgement from a peer that has sent the 
<spanx style="verb">SETTINGS_EXTENDED_SETTINGS</spanx> setting within a reasonable amount of time, 
it MAY issue a connection error (<xref target="RFC7540"></xref> Section 5.4.1) of type 
SETTINGS_TIMEOUT. This error MUST NOT be sent if the peer has not 
previously advertised support for EXTENDED_SETTINGS.</t>

</section>
<section anchor="security" title="Security Considerations">

<t>Because these frames can be used to request that peers retain potentially-large
state, implementations need to use caution in their retention policies.  Values
which are not understood MUST be discarded in order to protect against increased
memory usage.  Specifications which make use of EXTENDED_SETTINGS MUST include details
about how the contents can be parsed and stored, and SHOULD include details about
how the information can be compressed and when it can safely be discarded.</t>

</section>
<section anchor="iana" title="IANA Considerations">

<t>This draft establishes one new registry and add three entries across two 
existing registries.</t>

<t>A registry for Extended Settings identifiers is created in 
<xref target="iana-extended-settings-values"/>. Two frame types are registered in 
<xref target="iana-frame"/>. The HTTP/2 <spanx style="verb">SETTINGS_EXTENDED_SETTINGS</spanx> setting is 
registered in <xref target="iana-setting"/>.</t>

<section anchor="iana-extended-settings-values" title="Extended Settings Identifiers">

<t>This document establishes a registry for HTTP/2 extended settings. The 
“HTTP/2 Extended Settings” registry manages a 16-bit space. The “HTTP/2 
Extended Settings” registry operates under the “Expert Review” policy 
<xref target="RFC5226"></xref> for values in the range from 0x0000 to 0xefff, with values 
between and 0xf000 and 0xffff being reserved for Experimental Use.</t>

<t>New registrations are advised to provide the following information:</t>

<t><list style="hanging">
  <t hangText='Name:'>
  A symbolic name for the setting.  Specifying a setting name is
optional.</t>
  <t hangText='Code:'>
  The 16-bit code assigned to the setting.</t>
</list></t>

<t>Specification:  An optional reference to a specification that
describes the use of the setting.</t>

<t>No entries are registered by this document.</t>

</section>
<section anchor="iana-frame" title="New HTTP/2 Frames">

<t>Two new frame types are registered in the “HTTP/2 Frame Types” registry 
established in <xref target="RFC7540"></xref>. The entries in the following table are 
registered by this document.</t>

<figure anchor="fig-frame-table"><artwork><![CDATA[
+-----------------------+--------------+-------------------------+
| Frame Type            | Code         | Specification           |
+-----------------------+--------------+-------------------------+
| EXTENDED_SETTINGS     | 0xFRAME-TBD1 | {{settings-frame}}      |
| EXTENDED_SETTINGS_ACK | 0xFRAME-TBD2 | {{ack}}                 |
+-----------------------+--------------+-------------------------+
]]></artwork></figure>

</section>
<section anchor="iana-setting" title="HTTP/2 SETTINGS_HTTP_CERT_AUTH Setting">

<t>The <spanx style="verb">SETTINGS_EXTENDED_SETTINGS</spanx> setting is registered in the “HTTP/2 
Settings” registry established in <xref target="RFC7540"></xref>.</t>

<t><list style="hanging">
  <t hangText='Name:'>
  SETTINGS_EXTENDED_SETTINGS</t>
  <t hangText='Code:'>
  0xSETTING-TBD</t>
  <t hangText='Initial Value:'>
  0</t>
  <t hangText='Specification:'>
  This document.</t>
</list></t>

</section>
</section>


  </middle>

  <back>

    <references title='Normative References'>





<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='RFC5226' target='http://www.rfc-editor.org/info/rfc5226'>
<front>
<title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
<author initials='T.' surname='Narten' fullname='T. Narten'><organization /></author>
<author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'><organization /></author>
<date year='2008' month='May' />
<abstract><t>Many protocols make use of identifiers consisting of constants and other well-known values.  Even after a protocol has been defined and deployment has begun, new values may need to be assigned (e.g., for a new option type in DHCP, or a new encryption or authentication transform for IPsec).  To ensure that such quantities have consistent values and interpretations across all implementations, their assignment must be administered by a central authority.  For IETF protocols, that role is provided by the Internet Assigned Numbers Authority (IANA).</t><t>In order for IANA to manage a given namespace prudently, it needs guidelines describing the conditions under which new values can be assigned or when modifications to existing values can be made.  If IANA is expected to play a role in the management of a namespace, IANA must be given clear and concise instructions describing that role.  This document discusses issues that should be considered in formulating a policy for assigning values to a namespace and provides guidelines for authors on the specific text that must be included in documents that place demands on IANA.</t><t>This document obsoletes RFC 2434.  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='26'/>
<seriesInfo name='RFC' value='5226'/>
<seriesInfo name='DOI' value='10.17487/RFC5226'/>
</reference>




    </references>

    <references title='Informative References'>





<reference anchor='I-D.bishop-httpbis-http2-additional-certs'>
<front>
<title>Secondary Certificate Authentication in HTTP/2</title>

<author initials='M' surname='Bishop' fullname='Mike Bishop'>
    <organization />
</author>

<author initials='M' surname='Thomson' fullname='Martin Thomson'>
    <organization />
</author>

<date month='May' day='17' year='2016' />

<abstract><t>TLS provides fundamental mutual authentication services for HTTP, supporting up to one server certificate and up to one client certificate associated to the session to prove client and server identities as necessary.  This draft provides mechanisms for providing additional such certificates at the HTTP layer when these constraints are not sufficient.  Many HTTP servers host content from several origins.  HTTP/2 [RFC7540] permits clients to reuse an existing HTTP connection to a server provided that the secondary origin is also in the certificate provided during the TLS [I-D.ietf-tls-tls13] handshake.  In many cases, servers will wish to maintain separate certificates for different origins but still desire the benefits of a shared HTTP connection.  Similarly, servers may require clients to present authentication, but have different requirements based on the content the client is attempting to access.  This document describes a how such certificates can be provided at the HTTP layer to support both scenarios.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-bishop-httpbis-http2-additional-certs-01' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-bishop-httpbis-http2-additional-certs-01.txt' />
</reference>


<reference anchor="MS-HTTP2E" target="http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/[MS-HTTP2E].pdf">
  <front>
    <title>Hypertext Transfer Protocol Version 2 (HTTP/2) Extension</title>
    <author >
      <organization>Microsoft Corporation</organization>
    </author>
    <date year="2015" month="October"/>
  </front>
</reference>




<reference  anchor='RFC7838' target='http://www.rfc-editor.org/info/rfc7838'>
<front>
<title>HTTP Alternative Services</title>
<author initials='M.' surname='Nottingham' fullname='M. Nottingham'><organization /></author>
<author initials='P.' surname='McManus' fullname='P. McManus'><organization /></author>
<author initials='J.' surname='Reschke' fullname='J. Reschke'><organization /></author>
<date year='2016' month='April' />
<abstract><t>This document specifies &quot;Alternative Services&quot; 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>
</front>
<seriesInfo name='RFC' value='7838'/>
<seriesInfo name='DOI' value='10.17487/RFC7838'/>
</reference>



<reference anchor='I-D.ietf-httpbis-origin-frame'>
<front>
<title>The ORIGIN HTTP/2 Frame</title>

<author initials='M' surname='Nottingham' fullname='Mark Nottingham'>
    <organization />
</author>

<author initials='E' surname='Nygren' fullname='Erik Nygren'>
    <organization />
</author>

<date month='May' day='9' year='2016' />

<abstract><t>This document specifies the ORIGIN frame for HTTP/2, to indicate what origins are available on a given connection.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-httpbis-origin-frame-00' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-httpbis-origin-frame-00.txt' />
</reference>




    </references>




  </back>
</rfc>

