<?xml version="1.0" encoding="UTF-8"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced.
    An alternate method (rfc include) is described in the references. -->

<!ENTITY I-D.ietf-dnssd-hybrid SYSTEM  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-dnssd-hybrid.xml">
<!ENTITY I-D.ietf-dnssd-push SYSTEM  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-dnssd-push.xml">
<!ENTITY I-D.sekar-dns-llq SYSTEM  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.sekar-dns-llq.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-pusateri-hybridproxy-impl-00" ipr="trust200902">
 <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    you can add the attributes updates="NNNN" and obsoletes="NNNN"
    they will automatically be output with "(if approved)" -->

 <!-- ***** FRONT MATTER ***** -->

 <front>
   <!-- The abbreviated title is used in the page header - it is only necessary if the
        full title is longer than 39 characters -->

   <title abbrev="DNSSD-HybridProxy-Impl">DNS-SD Hybrid Proxy Implementation Advice</title>

   <!-- add 'role="editor"' below for the editors if appropriate -->

   <!-- Another author who claims to be an editor -->

   <author fullname="Tom Pusateri" initials="T.J." surname="Pusateri">
     <organization>Seeking affiliation</organization>

     <address>
       <postal>
         <street></street>
         <!-- Reorder these if your country does things differently -->
         <city>Hilton Head Island</city>
         <region>SC</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone>+1 843 473 7394</phone>
       <email>pusateri@bangj.com</email>
       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <date year="2015" month="April"/>

   <!-- If the month and year are both specified and are the current ones, xml2rfc will fill
        in the current day for you. If only the current year is specified, xml2rfc will fill
        in the current day and month for you. If the year is not the current one, it is
        necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the
        purpose of calculating the expiry date).  With drafts it is normally sufficient to
        specify just the year. -->

   <!-- Meta-data Declarations -->

   <area>DNSSD</area>

   <workgroup>Internet Engineering Task Force</workgroup>

   <!-- WG name at the upper left corner of the doc,
        IETF is fine for individual submissions.
        If this element is not present, the default is "Network Working Group",
        which is used by the RFC Editor as a nod to the history of the IETF. -->

   <keyword>dns hybrid proxy implementation</keyword>

   <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

   <abstract>
     <t>This document provides advice on the implementation of a DNS Service Discovery Hybrid Proxy Server. It describes the configuration parameters at the delegating DNS server, the hybrid proxy itself, and the client. It also describes the resource records required of the delegating DNS server and the hybrid proxy.</t>
   </abstract>
 </front>

 <middle>

   <section title="Introduction">
     <t>A hybrid proxy <xref target="I-D.ietf-dnssd-hybrid"/> dynamically maps between the multicast DNS link-local infrastructure and the wide-area unicast DNS infrastructure. Externally, it looks like a standard unicast DNS server. Internally, instead of static resource records, it builds a cache of resource records that it learns dynamically on an interface where mDNS is used. These resource records are mapped to a location in the unicast DNS hierarchy by associating a subdomain with each IP subnet.</t>
     <t>Responses to queries made for resource records in the subdomain are filled by a dynamic cache of records learned dynamically from the IP subnet. Unicast queries received by the hybrid proxy may trigger mDNS queries from the hybrid proxy to the IP subnet associated with the subdomain. If subscriptions are active for the record in a query, the hybrid proxy will already have an up to date cache and no mDNS queries are triggered.</t> 
   </section>
   <section title="Delegating DNS Server">
     <t>The delegating DNS server requires configuration of the subdomain delegations and the browse PTR records for each subdomain. All configuration parameters are in the form '@entity.parameter' for easy identification.</t>
     <section title="@delegating_server.subdomain_ns">
       <t>This configuration item is for each hybrid proxy on each subdomain.</t>

       <t>The delegating DNS server will have NS records for each hybrid proxy for the subdomain on each IP subnet it is connected. There maybe multiple NS records for the same subdomain for each hybrid proxy.</t>
       <texttable anchor="ns_records" title="Example NS Records">
       <ttcol align="left">Delegation</ttcol>
       <ttcol align="left">Class</ttcol>
       <ttcol align="left">Type</ttcol>
       <ttcol align="left">Hybrid Proxy</ttcol>
         <c>subdomain1.example.com.</c><c>IN</c><c>NS</c><c>foo.example.com.</c>
         <c>subdomain1.example.com.</c><c>IN</c><c>NS</c><c>bar.example.com.</c>
         <c>subdomain2.example.com.</c><c>IN</c><c>NS</c><c>hba.example.com.</c>
       </texttable>
       <t>If the DNS name of the hybrid proxy is within the delegating server's zone, it will also have address records for the hybrid proxy.</t>
     </section>
     <section title="@delegating_server.subdomain_browse_ptr">
       <t>This configuration item is for each subdomain.</t>

       <t>In order for clients to learn about all of the subdomains it should browse for services, the delegating DNS server should have a browse PTR record for each subdomain.</t>
       <texttable anchor="ptr_records" title="Example PTR Records">
       <ttcol align="left">Browse Service</ttcol>
       <ttcol align="left">Class</ttcol>
       <ttcol align="left">Type</ttcol>
       <ttcol align="left">Delegation</ttcol>
         <c>b._dns-sd._udp</c><c>IN</c><c>PTR</c><c>subdomain1.example.com.</c>
         <c>b._dns-sd._udp</c><c>IN</c><c>PTR</c><c>subdomain2.example.com.</c>
       </texttable>
     </section>
   </section>
   <section title="Hybrid Proxy Configuration">

     <section title="@hybrid_proxy.subdomain">
       <t>This configuration item is for each IP subnet.</t>

       <t>The hybrid proxy must determine which subdomain name to associate with each connected IP subnet. If multiple hybrid proxies exist on the same IP subnet, this subdomain name should be consistent across all hybrid proxies on that IP subnet.</t>

       <t>There are several different ways that a hybrid proxy can determine the subdomain name of it's connected IP subnets.</t>
       <t>
         <list style="numbers">
           <t>The subdomain name can be configured manually or distributed by an out of band method.</t>
           <t>The hybrid proxy can query legacy browse domain PTR records for the network portion of the interface address. Suppose an interface on the hybrid proxy is configured with IP address 192.0.2.1/24. The network portion is 192.0.2.0/24. A query is made for lb._dns-sd._udp.0.2.0.192.in-addr.arpa. For IPv6, the extension for PTR address queries is ip6.arpa. All hybrid proxies on the IP subnet will make the same query since the network portion is the same for all of them. The returned name will be &lt;subdomain&gt;.&lt;zone&gt;, where &lt;zone&gt; is the delegating zone. As an example, this could be foo.example.com where example.com is the domain name distributed through DHCP or SLAAC and foo is the assigned subdomain. If the hybrid proxy does not know the base domain name or know which domain name from a list of search domains to respond to, the domain name returned from this query can be used as a indicator. The left most label is the subdomain and the remainder is the base domain name or zone. This domain name could be different on each connected IP subnet of a particular hybrid proxy, especially in a multi-tenant environment.</t>
           <t>The hybrid proxy can use a naming algorithm where each proxy will arrive at the same value using the supplied algorithm. The hybrid proxy will have to learn the zone through another means such as DHCP or SLAAC. No particular algorithm should be mandated but an example of such an algorithm would be to create a hexadecimal string based on the network portion of the interface IP address. For the example above with interface IP address 192.0.2.1/24, the hexadecimal string of the network portion would be C0000200. This string could be prefixed with ASCII characters if desired resulting in a subdomain of netc0000200.example.com. All hybrid proxies with an interface on the same subnet can independently compute the same subdomain name. This might be challenging in a multi-vendor environment.</t>
         </list>
       </t>
     </section>
     <section title="@hybrid_proxy.ns_delegation_name">
       <t>This configuration item is for each IP subnet.</t>
     
       <t>In order for the hybrid to function as an authoritative server for a subdomain, the subdomain must be delegated by the DNS server responsible for the zone it is delegated from.</t>

       <t>The hybrid proxy must know the NS record delegation name and the address for which to listen for queries that are forwarded. Before the delegation server will forward queries to the delegated hybrid proxy for a subdomain, it will query the NS record for the subdomain from the hybrid proxy to ensure it will accept queries for the subdomain.</t>

       <t>In the case of multiple hybrid proxies, the delegating server will have multiple NS record delegations and will select one based on local policy to forward requests to.</t>
     </section>
     <section title="@hybrid_proxy.ns_delegation_name_address_records">
       <t>This configuration item is for each @hybrid_proxy.ns_delegation_name</t>
       <t>The address records must refer to active addresses (IPv4 or IPv6) on the hybrid proxy.</t>
     </section>
     <section title="Hybrid Proxy Records">
       <t>The hybrid proxy must answer the following resource records when queried:</t>
       <t>
         <list style="numbers">
           <t>SOA record - SOA for &lt;subdomain&gt;.&lt;zone&gt; with MNAME the same as the NS delegation name.</t>
           <t>Browse domain record - PTR b._dns-sd._udp.&lt;subdomain&gt;.&lt;zone&gt; with NAME pointing to the fully qualified &lt;subdomain&gt;.&lt;zone&gt;.</t>
           <t>Legacy browse domain record - PTR lb._dns-sd._udp.&lt;subdomain&gt;.&lt;zone&gt; with NAME pointing to the fully qualified &lt;subdomain&gt;.&lt;zone&gt;.</t>
         </list>
       </t>
       <t>Additionally, if <xref target="I-D.sekar-dns-llq">LLQ</xref> and/or <xref target="I-D.ietf-dnssd-push">DNS Push</xref> is supported, the hybrid proxy must answer to these additional records:</t>
       <t>
         <list style="numbers">
           <t>LLQ over UDP - SRV _dns-llq._udp.&lt;subdomain&gt;.&lt;zone&gt; with target as NS delegation name</t>
           <t>LLQ over TCP - SRV _dns-llq._tcp.&lt;subdomain&gt;.&lt;zone&gt; with target as NS delegation name</t>
           <t>DNS Push - SRV _dns-push._tcp.&lt;subdomain&gt;.&lt;zone&gt; with target as NS delegation name</t>
         </list>
       </t>
       <t>Since there may be multiple LLQ and/or DNS Push SRV records for each subdomain (one for each hybrid proxy), each hybrid proxy should return all of the SRV records from each hybrid proxy on the IP subnet. Otherwise only a subset of SRV records may be cached and load balancing may not be effective.</t>

       <t>In order for each hybrid proxy to learn about the other hybrid proxy's SRV records, each hybrid proxy should advertise its own SRV records for LLQ and/or DNS Push through mDNS on the shared IP subnet.</t>

       <t>Because there should only be one SOA record for the delegated subdomain, a mechanism is needed to ensure only one hybrid proxy advertises the SOA record for the delegated subdomain. (TBD)</t>

       <t>This satisfies the minimum configuration requirements but it is likely that additional parameters will be desired. Examples include the port numbers to listen for mandatory TLS or policy to determine which services get advertised to which unicast clients.</t>
     </section>

     <section title="@hybrid_proxy.udp_port">
       <t>Port 53, forwarded to by delegating DNS server</t>
     </section>

     <section title="@hybrid_proxy.udp_llq_port">
       <t>Port 53, 5352, or custom, advertised in SRV record</t>
     </section>

     <section title="@hybrid_proxy.tcp_llq_port">
       <t>Port 53, 5352, or custom, advertised in SRV record</t>
     </section>

     <section title="@hybrid_proxy.tcp_push_port">
       <t>Random port, advertised in SRV record, one will be assigned in DPRIVE for TLS/TCP</t>
     </section>

   </section>
   <section title="Client Configuration">

     <section title="@unicast_client.search_domains">

       <t>A unicast client will not necessarily need to know the name or IP address of the hybrid proxy. It can send unicast queries to the local resolver learned through DHCP or SLAAC. However, if long-lived queries (LLQ) or DNS Push Notifications are wanted, a direct connection from the client to the hybrid proxy is needed. This will require discovery of the name and IP address of a hybrid proxy for the subdomain.</t>

       <t>Based on the search domains learned (typically via DHCP or SLAAC), the client will want to query for the list of subdomains that are browseable. This is a PTR query for b._dns-sd._udp.&lt;zone&gt; for each search domain. This will return the list of subdomains to browse. The client can then make sure each subdomain is browseable with a PTR query to b._dns-sd._udp.&lt;subdomain&gt;.&lt;zone&gt;. Responses to this query will enable the client to then search for services in that subdomain using PTR queries for the service name. Clients may also query lb._dns-sd._udp.&lt;subdomain&gt;.&lt;zone&gt; for legacy browsing of the subdomain.</t>
     </section>
   </section>
   <section title="Hybrid Proxy Startup">

     <t>Can we auto-configure?</t>
     <t>
       <list style="numbers">
         <t>query PTR for each local interface address looking for name</t>
         <t>query PTR for legacy browseable reverse network name looking for subdomain</t>
       </list>
     </t>
     <t>Otherwise, we receive local configuration by other means.</t>
   <t>Are the DNS records in the delegating zone setup correctly for the hybrid proxy to function?</t>
   <t>
     <list style="numbers">
       <t>query through a local resolver for PTR records for b._dns-sd._udp.&lt;zone&gt;, noting connected subdomains</t>
       <t>query through a local resolver for NS record for each local subdomain that is connected and make sure the query arrives back to the hybrid proxy, send the response, and verify that the response is received. If these PTR and NS records are not in place, the hybrid proxy may wish to install the records through DNS Update if this option is available. The hybrid proxy may choose to not listen for queries until these records are present.</t>
       <t>query through a local resolver for PTR record for b._dns-sd._udp.&lt;subdomain&gt;.&lt;zone&gt; for each connected subdomain that passed the NS record test. This request will also be answered by the hybrid proxy.</t>
       <t>ensure that one and only one hybrid proxy on the IP subnet responds as the SOA for the subdomain. (TBD)</t>
       <t>If LLQ is supported over UDP, install _dns-llq._udp.&lt;subdomain&gt;.&lt;zone&gt; SRV and advertise _dns-llq._udp.local on IP subnet corresponding to &lt;subdomain&gt;.</t>
       <t>If LLQ is supported over TCP, install _dns-llq._tcp.&lt;subdomain&gt;.&lt;zone&gt; SRV and advertise _dns-llq._tcp.local on IP subnet corresponding to &lt;subdomain&gt;.</t>
       <t>If DNS Push is supported, install _dns-push._tcp.&lt;subdomain&gt;.&lt;zone&gt; SRV and advertise _dns-push._tcp.local on IP subnet corresponding to &lt;subdomain&gt;.</t>
       <t>Whether or not a hybrid proxy supports LLQ or DNS Push, the proxy must listen for other hybrid proxies on each IP subnet advertising the LLQ and DNS Push records and cache these for future SRV queries that may be forwarded to a hybrid proxy.</t>
       </list>
     </t>
   </section>
     
   <section anchor="IANA" title="IANA Considerations">
     <t>This document has no IANA considerations.</t>
   </section>

   <section anchor="Security" title="Security Considerations">
     <t>There are no security considerations at this time.</t>
   </section>
 </middle>

 <!--  *****BACK MATTER ***** -->

 <back>
   <!-- References split into informative and normative -->

   <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
    2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
       (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included files in the same
    directory as the including file. You can also define the XML_LIBRARY environment variable
    with a value containing a set of directories to search.  These can be either in the local
    filing system or remote ones accessed by http (http://domain/dir/... ).-->

   <references title="Normative References">
     &I-D.ietf-dnssd-hybrid;
   </references>

   <references title="Informative References">

     &I-D.sekar-dns-llq;
     &I-D.ietf-dnssd-push;

   </references>
 </back>
</rfc>
