<?xml version="1.0" encoding="US-ASCII"?>
<!-- used xml2rfc v2 -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc rfcedstyle="yes"?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" number="7064" consensus="yes" submissionType="IETF"
     ipr="trust200902">
  <front>
    <title abbrev="STUN URI">URI Scheme for the Session Traversal
    Utilities for NAT (STUN) Protocol</title>

    <author fullname="Suhas Nandakumar" initials="S."
            surname="Nandakumar">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 West Tasman Drive</street>

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>snandaku@cisco.com</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>USA</country>
        </postal>

        <email>gsalguei@cisco.com</email>
      </address>
    </author>

    <author fullname="Paul E. Jones" initials="P." surname="Jones">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>7025 Kit Creek Road</street>

          <city>Research Triangle Park</city>

          <region>NC</region>

          <code>27709</code>

          <country>USA</country>
        </postal>

        <email>paulej@packetizer.com</email>
      </address>
    </author>

    <author fullname="Marc Petit-Huguenin" initials="M."
            surname="Petit-Huguenin">
      <organization>Impedance Mismatch</organization>

      <address>
        <email>petithug@acm.org</email>
      </address>
    </author>

    <date month="November" year="2013"/>

    <area>Real Time Applications and Infrastructure</area>

    <workgroup>RTCWEB</workgroup>

    <abstract>
      <t>This document specifies the syntax and
      semantics of the Uniform Resource Identifier (URI) scheme for
      the Session Traversal Utilities for NAT (STUN) protocol.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>This document specifies the syntax and semantics of the
      Uniform Resource Identifier (URI) scheme for the Session
      Traversal Utilities for NAT (STUN) protocol.</t>

      <t>STUN is a protocol that serves as a tool for other protocols
      in dealing with Network Address Translator (NAT) traversal. It
      can be used by an endpoint to determine the IP address and port
      allocated to it by a NAT, to perform connectivity checks between
      two endpoints, and as a keepalive protocol to maintain NAT
      bindings. RFC 5389 <xref target="RFC5389"/> defines the
      specifics of the STUN protocol.</t>

      <t>The "stun" and "stuns" URI schemes are used to designate a
      stand-alone STUN server or any Internet host performing the
      operations of a STUN server in the context of STUN usages
      (Section 14 of RFC 5389 <xref target="RFC5389"/>). With the advent
      of standards such as WebRTC <xref target="WEBRTC"/>, we
      anticipate a plethora of endpoints and web applications to be
      able to identify and communicate with such a STUN server to
      carry out the STUN protocol. This implies that endpoints and/or
applications must be provisioned with the appropriate configuration to identify
the TURN server. Having an
      inconsistent syntax has its drawbacks and can result in
      non-interoperable solutions. 
Having an inconsistent syntax adds ambiguity and can result in
non-interoperable solutions and implementation limitations.  The "stun" and
"stuns" URI schemes help alleviate most of these issues by providing a
consistent way to describe, configure, and exchange the information identifying
a STUN server.
</t>
    </section>

    <section title="Terminology">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", 
      "MAY", and "OPTIONAL" in this document are to be interpreted as
      described in <xref target="RFC2119"/> when they appear in ALL
      CAPS. When these words are not in ALL CAPS (such as "should" or
      "Should"), they have their usual English meanings and are not to
      be interpreted as RFC 2119 key words.</t>
    </section>

    <section anchor="syntax"
             title="Definition of the &quot;stun&quot; or &quot;stuns&quot; URI">
      <section anchor="URI_Scheme_Syntax" title="URI Scheme Syntax">
        <t>"stun" and "stuns" URIs have the following formal ABNF syntax <xref
        target="RFC5234"/>:

<!-- [rfced] Please confirm that this update is correct:

Original:
   A STUN/STUNS URI has the following formal ABNF syntax [RFC5234]:

Edited:
   "stun" and "stuns" URIs have the following formal ABNF syntax
   [RFC5234]:
-->

</t>

        <figure>
          <artwork type="abnf"><![CDATA[
stunURI       = scheme ":" host [ ":" port ]
scheme        = "stun" / "stuns"

]]></artwork>
        </figure>

        <t>&lt;host&gt; and &lt;port&gt; are specified in [RFC3986].
        While these two ABNF productions are defined in [RFC3986] as
        components of the generic hierarchical URI, this does not
        imply that the "stun" and "stuns" URI schemes are hierarchical
        URIs. Developers MUST NOT use a generic hierarchical URI
        parser to parse a "stun" or "stuns" URI.</t>
      </section>

      <section anchor="URI_Scheme_Semantics"
               title="URI Scheme Semantics">
        <t>The "stun" and "stuns" URI schemes are used to designate a
        stand-alone STUN server or any Internet host performing the
        operations of a STUN server in the context of STUN usages
        (Section 14 of RFC 5389 <xref target="RFC5389"/>). The STUN
        protocol supports sending messages over UDP, TCP, or
        TLS-over-TCP. The "stuns" URI scheme MUST be used when STUN is
        run over TLS-over-TCP (or in the future DTLS-over-UDP), and the
        "stun" scheme MUST be used otherwise.</t>

        <t>The required &lt;host&gt; part of the "stun" URI denotes
        the STUN server host.</t>

        <t>For the optional DNS discovery procedure mentioned in
        Section 9 of RFC 5389, the "stun" URI scheme implies UDP as the
        transport protocol for SRV lookup, and the "stuns" URI scheme
        indicates TCP as the transport protocol.</t>

        <t>As specified in <xref target="RFC5389"/>, the &lt;port&gt;
        part, if present, denotes the port on which the STUN server is
        awaiting connection requests. If it is absent, the default
        port is 3478 for both UDP and TCP. The default port for STUN
        over TLS is 5349 as per Section 9 of <xref
        target="RFC5389"/>.</t>
      </section>
    </section>
<!--
      <section anchor="section.impl-status.libjingle"
               title="libjingle">
        <t><list style="hanging" hangIndent="3">
            <t hangText="Organization: "><vspace />
            Google, Inc.</t>

            <t hangText="Name: "><vspace />
            libjingle revision 4831;
            https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/source/talk/app/webrtc/peerconnection.cc</t>

            <t hangText="Description: "><vspace />
            Libjingle is a set of
            components provided by Google to implement Jingle
            protocols XEP-0166
            (http://xmpp.org/extensions/xep-0166.html) and XEP-0167
            (http://xmpp.org/extensions/xep-0167.html).</t>

            <t hangText="Level of maturity: "><vspace />
	    Beta</t>

            <t hangText="Coverage: "><vspace />
	    Implements
            draft-nandakumar-rtcweb-stun-uri-07 without IPv6. The stun
            and stuns schemes are parsed, and TLS is used when the
            secure bit is set.</t>

            <t hangText="Licensing: "><vspace />
	    BSD 3-clause license</t>

            <t
            hangText="Contact: "><vspace />
	    https://code.google.com/p/chromium/</t>

            <t
            hangText="URL: "><vspace />
	    https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/source/talk/app/webrtc/peerconnection.cc</t>
          </list></t>
      </section>

      <section anchor="section.impl-status.firefox" title="Firefox">
        <t><list style="hanging" hangIndent="3">
            <t hangText="Organization: "><vspace />
	    Mozilla</t>

            <t hangText="Name: "><vspace />
	    Firefox Aurora 21; http://hg.mozilla.org/mozilla-central/rev/6b5016ab9ebb</t>

            <t hangText="Description: "><vspace />
	    Mozilla Firefox is a free and open source web browser.</t>

            <t hangText="Level of maturity: "><vspace />
	    Beta</t>

            <t hangText="Coverage: "><vspace />
            Implements draft-nandakumar-rtcweb-stun-uri-03. The Mozilla code
            parses the "turn" and "turns" schemes but does not seem to
            use TLS.</t>

            <t hangText="Licensing: "><vspace />
	    Mozilla Public License, Version 2.0</t>

            <t
            hangText="Contact: "><vspace />
	    http://www.mozilla.org/en-US/firefox/channel/</t>

            <t
            hangText="URL: "><vspace />
	    http://hg.mozilla.org/mozilla-central/file/4ff1e574e509/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp</t>
          </list></t>
    </section>
-->
    <section anchor="security" title="Security Considerations">
      <t>The "stun" and "stuns" URI schemes do not introduce any
      specific security issues beyond the security considerations
      discussed in <xref target="RFC3986"/>. These URI schemes are
      intended for use in specific environments that involve NAT
      traversal. Users of the scheme need to carefully consider the
      security properties of the context in which they are using
      them.</t>

      <t>Although a "stun" or "stuns" URI does not itself include the
      username or password that will be used to authenticate the STUN
      client, in certain environments, such as WebRTC, the username
      and password will almost certainly be provisioned remotely by an
      external agent at the same time as a "stuns" URI is sent to that
      client. Thus, in such situations, if the username and password
      were received in the clear, there would be little or no benefit to
      using a "stuns" URI. For this reason, a STUN client MUST ensure
      that the username, password, "stuns" URI, and any other
      security-relevant parameters are received with equivalent
      security before using the "stuns" URI. Receiving those parameters
      over another TLS session can provide the appropriate level of
      security if both TLS sessions are similarly parameterized, e.g.,
      with commensurate strength ciphersuites.</t>
    </section>

    <section title="IANA Considerations">
      <t>This section contains the registration information for the
      "stun" and "stuns" URI schemes (in accordance with <xref
      target="RFC4395"/>). Note that these URI schemes are intended
      for use in very specific NAT traversal environments and should
      not be used otherwise on the open Web or Internet.</t>

      <section title="&quot;stun&quot; URI Registration">
        <t>URI scheme name: stun</t>

        <t>Status: permanent</t>

        <t>URI scheme syntax: See <xref
        target="URI_Scheme_Syntax"/></t>

        <t>URI scheme semantics: See <xref
        target="URI_Scheme_Semantics"/></t>

        <t>Encoding considerations: There are no encoding
        considerations beyond those in <xref target="RFC3986"/>.</t>

        <t>Applications/protocols that use this URI scheme name:<list>
            <t>The "stun" URI scheme is intended to be used by
            applications with a need to identify a STUN server to be
            used for NAT traversal.</t>
          </list></t>

        <t>Interoperability considerations: N/A</t>

        <t>Security considerations: See <xref target="security"/></t>

        <t>Contact: Suhas Nandakumar &lt;snandaku@cisco.com&gt;</t>

        <t>Author/Change controller: The IESG</t>

        <t>References: RFC 7064</t>

      </section>

      <section title="&quot;stuns&quot; URI Registration">
        <t>URI scheme name: stuns</t>

        <t>Status: permanent</t>

        <t>URI scheme syntax: See <xref
        target="URI_Scheme_Syntax"/></t>

        <t>URI scheme semantics: See <xref
        target="URI_Scheme_Semantics"/></t>

        <t>Encoding considerations: There are no encoding
        considerations beyond those in <xref target="RFC3986"/>.</t>

        <t>Applications/protocols that use this URI scheme name:</t>

        <t><list>

            <t>The "stuns" URI scheme is intended to be used by
            applications with a need to identify a STUN server to be
            used for NAT traversal over a secure connection.</t>
          </list></t>

        <t>Interoperability considerations: N/A</t>

        <t>Security considerations: See <xref target="security"/></t>

        <t>Contact: Suhas Nandakumar &lt;snandaku@cisco.com&gt;</t>

        <t>Author/Change controller: The IESG</t>

        <t>References: RFC 7064</t>

      </section>
    </section>

    <section title="Acknowledgements">
      <t>The authors would like to extend a very special thanks to
      Cullen Jennings for bringing to our attention to WebRTC's need for 
      this document, as well as his detailed review and thoughtful
      comments on this document.</t>

      <t>This document has benefited from extensive discussion and
      review of many of the members of the RTCWEB and BEHAVE working
      groups. The authors would also like to acknowledge Ted Hardie,
      Bjoern Hoehrmann, Russ Housley, Subramanian Moonesamy, Hadriel
      Kaplan, Graham Klyne, Peter Saint-Andre, Ted Lemon, Barry Leiba,
      Pete Resnick, Spencer Dawkins, Stephen Farrell, and Harald
      Alvestrand for their invaluable input, reviews, feedback
      comments, and suggestions that helped to improve this
      document.</t>

      <t>The authors would also like to express their gratitude to Dan
      Wing for his assistance in shepherding this document. We also
      want to thank Gonzalo Camarillo, the Real-time Applications and
      Infrastructure Area Director, for sponsoring this document as well as
his careful reviews.</t> 

    </section>
  </middle>

  <back>
    <references title="Normative References">

     <?rfc include="reference.RFC.2119" ?>
     <?rfc include="reference.RFC.3986" ?>
     <?rfc include="reference.RFC.5234" ?>

    </references>

    <references title="Informative References">

     <?rfc include="reference.RFC.2629" ?>
     <?rfc include="reference.RFC.4395" ?>
     <?rfc include="reference.RFC.5389" ?>

      <reference anchor="WEBRTC"
                 target="http://www.w3.org/TR/2012/WD-webrtc-20120821">
        <front>
          <title>WebRTC 1.0: Real-time Communication Between
          Browsers</title>

          <author fullname="Adam Bergkvist" initials="A."
                  surname="Bergkvist">
            <organization/>
          </author>

          <author fullname="Daniel C. Burnett" initials="D."
                  surname="Burnett">
            <organization/>
          </author>

          <author fullname="Cullen Jennings" initials="C."
                  surname="Jennings">
            <organization/>
          </author>

          <author fullname="Anant Narayanan" initials="A."
                  surname="Narayanan">
            <organization/>
          </author>

          <date day="21" month="August" year="2012"/>
        </front>

        <seriesInfo name="World Wide Web Consortium WD"
                    value="WD-webrtc-20120821"/>

        <format target="http://www.w3.org/TR/2012/WD-webrtc-20120821"
                type="HTML"/>
      </reference>

    </references>

    <section title="Examples">
      <t><xref target="examples1"/> shows examples for the "stun" and "stuns" URI
      schemes. For all these examples, the &lt;host&gt; component is
      populated with "example.org".</t>

      <texttable anchor="examples1">
        <ttcol>URI</ttcol>

        <c>stun:example.org</c>

        <c>stuns:example.org</c>

        <c>stun:example.org:8000</c>
      </texttable>
    </section>

    <section title="Design Notes">
      <t><list style="symbols">
          <t>One recurring comment was to stop using the suffix "s" on
          the URI scheme and to move the secure option to a parameter
          (e.g., ";proto=tls"). We decided against this idea because
          the need for ";proto=" for the STUN URI cannot be
          sufficiently explained, and supporting it would render an
          incomplete specification. This would also result in lost
          symmetry between the TURN and STUN URIs.</t>

          <t>Following the advice of Section 2.2 of <xref
          target="RFC4395"/>, and because the STUN URI does not
          describe a hierarchical structure, the STUN URIs are
          opaque.</t>
        </list></t>
    </section>
  </back>
</rfc>
