P2PSIP
Internet Engineering Task Force (IETF)                           N. Zong, Ed.
Internet-Draft Zong
Request for Comments: 7263                                      X. Jiang
Intended status:
Category: Standards Track                                        R. Even
Expires: April 24, 2014
ISSN: 2070-1721                                      Huawei Technologies
                                                                Y. Zhang
                                                  CoolPad
                                                        October 21, 2013 / China Mobile
                                                               June 2014

 An Extension to the REsource LOcation And Discovery (RELOAD) Protocol
                   to Support Direct Response Routing
                        draft-ietf-p2psip-drr-11

Abstract

   This document proposes defines an optional extension to the REsource LOcation
   And Discovery (RELOAD) protocol to support the direct response
   routing mode.  RELOAD recommends symmetric recursive routing for
   routing messages.  The new optional extension provides a shorter
   route for responses responses, thereby reducing the overhead on intermediate peers and peers.
   This document also describes the potential cases where this extension can
   be used.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list  It represents the consensus of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid the IETF community.  It has
   received public review and has been approved for a maximum publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in Section 2 of RFC 5741.

   Information about the current status of six months this document, any errata,
   and how to provide feedback on it may be updated, replaced, or obsoleted by other documents obtained at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on April 24, 2014.
   http://www.rfc-editor.org/info/rfc7263.

Copyright Notice

   Copyright (c) 2013 2014 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1. Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3 ....................................................4
   2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   3 .....................................................4
   3. Overview  . . . . . . . . . . . . . . . . . . . . . . . . . .   4 ........................................................5
      3.1. SRR and DRR . . . . . . . . . . . . . . . . . . . . . . .   4 ................................................5
           3.1.1. Symmetric Recursive Routing (SRR) . . . . . . . . . .   4 ...................6
           3.1.2. Direct Response Routing (DRR) . . . . . . . . . . . .   5 .......................6
      3.2. Scenarios where Where DRR can be used . . . . . . . . . . . . .   6 Can Be Used ............................7
           3.2.1. Managed or closed Closed P2P systems . . . . . . . . . . . .   6 Systems .......................7
           3.2.2. Wireless scenarios  . . . . . . . . . . . . . . . . .   6 Scenarios ..................................8
   4. Relationship between SRR and DRR  . . . . . . . . . . . . . .   6 ................................8
      4.1. How DRR works . . . . . . . . . . . . . . . . . . . . . .   7 Works ..............................................8
      4.2. How SRR and DRR work together . . . . . . . . . . . . . .   7 Work Together ..............................8
   5.  Comparison on cost of SRR and DRR . . . . . . . . . . . . . .   8
     5.1.  Closed or managed networks  . . . . . . . . . . . . . . .   8
     5.2.  Open networks . . . . . . . . . . . . . . . . . . . . . .   9
   6.  DRR extensions Extensions to RELOAD  . . . . . . . . . . . . . . . . . .   9
     6.1. ........................................9
      5.1. Basic requirements  . . . . . . . . . . . . . . . . . . .   9
     6.2. Requirements .........................................9
      5.2. Modification to RELOAD message structure  . . . . . . . .  10
       6.2.1.  State-keeping flag  . . . . . . . . . . . . . . . . .  10
       6.2.2. Message Structure ...................9
           5.2.1. State-Keeping Flag ..................................9
           5.2.2. Extensive routing mode  . . . . . . . . . . . . . . .  10
     6.3. Routing Mode .............................10
      5.3. Creating a request  . . . . . . . . . . . . . . . . . . .  11
       6.3.1. Request ........................................11
           5.3.1. Creating a request Request for DRR  . . . . . . . . . . . . .  11
     6.4. .........................11
      5.4. Request and response processing . . . . . . . . . . . . .  12
       6.4.1. Response Processing ...........................11
           5.4.1. Destination peer: receiving Peer: Receiving a request Request and sending
                  Sending a
               response  . . . . . . . . . . . . . . . . . . . . . .  12
       6.4.2. Response .................................11
           5.4.2. Sending peer: receiving Peer: Receiving a response  . . . . . . . . .  12
   7. Response .................12
   6. Overlay configuration extension . . . . . . . . . . . . . . .  12
   8. Configuration Extension ................................12
   7. Security considerations . . . . . . . . . . . . . . . . . . .  13
   9. Considerations ........................................12
   8. IANA considerations . . . . . . . . . . . . . . . . . . . . .  13
     9.1. Considerations ............................................13
      8.1. A new New RELOAD forwarding option  . . . . . . . . . . . . .  13
     9.2. Forwarding Option ............................13
      8.2. A new New IETF XML registry . . . . . . . . . . . . . . . . .  13
   10. Registry ...................................13
   9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  13
   11. ................................................13
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  14
     11.1. ....................................................13
      10.1. Normative references . . . . . . . . . . . . . . . . . .  14
     11.2. References .....................................13
      10.2. Informative references . . . . . . . . . . . . . . . . .  14
   12. References  . . . . . . . . . . . . . . . . . . . . . . . . .  14 ...................................14
   Appendix A. Optional methods Methods to investigate peer connectivity  .  14 Investigate Peer Connectivity .....15
     A.1. Getting addresses Addresses to be used Be Used as candidates Candidates for DRR  . . .  15 .........15
     A.2. Public reachability test  . . . . . . . . . . . . . . . .  16
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  17 Reachability Test ...................................16
   Appendix B. Comparison of Cost of SRR and DRR .....................17
     B.1. Closed or Managed Networks .................................17
     B.2. Open Networks ..............................................19

1.  Introduction

   The REsource LOcation And Discovery (RELOAD) protocol [I-D.ietf-p2psip-
   base] [RFC6940]
   recommends symmetric recursive routing (SRR) for routing messages and
   describes the extensions that would be required to support additional
   routing algorithms.  Other than  In addition to SRR, two other routing options: options --
   direct response routing (DRR) and relay peer routing (RPR) -- are
   also discussed in Appendix A of [I-D.ietf-p2psip-base]. [RFC6940].  As we show in section Section 3,
   DRR is advantageous over SRR in some scenarios
   by reducing in that DRR can reduce
   load (CPU and link bandwidth) on intermediate peers.  For example, in
   a closed network where every peer is in the same address realm, DRR
   performs better than SRR.  In other scenarios, using a combination of
   DRR and SRR together is more likely to bring provide benefits than if SRR
   is used alone.

   Note that in this document, document we focus on the DRR routing mode and its
   extensions to RELOAD to produce a standalone solution.  Please refer
   to RPR draft [I-D.ietf-p2psip-rpr] [RFC7264] for details on the RPR routing mode.

   We first discuss the problem statement in Section 3, then how 3.  How to combine
   DRR and SRR is presented in Section 4.  In Section 5, we give
   comparison on the cost of SRR and DRR in both managed and open
   networks.  An extension to RELOAD to
   support DRR is proposed defined in Section 6. 5.  Some optional methods to check
   peer connectivity are introduced in Appendix A.  In Appendix B, we
   give a comparison of the cost of SRR and DRR in both managed and open
   networks.

2.  Terminology

   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 [RFC2119].

   We use the terminology and definitions from the RELOAD base draft
   [I-D.ietf-p2psip-base] RELOAD specification
   [RFC6940] extensively in this document.  We also use terms defined in
   the NAT behavior discovery document [RFC5780].  Other terms used in
   this document are defined inline when used and are also defined below
   for reference.

      Publicly Reachable: A peer is publicly reachable if it can receive
      unsolicited messages from any other peer in the same overlay.
      Note: "publicly" "Publicly" does not mean that the peers must be on the
      public Internet, because the RELOAD protocol may be used in a
      closed network.

      Direct Response Routing (DRR): "DRR" refers to a routing mode in
      which responses to P2PSIP Peer-to-Peer SIP (P2PSIP) requests are returned
      to the sending peer directly from the destination peer based on
      the sending peer's own local transport address(es).  For
      simplicity, the abbreviation DRR "DRR" is used instead in the rest of the this
      document.

      Symmetric Recursive Routing (SRR): "SRR" refers to a routing mode
      in which responses follow the reverse path of the request to get
      to the sending peer.  For simplicity, the abbreviation SRR "SRR" is
      used
      instead in the rest of this document.

      Relay Peer Routing (RPR): "RPR" refers to a routing mode in which
      responses to P2PSIP requests are sent by the destination peer to
      the transport address of a relay peer that will forward the
      responses towards the sending peer.  For simplicity, the
      abbreviation "RPR" is used in the rest of this document.

3.  Overview

   RELOAD is expected to work under a great number of application
   scenarios.  The situations where RELOAD is to be deployed differ
   greatly.  For instance, some deployments are global, such as a Skype-
   like
   Skype-like system intended to provide public service, while others
   run in small-scale closed networks of small scale. networks.  SRR works in any situation, but
   DRR may work better in some specific scenarios.

3.1.  SRR and DRR

   RELOAD is a simple request-response protocol.  After sending a
   request, a peer waits for a response from a destination peer.  There
   are several ways for the destination peer to send a response back to
   the source peer.  In this section, we will provide detailed
   information on two routing modes: SRR and DRR.

   Some assumptions are made in the following illustrations. illustrations that follow:

   1)  Peer A sends a request destined to a peer who is the responsible
       peer for a Resource-ID k; k.

   2)  Peer X is the root peer being responsible for resource k; Resource-ID k.

   3)  The intermediate peers for the path from A to X are peer peers B, C,
       and D.

3.1.1.  Symmetric Recursive Routing (SRR)

   For SRR, when the request sent by peer A is received by an
   intermediate peer B, C C, or D, each intermediate peer will insert
   information on the peer from whom they got the request in the via-
   list
   Via List, as described in RELOAD. RELOAD [RFC6940].  As a result, the
   destination peer X will know the exact path which that the request has
   traversed.  Peer X will then send back the response in the reverse
   path by constructing a destination list Destination List based on the via-list Via List in the
   request.  Figure 1 illustrates SRR.

         A            B            C             D           X
         |  Request   |            |            |            |
         |----------->|            |            |            |
         |            | Request    |            |            |
         |            |----------->|            |            |
         |            |            | Request    |            |
         |            |            |----------->|            |
         |            |            |            | Request    |
         |            |            |            |----------->|
         |            |            |            |            |
         |            |            |            |  Response  |
         |            |            |            |<-----------|
         |            |            |  Response  |            |
         |            |            |<-----------|            |
         |            |  Response  |            |            |
         |            |<-----------|            |            |
         |  Response  |            |            |            |
         |<-----------|            |            |            |
         |            |            |            |            |

                            Figure 1. 1: SRR routing mode Mode

   SRR works in any situation, especially when there are NATs or
   firewalls.  A downside of this solution is that the message takes
   several hops to return to the peer, increasing the bandwidth usage
   and CPU/battery load of multiple peers.

3.1.2.  Direct Response Routing (DRR)

   In DRR, peer X receives the request sent by peer A through
   intermediate peer peers B, C C, and D, as in SRR.  However, peer X sends the
   response back directly to peer A based on peer A's local transport
   address.  In this case, the response is not routed through
   intermediate peers.  Figure 2 illustrates DRR.  Using a shorter route
   means less overhead on intermediate peers, especially in the case of
   wireless networks where the CPU and uplink bandwidth is are limited.
   For example, in the absence of NATs, or if the NAT implements endpoint-
   independent
   endpoint-independent filtering, this is the optimal routing
   technique.  Note that establishing a secure connection requires
   multiple round trips.  Please refer to Section 5 Appendix B for a cost
   comparison between SRR and DRR.

           A            B            C             D           X
           |  Request   |            |            |            |
           |----------->|            |            |            |
           |            | Request    |            |            |
           |            |----------->|            |            |
           |            |            | Request    |            |
           |            |            |----------->|            |
           |            |            |            | Request    |
           |            |            |            |----------->|
           |            |            |            |            |
           |            |            |            |  Response  |
           |<-----------+------------+------------+------------|
           |            |            |            |            |

                            Figure 2. 2: DRR routing mode Mode

3.2.  Scenarios where Where DRR can be used Can Be Used

   This section lists several scenarios where using DRR would work, work and
   identifies when the increased efficiency would be advantageous.

3.2.1.  Managed or closed Closed P2P systems Systems

   The properties that make P2P technology attractive, such as the lack
   of need for centralized servers, self-organization, etc. etc., are
   attractive for managed systems as well as unmanaged systems.  Many of
   these systems are deployed on private networks where peers are in the
   same address realm and/or can directly route to each other.  In such
   a scenario, the network administrator can indicate preference for DRR
   in the peer's configuration file.  Peers in such a system would
   always try DRR first, but peers MUST also support SRR in case DRR
   fails.  If during  During the process of establishing a direct connection with
   the sending peer, if the responding peer receives a request with SRR
   as the preferred routing mode (or it fails to establish the direct
   connection), the responding peer SHOULD NOT use DRR but instead
   switch to SRR.  The simple policy is to try DRR and and, if fails this fails,
   switch to SRR for all connections.  A finer grained policy is when  In a finer-grained policy, a peer keeps
   would keep a list of unreachable peers based on trying DRR and then
   would use only SRR for
   these those peers.  The advantage in of using DRR is on the
   network stability stability, since it puts less overhead on the intermediate
   peers that will not route the responses.  The intermediate peers will
   need to route less fewer messages and will save CPU resources as well as the
   link bandwidth usage.

3.2.2.  Wireless scenarios Scenarios

   In some mobile deployments, using DRR may help with reducing reduce radio battery
   usage and bandwidth by the intermediate peers.  The service provider
   may recommend using DRR based on his/her his knowledge of the topology.

4.  Relationship between SRR and DRR

4.1.  How DRR works Works

   DRR is very simple.  The only requirement is for the source peers to
   provide their potential (publically (publicly reachable) transport address to the
   destination peers, so that the destination peer knows where to send
   the response.  Responses are sent directly to the requesting peer.

4.2.  How SRR and DRR work together Work Together

   DRR is not intended to replace SRR.  It is better to use these two
   modes together to adapt to each peer's specific situation.  In this
   section, we give some informative suggestions on for how to transition
   between the routing modes in RELOAD.

   According to base draft [I-D.ietf-p2psip-base], [RFC6940], SRR MUST be supported.  An overlay MAY be
   configured to use alternative routing algorithms, and alternative
   routing algorithms MAY be selected on a per-message basis.  I.e.,  That is,
   a node in an overlay which that supports SRR and some other routing algorithm,
   algorithm -- for example DRR, example, DRR -- might use SRR some of the time and
   DRR some of the time.  A node joining the overlay should get from the configuration file the
   preferred routing mode. mode from the configuration file.  If an overlay
   runs within a private network and all peers in the system can reach
   each other directly, peers MAY send most of the transactions with
   DRR.  On the contrary, using  However, DRR SHOULD NOT be discouraged used in the open Internet or if the
   administrator does not feel he have has enough information about the
   overlay network topology.  A new overlay configuration element
   specifying the usage of DRR is defined in Section 7. 6.

   Alternatively, a peer can collect statistical data on the success of
   the different routing modes based on previous transactions and keep a
   list of non-reachable addresses.  Based on this data, the peer will
   have a clearer view about of the success rate of different routing modes.  Other than
   In addition to data on the success rate, the peer can also get data
   of finer granularity, granularity -- for example, the number of retransmission retransmissions
   the peer needs to achieve a desirable success rate.

   A typical strategy for the peer is as follows.  A peer chooses to
   start with DRR based on the configuration.  Based on the success rate
   seen from the lost message
   as indicated by statistics on lost messages or by responses that used
   DRR, the peer can either continue to offer DRR first or switch to
   SRR.  Note that a peer should use the DRR success statistic statistics to
   decide if whether to continue using DRR or fall back to SRR.  It is not recommended to
   make  Making
   such a decision per specific connection but this is not recommended; this
   should be an application decision.

5.  Comparison on cost of SRR and  DRR

   The major advantages in using Extensions to RELOAD

   Adding support for DRR are in going through less
   intermediate peers on requires extensions to the response.  By doing that it reduces current RELOAD
   protocol.  In this section, we define the
   load on those peers' resources like processing required extensions,
   including extensions to message structure and communication
   bandwidth. message processing.

5.1.  Closed or managed networks

   As described in Section 3, many P2P systems run  Basic Requirements

   All peers MUST be able to process requests for routing in a closed or
   managed environment (e.g., carrier networks) so that network
   administrators would know that they could safely use DRR. SRR brings out more and MAY
   support DRR routing hops than DRR.  Assuming that there requests.

5.2.  Modification to RELOAD Message Structure

   RELOAD provides an extensible framework to accommodate future
   extensions.  In this section, we define a ForwardingOption structure
   to support DRR mode.  Additionally, we present a state-keeping flag
   to inform intermediate peers if they are N allowed to not maintain
   state for a transaction.

5.2.1.  State-Keeping Flag

   RELOAD allows intermediate peers to maintain state in the P2P system and Chord is applied order to
   implement SRR -- for routing, the number
   of hops example, for a implementing hop-by-hop
   retransmission.  If DRR is used, the response in SRR will not follow the
   reverse path, and DRR are listed the state in the following
   table.  Establishing intermediate peers will not be
   cleared until such state expires.  In order to address this issue, we
   define a secure connection between new flag, state-keeping flag, in the sending peer and ForwardingOption
   structure to indicate whether the responding peer with (D)TLS requires multiple messages.  Note
   that establishing (D)TLS secure connections for P2P overlay state-keeping is not
   optimal in some cases, e.g., direct response routing where (D)TLS is
   heavy for temporary connections.  Therefore, in the following table,
   we show the cases of: 1) no (D)TLS in DRR; 2) still using DTLS in DRR
   as sub-optimal.  As the worst-cost case, 7 messages are used during
   the DTLS handshaking [DTLS].  (TLS Handshake is a two round-trip
   negotiation protocol while DTLS handshake is a three round-trip
   negotiation protocol.)

     Mode      | Success | No. of Hops | No. of Msgs
     ----------------------------------------------------
     SRR       |  Yes    |     log(N)  |    log(N)
     DRR       |  Yes    |     1       |    1
     DRR(DTLS) |  Yes    |     1       |    7+1

    Table 1. Comparison of SRR and DRR in closed networks

   From the above comparison, it is clear that:

   1) In most cases when N > 2 (2^1), DRR uses fewer hops than SRR.
   Using a shorter route means less overhead and resource usage on
   intermediate peers, which is an important consideration for adopting
   DRR in the cases where the resources such as CPU and bandwidth are
   limited, e.g., the case of mobile, wireless networks.

   2) In the cases when N > 256 (2^8), DRR also uses fewer messages than
   SRR.

   3) In the cases when N < 256, DRR uses more messages than SRR (but
   still uses fewer hops than SRR).  So the consideration on whether
   using DRR or SRR depends on other factors like using less resources
   (bandwidth and processing) from the intermediate peers.  Section 4
   provides use cases where DRR has better chance to work or where the
   intermediary resources considerations are important.

5.2.  Open networks

   In open networks (e.g., Internet) where DRR is not guaranteed to
   work, DRR can fall back to SRR if it fails after trial, as described
   in Section 4.  Based on the same settings in Section 5.1, the number
   of hops, number of messages for a response in SRR and DRR are listed
   in the following table.

     Mode      |       Success         | No. of Hops | No. of Msgs
     -----------------------------------------------------------
     SRR       |         Yes           |     log(N)  |    log(N)
     DRR       |         Yes           |     1       |    1
               | Fail&Fall back to SRR |     1+log(N)|    1+log(N)
     DRR(DTLS) |         Yes           |     1       |    7+1
               | Fail&Fall back to SRR |     1+log(N)|    8+log(N)

        Table 2. Comparison of SRR and DRR in open networks

   From the above comparison, it can be observed that trying to first
   use DRR could still provide an overall number of hops lower than
   directly using SRR.  Suppose that P peers are publicly reachable, the
   number of hops in DRR and SRR is P*1+(N-P)*(1+logN), N*logN,
   respectively.  The condition for fewer hops in DRR is
   P*1+(N-P)*(1+logN) < N*logN, which is P/N > 1/logN.  This means that
   when the number of peers N grows, the required ratio of publicly
   reachable peers P/N for fewer hops in DRR decreases.  Therefore, the
   chance of trying DRR with fewer hops than SRR becomes better as the
   scale of the network increases.

6.  DRR extensions to RELOAD

   Adding support for DRR requires extensions to the current RELOAD
   protocol.  In this section, we define the extensions required to the
   protocol, including extensions to message structure and to message
   processing.

6.1.  Basic requirements

   All peers MUST be able to process requests for routing in SRR, and
   MAY support DRR routing requests.

6.2.  Modification to RELOAD message structure

   RELOAD provides an extensible framework to accommodate future
   extensions.  In this section, we define a ForwardingOption structure
   to support DRR mode.  Additionally we present a state-keeping flag to
   inform intermediate peers if they are allowed to not maintain state
   for a transaction.

6.2.1.  State-keeping flag

   RELOAD allows intermediate peers to maintain state in order to
   implement SRR, for example for implementing hop-by-hop
   retransmission.  If DRR is used, the response will not follow the
   reverse path, and the state in the intermediate peers will not be
   cleared until such state expires.  In order to address this issue, we
   propose a new flag, state-keeping flag, in the message header to
   indicate whether the state keeping is required required in the
   intermediate peers.

   flag :

   Flag: 0x08 IGNORE-STATE-KEEPING

   If IGNORE-STATE-KEEPING is set, any peer receiving this message and
   which but
   who is not the destination of the message SHOULD forward the message
   with the full via_list Via List and SHOULD NOT maintain any internal state.

6.2.2.

5.2.2.  Extensive routing mode Routing Mode

   This draft document introduces a new forwarding option for an extensive
   routing mode.  This option conforms to the description in section
   Section 6.3.2.3 of [I-D.ietf-p2psip-base]. [RFC6940].

   We first define a new type to define the new option,
   extensive_routing_mode:

   The option value is illustrated as below, defining that defines the ExtensiveRoutingModeOption structure:
   structure is illustrated below:

   enum {(0),DRR(1),(255)} RouteMode;
   struct {
           RouteMode               routemode;
           OverlayLinkType         transport;
           IpAddressPort           ipaddressport;
           Destination             destinations<1..2^8-1>;
   } ExtensiveRoutingModeOption;

   The above structure reuses the OverlayLinkType, Destination Destination, and
   IpAddressPort structure structures as defined in section Sections 6.5.1.1, 6.3.2.2 6.3.2.2, and
   6.3.1.1 of [I-D.ietf-p2psip-base]. [RFC6940], respectively.

   RouteMode: refers to which type of routing mode is indicated to the
   destination peer.

   OverlayLinkType: refers to the transport type which that is used to deliver
   responses from the destination peer to the sending peer.

   IpAddressPort: refers to the transport address that the destination
   peer will use to send the response to. for sending responses.  This will be a sending peer
   address for DRR.

   Destination: refers to the sending peer itself.  If the routing mode
   is DRR, then the destination only contains the sending peer's Node-
   ID.

6.3.
   Node-ID.

5.3.  Creating a request

6.3.1. Request

5.3.1.  Creating a request Request for DRR

   When using DRR for a transaction, the sending peer MUST set the
   IGNORE-STATE-KEEPING flag in the ForwardingHeader.  Additionally, the
   peer MUST construct and include a ForwardingOptions ForwardingOption structure in the
   ForwardingHeader.  When constructing the ForwardingOption structure,
   the fields MUST be set as follows:

   1)  The type MUST be set to extensive_routing_mode.

   2)  The ExtensiveRoutingModeOption structure MUST be used for the
       option field within the ForwardingOptions ForwardingOption structure.  The fields
       MUST be defined as follows:

       2.1)  routemode set to 0x01 (DRR).

       2.2)  transport set as appropriate for the sender.

       2.3)  ipaddressport set to the peer's associated transport
             address.

       2.4)  The destination structure MUST contain one value, defined
             as type node "node" and set with the sending peer's own values.

6.4.

5.4.  Request and response processing Response Processing

   This section gives normative text for message processing after DRR is
   introduced.  Here, we only describe the additional procedures for
   supporting DRR.  Please refer to [I-D.ietf-p2psip-base] [RFC6940] for RELOAD base
   procedures.

6.4.1.

5.4.1.  Destination peer: receiving Peer: Receiving a request Request and sending Sending a response Response

   When the destination peer receives a request, it will check the
   options in the forwarding header.  If the destination peer can not cannot
   understand the extensive_routing_mode option in the request, it MUST
   attempt to use SRR to return an "Error_Unknown_Extension" response
   (defined in Section Sections 6.3.3.1 and Section 14.9 of [I-D.ietf-p2psip-
   base]) [RFC6940]) to the sending
   peer.

   If the routing mode is DRR, the destination peer MUST construct the
   Destination
   list List for the response with only one entry, using the sending
   requesting peer's Node-ID from the option Via List in the request as the
   value.

   In the event that the routing mode is set to DRR and there is not
   exactly one destination, the destination peer MUST try to return an
   "Error_Unknown_Extension" response (defined in Section Sections 6.3.3.1 and
   Section
   14.9 of [I-D.ietf-p2psip-base]) [RFC6940]) to the sending peer using SRR.

   After the peer constructs the destination list Destination List for the response, it
   sends the response to the transport address address, which is indicated in
   the ipaddressport field in the option using the specific transport
   mode in the Forwardingoption. ForwardingOption.  If the destination peer receives a
   retransmit with SRR preference on the message it is trying to respond
   to now, the responding peer SHOULD abort the DRR response and
   use SRR.

6.4.2.

5.4.2.  Sending peer: receiving Peer: Receiving a response Response

   Upon receiving a response, the peer follows the rules in [I-D.ietf-
   p2psip-base]. [RFC6940].
   The peer SHOULD note if DRR worked worked, in order to decide
   if whether to
   offer DRR again.  If the peer does not receive a response until the timeout
   timeout, it SHOULD resend the request using SRR.

7.

6.  Overlay configuration extension Configuration Extension

   This document extends the RELOAD overlay configuration (see
   Section 11.1 of [I-D.ietf-p2psip-base]) [RFC6940]) by adding one new element, "route-mode",
   inside each "configuration" element.

   The Compact Relax NG Grammar Regular Language for XML Next Generation (RELAX NG)
   grammar for this element is:

      namespace route-mode = "urn:ietf:params:xml:ns:p2p:route-mode"

      parameter &= element route-mode:mode { xsd:string }?

   This namespace is added into the <mandatory-extension> element in the
   overlay configuration file.  The defined routing modes include DRR
   and RPR.

   Mode

   The mode can be DRR or RPR and and, if specified in the configuration configuration,
   should be the preferred routing mode used by the application.

8.

7.  Security considerations Considerations

   The normative security recommendations of Section 13 of base draft
   [I-D.ietf-p2psip-base] [RFC6940] are
   applicable to this document.  As a routing alternative, the security
   part of DRR conforms to Section 13.6 of the
   base draft [RFC6940], which describes
   routing security.  For example, the DRR routing option provides the
   information about the route back to the source.  According to
   Section 13.6 of [RFC6940], the base draft the enter entire DRR routing message MUST be
   digitally signed and sent over by via a protected channel to protect the
   DRR routing information.

9.

8.  IANA considerations

9.1. Considerations

8.1.  A new New RELOAD forwarding option Forwarding Option

   A new RELOAD Forwarding Option type is has been added to the "RELOAD
   Forwarding Option
   Registry Option" registry defined in [I-D.ietf-p2psip-base].

   Type: 0x02 - [RFC6940].

   Code: 2
   Forwarding Option: extensive_routing_mode

9.2.

8.2.  A new New IETF XML registry

   This section requests Registry

   IANA to register has registered the following URN in the "XML Namespaces" class
   of the "IETF XML Registry" in accordance with [RFC3688].

   URI: urn:ietf:params:xml:ns:p2p:route-mode

   Registrant Contact: The IESG

   XML: This specification

10.

9.  Acknowledgments

   David Bryan has helped extensively with this document, document and helped provide
   some of the text, analysis, and ideas contained here.  The authors
   would like to thank Ted Hardie, Narayanan Vidya, Dondeti Lakshminath,
   Bruce Lowekamp, Stephane Bryant, Marc Petit-Huguenin Petit-Huguenin, and Carlos
   Jesus Bernardos Cano for their constructive comments.

11.

10.  References

11.1.

10.1.  Normative references References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC2119, RFC 2119, March 1997.

   [I-D.ietf-p2psip-base]

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              January 2004.

   [RFC6940]  Jennings, C., Lowekamp, B., Rescorla, E., Baset, S., and
              H. Schulzrinne, "REsource LOcation And Discovery (RELOAD)
              Base Protocol", draft-ietf-p2psip-base-26 (work in
   progress), February 2013.

   [RFC3688] Mealling, M., "The IETF XML Registry ", BCP 81, RFC3688, RFC 6940, January 2004.

11.2. 2014.

10.2.  Informative references References

   [Chord]    Stoica, I., Morris, R., Liben-Nowell, D., Karger, D.,
              Kaashoek, M., Dabek, F., and H. Balakrishnan, "Chord: A
              Scalable Peer-to-Peer Lookup Protocol for Internet
              Applications", IEEE/ACM Transactions on Networking
              Volume 11, Issue 1, 17-32, February 2003.

   [DTLS]     Modadugu, N., N. and E. Rescorla, E., "The Design and
              Implementation of Datagram TLS", Proc. 11th Network and
              Distributed System Security Symposium (NDSS),
              February 2004.

   [IGD2]     UPnP Forum, "WANIPConnection:2 Service", September 2010,
              <http://upnp.org/specs/gw/
              UPnP-gw-WANIPConnection-v2-Service.pdf>.

   [RFC3424]  Daigle, L. and IAB, "IAB Considerations for UNilateral
              Self-Address Fixing (UNSAF) Across Network Address
              Translation", RFC 3424, November 2002.

   [RFC5780]  MacDonald, D. and B. Lowekamp, "NAT Behavior Discovery
              Using STUN", RFC5780, Session Traversal Utilities for NAT (STUN)",
              RFC 5780, May 2010.

   [I-D.ietf-p2psip-rpr]

   [RFC6886]  Cheshire, S. and M. Krochmal, "NAT Port Mapping Protocol
              (NAT-PMP)", RFC 6886, April 2013.

   [RFC7264]  Zong, N., Jiang, X., Even, R. R., and Y. Zhang, Y., "An extension Extension
              to RELOAD the REsource LOcation And Discovery (RELOAD) Protocol
              to support Support Relay Peer Routing", draft-ietf-
   p2psip-rpr-11 (work in progress), October 2013.

   [IGD2] UPnP Forum, "WANIPConnection:2 Service (http://upnp.org/specs/
   gw/UPnP-gw-WANIPConnection-v2-Service.pdf)", September 2010.

   [RFC6886] Cheshire, S., Krochmal M., and K. Sekar, "NAT Port Mapping
   Protocol (NAT-PMP)", RFC6886, April 2013.

   [RFC3424] Daigle, L., "IAB Considerations for UNilateral Self-Address
   Fixing (UNSAF) Across Network Address Translation", RFC3424, November
   2002.

12.  References RFC 7264, June 2014.

   [wikiChord]
              Wikipedia, "Chord (peer-to-peer)", 2013,
              <http://en.wikipedia.org/w/
              index.php?title=Chord_%28peer-to-peer%29&oldid=549516287>.

Appendix A.  Optional methods Methods to investigate peer connectivity Investigate Peer Connectivity

   This section is for informational purposes only for providing and provides some
   mechanisms that can be used when the configuration information does
   not specify if DRR can be used.  It summarizes some methods which that can
   be used for by a peer to determine its own network location compared with
   NAT.  These methods may help a peer to decide which routing mode it
   may wish to try.  Note that there is no foolproof way to determine
   if
   whether a peer is publically publicly reachable, other than via out-of-band
   mechanisms.  This document addresses the UNSAF UNilateral Self-Address Fixing
   (UNSAF) [RFC3424] concerns considerations by specifying a fallback plan to SRR [p2psip-base-draft].
   [RFC6940].  SRR is not an UNSAF mechanism.  The  This document does not
   define any new UNSAF mechanisms.

   For DRR to function correctly, a peer may attempt to determine
   whether it is publicly reachable.  If it is not, the peers peer should fall
   back to SRR.  If the peer believes it is publically publicly reachable, DRR may
   be attempted.  NATs and firewalls are two major contributors to
   preventing DRR from functioning properly.  There are a number of
   techniques by which a peer can get its reflexive address on the
   public side of the NAT.  After obtaining the reflexive address, a
   peer can perform further tests to learn whether the reflexive address
   is publicly reachable.  If the address appears to be publicly
   reachable, the peers peer to which the address belongs can use DRR for
   responses.

   Some conditions that are unique in P2PSIP architecture which could be
   leveraged to facilitate the tests.  In a P2P overlay network, each
   peer
   only has partial only a partial view of the whole network, network and knows of a few
   peers in the overlay.  P2P routing algorithms can easily deliver a
   request from a sending peer to a peer with whom the sending peer has
   no direct connection.  This makes it easy for a peer to ask other
   peers to send unsolicited messages back to the requester.

   In the following sections, we first introduce several ways for a peer
   to get
   to get the addresses needed for further tests.  Then, a test for
   learning whether a peer may be publicly reachable is proposed.

A.1.  Getting Addresses to Be Used as Candidates for DRR

   In order to test whether a peer may be publicly reachable, the peer
   should first get one or more addresses that will be used by other
   peers to send him messages directly.  This address is either a local
   address of a peer or a translated address that is assigned by a NAT
   to the peer.

   Session Traversal Utilities for NAT (STUN) is used to get a reflexive
   address on the public side of a NAT with the help of STUN servers.
   NAT behavior discovery using STUN is specified in [RFC5780].  Under
   the RELOAD architecture, a few infrastructure servers can be
   leveraged for discovering NAT behavior, such as enrollment servers,
   diagnostic servers, bootstrap servers, etc.

   The peer can use a STUN Binding request to one of the STUN servers to
   trigger a STUN Binding response, which returns the reflexive address
   from the server's perspective.  If the reflexive transport address is
   the same as the source address of the Binding request, the peer can
   determine that there is likely no NAT between it and the chosen
   infrastructure server.  (Certainly, in some rare cases, the allocated
   address happens to be the same as the source address.  Further tests
   will detect this case and rule it out in the end.)  Usually, these
   infrastructure servers are publicly reachable in the overlay, so the
   peer can be considered publicly reachable.  On the other hand, using
   the techniques in [RFC5780], a peer can also decide whether it is
   behind a NAT with endpoint-independent mapping behavior.  If the addresses needed peer
   is behind a NAT with endpoint-independent mapping behavior, the
   reflexive address should also be a candidate for further tests.  Then

   The Universal Plug and Play Internet Gateway Device (UPnP-IGD) [IGD2]
   is a test for
   learning whether mechanism that a peer may be publicly reachable is proposed.

A.1.  Getting addresses can use to be used as candidates for DRR

   In order get the assigned address from
   its residential gateway, and after obtaining this address to test whether a peer may be publicly reachable,
   communicate it with other peers, the peer
   should first get one or more addresses which will be used by other
   peers to send him can receive unsolicited
   messages directly.  This address from outside, even though it is either behind a local NAT.  So, the
   address of obtained through the UPnP mechanism should also be used for
   further tests.

   Another way that a peer or a translated address which is behind NAT can learn its assigned address by a
   NAT
   to the peer.

   STUN is used to get a reflexive address on via the public side of a NAT Port Mapping Protocol (NAT-PMP) [RFC6886].  As
   with UPnP-IGD, the help of STUN servers.  Discovery of NAT behavior address obtained using STUN
   is specified in [RFC5780].  Under RELOAD architecture, a few
   infrastructure servers this mechanism should also
   be tested further.

   The above techniques are not exhaustive.  These techniques can be leveraged
   used to get candidate transport addresses for discovering NAT behavior,
   such as enrollment servers, diagnostic servers, bootstrap servers,
   etc. further tests.

A.2.  Public Reachability Test

   Using the transport addresses obtained by the above techniques, a
   peer can start a test to learn whether the candidate transport
   address is publicly reachable.  The basic idea of the test is that a
   peer can use sends a STUN Binding request and expects another peer in the overlay to one of STUN servers to
   trigger send
   back a STUN Binding response which returns the reflexive address
   from the server's perspective. response.  If the reflexive transport address response is successfully received by the same as
   sending peer and the source address of peer giving the Binding request, response has no direct
   connection with the sending peer, the sending peer can determine that there likely
   the address is no NAT between it probably publicly reachable and hence the chosen
   infrastructure server (Certainly, in some rare cases, the allocated
   address happens to peer may be
   publicly reachable at the same as the source tested transport address.  Further tests

   In a P2P overlay, a request is routed through the overlay and finally
   a destination peer will detect this case terminate the request and rule it out in give the end.).  Usually, these
   infrastructure severs are publicly reachable response.
   In a large system, there is a high probability that the destination
   peer has no direct connection with the sending peer.  Every peer
   maintains a connection table, particularly in the overlay, RELOAD
   architecture, so the it is easier for a peer can be considered to see whether it has direct
   connection with another peer.

   If a peer wants to test whether its transport address is publicly reachable.  On
   reachable, it can send a request to the overlay.  The routing for the
   test message would be different from other hand, kinds of requests because
   it is not for storing or fetching something to or from the overlay,
   or for locating a specific peer; instead, it is to get a peer who can
   deliver to the sending peer an unsolicited response and who has no
   direct connection with
   the techniques in [RFC5780], a him.  Each intermediate peer can also decide receiving the
   request first checks to see whether it is
   behind has a NAT direct connection with endpoint-independent mapping behavior.  If
   the peer sending peer.  If there is behind a NAT with endpoint- independent mapping behavior, direct connection, the
   reflexive address should also be a candidate for further tests.

   UPnP-IGD [IGD2] request is a mechanism that a peer can use
   routed to get the
   assigned address from its residential gateway next peer.  If there is no direct connection, the
   intermediate peer terminates the request and after obtaining
   this address sends the response back
   directly to communicate it with other peers, the sending peer can receive
   unsolicited messages from outside, even though it is behind a NAT.
   So with the transport address obtained through under test.

   After performing the test, if the UPnP mechanism should also be
   used for further tests.

   Another way that a peer behind NAT determines that it may be
   publicly reachable, it can use to learn its assigned
   address by NAT is NAT-PMP [RFC6886].  Like try DRR in UPnP-IGD, the address
   obtained using this mechanism should also be tested further. subsequent transactions.

Appendix B.  Comparison of Cost of SRR and DRR

   The above techniques are not exhaustive.  These techniques can be
   used to get candidate transport addresses for further tests.

A.2.  Public reachability test

   Using major advantage of using DRR is that it reduces the transport addresses obtained number of
   intermediate peers traversed by the above techniques, a
   peer can start a test to learn whether response.  This reduces the load,
   such as processing and communication bandwidth, on those peers'
   resources.

B.1.  Closed or Managed Networks

   As described in Section 3, many P2P systems run in a closed or
   managed environment (e.g., carrier networks), so network
   administrators would know that they could safely use DRR.

   SRR uses more routing hops than DRR.  Assuming that there are N peers
   in the candidate transport
   address P2P system and Chord [Chord] [wikiChord] is publicly reachable.  The basic idea applied for
   routing, the test is number of hops for a
   peer to send a request response in SRR and expect another peer in DRR are
   listed in the overlay to send
   back following table.  Establishing a response.  If the response is received by secure connection
   between the sending peer
   successfully and also the responding peer giving with Transport Layer
   Security (TLS) or Datagram TLS (DTLS) requires multiple messages.
   Note that establishing (D)TLS secure connections for a P2P overlay is
   not optimal in some cases, e.g., DRR where (D)TLS is heavy for
   temporary connections.  Therefore, in the response has following table we show the
   cases of 1) no direct
   connection with (D)TLS in DRR and 2) still using DTLS in DRR as
   sub-optimal.  As the sending peer, worst-cost case, seven (7) messages are used
   during DTLS handshaking [DTLS].  (The TLS handshake is a negotiation
   protocol that requires two (2) round trips, while the sending peer can determine DTLS handshake
   is a negotiation protocol that requires three (3) round trips.)

            Mode       | Success | No. of Hops | No. of Msgs
            ------------------------------------------------
            SRR        |  Yes    |     log(N)  |    log(N)
            DRR        |  Yes    |     1       |    1
            DRR (DTLS) |  Yes    |     1       |    7+1

         Table 1: Comparison of SRR and DRR in Closed Networks

   From the address above comparison, it is clear that:

   1)  In most cases when the number of peers (N) > 2 (2^1), DRR uses
       fewer hops than SRR.  Using a shorter route means less overhead
       and resource usage on intermediate peers, which is probably publicly reachable an important
       consideration for adopting DRR in the cases where such resources
       as CPU and hence bandwidth are limited, e.g., the peer may be
   publicly reachable at case of mobile,
       wireless networks.

   2)  In the tested transport address. cases when N > 256 (2^8), DRR also uses fewer messages
       than SRR.

   3)  In a P2P overlay, a request is routed through the overlay and finally
   a destination peer will terminate cases when N < 256, DRR uses more messages than SRR (but
       still uses fewer hops than SRR), so the request consideration of whether
       to use DRR or SRR depends on other factors such as using less
       resources (bandwidth and give processing) from the response.
   In a large system, there is intermediate peers.
       Section 4 provides use cases where DRR has a high probability that better chance of
       working or where the destination
   peer has no direct connection with considerations of intermediary resources are
       important.

B.2.  Open Networks

   In open networks (e.g., the sending peer.  Especially in
   RELOAD architecture, every peer maintains a connection table.  So it Internet) where DRR is easier for a peer not guaranteed to check whether
   work, DRR can fall back to SRR if it has direct connection with
   another peer.

   If fails after trial, as described
   in Section 4.  Based on the same settings as those listed in
   Appendix B.1, the number of hops, as well as the number of messages
   for a peer wants response in SRR and DRR, are listed in the following table:

    Mode       |       Success           | No. of Hops | No. of Msgs
    ----------------------------------------------------------------
    SRR        |         Yes             |   log(N)    |   log(N)
    DRR        |         Yes             |   1         |   1
               | Fail & fall back to test whether its transport address is publicly
   reachable, it can send a request SRR |   1+log(N)  |   1+log(N)
    DRR (DTLS) |         Yes             |   1         |   7+1
               | Fail & fall back to the overlay.  The routing for the
   test message would be different from other kinds SRR |   1+log(N)  |   8+log(N)

          Table 2: Comparison of requests because
   it is not for storing/fetching something to/from SRR and DRR in Open Networks

   From the overlay or
   locating a specific peer, instead above comparison, it is to get a peer who can deliver
   the sending peer an unsolicited response and which has no direct
   connection with him.  Each intermediate peer receiving the request be observed that trying to first checks whether it has a direct connections with
   use DRR could still provide an overall number of hops lower than
   directly using SRR.  Suppose that P peers are publicly reachable; the sending
   peer.  If there
   number of hops in DRR and SRR is a direct connection, the request P*1+(N-P)*(1+logN) and N*logN,
   respectively.  The condition for fewer hops in DRR is routed to the
   next peer.  If there
   P*1+(N-P)*(1+logN) < N*logN, which is no direct connection, the intermediate peer
   terminates P/N > 1/logN.  This means that
   when the request and sends number of peers (N) grows, the response back directly to required ratio of publicly
   reachable peers P/N for fewer hops in DRR decreases.  Therefore, the
   sending peer
   chance of trying DRR with fewer hops than SRR improves as the transport address under test.

   After performing the test, if scale
   of the peer determines that it may be
   publicly reachable, it can try DRR in subsequent transactions. network increases.

Authors' Addresses

   Ning Zong (editor)
   Huawei Technologies

   Email:

   EMail: zongning@huawei.com

   Xingfeng Jiang
   Huawei Technologies

   Email:

   EMail: jiang.x.f@huawei.com
   Roni Even
   Huawei Technologies

   Email:

   EMail: roni.even@mail01.huawei.com

   Yunfei Zhang
   CoolPad

   Email: / China Mobile

   EMail: hishigh@gmail.com