<?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.31 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC6891 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6891.xml">
<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC1035 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC7828 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7828.xml">
<!ENTITY RFC7766 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7766.xml">
<!ENTITY RFC7858 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7858.xml">
]>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>

<rfc ipr="trust200902" docName="draft-bellis-dnsop-session-signal-01" category="std">

  <front>
    <title>DNS Session Signaling</title>

    <author initials="R." surname="Bellis" fullname="Ray Bellis">
      <organization abbrev="ISC">Internet Systems Consortium, Inc.</organization>
      <address>
        <postal>
          <street>950 Charter Street</street>
          <city>Redwood City</city>
          <code>CA 94063</code>
          <country>USA</country>
        </postal>
        <phone>+1 650 423 1200</phone>
        <email>ray@isc.org</email>
      </address>
    </author>
    <author initials="S." surname="Cheshire" fullname="Stuart Cheshire">
      <organization>Apple Inc.</organization>
      <address>
        <postal>
          <street>1 Infinite Loop</street>
          <city>Cupertino</city>
          <code>CA 95014</code>
          <country>USA</country>
        </postal>
        <phone>+1 408 974 3207</phone>
        <email>cheshire@apple.com</email>
      </address>
    </author>
    <author initials="J." surname="Dickinson" fullname="John Dickinson">
      <organization abbrev="Sinodun">Sinodun Internet Technologies</organization>
      <address>
        <postal>
          <street>Magadalen Centre</street> <street>Oxford Science Park</street>
          <city>Oxford</city>
          <code>OX4 4GA</code>
          <country>United Kingdom</country>
        </postal>
        <email>jad@sinodun.com</email>
      </address>
    </author>
    <author initials="S." surname="Dickinson" fullname="Sara Dickinson">
      <organization abbrev="Sinodun">Sinodun Internet Technologies</organization>
      <address>
        <postal>
          <street>Magadalen Centre</street> <street>Oxford Science Park</street>
          <city>Oxford</city>
          <code>OX4 4GA</code>
          <country>United Kingdom</country>
        </postal>
        <email>sara@sinodun.com</email>
      </address>
    </author>
    <author initials="A." surname="Mankin" fullname="Allison Mankin">
      <organization>Salesforce</organization>
      <address>
        <email>allison.mankin@gmail.com</email>
      </address>
    </author>
    <author initials="T." surname="Pusateri" fullname="Tom Pusateri">
      <organization>Unaffiliated</organization>
      <address>
        <phone>+1 843 473 7394</phone>
        <email>pusateri@bangj.com</email>
      </address>
    </author>

    <date year="2016" month="July"/>

    <area>Internet</area>
    <workgroup>DNSOP Working Group</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>The Extension Mechanisms for DNS (EDNS(0)) <xref target="RFC6891"/> is explicitly
defined to only have “per-message” semantics.  This document defines a
new Session Signaling OpCode used to carry persistent “per-session”
type-length-values (TLVs), and defines an initial set of TLVs used to
manage session timeouts and termination.</t>



    </abstract>


  </front>

  <middle>


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

<t>The Extension Mechanisms for DNS (EDNS(0)) <xref target="RFC6891"/> is explicitly
defined to only have “per-message” semantics.  This document defines a
new Session Signaling OpCode used to carry persistent “per-session”
type-length-values (TLVs), and defines an initial set of TLVs used to
manage session timeouts and termination.</t>

<t>A further issue with EDNS(0) is that there is no standard mechanism for
a client to be able to tell whether a server has processed or otherwise
acted upon the individual options contained with an OPT RR.  The Session
Signaling OpCode therefore requires an explicit response to each request
message.</t>

<t>It should be noted that the message format (see <xref target="format"/>) does not
conform to the standard DNS packet format.</t>

</section>
<section anchor="terminology" title="Terminology">

<t>The terms “initiator” and “responder” correspond respectively to the
initial sender and subsequent receiver of a Session Signaling TLV,
regardless of which was the “client” and “server” in the usual DNS
sense.  The term “sender” may apply to either an initiator or responder.</t>

<t>The term “session” in the context of this document means the exchange of
DNS messages over a single connection using an end-to-end transport
protocol where:</t>

<t><list style="symbols">
  <t>connections can be long-lived</t>
  <t>either end of the connection may initiate requests</t>
  <t>message delivery order is guaranteed</t>
  <t>it is guaranteed that the same two endpoints are in communication for
the entire lifetime of the session.</t>
</list></t>

<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 anchor="protocol-details" title="Protocol Details">

<t>Session Signaling messages MUST only be carried in protocols and in
environments where a session may be established according to the
definition above.  Standard DNS over TCP <xref target="RFC1035"/>, and DNS over TLS
<xref target="RFC7858"/> are appropriate protocols.  DNS over plain UDP is not
appropriate since it fails on both the bi-directional initiation
requirement and the message order delivery requirement.</t>

<t>Session Signaling messages relate only to the specific session in which
they are being carried.  Where a middle box (e.g. a DNS proxy,
forwarder, or session multiplexer) is in the path the message MUST NOT
be blindly forwarded in either direction by that middle box.  This does
not preclude the use of these messages in the presence of a NAT box that
rewrites Layer 3 or Layer 4 headers but otherwise maintains the effect
of a single session.</t>

<t>A server MUST NOT initiate Session Signaling messages until a
client-initiated Session Signaling message is received first.  This
requirement is to ensure that the client does not observe unsolicited
inbound messages until it has indicated its ability to handle them.</t>

<t>Session Signaling support is therefore said to be confirmed from the
client’s point of view after the first session signaling TLV has been
sent by that client and subsequently successfully acknowledged by the
server.</t>

<t>Use of Session Signaling by a client should be taken as an implicit
request for a long-lived session.</t>

<section anchor="format" title="Message Format">

<t>A message containing a Session Signaling OpCode does not conform to the
usual DNS message format.  The 4 octet header format from <xref target="RFC1035"/>
is however preserved, since that includes the message ID and OpCode and
RCODE fields, and the QR bit that differentiates requests from responses.</t>

<t>Each message MUST contain only a single TLV.</t>

<figure><artwork><![CDATA[
                                             1   1   1   1   1   1
     0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                          MESSAGE ID                           |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |QR |    OpCode     |            Z              |     RCODE     |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                                                               |
   /                           TLV-DATA                            /
   /                                                               /
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>The MESSAGE ID, QR, OpCode and RCODE fields have their usual meaning as
defined in <xref target="RFC1035"/>.</t>

<t>The Z bits are currently unused, and SHOULD be set to zero (0) in
requests and responses unless re-defined in a later specification.</t>

</section>
<section anchor="message-handling" title="Message Handling">

<t>Both clients and servers may unilaterally send Session Signaling
messages at any point in the lifetime of a session and are therefore
considered to be the initiator with respect to that message.  The
initiator MUST set the value of the QR bit in the DNS header to zero
(0), and the responder MUST set it to one (1).</t>

<t>Every Session Signaling request message MUST elicit a response (which
MUST have the same ID in the DNS message header as in the request).</t>

<t>In order to preserve the correct sequence of state, Session Signaling
requests MUST NOT be processed out of order.</t>

<t>« RB: should the presence of a SS message create a “sequencing point”,
such that all pending responses must be answered? »</t>

<t>The RCODE value in a response uses a subset of the standard
(non-extended) RCODE values from the IANA DNS RCODEs registry,
interpreted as follows:</t>

<texttable>
      <ttcol align='right'>Code</ttcol>
      <ttcol align='left'>Mnemonic</ttcol>
      <ttcol align='left'>Description</ttcol>
      <c>0</c>
      <c>NOERROR</c>
      <c>TLV processed successfully</c>
      <c>1</c>
      <c>FORMERR</c>
      <c>TLV format error</c>
      <c>4</c>
      <c>NOTIMP</c>
      <c>Session Signaling not supported</c>
      <c>5</c>
      <c>REFUSED</c>
      <c>TLV declined for policy reasons</c>
</texttable>

</section>
<section anchor="tlv-format" title="TLV Format">

<figure><artwork><![CDATA[
                                             1   1   1   1   1   1
     0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                         SESSION-TYPE                          |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                        SESSION-LENGTH                         |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                                                               |
   /                         SESSION-DATA                          /
   /                                                               /
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t><list style="hanging">
  <t hangText='SESSION-TYPE:'>
  A 16 bit field in network order giving the type of the current Session
Signaling TLV per the IANA DNS Session Signaling Type Codes Registry.</t>
  <t hangText='SESSION-LENGTH:'>
  A 16 bit field in network order giving the size in octets of
SESSION-DATA.</t>
  <t hangText='SESSION-DATA:'>
  Type-code specific.</t>
</list></t>

</section>
</section>
<section anchor="mandatory-tlvs" title="Mandatory TLVs">

<section anchor="session-management-support-tlvs" title="Session Management Support TLVs">

<section anchor="not-implemented" title="“Not Implemented”">

<t>Since the “NOTIMP” RCODE is required to indicate lack of support for the
Session Signaling OpCode itself, the “Not Implemented” TLV (0) MUST
be returned in response to a TLV that is not implemented by the
responder.</t>

<t>This TLV has no SESSION-DATA.</t>

</section>
</section>
<section anchor="session-management-tlvs" title="Session Management TLVs">

<section anchor="start-session" title="Start Session">

<t>The Start Session TLV (1) SHOULD be used by a client to indicate support
for Session Signaling.  It MUST NOT be initiated by a server.</t>

<t>It is not required that this TLV be used in every session - any valid
client-initiated TLV will suffice to initiate Session Signaling support.
The intention of this TLV is to provide a suitable “No-Op” TLV to permit
Session Signaling support to be negotiated without carrying any other
information.</t>

<t>This TLV has no SESSION-DATA.</t>

<t>« RB: this could perhaps also be used as a real “no-op” message to
provide application-level keep-alive pings »</t>

</section>
<section anchor="terminate-session" title="Terminate Session">

<t>The Terminate Session TLV (2) MAY be sent by a server to request that
the client terminate the session.  It MUST NOT be initiated by a client.</t>

<t>The client SHOULD terminate the session as soon as possible, but MAY
wait for any inflight queries to be answered.  It MUST NOT initiate any
new requests over the existing session.</t>

<t>The SESSION-DATA is as follows:</t>

<figure><artwork><![CDATA[
                                             1   1   1   1   1   1
     0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                        RECONNECT DELAY                        |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t><list style="hanging">
  <t hangText='RECONNECT DELAY:'>
  a time value, specified as a 16 bit word in network order in units of
100 milliseconds, within which the client MUST NOT establish a new
session to the current server.</t>
</list></t>

<t>The RECOMMENDED value is 10 seconds.  « RB: text required here about
default values for load balancers, etc »</t>

</section>
<section anchor="idle-timeout" title="Idle Timeout">

<t>The Idle Timeout TLV (3) has similar intent to the EDNS TCP Keepalive
Option <xref target="RFC7828"/>.  It is used by a server to tell the client how long
it may leave the current session idle for.  a client.  The definition of
an idle session is as specified in <xref target="RFC7766"/>.</t>

<t>Messages generate by the client have no SESSION-DATA (whether in
requests or responses).  A client-initiated Idle Timeout TLV allows the
client to request the current timeout value, whereas a server-initiated
request allows the server to unilaterally update the current timeout
value.</t>

<t>Messages generated by the server contain SESSION-DATA as follows:</t>

<figure><artwork><![CDATA[
                                             1   1   1   1   1   1
     0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                         IDLE TIMEOUT                          |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t><list style="hanging">
  <t hangText='IDLE TIMEOUT:'>
  the idle timeout for the current session, specified as a 16
bit word in network order in units of 100 milliseconds.</t>
</list></t>

<t>The client SHOULD terminate the current session if it remains idle for
longer than the specified timeout (and MAY of course terminate the
session earlier).  The server MAY unilaterally terminate the connection
at any time, but SHOULD allow the client to keep the connection open if
further messages are received before the idle timeout expires.</t>

<t>A client / server pair that supports Session Signaling MUST NOT use the
EDNS TCP KeepAlive option within any message once bi-directional Session
Signaling support has been confirmed.</t>

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

<section anchor="dns-session-signaling-opcode-registration" title="DNS Session Signaling Opcode Registration">

<t>IANA are directed to assign the value TBD for the Session Signaling
OpCode in the DNS OpCodes Registry.</t>

</section>
<section anchor="dns-session-signaling-type-codes-registry" title="DNS Session Signaling Type Codes Registry">

<t>IANA are directed to create the DNS Session Signaling Type Codes
Registry, with initial values as follows:</t>

<texttable>
      <ttcol align='right'>Type</ttcol>
      <ttcol align='left'>Name</ttcol>
      <ttcol align='left'>Status</ttcol>
      <ttcol align='left'>Reference</ttcol>
      <c>0</c>
      <c>Not implemented</c>
      <c>&#160;</c>
      <c>RFC-TBD1</c>
      <c>1</c>
      <c>Start Session</c>
      <c>Standard</c>
      <c>RFC-TBD1</c>
      <c>2</c>
      <c>Terminate Session</c>
      <c>Standard</c>
      <c>RFC-TBD1</c>
      <c>3</c>
      <c>Idle Timeout</c>
      <c>Standard</c>
      <c>RFC-TBD1</c>
      <c>4 - 63</c>
      <c>Unassigned, reserved for session management TLVs</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>64 - 63487</c>
      <c>Unassigned</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>63488 - 64511</c>
      <c>Reserved for local / experimental use</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>64512 - 65535</c>
      <c>Reserved for future expansion</c>
      <c>&#160;</c>
      <c>&#160;</c>
</texttable>

<t>Registration of additional Session Signaling Type Codes requires Expert
Review. « RB: definition of process required? »</t>

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

<t>If this mechanism is to be used with DNS over TLS, then these messages
are subject to the same constraints as any other DNS over TLS messages
and MUST NOT be sent in the clear before the TLS session is established.</t>

</section>
<section anchor="acknowledgements" title="Acknowledgements">

<t>TBW</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>

&RFC6891;
&RFC2119;
&RFC1035;
&RFC7828;
&RFC7766;


    </references>

    <references title='Informative References'>

&RFC7858;


    </references>



  </back>
</rfc>

