<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- try to enforce the ID-nits conventions and DTD validity -->
<?rfc strict="yes" ?>
<!-- items used when reviewing the document -->
<?rfc comments="no" ?>
<!-- controls display of <cref> elements -->
<?rfc inline="no" ?>
<!-- when no, put comments at end in comments section,
                                otherwise, put inline -->
<?rfc editing="no" ?>
<!-- when yes, insert editing marks -->
<!-- create table of contents (set it options).
           Note the table of contents may be omitted
         for very short documents -->
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<!-- choose the options for the references. Some like
         symbolic tags in the references (and citations)
         and others prefer numbers. -->
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<!-- these two save paper: start new paragraphs from the same page etc. -->
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<!-- end of list of processing instructions -->
<!-- Information about the document.
         categories values: std, bcp, info, exp, and historic
         For Internet-Drafts, specify attribute "ipr".
         (ipr values are: full3667, noModification3667, noDerivatives3667),
         Also for Internet-Drafts, can specify values for
         attributes "iprExtract", and "docName".  Note
         that the value for iprExtract is the anchor attribute
         value of a section that can be extracted, and is only
         useful when the value of "ipr" is not "full3667". -->
<!-- TODO: verify which attributes are specified only
            by the RFC editor.  It appears that attributes
            "number", "obsoletes", "updates", and "seriesNo"
            are specified by the RFC editor (and not by
            the document author). -->
<rfc category="std" docName="draft-ietf-sipcore-dns-dual-stack-08"
     ipr="trust200902" updates="3263">
  <front>
    <title abbrev="Locating SIP Servers in IPv4/IPv6">Locating Session
    Initiation Protocol (SIP) Servers in a Dual-Stack IP
    Network</title>

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

    <author fullname="Olle E. Johansson" initials="O. E"
            surname="Johansson">
      <organization>Edvina AB</organization>

      <address>
        <postal>
          <street>Runbov&auml;gen 10</street>

          <city>Sollentuna</city>

          <code>SE-192 48</code>

          <country>SE</country>
        </postal>

        <email>oej@edvina.net</email>
      </address>
    </author>

    <author fullname="Gonzalo Salgueiro" initials="G"
            surname="Salgueiro">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>7200-12 Kit Creek Road</street>

          <city>Research Triangle Park</city>

          <region>NC</region>

          <code>27709</code>

          <country>US</country>
        </postal>

        <email>gsalguei@cisco.com</email>
      </address>
    </author>
    
    <author fullname="Vijay Gurbani" initials="V" surname="Gurbani">
      <organization>Bell Labs, Nokia Networks</organization>

      <address>
        <postal>
          <street>1960 Lucent Lane</street>

          <street>Rm 9C-533</street>

          <city>Naperville</city>

          <region>IL</region>

          <code>60563</code>

          <country>US</country>
        </postal>

        <email>vkg@bell-labs.com</email>
      </address>
    </author>

    <author fullname="Dale R. Worley" initials="D. R" surname="Worley" role="editor">
      <organization abbrev="Ariadne">Ariadne Internet Services</organization>
      <address>
        <postal>
          <street>738 Main St.</street>
          <city>Waltham</city>
          <region>MA</region>
          <code>02451</code>
          <country>US</country>
        </postal>
        <email>worley@ariadne.com</email>
      </address>
    </author>

    <date year="2016" month="August" day="31"/>

    <!-- month="May" is no longer necessary note also, day="30" is optional -->

    <area>Real Time Applications and Infrastructure (RAI)</area>

    <!-- WG name at the upperleft corner of the doc, IETF fine for individual submissions -->

    <workgroup>SIPCORE</workgroup>

    <keyword>I-D</keyword>

    <keyword>Internet-Draft</keyword>

    <abstract>
      <t>RFC 3263 defines how a Session Initiation Protocol (SIP)
      implementation, given a SIP Uniform Resource Identifier (URI),
      should locate the next-hop SIP server using Domain Name System
      (DNS) procedures. As SIP networks increasingly transition from
      IPv4-only to dual-stack, a quality user experience must be
      ensured for dual-stack SIP implementations. This document
      updates the DNS procedures described in RFC 3263 for
      dual-stack SIP implementations in preparation for forthcoming
      specifications for applying Happy Eyeballs principles to SIP.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>The Session Initiation Protocol (SIP, <xref target="RFC3261"/>)
      and the additional documents that extended it provide
      support for both IPv4 and IPv6.  However, this support does not
      fully extend to the highly hybridized environments that are
      characteristic of the transitional migratory phase from IPv4 to
      IPv6 networks.  During this phase, many server and client 
      implementations run on dual-stack hosts. In such environments, 
      a dual-stack host will likely suffer greater connection delay, and 
      by extension an inferior user experience, than an IPv4-only host. 
      The need to remedy this diminished performance of dual-stack hosts 
      led to the development of the Happy Eyeballs <xref target="RFC6555"/>
      algorithm, which has since been implemented in many
      protocols and applications.</t>
 
      <t>This document updates the DNS lookup procedures of RFC 3263
      <xref target="RFC3263"/> in preparation for the specification of
      the application of Happy Eyeballs to SIP.  Happy Eyeballs will
      provide enhanced
      performance, and consequently user experience, in highly
      hybridized dual-stack SIP networks. The procedures described
      herein are such that a dual-stack client should look up both A
      and AAAA records in DNS and then select the best way to set up a
      network flow. The details of how the latter is done is
      considered out of scope for this document. See the Happy
      Eyeballs algorithm and implementation and design considerations
      in RFC 6555 <xref target="RFC6555"/> for more information about
      issues with setting up dual-stack network flows.</t>

      <t><xref target="clarify_6724"/> of this document clarifies the
      interaction of <xref target="RFC3263"/> with <xref
      target="RFC6157"/> and <xref target="RFC6724"/>.</t>

    </section>

    <section title="Terminology">
      <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 RFC 2119 <xref target="RFC2119"/>.</t>

      <t>RFC 3261 <xref target="RFC3261"/> defines additional terms
      used in this document that are specific to the SIP domain such
      as "proxy", "registrar", "redirect server", "user agent server"
      or "UAS", "user agent client" or "UAC", "back-to-back user
      agent" or "B2BUA", "dialog", "transaction", and "server
      transaction".</t>

      <t>This document uses the term "SIP server" that is defined to
      include the following SIP entities: user agent server,
      registrar, redirect server, a SIP proxy in the role of user
      agent server, and a B2BUA in the role of a user agent
      server.</t>

      <t>While this document focuses on the dual-stack situation
      described in RFC 6555 and other documents, concerning the
      migration from an IPv4-only network to a network supporting both
      IPv4 and IPv6, the techniques described can be used in other
      situations.  Possible situations include when a device has
      multiple interfaces with distinct addressing characteristics and
      when additional IP address families are created in the future.
      This document uses the general term "dual-stack" to include all
      situations where the client has access to multiple communication
      methods that have distinct addressing characteristics.</t>

      <t>The term "address records" means the DNS records which translate
      a domain name into addresses within the address family(ies) that
      the entity supports (as A records provide IPv4 addresses and AAAA
      records provide IPv6 addresses), regardless of whether the address
      family was defined before or after this document was approved.</t>
    </section>

    <section anchor="Updates"
             title="DNS Procedures in a Dual-Stack Network">
      <t>This specification introduces two normative DNS lookup
      procedures. These are designed to improve the performance of
      dual-stack clients in IPv4/IPv6 networks.</t>

      <section anchor="AandAAAA"
               title="Dual-Stack SIP UA DNS Record Lookup Procedure">
        <t>Once the transport protocol has been determined, the
        procedure for discovering an IP address if the TARGET is not a
        numeric IP address but the port is explicitly stated in the
        URI, is detailed in Section 4.2 of RFC 3263 <xref
        target="RFC3263"/>. The piece relevant to this discussion
        is: <list style="empty">
            <t>If the TARGET was not a numeric IP address, but a port
            is present in the URI, the client performs an A or AAAA
            record lookup of the domain name. The result will be a
            list of IP addresses, each of which can be contacted at
            the specific port from the URI and transport protocol
            determined previously.</t>
          </list></t>

        <t>Section 4.2 of RFC 3263 <xref target="RFC3263"/> also goes
        on to describe the procedure for discovering an IP
        address if the TARGET is not a numeric IP address, and no port
        is present in the URI. The piece relevant to to this
        discussion is:</t>

        <t><list style="empty">
            <t>If no SRV records were found, the client performs an A
            or AAAA record lookup of the domain name. The result will
            be a list of IP addresses, each of which can be contacted
            using the transport protocol determined previously, at the
            default port for that transport. Processing then proceeds
            as described above for an explicit port once the A or AAAA
            records have been looked up.</t>
          </list></t>

        <t>Happy Eyeballs <xref target="RFC6555"/> documents that
        looking up the "A or AAAA record" is not an effective practice
        for dual-stack clients and that it can add significant
        connection delay and greatly degrade user experience.
        Therefore, this document makes the following normative
        addendum to the DNS lookup procedures of Section 4.2 of RFC
        3263 <xref target="RFC3263"/> for IPv4/IPv6 hybrid SIP
        networks and recommends it as a best practice for such
        dual-stack networks:</t>

        <t><list style="empty">
            <t>The dual-stack client SHOULD look up address
            records for all address families that it
            supports for the domain name and add the resulting
            addresses to the list of IP addresses to be contacted.
            A client MUST be prepared for the existence of DNS
	    resource records containing
            addresses in families that it does not support; if such
	    records may be returned by the client's DNS queries,
	    such records MUST be ignored as unusable and the supported
            addresses used as specified herein.</t>
          </list></t>
      </section>

      <section anchor="SrvPreference"
               title="Indicating Address Family Preference in DNS SRV Records">
        <t>The Happy Eyeballs algorithm <xref target="RFC6555"/> is
        particularly effective for dual-stack HTTP client applications
        that have significant performance differences between their IPv4 and IPv6
        network paths.  This is because the client can initiate two
	TCP connections to the server, one using IPv4 and one using
	IPv6, and then use the connection which completes first.
	This works properly because the client can test each route by
	initiating a TCP connection, but simply opening a TCP
	connection to an HTTP server does not change the
	server's state; the client will send the HTTP request on only
	one connection.</t>

	<t>Unfortunately, in common SIP situations, it is not possible
	to "race" simultaneous request attempts using two address
	families.  If the SIP requests are transmitted as single UDP
	packets, sending two copies of the request to two different
	addresses risks having two copies of the request propagating
	through the SIP network at the same time.  The difference
	between SIP and HTTP is that in SIP the sender cannot test a route
	in a non-state-changing way.</t>

	<t>(If two copies of the same request arrive at the
	destination client, the client MUST reject the second of them
	with a 482 "Merged Request" response.<xref target="RFC3261"/>
	But this rule is not
	sufficient to prevent user-visible differences in behavior.
	A proxy that is upstream of the second request to arrive at
	the client may (almost immediately!) serially fork the second
	request to further destinations (e.g., the voicemail service
	for the destination client).)</t>

	<t>In this common scenario it is often necessary
        for a dual-stack client to indicate a preference for either
        IPv4 or IPv6. A service may use DNS SRV records to indicate
        such a preference for an address family. This way, a server
        with a high-latency and/or low-capacity IPv4 tunnel may
        indicate a preference for being contacted using IPv6. A server
        that wishes to do this can use the lowest SRV priority to
        publish hostnames that only resolve in IPv6 and the next
        priority with host names that resolve in both address
        families.</t>

	<t>Note that hostnames that have addresses in only one address
	family are discouraged by <xref target="RFC6555"/>.  Such
	special-purpose hostnames SHOULD be used only as described in
	this section, as
	targets of SRV records for an aggregate host name, where the
	aggregate host name ultimately resolves to addresses in all
	families supported by the client.</t>

      </section>
    </section>

    <section title="Clarification of Interaction with RFC 6724" anchor="clarify_6724">
      <t>Section 5 of <xref target="RFC6157"/> specifies that the addresses
      from the address records for a single target DNS name for a server's
      DNS name must be contacted in the order specified by the source and
      destination address selection algorithms defined in <xref
      target="RFC6724"/>.
      The set of addresses provided to a single invocation of the
      destination address selection algorithm MUST be
      the address records for the target DNS name in a single SRV
      record (or, if there are no SRV records, the DNS name in the URI
      or derived via NAPTR) -- the
      destination address selection algorithm MUST NOT reorder
      addresses derived from different SRV records.
      Typically, desination address selection is done by using the
      (relatively new) getaddrinfo() function to
      translate the target DNS name into a list of IPv4 and/or IPv6
      addresses in the order in which they are to be contacted, as that
      function implements <xref target="RFC6724"/>.</t>

      <t>Thus, if SRV lookup on the server's DNS name is successful, the
      major ordering of the complete list of destination addresses is
      determined by the priority and weight fields of the SRV records (as
      specified in <xref target="RFC2782"/>) and the (minor) ordering among
      the destinations derived from the "target" field of a single SRV
      record is determined by <xref target="RFC6724"/>.</t>

      <t>For example, consider a server with DNS name example.com, with TCP
      transport specified.  The relevant SRV records for example.com are:
      <list style="empty"><t>
      _sip._tcp.example.com.  300 IN  SRV  10 1 5060 sip-1.example.com.<vspace blankLines="0"/>
      _sip._tcp.example.com.  300 IN  SRV  20 1 5060 sip-2.example.com.<vspace blankLines="0"/>
      </t></list>
      The processing of <xref target="RFC2782"/> results in this
      ordered list of target domain names:
      <list style="empty"><t>
      sip-1.example.com<vspace blankLines="0"/>
      sip-2.example.com<vspace blankLines="0"/>
      </t></list>
      The address records for sip-1.example.com, as ordered by <xref target="RFC6724"/>, are
      <list style="empty"><t>
      sip-1.example.com.     300  IN  AAAA  2001:0db8:58:c02::face<vspace blankLines="0"/>
      sip-1.example.com.     300  IN  AAAA  2001:0db8:c:a06::2:cafe<vspace blankLines="0"/>
      sip-1.example.com.     300  IN  AAAA  2001:0db8:44:204::d1ce<vspace blankLines="0"/>
      sip-1.example.com.    300  IN  A     192.0.2.45<vspace blankLines="0"/>
      sip-1.example.com.    300  IN  A     203.0.113.109<vspace blankLines="0"/>
      sip-1.example.com.    300  IN  A     198.51.100.24<vspace blankLines="0"/>
      </t></list>
      and the address records for sip-2.example.com, as ordered by <xref target="RFC6724"/>, are:
      <list style="empty"><t>
      sip-2.example.com.     300  IN  AAAA  2001:0db8:58:c02::dead<vspace blankLines="0"/>
      sip-2.example.com.     300  IN  AAAA  2001:0db8:c:a06::2:beef<vspace blankLines="0"/>
      sip-2.example.com.     300  IN  AAAA  2001:0db8:44:204::c0de<vspace blankLines="0"/>
      sip-2.example.com.    300  IN  A     192.0.2.75<vspace blankLines="0"/>
      sip-2.example.com.    300  IN  A     203.0.113.38<vspace blankLines="0"/>
      sip-2.example.com.    300  IN  A     198.51.100.140<vspace blankLines="0"/>
      </t></list>
      Thus, the complete list of destination addresses has this ordering:
      <list style="empty"><t>
      2001:0db8:58:c02::face<vspace blankLines="0"/>
      2001:0db8:c:a06::2:cafe<vspace blankLines="0"/>
      2001:0db8:44:204::d1ce<vspace blankLines="0"/>
      192.0.2.45<vspace blankLines="0"/>
      203.0.113.109<vspace blankLines="0"/>
      198.51.100.24<vspace blankLines="0"/>
      2001:0db8:58:c02::dead<vspace blankLines="0"/>
      2001:0db8:c:a06::2:beef<vspace blankLines="0"/>
      2001:0db8:44:204::c0de<vspace blankLines="0"/>
      192.0.2.75<vspace blankLines="0"/>
      203.0.113.38<vspace blankLines="0"/>
      198.51.100.140<vspace blankLines="0"/>
      </t></list>
      In particular, the destination addresses derived from
      sip-1.example.com and those derived from sip-2.example.com are
      not interleaved; <xref target="RFC6724"/> does not operate on
      the complete list.  This would be true even if the two SRV
      records had the same priority and were (randomly) ordered based
      on their weights, as the address records of two target DNS names
      are never interleaved.
      </t>
    </section> <!-- 6157 clarification -->

    <section anchor="Security" title="Security Considerations">
      <t>This document introduces two new normative procedures to the
      existing DNS procedures used to locate SIP servers.  
      A client may contact additional target addresses for a URI
      beyond those prescribed in <xref target="RFC3263"/>, and/or it may
      contact target addresses in a different order than prescribed in
      <xref target="RFC3263"/>.  Neither of these
      changes introduce any new security considerations because it has
      always been assumed that a client desiring to send to a URI may
      contact any of its targets that are listed in DNS.</t>

      <t>The specific security vulnerabilities, attacks and threat
      models of the various protocols discussed in this document (SIP,
      DNS, SRV records, Happy Eyeballs requirements and algorithm,
      etc.) are well documented in their respective
      specifications.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document does not require any actions by IANA.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgments">
      <t>The authors would like to acknowledge the support and
      contribution of the SIP Forum IPv6 Working Group. This document
      is based on a lot of tests and discussions at SIPit events,
      organized by the SIP Forum.</t>

      <t>This document has benefited from the expertise and review
      feedback of many participants of the IETF DISPATCH and SIPCORE
      WG mailing lists as well as those on the SIP Forum IPv6 Task
      Group mailing list. The authors wish to specifically call out
      the efforts and express their gratitude for the detailed and
      thoughtful comments and corrections of Dan Wing, Brett Tate,
      Rifaat Shekh-Yusef, Carl Klatsky, Mary Barnes,
      Keith Drage, Cullen Jennings, Simon Perreault, Paul Kyzivat,
      Adam Roach, Richard Barnes, Ben Campbell, Stefan Winter,
      Spencer Dawkins, and Suresh Krishnan.
      Adam Roach devised the example in <xref target="clarify_6724"/>.</t>
    </section>

    <section title="Revision History" anchor="revision">
      <t>[Note to RFC Editor:  Please remove this entire section upon
      publication as an RFC.]</t>

      <section title="Changes from draft-ietf-sipcore-dns-dual-stack-07 to draft-ietf-sipcore-dns-dual-stack-08" anchor="changes-07-08">
	<t>Remove the reference to RFC 3484, since that RFC has been
	superseded, and the reference was only the statement that 3484
	had been superseded by RFC 6724.</t>
	<t>Added explanation why "racing" simultaneous copies of a SIP
	requests causes incorrect behavior.  Acknowledged Spencer
	Dawkins for this.</t>
	<t>In <xref target="clarify_6724"/>, made explcit the ordered
	list of target domain names that result from processing the
	SRV records.  Acknowledged Suresh Krishnan for suggesting this.</t>
	<t>Updated the Terminology section to remove the definitions
	of "IPv4-only", etc. (which weren't being used) and add a
	definition of "dual-stack" that includes all multiple-stack
	situations.</t>
      </section>

      <section title="Changes from draft-ietf-sipcore-dns-dual-stack-06 to draft-ietf-sipcore-dns-dual-stack-07" anchor="changes-06-07">
	<t>Update per Ben Campbell's AD evaluation.</t>
	<t>Update Vijay Gurbani's affiliation.</t>
	<t>Update per Stefan Winter's OPS-DIR review.</t>
      </section>

      <section title="Changes from draft-ietf-sipcore-dns-dual-stack-05 to draft-ietf-sipcore-dns-dual-stack-06" anchor="changes-05-06">
	<t>Acknowledged Adam Roach for providing the example in <xref
	target="clarify_6724"/>.</t>
	<t>Correct references to <xref target="RFC6157"/>
	vs. references to <xref target="RFC6724"/>.</t>
      </section>

      <section title="Changes from draft-ietf-sipcore-dns-dual-stack-04 to draft-ietf-sipcore-dns-dual-stack-05" anchor="changes-04-05">
	<t>Simplified the acknowledgments.</t>
	<t>Improve wording and punctuation.</t>
	<t>Rewrote <xref target="clarify_6724"/> based on critiques on
	the Sipcore list.  Included an example by Adam Roach.</t>
	<t>Replaced "RR's" with "records" per suggestion by Jean Mahoney.</t>
      </section>

      <section title="Changes from draft-ietf-sipcore-dns-dual-stack-03 to draft-ietf-sipcore-dns-dual-stack-04" anchor="changes-03-04">
        <t>Changed the "updates" specification to add RFC 3263 and
        remove RFC 6157.</t>
        <t>Added Simon Perreault to the acknowledgments.</t>
	<t>Minor wording changes.</t>
      </section>

      <section title="Changes from draft-ietf-sipcore-dns-dual-stack-02 to draft-ietf-sipcore-dns-dual-stack-03" anchor="changes-02-03">
        <t>Described the relationship to RFC 3263 as "update", since
        the existing wording in 3263 is not what we want.  Arguably,
        the new wording is what was intended in 3263, but the existing
        wording either does not say that or says it in a way that is
        easily misunderstood.</t>
        <t>Described the relationship to RFC 6157 as "clarification",
        since the described interaction between 3263 and 6157 appears
        to be the only reasonable interpretation.</t>
        <t>Revised wording, punctuation, and capitalization in various
        places.</t>
        <t>Clarified that this draft does not document Happy Eyeballs
        for SIP, but is preparatory for it.</t>
        <t>Attempted to use "update" for text that is definitively a
        change to the preexisting text and "clarify" for text that is
        a more clear statement of the (presumed) intention of the
        preexisting text.</t>
        <t>Removed normative words from section 1, the
        introduction.</t>
        <t>Copied definition of "address records" from RFC
        2782 (SRV records) to allow the specifications to expand automatically to
        include any new address families.</t>
        <t>Relocated the text requiring a client to ignore addresses
        that it discovers in address families it does not support from
        section 4.2 (which describes why the situation arises) to
        section 4.1 (which describes how clients look up RRs).</t>
        <t>Clarified the interaction with RFC 6157 (source and
        destination address selection in IPv6) to specify what must
        have been intended:  The major sort of the
        destinations is the ordering determined by priority/weight in
        the SRV records; the addresses derived from a single
        SRV record's target are minorly sorted based on RFC 6157.</t>
        <t>Removed editor's name from the acknowledgments list.</t>
      </section>

    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include="reference.RFC.2782"?>

      <?rfc include='reference.RFC.3263"?>
      
      <?rfc include="reference.RFC.6157" ?>

      <?rfc include="reference.RFC.6724"?>

    </references>

    <references title="Informative References">

      <?rfc include="reference.RFC.3261"?>

      <?rfc include="reference.RFC.6555" ?>

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