<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no"?>
<?rfc sortrefs="no"?>
<?rfc tocdepth="4"?>

<rfc number="7904" category="std" submissionType="IETF" consensus="yes" ipr="pre5378Trust200902">
  <front>
    <title abbrev="RELOAD SIP Usage">A SIP Usage for REsource LOcation And
    Discovery (RELOAD)</title>

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

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

          <street>MS: SJC-21/2</street>

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>United States of America</country>
        </postal>

        <phone>+1 408 421-9990</phone>

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

    <author fullname="Bruce B. Lowekamp" initials="B. B." surname="Lowekamp">
      <organization>Skype</organization>

      <address>
        <postal>
          <street></street>

          <city>Palo Alto</city>

          <region>CA</region>

          <country>United States of America</country>
        </postal>

        <email>bbl@lowekamp.net</email>
      </address>
    </author>

    <author fullname="Eric Rescorla" initials="E.K." surname="Rescorla">
      <organization>RTFM, Inc.</organization>

      <address>
        <postal>
          <street>2064 Edgewood Drive</street>

          <city>Palo Alto</city>

          <region>CA</region>

          <code>94303</code>

          <country>United States of America</country>
        </postal>

        <phone>+1 650 678 2350</phone>

        <email>ekr@rtfm.com</email>
      </address>
    </author>

    <author fullname="Salman A. Baset" initials="S.A." surname="Baset">
      <organization abbrev="IBM">IBM T. J. Watson Research Center</organization>

      <address>
        <postal>
          <street>1101 Kitchawan Road</street>

          <city>Yorktown Heights</city>

          <region>NY</region>
<code>10598</code>
          <country>United States of America</country>
        </postal>

        <email>sabaset@us.ibm.com</email>
      </address>
    </author>

    <author fullname="Henning Schulzrinne" initials="H.G."
            surname="Schulzrinne">
      <organization>Columbia University</organization>

      <address>
        <postal>
          <street>1214 Amsterdam Avenue</street>

          <city>New York</city>

          <region>NY</region>
<code>10027</code>
          <country>United States of America</country>
        </postal>

        <email>hgs@cs.columbia.edu</email>
      </address>
    </author>

    <author fullname="Thomas C. Schmidt" initials="T C." role="editor"
            surname="Schmidt">
      <organization>HAW Hamburg</organization>

      <address>
        <postal>
          <street>Berliner Tor 7</street>

          <city>Hamburg</city>

          <code>20099</code>

          <country>Germany</country>
        </postal>

        <email>t.schmidt@haw-hamburg.de</email>
      </address>
    </author>

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

    <area>RAI</area>

    <workgroup>P2PSIP</workgroup>

<keyword>p2psip</keyword>
<keyword>p2p</keyword>
<keyword>sip</keyword>
<keyword>reload</keyword>
<keyword>peer-to-peer</keyword>
<keyword>session initiation</keyword>
<keyword>distributed session management</keyword>
<keyword>overlay network</keyword>
<keyword>SIP registrar</keyword>

    <abstract>
      <t>This document defines a SIP Usage for REsource LOcation And Discovery
      (RELOAD). The SIP Usage provides the functionality of a SIP proxy or
      registrar in a fully distributed system and includes a lookup service
      for Address of Records (AORs) stored in the overlay. It also defines
      Globally Routable User Agent URIs (GRUUs) that allow the registrations
      to map an AOR to a specific node reachable through the overlay. After
      such initial contact of a Peer, the RELOAD AppAttach method is used to
      establish a direct connection between nodes through which SIP messages
      are exchanged.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>REsource LOcation And Discovery (RELOAD) <xref
      target="RFC6940"></xref> specifies a peer-to-peer (P2P) signaling
      protocol for general use on the Internet. This document defines a
      SIP Usage of RELOAD that allows SIP <xref target="RFC3261"></xref> user
      agents (UAs) to establish peer-to-peer SIP (or SIPS) sessions without
      the requirement for a permanent proxy or registration servers, e.g., a
      fully distributed telephony service. This service transparently supports
      SIP addressing including telephone numbers. In such a network, the
      RELOAD overlay itself performs the registration and rendezvous functions
      ordinarily associated with such servers.</t>

      <t>The SIP Usage involves two basic functions:</t>

      <t><list style="hanging">
          <t hangText="Registration:">SIP UAs can use the RELOAD data storage
          functionality to store a mapping from their Address of Record (AOR)
          to their Node-ID in the overlay and to retrieve the Node-ID of
          other UAs.</t>

          <t hangText="Rendezvous:">Once a SIP UA has identified the Node-ID
          for an AOR it wishes to call, it can use the RELOAD message routing
          system to set up a direct connection for exchanging SIP
          messages.</t>
        </list></t>

      <t>Mappings are stored in the SipRegistration Resource Record defined in
      this document. All operations required to perform a SIP registration or
      rendezvous are standard RELOAD protocol methods.</t>

      <t>For example, Bob registers his AOR, "bob@dht.example.com", for his
      Node-ID "1234". When Alice wants to call Bob, she queries the overlay
      for "bob@dht.example.com" and receives Node-ID "1234" in return. She
      then uses the overlay routing to establish a direct connection with Bob
      and can directly transmit a standard SIP INVITE. In detail, this works
      along the following steps:</t>

      <t><list style="numbers">
          <t>Bob, operating Node-ID "1234", stores a mapping from his AOR to
          his Node-ID in the overlay by applying a Store request for
          "bob@dht.example.com -&gt; 1234".</t>

          <t>Alice, operating Node-ID "5678", decides to call Bob. She
          retrieves Node-ID "1234" by performing a Fetch request on
          "bob@dht.example.com".</t>

          <t>Alice uses the overlay to route an AppAttach message to Bob's
          Peer (ID "1234"). Bob responds with his own AppAttach and they set
          up a direct connection, as shown in <xref
          target="fig-connection"></xref>. Note that mutual Interactive
          Connectivity Establishment (ICE) checks are invoked automatically
          from the AppAttach message exchange.</t>
        </list></t>

      <figure align="center" anchor="fig-connection"
              title="Connection Setup in P2P SIP Using the RELOAD Overlay">
        <artwork><![CDATA[
                     Overlay
Alice       Peer1     ...          PeerN      Bob
(5678)                                     (1234)
-------------------------------------------------
AppAttach ->
            AppAttach ->
                      AppAttach -> 
                                  AppAttach ->
                                     <- AppAttach
                            <- AppAttach
                 <- AppAttach
     <- AppAttach

<------------------ ICE Checks ----------------->
INVITE ----------------------------------------->
<--------------------------------------------- OK
ACK -------------------------------------------->
<------------ ICE Checks for media ------------->
<-------------------- RTP ---------------------->
    ]]></artwork>
      </figure>

      <t></t>

      <t>It is important to note that the only role of RELOAD in this example is to set
      up the direct SIP connection between Alice and Bob. As soon as the ICE
      checks complete and the connection is established, ordinary SIP or SIPS
      is used. In particular, the establishment of the media channel for a
      phone call happens via the usual SIP mechanisms, and RELOAD is not
      involved. Media never traverses the overlay. After the successful
      exchange of SIP messages, communicating Peers run ICE connectivity checks for
      media.</t>

      <t>In addition to mappings from AORs to Node-IDs, the SIP Usage also
      allows mappings from AORs to other AORs. This enables an indirection
      useful for call forwarding. For instance, if Bob wants his phone calls
      temporarily forwarded to Charlie, he can store the mapping
      "bob@dht.example.com -&gt; charlie@dht.example.com". When Alice wants to
      call Bob, she retrieves this mapping and can then fetch Charlie's AOR to
      retrieve his Node-ID. These mechanisms are described in <xref
      target="sec-registration"></xref>.</t>

      <t>Alternatively, Globally Routable User Agent URIs (GRUUs) <xref
      target="RFC5627"></xref> can be used for directly accessing Peers. They
      are handled via a separate mechanism, as described in <xref
      target="sec-gruus"></xref>.</t>

<t>Concepts used in this document can be extended to include tel URIs
       <xref target="RFC3966"/>, but this will require further specifications to ensure
       semantic interoperability of implementations.</t>

      <t>The SIP Usage for RELOAD addresses a fully distributed deployment of
      session-based services among overlay Peers. 

This RELOAD Usage may be
  relevant in a variety of environments, including a tightly controlled
  environment of a single provider that admits parties using AORs
  with domains from controlled namespace(s) only, or an open, multi-party
      infrastructure that liberally allows a registration and rendezvous for
      various or any domain namespace. It is noteworthy in this context that --
      in contrast to regular SIP -- domain names play no role in routing to a
      proxy server. Once connectivity to an overlay is given, 
the technology allows any name registration, possibly constrained by
overlay domain restrictions.
      </t>

    </section>

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


      <t>We use the terminology and definitions from <xref
      target="RFC7890">"Concepts and Terminology for Peer-to-Peer SIP (P2PSIP)"</xref> and the <xref target="RFC6940">RELOAD Base
      Protocol</xref> extensively in this document.</t>

      <t>In addition, terms defined by SIP <xref target="RFC3261"></xref>
      apply to this memo. The term AOR is the SIP "Address of Record" used to
      identify a user in SIP. For example, "alice@example.com" could be the AOR
      for Alice. For the purposes of this specification, an AOR is considered
      not to include the scheme (e.g., sip:), as the AOR needs to match the
      rfc822Name in the X.509 v3 certificates <xref target="RFC5280"></xref>. It
      is worth noting that SIP and SIPS are distinguished in P2PSIP by the
      Application-ID.</t>
    </section>

    <section anchor="sec-registration" title="Registering AORs in the Overlay">
      <section title="Overview">
        <t>In ordinary SIP, a UA registers the user's AOR and its network
        location with a registrar. In RELOAD, this registrar function is
        provided by the overlay as a whole. To register its location, a RELOAD
        peer stores a SipRegistration Resource Record under its own AOR using
        the SIP-REGISTRATION Kind, which is formally defined in <xref
        target="sec.sip-reg-kind"></xref>. Note that the registration lifetime
        known from the regular SIP REGISTER method is inherited from the
        lifetime attribute of the basic RELOAD StoredData structure (see
        Section 7 in <xref target="RFC6940"></xref>).</t>

        <t>A RELOAD overlay MAY restrict the storage of AORs. Namespaces
        (i.e., the right-hand side of the AOR) that are supported for
        registration and lookup can be configured for each RELOAD deployment
        as described in <xref target="sec-ocde"></xref>.</t>

        <t>As a simple example, consider Alice with an AOR
        "alice@dht.example.org" at Node-ID "1234". She might store the mapping
        "alice@dht.example.org -&gt; 1234" telling anyone who wants to call
        her to contact node "1234".</t>

        <t>RELOAD peers can store two kinds of SIP mappings,</t>

        <t><list style="symbols">
            <t>from an AOR to a destination list (a single Node-ID is just a
            trivial destination list), or</t>

            <t>from one AOR to another.</t>
          </list></t>

        <t>The meaning of the first kind of mapping is "in order to contact
        me, form a connection with this Peer." The meaning of the second kind
        of mapping is "in order to contact me, dereference this AOR". The
        latter allows for forwarding. For instance, if Alice wants her calls
        to be forwarded to her secretary, Sam, she might insert the following
        mapping, "alice@dht.example.org -&gt; sam@dht.example.org".</t>

        <t></t>
      </section>

      <section anchor="sec-datastructure" title="Data Structure">
        <t>This section defines the SipRegistration Resource Record as
        follows:</t>
        <figure>
          <artwork><![CDATA[
       enum { 
           sip_registration_uri(1),
           sip_registration_route(2), 
           (255)
       } SipRegistrationType;
      
       select (SipRegistration.type) {
         case sip_registration_uri:
           opaque               uri<0..2^16-1>;

         case sip_registration_route:
           opaque               contact_prefs<0..2^16-1>;
           Destination          destination_list<3..2^16-1>;

         /* This type can be extended */

       } SipRegistrationData;

       struct {
          SipRegistrationType   type;
          uint16                length;
          SipRegistrationData   data;          
      } SipRegistration;
                ]]></artwork>
        </figure>
        <t>The contents of the SipRegistration Resource Record are:</t>
        <t><list style="hanging">
                        <t hangText="type "></t>
            <t>the type of the registration</t>
                        <t hangText="length "></t>
            <t>the length of the rest of the PDU</t>
                        <t hangText="data "></t>
            <t>the registration data</t>
          </list></t>

        <t><list style="symbols">
            <t>If the registration is of type "sip_registration_uri", then the
            contents are an opaque string containing the AOR.</t>

            <t>If the registration is of type "sip_registration_route", then
            the contents are an opaque string containing the registrant's
            contact preferences and a destination list for the Peer.</t>
          </list></t>

        <t>The callee expresses its capabilities within the contact
        preferences as specified in <xref target="RFC3840"></xref>. It encodes
        a media feature set comprised of its capabilities as a contact
        predicate, i.e., a string of feature parameters that appear as part of
        the Contact header field. Feature parameters are derived from the
        media feature set syntax of <xref target="RFC2533"></xref> (see also
        <xref target="RFC2738"></xref>) as described in <xref
        target="RFC3840"></xref>.</t>

        <t>This encoding covers all SIP User Agent capabilities, as defined in
        <xref target="RFC3840"></xref> and registered in the SIP feature tag
        registration tree. In particular, a callee can indicate that it
        prefers contact via a particular SIP scheme -- SIP or SIPS -- by using
        one of the following contact_prefs attributes:</t>

        <figure>
          <artwork><![CDATA[      (sip.schemes=SIP)
      (sip.schemes=SIPS)]]></artwork>
        </figure>

        <t></t>

        <t>RELOAD explicitly supports multiple registrations for a single AOR.
        The registrations are stored in a dictionary with Node-IDs as the
        dictionary keys. Consider, for instance, the case where Alice has two
        Peers:</t>

        <t><list style="symbols">
            <t>her desk phone (1234)</t>

            <t>her cell phone (5678)</t>
          </list></t>

        <t>Alice might store the following in the overlay at resource
        "alice@dht.example.com":</t>

        <t><list style="symbols">
            <t>a SipRegistration of type "sip_registration_route" with 
            dictionary key "1234" and value "1234", both referring to Node-IDs</t>

            <t>a SipRegistration of type "sip_registration_route" with 
            dictionary key "5678" and value "5678"</t>
          </list></t>

        <t>Note that this structure explicitly allows one Node-ID to forward
        to another Node-ID. For instance, Alice could set calls to her desk
        phone to ring at her cell phone by storing a SipRegistration of type
        "sip_registration_route" with a dictionary key "1234" and a value
        "5678".</t>
      </section>

      <section anchor="sec-accesscontrol" title="Access Control">
        <t>In order to prevent hijacking or other misuse, registrations are
        subject to access control rules. Two kinds of restrictions apply:</t>

        <t><list style="symbols">
            <t>A Store is permitted only for AORs with domain names that fall
            into the namespaces supported by the RELOAD Overlay Instance.</t>

            <t>Storing requests are performed according to the USER-NODE-MATCH
            access control policy of RELOAD.</t>
          </list></t>

        <t>Before issuing a Store request to the overlay, any Peer SHOULD
        verify that the AOR of the request is a valid Resource Name with
        respect to its domain name and the namespaces defined in the overlay
        configuration document (see <xref target="sec-ocde"></xref>).</t>

        <t>Before a Store is permitted, the Storing Peer MUST check that:</t>

        <t><list style="symbols">
            <t>The AOR of the request is a valid Resource Name with respect to
            the namespaces defined in the overlay configuration document.</t>

            <t>The certificate contains a username that is a SIP AOR that hashes to the Resource-ID it is being stored at.</t>

            <t>The certificate contains a Node-ID that is the same as the
            dictionary key it is being stored at.</t>
          </list></t>

        <t>If any of these checks fail, the request MUST be rejected with an
        Error_Forbidden error.</t>

        <t>Note that these rules permit Alice to forward calls to Bob without
        his permission. However, they do not permit Alice to forward Bob's
        calls to her. See <xref
        target="sec-security-malicious-retargeting"></xref> for additional
        details.</t>
      </section>

      <section anchor="sec-ocde"
               title="Overlay Configuration Document Extension">
        <t>The use of a SIP-enabled overlay MAY be restricted to users with
        AORs from specific domains. 

When deploying an overlay service, providers
  can implement such restrictions by defining a set of
  namespaces for admissible domain names.

 This section extends the
        overlay configuration document by defining new elements for patterns
        that describe a corresponding domain name syntax.</t>

        <t>A RELOAD overlay can be configured to accept store requests for any
        AOR, or to apply domain name restrictions. To apply restrictions, the
        overlay configuration document needs to contain a
        &lt;domain-restrictions&gt; element. The &lt;domain-restrictions&gt;
        element serves as a container for zero to multiple &lt;pattern&gt;
        sub-elements. A &lt;pattern&gt; element MAY be present if the "enable"
        attribute of its parent element is set to true. Each &lt;pattern&gt;
        element defines a pattern for constructing admissible resource names.
        It is of type xsd:string and interpreted as a regular expression
        according to "POSIX Extended Regular Expression" (see the
        specifications in <xref target="IEEE-Posix"></xref>). Encoding of the
        domain name adheres to the restricted ASCII character set without
        character escaping as defined in Section 19.1 of <xref
        target="RFC3261"></xref>.</t>

        <t>Inclusion of a &lt;domain-restrictions&gt; element in an overlay
        configuration document is OPTIONAL. If the element is not included,
        the default behavior is to accept any AOR. If the element is included
        and the &ldquo;enable&rdquo; attribute is not set or set to false, the
        overlay MUST only accept AORs that match the domain name of the
        overlay. If the element is included and the &ldquo;enable&rdquo;
        attribute is set to true, the overlay MUST only accept AORs that match
        patterns specified in the &lt;domain-restrictions&gt; element.</t>

        <figure align="center" suppress-title="true">
          <artwork align="left" xml:space="preserve"><![CDATA[ 
Example of Domain Patterns:
dht\.example\.com
.*\.my\.example
        ]]></artwork>
        </figure>

        <t>In this example, any AOR will be accepted that is either of the
        form &lt;user&gt;@dht.example.com, or ends with the domain
        "my.example".</t>

        <t>The Relax NG grammar for the AOR Domain Restriction reads:</t>

        <figure align="left" anchor="fig-le" suppress-title="true">
          <artwork align="left" xml:space="preserve"><![CDATA[
# AOR DOMAIN RESTRICTION URN SUB-NAMESPACE 

namespace sip = "urn:ietf:params:xml:ns:p2p:config-base:sip"

# AOR DOMAIN RESTRICTION ELEMENT 

Kind-parameter &= element sip:domain-restriction {

    attribute enable { xsd:boolean }

    # PATTERN ELEMENT 

    element sip:pattern { xsd:string }*
}?
          ]]></artwork>
        </figure>
      </section>
    </section>

    <section anchor="sec-lookup" title="Looking up an AOR">
      <section anchor="sec-routing" title="Finding a Route to an AOR">
        <t>A RELOAD user, member of an overlay, who wishes to call another
        user with a given AOR SHALL proceed in the following way:</t>

        <t><list style="hanging">
            <t hangText="AOR is a GRUU?">If the AOR is a GRUU for this overlay,
            the callee can be contacted directly as described in <xref
            target="sec-gruus"></xref>.</t>

            <t hangText="AOR domain is hosted in overlay?">If the domain part
            of the AOR matches a domain pattern configured in the overlay, the
            user can continue to resolve the AOR in this overlay. The user MAY
            choose to query the DNS service records to search for additional
            support of this domain name.</t>

            <t hangText="AOR domain not supported by overlay?">If the domain
            part of the AOR is not supported in the current overlay, the user
            might query the DNS (or other discovery services at hand) to
            search for an alternative overlay that services the AOR under
            request. Alternatively, standard SIP procedures for contacting the
            callee might be used.</t>

            <t hangText="AOR inaccessible?">If all of the above contact
            attempts fail, the call fails.</t>
          </list></t>

        <t>The procedures described above likewise apply when nodes are
        simultaneously connected to several overlays.</t>
      </section>

      <section anchor="sec-resolving" title="Resolving an AOR">
        <t>A RELOAD user that has discovered a route to an AOR in the current
        overlay SHALL execute the following steps:</t>

        <t><list style="numbers">
            <t>Perform a Fetch for Kind SIP-REGISTRATION at the Resource-ID
            corresponding to the AOR. This Fetch SHOULD NOT indicate any
            dictionary keys, so that it will fetch all the stored values.</t>

            <t>If any of the results of the Fetch are non-GRUU AORs, then
            repeat step 1 for that AOR.</t>

            <t>Once only GRUUs and destination lists remain, the Peer removes
            duplicate destination lists and GRUUs from the list and initiates
            SIP or SIPS connections to the appropriate Peers as described in
            the following sections. If there are also external AORs, the Peer
            follows the appropriate procedure for contacting them as well.</t>
          </list></t>
      </section>
    </section>

    <section anchor="sec-connecting" title="Forming a Direct Connection">
      <section anchor="sec-setup" title="Setting Up a Connection">
        <t>Once the Peer has translated the AOR into a set of destination
        lists, it then uses the overlay to route AppAttach messages to each of
        those Peers. The "application" field MUST be either 5060 to indicate
        SIP or 5061 to indicate SIPS. If certificate-based authentication is in
        use, the responding Peer MUST present a certificate with a Node-ID
        matching the terminal entry in the destination list. Otherwise, the
        connection MUST NOT be used and MUST be closed. Note that it is
        possible that the Peers already have a RELOAD connection mutually
        established. This MUST NOT be used for SIP messages unless it is a SIP
        connection. A previously established SIP connection MAY be used for a
        new call.</t>

        <t>Once the AppAttach succeeds, the Peer sends plain or (D)TLS-encrypted SIP messages over the connection as in normal SIP. A caller
        MAY choose to contact the callee using SIP or SIPS, but SHOULD follow
        a preference indicated by the callee in its contact_prefs attribute
        (see <xref target="sec-datastructure"></xref>). A callee MAY choose to
        listen on both SIP and SIPS ports and accept calls from either SIP
        scheme, or select a single one. However, a callee that decides to
        accept SIPS calls only, SHOULD indicate its choice by setting the
        corresponding attribute in its contact_prefs. It is noteworthy that,
        according to <xref target="RFC6940"></xref>, all overlay links are
        built on (D)TLS-secured transport.</t>

        <t>SIP messages carry the SIP URIs of actual overlay endpoints (e.g.,
        "sip:alice@dht.example.com") in the Via and Contact headers, while the
        communication continues via the RELOAD connection. However, a UA can
        redirect its communication path by setting an alternate Contact header
        field like in ordinary SIP.</t>
      </section>

      <section anchor="sec-keepalive" title="Keeping a Connection Alive">
        <t>

In many cases, RELOAD connections established from ICE <xref target="RFC5245"/>
negotiations will traverse stateful NATs and firewalls.  It is the
responsibility of the Peers to send messages with a frequency
sufficient to maintain the necessary state in these NATs and firewalls
and thus keep the connection alive.
 Keepalives are a
        mandatory component of ICE (see Section 10 of <xref
        target="RFC5245"></xref>) and no further operations are required.
        Applications that want to assure maintenance of sessions individually
        need to follow regular SIP means. Accordingly, a SIP Peer MAY apply
        keep-alive techniques in agreement with its transport binding as
        defined in Section 3.5 of <xref target="RFC5626"></xref>.</t>
      </section>
    </section>

    <section anchor="sec-gruus" title="Using GRUUs">
      <t>Globally Routable User Agent URIs (GRUUs) <xref
      target="RFC5627"></xref> have been designed to allow direct routing to a
      specific UA instance without the need for dereferencing by a
      domain-specific SIP proxy function. The concept is transferred to RELOAD
      overlays as follows. GRUUs in RELOAD are constructed by embedding a
      base64-encoded destination list in the "gr" URI parameter of the GRUU.
      The base64 encoding is done with the alphabet specified in Table 1 of
      <xref target="RFC4648"></xref> with the exception that "~" is used in
      place of "=".</t>

      <figure>
        <artwork><![CDATA[Example of a RELOAD GRUU:
alice@example.com;gr=MDEyMzQ1Njc4OTAxMjM0NTY3ODk~
             ]]></artwork>
      </figure>

      <t></t>

      <t>GRUUs do not require storing data in the Overlay Instance. Rather,
      when a Peer needs to route a message to a GRUU in the same P2P overlay,
      it simply uses the destination list and connects to that Peer. Because a
      GRUU contains a destination list, it can have the same contents as a
      destination list stored elsewhere in the resource dictionary.</t>

      <t>Anonymous GRUUs <xref target="RFC5767"></xref> are constructed
      analogously, but require either that the enrollment server issues a
      different Node-ID for each anonymous GRUU required, or that a
      destination list be used that includes a Peer that compresses the
      destination list to stop the Node-ID from being revealed.</t>
    </section>

    <section anchor="sec.sip-reg-kind"
             title="SIP-REGISTRATION Kind Definition">
      <t>This section defines the SIP-REGISTRATION Kind.</t>

      <t><list style="hanging">

          <t hangText="Name:">SIP-REGISTRATION</t>

          <t hangText="Kind IDs:">The Resource Name for the SIP-REGISTRATION
          Kind-ID is the AOR of the user as specified in <xref target="term"/>. The data
          stored is a SipRegistration, which can contain either another URI or
          a destination list to the Peer that is acting for the user.</t>

          <t hangText="Data Model:">The data model for the SIP-REGISTRATION
          Kind-ID is a dictionary. The dictionary key is the Node-ID of the
          Storing Peer. This allows each Peer (presumably corresponding to a
          single device) to store a single route mapping.</t>

          <t hangText="Access Control:">USER-NODE-MATCH. Note that this matches
          the SIP AOR against the rfc822Name in the X.509 v3 certificate. The
          rfc822Name does not include the scheme so that the "sip:" prefix
          needs to be removed from the SIP AOR before matching. Escaped
          characters ('%' encoding) in the SIP AOR also need to be decoded
          prior to matching (see <xref target="RFC3986"></xref>).</t>
        </list></t>

      <t>
Data stored under the SIP-REGISTRATION Kind is of type
  SipRegistration, containing one of two data types:
 <list style="hanging">

          <t hangText="sip_registration_uri "></t>

          <t>A URI that the user can be reached at.</t>

          <t hangText="sip_registration_route "></t>

          <t>A destination list that can be used to reach the user's
          Peer.</t>
        </list></t>

    </section>

    <section title="Security Considerations">
      <section title="RELOAD-Specific Issues">
        <t>This Usage for RELOAD does not define new protocol elements or
        operations. Hence, no new threats arrive from message exchanges in
        RELOAD.</t>

        <t>
This document introduces an AOR domain restriction function that must
  be compared against the registration attempt by the Storing Peer.

 A misconfigured or malicious
        Peer could cause frequent rejects of illegitimate storing requests.
        However, domain name control relies on a lightweight pattern matching
        and can be processed prior to validating certificates. Hence, no extra
        burden is introduced for RELOAD peers beyond loads already present in
        the base protocol.</t>
      </section>

      <section anchor="section.sip-issues" title="SIP-Specific Issues">
        <section title="Fork Explosion">
          <t>Because SIP includes a forking capability (the ability to
          retarget to multiple recipients), fork bombs (i.e., attacks using
          SIP forking to amplify the effect on the intended victims) are a
          potential DoS concern. However, in the SIP Usage of RELOAD, fork
          bombs are a much lower concern than in a conventional SIP Proxy
          infrastructure, because the calling party is involved in each
          retargeting event. It can therefore directly measure the number of
          forks and throttle at some reasonable number.</t>
        </section>

        <section anchor="sec-security-malicious-retargeting"
                 title="Malicious Retargeting">
          <t>
To launch a DoS attack, the owner of a popular AOR could retarget all
calls to the victim.
 This attack is common to
          SIP and is difficult to ameliorate without requiring the target of a
          SIP registration to authorize all stores. The overhead of that
          requirement would be excessive and, in addition, there are good use
          cases for retargeting to a Peer without its explicit
          cooperation.</t>
        </section>

        <section title="Misuse of AORs">
          <t>
A RELOAD overlay and enrollment service that liberally accepts
  registrations for AORs of domain names unrelated to the overlay
  instance and without further authorization could store presence
  state for AORs without the consent of the owner of the AOR.

 An attacker could hijack names,
          register a bogus presence, and attract calls dedicated to a victim
          that resides within or outside the Overlay Instance.</t>

          <t>A hijacking of AORs can be mitigated by restricting the name
          spaces admissible in the Overlay Instance, or by additional
          verification actions of the enrollment service. To prevent an
          (exclusive) routing to a bogus registration, a caller can in
          addition query the DNS (or other discovery services at hand),
          search for an alternative presence of the callee in another overlay
          or a SIP infrastructure using <xref target="RFC3263"/> for name resolution.</t>
        </section>

        <section title="Privacy Issues">
          <t>All RELOAD SIP registration data is visible to all nodes in the
          overlay. Location privacy can be gained from using anonymous GRUUs.
          Methods of providing anonymity or deploying pseudonyms exist, but
          are beyond the scope of this document.</t>
        </section>
      </section>
    </section>

    <section title="IANA Considerations">
      <section title="Data Kind-ID">
        <t>IANA has registered the following code point in the "RELOAD Data
        Kind-ID" Registry (cf., <xref target="RFC6940"></xref>) to represent
        the SIP-REGISTRATION Kind, as described in <xref
        target="sec.sip-reg-kind"></xref>.</t><figure>
<artwork align="center"><![CDATA[ 
+---------------------+------------+-----------+
| Kind                |    Kind-ID | Reference |
+---------------------+------------+-----------+
| SIP-REGISTRATION    |        0x1 | RFC 7904  |
+---------------------+------------+-----------+
]]></artwork>
        </figure>
      </section>

      <section title="XML Namespace Registration">
        <t>This document registers the following URI for the config XML
        namespace in the IETF XML registry defined in <xref
        target="RFC3688"></xref>:</t>

        <t><list style="hanging">
            <t hangText="URI:">urn:ietf:params:xml:ns:p2p:config-base:sip</t>

            <t hangText="Registrant Contact:">The IESG</t>

            <t hangText="XML:">N/A; the requested URI is an XML namespace</t>
          </list></t>
      </section>
    </section>

  </middle>

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

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

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

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

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

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

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

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

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

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

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

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

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


      <reference anchor="IEEE-Posix">
        <front>
          <title>International Standard - Information technology Portable
	  Operating System Interface (POSIX) Base Specifications, Issue 7</title>

          <author>
<organization>IEEE</organization></author>
          <date month="September" year="2009"/>
        </front>

        <seriesInfo name="ISO/IEC/IEEE" value="9945:2009"/>
        <seriesInfo name="DOI" value="10.1109/IEEESTD.2009.5393893"/>
      </reference>

    </references>

    <references title="Informative References">

      <?rfc include="reference.RFC.3263"?>
      <?rfc include="reference.RFC.3966"?>

<!--draft-ietf-p2psip-concepts-09 in AUTH48 state -->
<reference anchor="RFC7890" target="http://www.rfc-editor.org/info/rfc7890">

<front>
<title>Concepts and Terminology for Peer-to-Peer SIP (P2PSIP)</title>

<author initials='D' surname='Bryan' fullname='David Bryan'>
    <organization />
</author>

<author initials='P' surname='Matthews' fullname='Philip Matthews'>
    <organization />
</author>

<author initials='E' surname='Shim' fullname='Eunsoo Shim'>
    <organization />
</author>

<author initials='D' surname='Willis' fullname='Dean Willis'>
    <organization />
</author>

<author initials='S' surname='Dawkins' fullname='Spencer Dawkins'>
    <organization />
</author>

<date month='June' year='2016' />
</front>
<seriesInfo name='RFC' value='7890'/>
<seriesInfo name="DOI" value="10.17487/RFC7890"/>

</reference>


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

<!-- draft-ietf-p2psip-share-08 IESG state AD Evaluation::External Party--> 

<reference anchor='SHARE'>
<front>
<title>A Usage for Shared Resources in RELOAD (ShaRe)</title>

<author initials='A' surname='Knauf' fullname='Alexander Knauf'>
    <organization />
</author>

<author initials='T' surname='Schmidt' fullname='Thomas Schmidt'>
    <organization />
</author>

<author initials='G' surname='Hege' fullname='Gabriel Hege'>
    <organization />
</author>

<author initials='M' surname='Waehlisch' fullname='Matthias Waehlisch'>
    <organization />
</author>

<date month='March' day='20' year='2016' />

</front>

<seriesInfo name='Work in Progress,' value='draft-ietf-p2psip-share-08' />
</reference>



    </references>

    <section title="Third-Party Registration">
      <t>
Non-peer-to-peer SIP defines third-party registration
  (e.g., an assistant acting for a manager or a changing set of users
registering under a role-based AOR) in Section 10.2 of <xref
      target="RFC3261"></xref>. This is a REGISTER that uses the URI of the
      third party in its From header and cannot be translated directly into a
      P2PSIP registration because only the owner of the certificate can store
      a SIP-REGISTRATION in a RELOAD overlay.</t>

      <t>
Third-party registration can be implemented by using the extended
  access control mechanism USER-CHAIN-ACL defined in <xref target='SHARE'/>. Creating a new Kind
      "SIP-3P-REGISTRATION" that is ruled by USER-CHAIN-ACL allows the owner
      of the certificate to delegate the right for registration to individual
      third parties. 

This way, the SIP third-party registration
  functionality can be regained without weakening the security controls
  of RELOAD.
      </t>
    </section>

    <section title="Acknowledgments" numbered="no">
      <t>This document was generated in parts from initial drafts and
      discussions in the early specification phase of the P2PSIP base
      protocol. 

We gratefully acknowledge the significant contributions made by (in
alphabetical order) David A.&nbsp;Bryan, James Deverick, Marcin
Matuszewski, Jonathan Rosenberg, and Marcia Zangrilli.
      </t>

      <t>Additional thanks go to all those who helped with ideas, discussions,
      and reviews, in particular (in alphabetical order) Roland Bless, Michael
      Chen, Alissa Cooper, Marc Petit-Huguenin, Brian Rosen, Meral
      Shirazipour, and Matthias Waehlisch.</t>
    </section>

  </back>
</rfc>
