<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-grubto-dnsop-dns-out-of-protocol-signalling-03" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true">

<front>
<title abbrev="dns-oops">DNS Out Of Protocol Signalling</title><seriesInfo value="draft-grubto-dnsop-dns-out-of-protocol-signalling-03" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="C." surname="Almond" fullname="Cathy Almond"><organization abbrev="ISC">Internet Systems Consortium, Inc.</organization><address><postal><street>PO Box 360</street>
<city>Newmarket</city>
<code>NH 03857</code>
<country>United States of America</country>
</postal><phone>+1 650 423 1300</phone>
<email>cathya@isc.org</email>
</address></author>
<author initials="P." surname="van Dijk" fullname="Peter van Dijk"><organization>PowerDNS</organization><address><postal><street></street>
<city>Den Haag</city>
<country>Netherlands</country>
</postal><email>peter.van.dijk@powerdns.com</email>
</address></author>
<author initials="M.W." surname="Groeneweg" fullname="Marc Groeneweg"><organization abbrev="SIDN">Stichting Internet Domeinregistratie Nederland</organization><address><postal><street>Postbus 5022</street>
<city>Arnhem</city>
<code>6802EA</code>
<country>Netherlands</country>
</postal><email>marc.groeneweg@sidn.nl</email>
</address></author>
<author initials="S.W.J." surname="Ubbink" fullname="Stefan Ubbink"><organization abbrev="SIDN">Stichting Internet Domeinregistratie Nederland</organization><address><postal><street>Postbus 5022</street>
<city>Arnhem</city>
<code>6802EA</code>
<country>Netherlands</country>
</postal><email>stefan.ubbink@sidn.nl</email>
</address></author>
<author initials="D." surname="Salzman" fullname="Daniel Salzman"><organization>CZ.NIC</organization><address><postal><street></street>
<country>CZ</country>
</postal><email>daniel.salzman@nic.cz</email>
</address></author>
<author initials="W." surname="Toorop" fullname="Willem Toorop"><organization>NLnet Labs</organization><address><postal><street>Science Park 400</street>
<city>Amsterdam</city>
<code>1098 XH</code>
<country>Netherlands</country>
</postal><email>willem@nlnetlabs.nl</email>
</address></author>
<date year="2023" month="July" day="10"></date>
<area>Internet</area>
<workgroup>DNSOP Working Group</workgroup>

<abstract>
<t>This document seeks to specify a method for DNS servers to signal programs outside of the server software, and which are not necessarily involved with the DNS protocol, about conditions that can arise within the server.
These signals can be used to invoke actions in areas that help provide the DNS service, such as routing.</t>
<t>Currently this document serves as a requirements document to come to a signalling mechanism that will suit the use cases best.
Part of that effort is to assemble a list of conditions with potential associated out of DNS protocol actions, as well as inventory and assess existing signalling mechanisms for suitability.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Operators of DNS servers can benefit from automatically taking action upon certain conditions in the name server software.
Some conditions can be monitored from outside the server software, but for adequate and immediate action, the server software itself should signal about the condition immediately when it occurs to invoke action by a listener for these signals.</t>
<t>An example of such a condition is when all zones, from a set served from an anycasted prefix, are loaded and ready to be served.
An associated action may be to start announcing a prefix route from the point-of-presence where the name server is running and to withdraw the prefix route if one of the zones cannot be served anymore.
This way queries for zones will only reach the point-of-presence if the name server software can answer those queries.</t>
<t>Another example condition may be if an recursive resolver served from an anycasted prefix, is started and ready to serve, with the same associated action of only announcing the anycasted prefix when the recursive resolver can serve queries.</t>
<t>All anycasted DNS services can benefit from the mechanism alone, by the increased adequacy and reduced resources of not having to poll for a server's state.
DNS services with diverse implementations will benefit from standardizing of the name server signalling.</t>
<t>Before coming to a specification for the mechanism, this document will serve to inventorise the already available standardized and non-standardized signalling channels and assess them for usability for out of protocol signalling.</t>
</section>

<section anchor="terminology"><name>Terminology and Definitions</name>
<t>The key words &quot;<bcp14>MUST</bcp14>&quot;, &quot;<bcp14>MUST NOT</bcp14>&quot;, &quot;<bcp14>REQUIRED</bcp14>&quot;,
&quot;<bcp14>SHALL</bcp14>&quot;, &quot;<bcp14>SHALL NOT</bcp14>&quot;, &quot;<bcp14>SHOULD</bcp14>&quot;, &quot;<bcp14>SHOULD NOT</bcp14>&quot;,
&quot;<bcp14>RECOMMENDED</bcp14>&quot;, &quot;<bcp14>NOT RECOMMENDED</bcp14>&quot;, &quot;<bcp14>MAY</bcp14>&quot;, and
&quot;<bcp14>OPTIONAL</bcp14>&quot; in this document are to be interpreted as described in
BCP 14 <xref target="RFC2119"></xref><xref target="RFC8174"></xref> when, and only when, they appear in all
capitals, as shown here.</t>
</section>

<section anchor="conditions"><name>Conditions to be signalled</name>
<t>This section served to collect a list of conditions for which actions outside of the DNS protocol may be interesting.
A signal will be sent if the condition is met, and also when the condition is no longer met.
Some conditions take configuration parameters influencing when the conditions are met.
Some conditions may contain arguments when signalled.
When applicable, the parameters and arguments are given with each condition.</t>
<t>Some conditions may be identified from outside of the DNS server by polling for the condition.
This is more resource intensive that listening for a signal, but may also be more robust.
When this is the case, how the condition can be identified is provided with the condition.</t>

<section anchor="isrunning"><name>The DNS server is running and can respond to queries</name>
<t>How to identify:</t>

<ul>
<li>check if the DNS server is running by doing a query to see if it responds</li>
</ul>
<t>Action:</t>

<ul>
<li>Start announcing the prefix on which this zone is served with BGP
A announcement may be withdrawn when the condition is no longer met.</li>
</ul>
</section>

<section anchor="shutdown"><name>Shutting down</name>
<t>How to identify:</t>

<ul>
<li>Maintenance, before shutting down the name server, initiate at least the BGP withdrawl</li>
</ul>
<t>Action:</t>

<ul>
<li>Stop the BGP announcement of the prefix</li>
</ul>
</section>

<section anchor="crashed"><name>The nameserver has crashed</name>
<t>How to identify:</t>

<ul>
<li>The name server is no longer running (or does not respond to queries, although that might also be the case when it is under an attack)</li>
</ul>
<t>Action:</t>

<artwork>- Stop the BGP announcement of the prefix
</artwork>
<t>This condition maybe only detected from outside of the DNS server.</t>
</section>

<section anchor="azoneready"><name>A zone is loaded and ready to serve</name>
<t>How to identify:</t>

<ul>
<li>Query the zone to see if it responds</li>
</ul>
<t>Argument:</t>

<ul>
<li>The zone that was loaded</li>
</ul>
<t>Action:</t>

<ul>
<li>Start announcing the prefix on which these zones are served with BGP.
A announcement may be withdrawn when the condition is no longer met.</li>
</ul>
<t>Some name servers, when configured to notify targets when a zone is updated <xref target="RFC1996"></xref>, will also notify those targets when a zone is just loaded.
The notify itself may be considered an appropriate signal, although it will not be emitted when the zone is no longer served.</t>
</section>

<section anchor="allzonesready"><name>All zones are loaded and ready to serve</name>
<t>Action:</t>

<ul>
<li>Start announcing the prefix on which these zones are served with BGP.
A announcement may be withdrawn when the condition is no longer met.</li>
</ul>
<t>This condition may be derived from one or more &quot;A zone is loaded and ready to serve&quot; (<xref target="azoneready"></xref>) signals when a list of all zones served is available.</t>
</section>

<section anchor="updatedzone"><name>A zone is updated to a new version</name>
<t>How to identify:</t>

<ul>
<li>Query the zone's SOA record, register value and then compare to expected version</li>
</ul>
<t>Argument:</t>

<ul>
<li>The zone that was updated</li>
</ul>
<t>Action:</t>

<ul>
<li>Verify the zone content. Is it DNSSEC valid, does the ZONEMD validate.</li>
</ul>
<t>Name servers can usually already signal this with NOTIFY <xref target="RFC1996"></xref></t>
</section>

<section anchor="a-zone-is-about-to-expire"><name>A zone is (about to) expire</name>
<t>Parameter:</t>

<ul>
<li>The period before expiration.
A value of 0 will emit the signal the moment the zone expires.</li>
</ul>
<t>Argument:</t>

<ul>
<li>The zone that is (about to) expire</li>
</ul>
<t>Action:</t>

<ul>
<li>Stop the BGP announcement of the prefix on which the zone is served.
It may be reannounced when the zone becomes available again (See <xref target="azoneready"></xref>).</li>
</ul>
</section>

<section anchor="dnssec-signatures-are-about-to-expire"><name>DNSSEC signatures are (about to) expire</name>
<t>Parameter:</t>

<ul>
<li>The period before expiration.
A value of 0 will emit the signal the DNSSEC signature expires.</li>
</ul>
<t>Argument:</t>

<ul>
<li>The zone that contains the signature</li>
<li>The resource record set owner name and type with the signature that will soon expire</li>
</ul>
<t>Action:</t>

<ul>
<li>Stop the BGP announcement of the prefix on which the zone is served.
It may be reannounced when the zone becomes DNSSEC valid again.</li>
</ul>
</section>

<section anchor="queryratehigh"><name>Query rate is exceeding a threshold</name>
<t>Parameter:</t>

<ul>
<li>The number of queries per second threshold.</li>
</ul>
<t>Action:</t>

<ul>
<li>Lengthen the AS path for the BGP announcement for a prefix, to demotivate the anycast node that receives all the queries.</li>
<li>Or if the query rate is indicating a denial of service attack, keep the BGP AS path short, to absorb the attack.</li>
<li>Signal to Security Information and Event Management SIEM and logging that  problem has been observed.</li>
</ul>
</section>

<section anchor="queryrate_derivat"><name>Query rate increase is exceeding a threshold</name>
<t>Parameter:</t>

<ul>
<li>The number of queries per second increase per second threshold.</li>
</ul>
<t>Action:</t>

<ul>
<li>The same actions as for &quot;Query rate is exceeding a threshold&quot; (<xref target="queryratehigh"></xref>) apply.</li>
</ul>
</section>

<section anchor="ede"><name>Extended DNS Error conditions</name>
<t>Parameter:</t>

<ul>
<li>The Extended DNS Error conditions for which to signal <xref target="RFC8914"></xref></li>
</ul>
<t>Argument:</t>

<ul>
<li>The Extended DNS Error condition that occurred.</li>
</ul>
<t>Action:</t>

<ul>
<li>Dependent on the DNS Error condition</li>
</ul>
</section>
</section>

<section anchor="requirements"><name>Requirements for signalling mechanisms and channels</name>

<ul>
<li>All conditions are sensitive information and should be stay either in the administered domain (for example on the local machine that is under control of the operator), or needs to be authenticated.</li>
</ul>
</section>

<section anchor="existing"><name>Existing signalling mechanisms and channels</name>
<t>What follows is a list of existing signalling mechanisms and a comparison of those channels in <xref target="comparison"></xref>.</t>

<section anchor="notify"><name>Notify</name>
<t>DNS NOTIFY <xref target="RFC1996"></xref> is an existing ubiquitous mechanism to signal zones.
It is intended to target name servers, but tooling exists to listen for NOTIFY messages and trigger execution of a command when a zone is updated (See <xref target="nsnotifyd"></xref>).</t>
<t>Advantages:</t>

<ul>
<li><t>Native signalling for zone updates present right now (See <xref target="updatedzone"></xref>)</t>
</li>
<li><t>Indirect support for zone loaded (See <xref target="azoneready"></xref>)</t>
</li>
</ul>
<t>Disadvantages:</t>

<ul>
<li><t>One available Open Source Software which lacks authentication support and is therefore only suitable for local usage</t>
</li>
<li><t>Only two conditions are signalled.</t>
</li>
<li><t>Does not signal when the conditions are no longer met.</t>
</li>
</ul>
</section>

<section anchor="dbus"><name>D-Bus as publication channel</name>
<t>D-Bus is a mechanism for exchanging messages between processes local on the same machine (See <xref target="D-Bus"></xref>).
The D-BUS protocol is a one-to-one protocol, but distribution of messages (or signals) to multiple other applications is carried out by a program intended for this purpose: the D-Bus <em>message bus</em>.</t>
<t>Advantages:</t>

<ul>
<li><t>Implementation already exists (See <xref target="Knot-DNS-3.1.6"></xref>)</t>
</li>
<li><t>Good Open Source Software library support [TODO references]</t>
</li>
</ul>
<t>Disadvantages:</t>

<ul>
<li><t>Server needs to be started before clients making it less robust.</t>
</li>
<li><t>Is only communicated locally to the machine</t>
</li>
</ul>
</section>

<section anchor="ddos-open-threat-signaling"><name>DDoS Open Threat Signaling</name>
<t>DDoS Open Threat Signaling (DOTS) <xref target="RFC9132"></xref> is a set of protocols for real-time signaling of threat-mitigation requests within and between different operational domains.</t>
<t>Advantages:</t>

<ul>
<li><t>Publish / Subscribe mechanism</t>
</li>
<li><t>Inter-operator communications</t>
</li>
<li><t>Authenticated</t>
</li>
<li><t>Open Source server software exists [TODO reference go-dots]</t>
</li>
</ul>
<t>Disadvantages:</t>

<ul>
<li>No Open Source client library exists? We need to get information during the upcoming hackathon at the IETF117.
Current DOTS builds upon CoAP <xref target="RFC7252"></xref> for which many client library implementations exist.</li>
</ul>
</section>

<section anchor="mqtt"><name>MQTT</name>
<t>MQTT (see <xref target="MQTT-OASIS-Standard-v5"></xref>) is a lightweight publish-subscribe network protocol for messages.</t>
<t>Advantages:</t>

<ul>
<li><t>Network Publish / Subscribe mechanism</t>
</li>
<li><t>Supports authentication</t>
</li>
</ul>
<t>Disadvantages:</t>

<ul>
<li>Need to gain experience at the IETF117 hackathon</li>
</ul>
</section>

<section anchor="comparison"><name>Observations and comparison</name>
<table>
<thead>
<tr>
<th>Method</th>
<th>NOTIFY</th>
<th>D-Bus</th>
<th>DOTS</th>
<th>MQTT</th>
</tr>
</thead>

<tbody>
<tr>
<td>Local to machine</td>
<td>+</td>
<td>++</td>
<td>+</td>
<td>+</td>
</tr>

<tr>
<td>inter-machine</td>
<td>+</td>
<td>-</td>
<td>+</td>
<td>+</td>
</tr>

<tr>
<td>inter-operator</td>
<td>+</td>
<td>-</td>
<td>++</td>
<td>-</td>
</tr>

<tr>
<td>Publish Subscribe</td>
<td>-</td>
<td>-</td>
<td>++</td>
<td>++</td>
</tr>

<tr>
<td>Authentication</td>
<td>+-</td>
<td>-</td>
<td>+</td>
<td>+</td>
</tr>

<tr>
<td>Client library availability</td>
<td>NA</td>
<td>++</td>
<td>?</td>
<td>++</td>
</tr>
</tbody>
</table></section>
</section>

<section anchor="security"><name>Security and Privacy Considerations</name>
<t>Signalling MUST be performed in an authenticated and private manner.</t>
</section>

<section anchor="implementation"><name>Implementation Status</name>

<ul>
<li>Knot DNS has support for D-Bus notifications (See <xref target="dbus"></xref>) for significant server and zone events with the &quot;<tt>dbus-event</tt>&quot; configuration parameter since version 3.1.6 <xref target="Knot-DNS-3.1.6"></xref></li>
<li>NSD has a feature branch <xref target="NSD-oops-branch"></xref> where work is being done on the implementation</li>
</ul>
</section>

<section anchor="iana"><name>IANA Considerations</name>
<t>This document has no IANA actions</t>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>We would like to thank the people of the port53 hackathon in Rotterdam for
their contributions. Mainly Doris Hauser, Lars-Johan Liman, Vilhelm Prytz and
Henrik Kramselund</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1996.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7252.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8914.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9132.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="D-Bus" target="https://dbus.freedesktop.org/doc/dbus-specification.html">
  <front>
    <title>D-Bus Specification</title>
    <author fullname="Havoc Pennington" initials="H." surname="Pennington">
      <organization>Red Hat, Inc.</organization>
    </author>
    <author fullname="Anders Carlsson" initials="A." surname="Carlsson">
      <organization>CodeFactory AB</organization>
    </author>
    <author fullname="Alexander Larsson" initials="A." surname="Larsson">
      <organization>Red Hat, Inc.</organization>
    </author>
    <author fullname="Sven Herzberg" initials="S." surname="Herzberg">
      <organization>Imendio AB</organization>
    </author>
    <author fullname="Simon McVittie" initials="S." surname="McVittie">
      <organization>Collabora Ltd.</organization>
    </author>
    <author fullname="David Zeuthen" initials="D." surname="Zeuthen"></author>
    <date year="2023" month="February"></date>
  </front>
</reference>
<reference anchor="Knot-DNS-3.1.6" target="https://www.knot-dns.cz/2022-02-08-version-316.html">
  <front>
    <title>Knot DNS - Version 3.1.6</title>
    <author>
      <organization>CZ.NIC</organization>
    </author>
    <date year="2022" month="February"></date>
  </front>
</reference>
<reference anchor="MQTT-OASIS-Standard-v5" target="https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html">
  <front>
    <title>OASIS Standard MQTT Version 5.0</title>
    <author fullname="Andrew Banks" initials="A." surname="Banks">
      <organization>IBM</organization>
    </author>
    <author fullname="Ed Briggs" initials="E." surname="Briggs">
      <organization>Microsoft</organization>
    </author>
    <author fullname="Ken Borgendale" initials="K." surname="Borgendale">
      <organization>IBM</organization>
    </author>
    <author fullname="Raphul Gupta" initials="R." surname="Gupta">
      <organization>IBM</organization>
    </author>
    <date year="2019" month="Mar" day="19"></date>
  </front>
</reference>
<reference anchor="NSD-oops-branch" target="https://github.com/NLnetLabs/nsd/tree/features/oops">
  <front>
    <title>NSD feature/oops branch</title>
    <author>
      <organization>NLnet Labs</organization>
    </author>
    <date year="2023" month="May"></date>
  </front>
</reference>
<reference anchor="nsnotifyd" target="https://dotat.at/prog/nsnotifyd/">
  <front>
    <title>nsnotifyd: scripted DNS NOTIFY handler</title>
    <author fullname="Tony Finch" initials="T." surname="Finch"></author>
    <date year="2022" month="Jan"></date>
  </front>
</reference>
</references>

<section anchor="implementation-1"><name>Implementation Status</name>
<t><strong>Note to the RFC Editor</strong>: please remove this entire appendix before publication.</t>
<t>Knot currently uses <xref target="D-Bus"></xref> for this.</t>
</section>

<section anchor="change"><name>Change History</name>
<t><strong>Note to the RFC Editor</strong>: please remove this entire appendix before publication.</t>

<ul>
<li>draft-grubto-dnsop-dns-out-of-protocol-signalling-03</li>
</ul>
<blockquote><t>Rename &quot;name server&quot; into &quot;DNS server&quot; when it also applies to recursive resolvers</t>
<t>Make a single list of conditions with per condition indicated the parameters (how they can be influenced by configuration), the arguments (the signal payload) and &quot;how to identify&quot; if the condition can be identified from outside of the DNS server.</t>
<t>Removing DNS Error reporting monitoring agent as a channel to evaluate</t>
<t>Add DOTS and MQTT as a potential signal channels for our conditions</t>
</blockquote>
<ul>
<li>draft-grubto-dnsop-dns-out-of-protocol-signalling-02</li>
</ul>
<blockquote><t>Updates after discussion during the port53 hackathon in Rotterdam.</t>
</blockquote>
<ul>
<li>draft-grubto-dnsop-dns-out-of-protocol-signalling-00</li>
</ul>
<blockquote><t>Initial version</t>
</blockquote></section>

</back>

</rfc>
