P2PSIPInternet Engineering Task Force (IETF) N.Zong, Ed. Internet-DraftZong Request for Comments: 7263 X. JiangIntended status:Category: Standards Track R. EvenExpires: April 24, 2014ISSN: 2070-1721 Huawei Technologies Y. Zhang CoolPadOctober 21, 2013/ China Mobile June 2014 An Extension to the REsource LOcation And Discovery (RELOAD) Protocol to Support Direct Response Routingdraft-ietf-p2psip-drr-11Abstract This documentproposesdefines 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 forresponsesresponses, thereby reducingtheoverhead on intermediatepeers andpeers. This document also describesthepotential cases where this extension can be used. Status of This Memo ThisInternet-Draftissubmitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documentsan 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 listIt represents the consensus ofcurrent Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents validthe IETF community. It has received public review and has been approved fora maximumpublication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 ofsix monthsRFC 5741. Information about the current status of this document, any errata, and how to provide feedback on it may beupdated, replaced, or obsoleted by other documentsobtained atany 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)20132014 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. ScenarioswhereWhere DRRcan be used . . . . . . . . . . . . . 6Can Be Used ............................7 3.2.1. Managed orclosedClosed P2Psystems . . . . . . . . . . . . 6Systems .......................7 3.2.2. Wirelessscenarios . . . . . . . . . . . . . . . . . 6Scenarios ..................................8 4. Relationship between SRR and DRR. . . . . . . . . . . . . . 6................................8 4.1. How DRRworks . . . . . . . . . . . . . . . . . . . . . . 7Works ..............................................8 4.2. How SRR and DRRwork together . . . . . . . . . . . . . . 7Work Together ..............................8 5. DRRextensionsExtensions to RELOAD. . . . . . . . . . . . . . . . . . 9........................................9 5.1. Basicrequirements . . . . . . . . . . . . . . . . . . . 9Requirements .........................................9 5.2. Modification to RELOADmessage structure . . . . . . . . 10Message Structure ...................9 5.2.1.State-keeping flag . . . . . . . . . . . . . . . . . 10State-Keeping Flag ..................................9 5.2.2. Extensiverouting mode . . . . . . . . . . . . . . . 10Routing Mode .............................10 5.3. Creating arequest . . . . . . . . . . . . . . . . . . . 11Request ........................................11 5.3.1. Creating arequestRequest for DRR. . . . . . . . . . . . . 11.........................11 5.4. Request andresponse processing . . . . . . . . . . . . . 12Response Processing ...........................11 5.4.1. Destinationpeer: receivingPeer: Receiving arequestRequest andsendingSending aresponse . . . . . . . . . . . . . . . . . . . . . . 12Response .................................11 5.4.2. Sendingpeer: receivingPeer: Receiving aresponse . . . . . . . . . 12Response .................12 6. Overlayconfiguration extension . . . . . . . . . . . . . . . 12Configuration Extension ................................12 7. Securityconsiderations . . . . . . . . . . . . . . . . . . . 13Considerations ........................................12 8. IANAconsiderations . . . . . . . . . . . . . . . . . . . . . 13Considerations ............................................13 8.1. AnewNew RELOADforwarding option . . . . . . . . . . . . . 13Forwarding Option ............................13 8.2. AnewNew IETF XMLregistry . . . . . . . . . . . . . . . . . 13Registry ...................................13 9. Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . 13................................................13 10. References. . . . . . . . . . . . . . . . . . . . . . . . . 14....................................................13 10.1. Normativereferences . . . . . . . . . . . . . . . . . . 14References .....................................13 10.2. Informativereferences . . . . . . . . . . . . . . . . . 14References ...................................14 Appendix A. OptionalmethodsMethods toinvestigate peer connectivity . 14Investigate Peer Connectivity .....15 A.1. GettingaddressesAddresses tobe usedBe Used ascandidatesCandidates for DRR. . . 15.........15 A.2. Publicreachability test . . . . . . . . . . . . . . . . 16Reachability Test ...................................16 Appendix B. Comparisonon costof Cost of SRR and DRR. . . . . . . . . 15.....................17 B.1. Closed ormanaged networks . . . . . . . . . . . . . . . 15Managed Networks .................................17 B.2. Opennetworks . . . . . . . . . . . . . . . . . . . . . . 16 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17Networks ..............................................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 thanIn addition to SRR, two other routingoptions: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 insectionSection 3, DRR is advantageous over SRR in some scenariosby reducingin 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 tobringprovide benefits than if SRR is used alone. Note that in thisdocument,document we focus on the DRRroutingmode and its extensions to RELOAD to produce a standalone solution. Please refer toRPR draft [I-D.ietf-p2psip-rpr][RFC7264] for details on the RPRroutingmode. We first discuss the problem statement in Section3, then how3. 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 isproposeddefined in Section6.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 usetheterminology and definitions from theRELOADbasedraft [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 toP2PSIPPeer-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 abbreviationDRR"DRR" is usedinsteadin the rest ofthethis 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 abbreviationSRR"SRR" is usedinsteadin 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 aSkype- likeSkype-like system intended to provide public service, while others run in small-scale closednetworks 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 thefollowing illustrations.illustrations that follow: 1) Peer A sends a request destined to a peer who is the responsible peer for a Resource-IDk;k. 2) Peer X is the root peerbeingresponsible forresource k;Resource-ID k. 3) The intermediate peers for the path from A to X arepeerpeers 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,CC, or D, each intermediate peer will insert information on the peer from whom they got the request in thevia- listVia List, as described inRELOAD.RELOAD [RFC6940]. As a result, the destination peer X will know the exact pathwhichthat the request has traversed. Peer X will then send back the response in the reverse path by constructing adestination listDestination List based on thevia-listVia List in the request. Figure 1 illustrates SRR. A B C D X | Request | | | | |----------->| | | | | | Request | | | | |----------->| | | | | | Request | | | | |----------->| | | | | | Request | | | | |----------->| | | | | | | | | | Response | | | | |<-----------| | | | Response | | | | |<-----------| | | | Response | | | | |<-----------| | | | Response | | | | |<-----------| | | | | | | | | Figure1.1: SRRrouting modeMode 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 intermediatepeerpeers B,CC, 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 bandwidthisare limited. For example, in the absence of NATs, or if the NAT implementsendpoint- independentendpoint-independent filtering, this is the optimal routing technique. Note that establishing a secure connection requires multiple round trips. Please refer toSection 5Appendix B for a cost comparison between SRR and DRR. A B C D X | Request | | | | |----------->| | | | | | Request | | | | |----------->| | | | | | Request | | | | |----------->| | | | | | Request | | | | |----------->| | | | | | | | | | Response | |<-----------+------------+------------+------------| | | | | | Figure2.2: DRRrouting modeMode 3.2. ScenarioswhereWhere DRRcan be usedCan Be Used This section lists several scenarios where using DRR wouldwork,work and identifies when the increased efficiency would be advantageous. 3.2.1. Managed orclosedClosed P2PsystemsSystems 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 duringDuring 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 DRRandand, iffailsthis fails, switch to SRR for all connections.A finer grained policy is whenIn a finer-grained policy, a peerkeepswould keep a list of unreachable peers based on trying DRR and then would use only SRR forthesethose peers. The advantageinof using DRR ison thenetworkstabilitystability, since it puts less overhead on the intermediate peers that will not route the responses. The intermediate peers will need to routelessfewer messages and will save CPU resources as well asthelink bandwidth usage. 3.2.2. WirelessscenariosScenarios In some mobile deployments, using DRR may helpwith reducingreduce radio battery usage and bandwidth by the intermediate peers. The service provider may recommend using DRR based onhis/herhis knowledge of the topology. 4. Relationship between SRR and DRR 4.1. How DRRworksWorks 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 DRRwork togetherWork 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 suggestionsonfor how to transition between the routing modes in RELOAD. According tobase 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 overlaywhichthat supports SRR and some other routingalgorithm,algorithm -- forexample DRR,example, DRR -- might use SRR some of the time and DRR some of the time. A node joining the overlay should getfrom the configuration filethe preferred routingmode.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, usingHowever, DRR SHOULD NOT bediscouragedused in the open Internet or if the administrator does not feel hehavehas enough information about the overlay network topology. A new overlay configuration element specifying the usage of DRR is defined in Section7.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 viewaboutof the success rate of different routing modes.Other thanIn addition to data on the success rate, the peer can also get data of finergranularity,granularity -- for example, the number ofretransmissionretransmissions 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 rateseen from the lost messageas 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 successstatisticstatistics to decideifwhether to continue using DRR or fall back to SRR.It is not recommended to makeMaking such a decision per specific connectionbut thisis not recommended; this should be an application decision. 5. DRRextensionsExtensions to RELOAD Adding support for DRR requires extensions to the current RELOAD protocol. In this section, we define theextensionsrequiredto the protocol,extensions, including extensions to message structure andtomessage processing. 5.1. BasicrequirementsRequirements All peers MUST be able to process requests for routing inSRR,SRR and MAY support DRR routing requests. 5.2. Modification to RELOADmessage structureMessage Structure RELOAD provides an extensible framework to accommodate future extensions. In this section, we define a ForwardingOption structure to support DRR mode.AdditionallyAdditionally, we present a state-keeping flag to inform intermediate peers if they are allowed to not maintain state for a transaction. 5.2.1.State-keeping flagState-Keeping Flag RELOAD allows intermediate peers to maintain state in order to implementSRR,SRR -- forexampleexample, 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, weproposedefine a new flag, state-keeping flag, in themessage headerForwardingOption structure to indicate whether thestate keepingstate-keeping is required in the intermediate peers.flag :Flag: 0x08 IGNORE-STATE-KEEPING If IGNORE-STATE-KEEPING is set, any peer receiving this messageand whichbut who is not the destination of the message SHOULD forward the message with the fullvia_listVia List and SHOULD NOT maintain any internal state. 5.2.2. Extensiverouting modeRouting Mode Thisdraftdocument introduces a new forwarding option for an extensive routing mode. This option conforms to the description insectionSection 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 valueis illustrated as below, definingthat defines the ExtensiveRoutingModeOptionstructure: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,DestinationDestination, and IpAddressPortstructurestructures as defined insectionSections 6.5.1.1,6.3.2.26.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 typewhichthat is used to deliver responses from the destination peer to the sending peer. IpAddressPort: refers to the transport address that the destination peer will useto 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'sNode- ID.Node-ID. 5.3. Creating arequestRequest 5.3.1. Creating arequestRequest 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 aForwardingOptionsForwardingOption 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 theForwardingOptionsForwardingOption 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 typenode"node" and set with the sending peer's own values. 5.4. Request andresponse processingResponse 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. 5.4.1. Destinationpeer: receivingPeer: Receiving arequestRequest andsendingSending aresponseResponse When the destination peer receives a request, it will check the options in the forwarding header. If the destination peercan notcannot understand the extensive_routing_mode option in the request, it MUST attempt to use SRR to return an "Error_Unknown_Extension" response (defined inSectionSections 6.3.3.1 andSection14.9 of[I-D.ietf-p2psip- base])[RFC6940]) to the sending peer. If the routing mode is DRR, the destination peer MUST construct the DestinationlistList for the response with only one entry, using thesendingrequesting peer's Node-ID from theoptionVia 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 inSectionSections 6.3.3.1 andSection14.9 of[I-D.ietf-p2psip-base])[RFC6940]) to the sending peer using SRR. After the peer constructs thedestination listDestination List for the response, it sends the response to the transportaddressaddress, which is indicated in the ipaddressport field in the option using the specific transport mode in theForwardingoption.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. 5.4.2. Sendingpeer: receivingPeer: Receiving aresponseResponse Upon receiving a response, the peer follows the rules in[I-D.ietf- p2psip-base].[RFC6940]. The peer SHOULD note if DRRworkedworked, in order to decideifwhether to offer DRR again. If the peer does not receive a response until thetimeouttimeout, it SHOULD resend the request using SRR. 6. Overlayconfiguration extensionConfiguration 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 CompactRelax NG GrammarRegular 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.ModeThe mode can be DRR or RPRandand, if specified in theconfigurationconfiguration, should be the preferred routing mode used by the application. 7. SecurityconsiderationsConsiderations The normative security recommendations of Section 13 ofbase 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 ofthe base draft[RFC6940], which describes routing security. For example, the DRR routing option providestheinformation about the route back to the source. According to Section 13.6 of [RFC6940], thebase draft the enterentire DRR routing message MUST be digitally signed and sent overbyvia a protected channel to protect the DRR routing information. 8. IANAconsiderationsConsiderations 8.1. AnewNew RELOADforwarding optionForwarding Option A new RELOAD Forwarding Option typeishas been added to the "RELOAD ForwardingOption RegistryOption" registry defined in[I-D.ietf-p2psip-base]. Type: 0x02 -[RFC6940]. Code: 2 Forwarding Option: extensive_routing_mode 8.2. AnewNew IETF XMLregistry This section requestsRegistry IANAto registerhas 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 9. Acknowledgments David Bryanhashelped extensively with thisdocument,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, MarcPetit-HugueninPetit-Huguenin, and Carlos Jesus Bernardos Cano for their constructive comments. 10. References 10.1. NormativereferencesReferences [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, January2004.2014. 10.2. InformativereferencesReferences [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 UsingSTUN", RFC5780,Session Traversal Utilities for NAT (STUN)", RFC 5780, May 2010.[I-D.ietf-p2psip-rpr] Zong, N., Jiang, X., Even, R. and Zhang, Y., "An extension to RELOAD to 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.,S. andK. Sekar,M. Krochmal, "NAT Port Mapping Protocol (NAT-PMP)",RFC6886,RFC 6886, April 2013.[RFC3424] Daigle, L., "IAB Considerations for UNilateral Self-Address Fixing (UNSAF) Across Network Address Translation", RFC3424, November 2002. 12. References[RFC7264] Zong, N., Jiang, X., Even, R., and Y. Zhang, "An Extension to the REsource LOcation And Discovery (RELOAD) Protocol to Support Relay Peer Routing", 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. OptionalmethodsMethods toinvestigate peer connectivityInvestigate Peer Connectivity This section is for informational purposes onlyfor providingand provides some mechanisms that can be used when the configuration information does not specify if DRR can be used. It summarizes some methodswhichthat can be usedforby 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 determineifwhether a peer ispublicallypublicly reachable, other than via out-of-band mechanisms. This document addressesthe UNSAFUNilateral Self-Address Fixing (UNSAF) [RFC3424]concernsconsiderations by specifying a fallback plan to SRR[p2psip-base-draft].[RFC6940]. SRR is not an UNSAF mechanism.TheThis 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, thepeerspeer should fall back to SRR. If the peer believes it ispublicallypublicly 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, thepeerspeer to which the address belongs can use DRR for responses. Some conditions that are unique in P2PSIP architecturewhichcould be leveraged to facilitate the tests. In a P2P overlay network, each peeronlyhaspartialonly a partial view of the wholenetwork,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 the addresses needed for further tests.ThenThen, a test for learning whether a peer may be publicly reachable is proposed. A.1. GettingaddressesAddresses tobe usedBe Used ascandidatesCandidates for DRR In order to test whether a peer may be publicly reachable, the peer should first get one or more addresseswhichthat will be used by other peers to send him messages directly. This address is either a local address of a peer or a translated addresswhichthat is assigned by a NAT to the peer.STUNSession 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.Discovery ofNAT 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 Bindingresponseresponse, 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 therelikelyis likely no NAT between it and the chosen infrastructureserverserver. (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 theend.).end.) Usually, these infrastructureseversservers are publicly reachable in the overlay, so the peer can be considered publicly reachable. On the other hand,withusing the techniques in [RFC5780], a peer can also decide whether it is behind a NAT with endpoint-independent mapping behavior. If the peer is behind a NAT withendpoint- independentendpoint-independent mapping behavior, the reflexive address should also be a candidate for further tests.UPnP-IGDThe Universal Plug and Play Internet Gateway Device (UPnP-IGD) [IGD2] is a mechanism that a peer can use to get the assigned address from its residentialgatewaygateway, and after obtaining this address to communicate it with other peers, the peer can receive unsolicited messages from outside, even though it is behind a NAT.SoSo, the address obtained through the UPnP mechanism should also be used for further tests. Another way that a peer behind NAT canuse tolearn its assigned address by NAT isNAT-PMPvia the NAT Port Mapping Protocol (NAT-PMP) [RFC6886].Like inAs with UPnP-IGD, the address obtained using this mechanism should also be tested further. The above techniques are not exhaustive. These techniques can be used to get candidate transport addresses for further tests. A.2. Publicreachability testReachability 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 ideaforof the test isforthat a peerto sendsends a request andexpectexpects another peer in the overlay to send back a response. If the response is successfully received by the sending peersuccessfullyandalsothe peer giving the response has no direct connection with the sending peer, the sending peer can determine that the address is probably publicly reachable and hence the peer may be publicly reachable at the tested transport address. In a P2P overlay, a request is routed through the overlay and finally a destination peer will terminate the request and give the response. In a large system, there is a high probability that the destination peer has no direct connection with the sending peer.Especially in RELOAD architecture, everyEvery peer maintains a connectiontable. Sotable, particularly in the RELOAD architecture, so it is easier for a peer tochecksee whether it has direct connection with another peer. If a peer wants to test whether its transport address is publicly reachable, it can send a request to the overlay. The routing for the test message would be different from other kinds of requests because it is not forstoring/fetchingstoring or fetching somethingto/fromto or from theoverlayoverlay, or for locating a specificpeer, insteadpeer; instead, it is to get a peer who can deliver to the sending peer an unsolicited response andwhichwho has no direct connection with him. Each intermediate peer receiving the request first checks to see whether it has a directconnectionsconnection with the sending peer. If there is a direct connection, the request is routed to the next peer. If there is no direct connection, the intermediate peer terminates the request and sends the response back directly to the sending peer with the transport address under test. After performing the test, if the peer determines that it may be publicly reachable, it can try DRR in subsequent transactions. Appendix B. Comparisonon costof Cost of SRR and DRR The majoradvantages inadvantage of using DRRare in going through lessis that it reduces the number of intermediate peersontraversed by the response.By doing that itThis reduces theload on those peers' resources likeload, such as processing and communicationbandwidth.bandwidth, on those peers' resources. B.1. Closed ormanaged networksManaged Networks As described in Section 3, many P2P systems run in a closed or managed environment (e.g., carriernetworks)networks), sothatnetwork administrators would know that they could safely use DRR. SRRbrings outuses more routing hops than DRR. Assuming that there are N peers in the P2P system and Chord [Chord] [wikiChord] is applied for routing, the number of hops for a response in SRR and in DRR are listed in the following table. Establishing a secure connection between the sending peer and the responding peer with(D)TLSTransport 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.,direct response routingDRR where (D)TLS is heavy for temporary connections. Therefore, in the followingtable,table we show the casesof:of 1) no (D)TLS inDRR;DRR and 2) still using DTLS in DRR as sub-optimal. As the worst-cost case,7seven (7) messages are used duringtheDTLS handshaking [DTLS].(TLS Handshake(The TLS handshake is atwo round-tripnegotiation protocol that requires two (2) round trips, while the DTLS handshake is athree round-tripnegotiationprotocol.)protocol that requires three (3) round trips.) Mode | Success | No. of Hops | No. of Msgs---------------------------------------------------------------------------------------------------- SRR | Yes | log(N) | log(N) DRR | Yes | 1 | 1DRR(DTLS)DRR (DTLS) | Yes | 1 | 7+1 Table1.1: Comparison of SRR and DRR inclosed networksClosed Networks From the above comparison, it is clear that: 1) In most cases whenNthe 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 an important consideration for adopting DRR in the cases wherethe resourcessuch resources 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 thanSRR). SoSRR), so the considerationonof whetherusingto use DRR or SRR depends on other factorslikesuch as using less resources (bandwidth and processing) from the intermediate peers. Section 4 provides use cases where DRR has a better chanceto workof working or where the considerations of intermediary resourcesconsiderationsare important. B.2. OpennetworksNetworks In open networks (e.g., the 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 as those listed inSection 5.1,Appendix B.1, the number of hops, as well as the number of messages for a response in SRR andDRRDRR, are listed in the followingtable.table: Mode | Success | No. of Hops | No. of Msgs--------------------------------------------------------------------------------------------------------------------------- SRR | Yes | log(N) | log(N) DRR | Yes | 1 | 1 |Fail&FallFail & fall back to SRR |1+log(N)|1+log(N)DRR(DTLS)| 1+log(N) DRR (DTLS) | Yes | 1 | 7+1 |Fail&FallFail & fall back to SRR |1+log(N)|1+log(N) | 8+log(N) Table2.2: Comparison of SRR and DRR inopen networksOpen 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 publiclyreachable,reachable; the number of hops in DRR and SRR isP*1+(N-P)*(1+logN),P*1+(N-P)*(1+logN) and 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 peersN(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 SRRbecomes betterimproves as the scale of the network increases. Authors' Addresses Ning Zong(editor)Huawei TechnologiesEmail:EMail: zongning@huawei.com Xingfeng Jiang Huawei TechnologiesEmail:EMail: jiang.x.f@huawei.com Roni Even Huawei TechnologiesEmail:EMail: roni.even@mail01.huawei.com Yunfei Zhang CoolPadEmail:/ China Mobile EMail: hishigh@gmail.com