idnits 2.17.1 draft-ietf-p2psip-service-discovery-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 3 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 312 has weird spacing: '...ExtType type...' -- The document date (August 05, 2013) is 3911 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 279 -- Looks like a reference, but probably isn't: '7' on line 279 -- Looks like a reference, but probably isn't: '8' on line 279 -- Looks like a reference, but probably isn't: '15' on line 279 == Outdated reference: A later version (-09) exists of draft-ietf-p2psip-concepts-05 Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 P2PSIP Working Group J. Maenpaa 3 Internet-Draft G. Camarillo 4 Intended status: Standards Track Ericsson 5 Expires: February 06, 2014 August 05, 2013 7 Service Discovery Usage for REsource LOcation And Discovery (RELOAD) 8 draft-ietf-p2psip-service-discovery-09.txt 10 Abstract 12 REsource LOcation and Discovery (RELOAD) does not define a generic 13 service discovery mechanism as a part of the base protocol. This 14 document defines how the Recursive Distributed Rendezvous (ReDiR) 15 service discovery mechanism used in OpenDHT can be applied to RELOAD 16 overlays to provide a generic service discovery mechanism. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on February 06, 2014. 35 Copyright Notice 37 Copyright (c) 2013 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3. Introduction to ReDiR . . . . . . . . . . . . . . . . . . . . 4 55 4. Using ReDiR in a RELOAD Overlay Instance . . . . . . . . . . 7 56 4.1. Data Structure . . . . . . . . . . . . . . . . . . . . . 7 57 4.2. Selecting the Starting Level . . . . . . . . . . . . . . 8 58 4.3. Service Provider Registration . . . . . . . . . . . . . . 8 59 4.4. Refreshing Registrations . . . . . . . . . . . . . . . . 9 60 4.5. Service Lookups . . . . . . . . . . . . . . . . . . . . . 10 61 4.6. Removing Registrations . . . . . . . . . . . . . . . . . 11 62 5. Access Control Rules . . . . . . . . . . . . . . . . . . . . 11 63 6. REDIR Kind Definition . . . . . . . . . . . . . . . . . . . . 12 64 7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 12 65 7.1. Service Registration . . . . . . . . . . . . . . . . . . 13 66 7.2. Service Lookup . . . . . . . . . . . . . . . . . . . . . 14 67 8. Overlay Configuration Document Extension . . . . . . . . . . 15 68 9. Security Considerations . . . . . . . . . . . . . . . . . . . 15 69 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 70 10.1. Access Control Policies . . . . . . . . . . . . . . . . 15 71 10.2. Data Kind-ID . . . . . . . . . . . . . . . . . . . . . . 16 72 10.3. ReDiR Namespaces . . . . . . . . . . . . . . . . . . . . 16 73 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 16 74 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 75 12.1. Normative References . . . . . . . . . . . . . . . . . . 17 76 12.2. Informative References . . . . . . . . . . . . . . . . . 17 77 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 79 1. Introduction 81 REsource LOcation And Discovery (RELOAD) [I-D.ietf-p2psip-base] is a 82 peer-to-peer signaling protocol that can be used to maintain an 83 overlay network, and to store data in and retrieve data from the 84 overlay. Although RELOAD defines a Traversal Using Relays around 85 Network Address Translation (TURN) specific service discovery 86 mechanism, it does not define a generic service discovery mechanism 87 as a part of the base protocol. This document defines how the 88 Recursive Distributed Rendezvous (ReDiR) service discovery mechanism 89 [Redir] used in OpenDHT can be applied to RELOAD overlays. 91 In a Peer-to-Peer (P2P) overlay network such as a RELOAD Overlay 92 Instance, the peers forming the overlay share their resources in 93 order to provide the service the system has been designed to provide. 94 The peers in the overlay both provide services to other peers and 95 request services from other peers. Examples of possible services 96 peers in a RELOAD Overlay Instance can offer to each other include a 97 TURN relay service, a voice mail service, a gateway location service, 98 and a transcoding service. Typically, only a small subset of the 99 peers participating in the system are providers of a given service. 100 A peer that wishes to use a particular service faces the problem of 101 finding peers that are providing that service from the Overlay 102 Instance. 104 A naive way to perform service discovery is to store the Node-IDs of 105 all nodes providing a particular service under a well-known key k. 106 The limitation of this approach is that it scales linearly with the 107 number of nodes that provide the service. The problem is two-fold: 108 the node n that is responsible for service s identified by key k may 109 end up storing a large number of Node-IDs and most importantly, may 110 also become overloaded since all service lookup requests for service 111 s will need to be answered by node n. An efficient service discovery 112 mechanism does not overload the nodes storing pointers to service 113 providers. In addition, the mechanism must ensure that the load of 114 providing a given service is distributed evenly among the nodes 115 providing the service. 117 ReDiR implements service discovery by building a tree structure of 118 the service providers that provide a particular service. The tree 119 structure is stored into the RELOAD Overlay Instance using RELOAD 120 Store and Fetch requests. Each service provided in the Overlay 121 Instance has its own tree. The nodes in a ReDiR tree contain 122 pointers to service providers. During service discovery, a peer 123 wishing to use a given service fetches ReDiR tree nodes one-by-one 124 from the RELOAD Overlay Instance until it finds a service provider 125 responsible for its Node-ID. It has been proved that ReDiR can find 126 a service provider using only a constant number of Fetch operations 127 [Redir]. 129 2. Terminology 131 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 132 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 133 document are to be interpreted as described in RFC 2119 [RFC2119]. 135 This document uses the terminology and definitions from the Concepts 136 and Terminology for Peer to Peer SIP [I-D.ietf-p2psip-concepts] 137 draft. 139 DHT: Distributed Hash Tables (DHTs) are a class of decentralized 140 distributed systems that provide a lookup service similar to a 141 regular hash table. Given a key, any peer participating in the 142 system can retrieve the value associated with that key. The 143 responsibility for maintaining the mapping from keys to values is 144 distributed among the peers. 146 H(x): Refers to a hash function (e.g., SHA-1) calculated over the 147 value x. 149 I(lvl,k): An interval at level lvl in the ReDiR tree that encloses 150 key k. As an example, I(5,10) refers to an interval at level 5 in 151 the ReDiR tree within whose range key 10 falls. 153 n.id: Refers to the RELOAD Node-ID of node n. 155 Namespace: An arbitrary identifier that identifies a service 156 provided in the RELOAD Overlay Instance. Examples of potential 157 namespaces include "voice-mail" and "turn-relay". The namespace 158 is an UTF-8 text string. 160 numBitsInNodeId: Refers to the number of bits in a RELOAD Node-ID. 161 This value is used in the equations for calculating the ranges of 162 intervals that ReDiR tree nodes are responsible for. 164 ReDiR tree: A tree structure of the nodes that provide a particular 165 service. The nodes embed the ReDiR tree into the RELOAD Overlay 166 Instance using RELOAD Store and Fetch requests. Each tree node in 167 the ReDiR tree belongs to some level in the tree. The root node 168 of the ReDiR tree is located at level 0 of the ReDiR tree. The 169 child nodes of the root node are located at level 1. The children 170 of the tree nodes at level 1 are located at level 2, and so forth. 171 The ReDiR tree has a branching factor b. At every level lvl in the 172 ReDiR tree, there is room for a maximum of b^lvl tree nodes. Each 173 tree node in the ReDiR tree is uniquely identified by a pair 174 (lvl,j), where lvl is a level in the ReDiR tree and j is the 175 position of the tree node (from the left) at that level. 177 Successor: The successor of identifier k in namespace ns is the node 178 belonging to the namespace ns whose identifier most immediately 179 follows the identifier k. 181 3. Introduction to ReDiR 183 Recursive Distributed Rendezvous (ReDiR) [Redir] does not require new 184 functionality from the RELOAD base protocol. This is possible since 185 ReDiR interacts with the RELOAD Overlay Instance by simply storing 186 and fetching data, that is, using RELOAD Store and Fetch requests. 187 ReDiR creates a tree structure of the service providers of a 188 particular service and stores it into the RELOAD Overlay Instance 189 using the Store and Fetch requests. ReDiR service lookups require a 190 logarithmic number of Fetch operations. Further, if information from 191 past service lookups is used to determine the optimal level in the 192 ReDiR tree from which to start new service lookups, an average 193 service lookup can typically finish after a constant number of Fetch 194 operations assuming that Node-IDs are distributed uniformly at 195 random. 197 In ReDiR, each service provided in the overlay is identified by an 198 identifier, called the namespace. All service providers of a given 199 service store their information under the namespace of that service. 200 Peers wishing to use a service perform lookups within the namespace 201 of the service. The result of a ReDiR lookup for an identifier k in 202 namespace ns is a RedirServiceProvider structure (see Section 4.1) of 203 a service provider that belongs to ns and whose Node-ID is the 204 closest successor of identifier k in the namespace. 206 Each tree node in the ReDiR tree contains a dictionary of 207 RedirServiceProvider entries of peers providing a particular service. 208 Each tree node in the ReDiR tree also belongs to some level in the 209 tree. The root node of the ReDiR tree is located at level 0. The 210 child nodes of the root node are located at level 1 of the ReDiR 211 tree. The children of the tree nodes at level 1 are located at level 212 2, and so forth. The ReDiR tree has a branching factor, whose value 213 is determined by a new element in the RELOAD overlay configuration 214 document, called branching-factor. At every level lvl in the ReDiR 215 tree, there is room for a maximum of branching-factor^lvl tree nodes. 216 As an example, in a tree whose branching-factor is 2, the second 217 level can contain up to 4 tree nodes (note that a given level may 218 contain less than the maximum number of tree nodes since empty tree 219 nodes are not stored). Each tree node in the ReDiR tree is uniquely 220 identified by a pair (lvl,j), where lvl is a level in the ReDiR tree 221 and j is the position of the tree node (from the left) at that level. 222 As an example, the pair (2,3) identifies the 3rd tree node from the 223 left at level 2. 225 The ReDiR tree is stored into the RELOAD Overlay Instance tree node 226 by tree node, by storing the values of tree node (level,j) under a 227 key created by taking a hash over the concatenation of the namespace, 228 level, and j, that is, as H(namespace,level,j). As an example, the 229 root of the tree for a voice mail service is stored at H("voice- 230 mail",0,0). Each node (level,j) in the ReDiR tree contains b 231 intervals of the DHT's identifier space as follows: 233 [2^numBitsInNodeID*b^(-level)*(j+(b'/b)), 234 2^numBitsInNodeID*b^(-level)*(j+((b'+1)/b))), for 0<=b'; 314 opaque namespace<0..2^16-1>; 315 uint16 level; 316 uint16 node; 317 uint16 length; 319 select (type) { 320 /* This type may be extended */ 321 } extension; 323 } RedirServiceProvider; 325 The contents of the RedirServiceProvider Resource Record are as 326 follows: 328 The type of an extension to the RedirServiceProvider Resource 329 Record. Unknown types are allowed. 331 A list of IDs through which a message is to be routed to reach the 332 service provider. The destination list consists of a sequence of 333 Destination values. The contents of the Destination structure are 334 as defined in RELOAD base [I-D.ietf-p2psip-base]. 336 An opaque UTF-8 encoded string containing the namespace. 338 The level in the ReDiR tree. 340 The position of the node storing this RedirServiceProvider record 341 at the current level in the ReDiR tree. 343 The length of the rest of the Resource Record. 345 An extension value. The RedirServiceProvider Resource Record can 346 be extended to include for instance service or service provider 347 specific information. 349 4.2. Selecting the Starting Level 351 Before registering as a service provider or performing a service 352 lookup, a peer needs to determine the starting level Lstart for the 353 registration or lookup operation in the ReDiR tree. It is 354 RECOMMENDED that Lstart is set to 2. In subsequent registrations, 355 Lstart MAY, as an optimization, be set to the lowest level at which a 356 registration operation has last completed. 358 In the case of subsequent service lookups, nodes MAY, as an 359 optimization, record the levels at which the last 16 service lookups 360 completed and take Lstart to be the mode of those depths. 362 4.3. Service Provider Registration 364 A node MUST use the following procedure to register as a service 365 provider in the RELOAD Overlay Instance: 367 1. A node n with Node-ID n.id wishing to register as a service 368 provider starts from a starting level Lstart (see Section 4.2 for 369 the details on selecting the starting level). Therefore, node n 370 sets the current level to level=Lstart. 372 2. Node n MUST send a RELOAD Fetch request to fetch the contents of 373 the tree node responsible for I(level,n.id). An interval I(l,k) 374 is the interval at level l in the ReDiR tree that includes key k. 375 The fetch MUST be a wildcard fetch. 377 3. Node n MUST send a RELOAD Store request to add its 378 RedirServiceProvider entry to the dictionary stored in the tree 379 node responsible for I(level,n.id). Note that node n always 380 stores its RedirServiceProvider entry, regardless of the contents 381 of the dictionary. 383 4. If node n's Node-ID (n.id) is the lowest or highest Node-ID 384 stored in the tree node responsible for I(Lstart,n.id), node n 385 MUST reduce the current level by one (i.e., set level=level-1) 386 and continue up the ReDiR tree towards the root level (level 0), 387 repeating the steps 2 and 3 above. Node n MUST continue in this 388 way until it reaches either the root of the tree or a level at 389 which n.id is not the lowest or highest Node-ID in the interval 390 I(level,n.id). 392 5. Node n MUST also perform a downward walk in the ReDiR tree, 393 during which it goes through the tree nodes responsible for 394 intervals I(Lstart,n.id), I(Lstart+1,n.id), I(Lstart+2,n.id), 395 etc. At each step, node n MUST fetch the responsible tree node, 396 and store its RedirServiceProvider record in that tree node if 397 n.id is the lowest or highest Node-ID in its interval. Node n 398 MUST end this downward walk as soon as it reaches a level l at 399 which it is the only service provider in its interval I(l,n.id). 401 Note that above, when we refer to 'the tree node responsible for 402 I(l,k)', we mean the entire tree node (that is, all the intervals 403 within the tree node) responsible for interval I(l,k). In contrast, 404 I(l,k) refers to a specific interval within a tree node. 406 4.4. Refreshing Registrations 408 All state in the ReDiR tree is soft. Therefore, a service provider 409 needs to periodically repeat the registration process to refresh its 410 RedirServiceProvider Resource Record. If a record expires, it MUST 411 be dropped from the dictionary by the peer storing the tree node. 412 Deciding an appropriate lifetime for the RedirServiceProvider 413 Resource Records is up to each service provider. Every service 414 provider MUST repeat the entire registration process periodically 415 until it leaves the RELOAD Overlay Instance. 417 Note that no new mechanisms are needed to keep track of the remaining 418 lifetime of RedirServiceProvider records. The 'storage_time' and 419 'lifetime' fields of RELOAD's StoredData structure can be used for 420 this purpose in the usual way. 422 4.5. Service Lookups 424 The purpose of a service lookup for identifier k in namespace ns is 425 to find the node that is a part of ns and whose identifier most 426 immediately follows (i.e., is the closest successor of) the 427 identifier k. 429 A service lookup operation resembles the service registration 430 operation described in Section 4.3. Service lookups start from a 431 given starting level level=Lstart in the ReDiR tree (see Section 4.2 432 for the details on selecting the starting level). At each step, a 433 node n wishing to discover a service provider MUST fetch the tree 434 node responsible for the interval I(level,n.id) that encloses the 435 search key n.id at the current level using a RELOAD Fetch request. 436 Having fetched the tree node, node n MUST determine the next action 437 to carry out as follows: 439 1. If there is no successor of node n present in the just fetched 440 ReDiR tree node (note: within the entire tree and not only within 441 the current interval) responsible for I(level,n.id), then the 442 successor of node n must be present in a larger segment of the 443 identifier space (i.e., further up in the ReDiR tree where each 444 interval and tree node covers a larger range of the identifier 445 space). Therefore, node n MUST reduce the current level by one 446 to level=level-1 and carry out a new Fetch operation for the tree 447 node responsible for n.id at that level. The fetched tree node 448 is then analyzed and the next action determined by checking 449 conditions 1-3. 451 2. If n.id is neither the lowest nor the highest Node-ID within the 452 interval (note: within the interval, not within the entire tree 453 node) I(level,n.id), n MUST next check the tree node responsible 454 for n.id at the next level down the tree. Thus, node n MUST 455 increase the level by one to level=level+1 and carry out a new 456 Fetch operation at that level. The fetched tree node is then 457 analyzed and the next action determined by checking conditions 458 1-3. 460 3. If neither of the conditions above holds, meaning that there is a 461 successor s of n.id present in the just fetched ReDiR tree node 462 and n.id is the highest or lowest Node-ID in its interval, the 463 service lookup has finished successfully and s must be the 464 closest successor of n.id in the ReDiR tree. 466 Note that above, when we refer to 'the tree node responsible for 467 interval I(l,k)', we mean the entire tree node (that is, all the 468 intervals within the tree node) responsible for interval I(l,k). In 469 contrast, I(l,k) refers to a specific interval within a tree node. 471 Note also that there may be some cases in which no successor can be 472 found from the ReDiR tree. An example is a situation in which all of 473 the service providers stored in the ReDiR tree have a Node-ID smaller 474 than identifier k. In this case, the upward walk of the service 475 lookup will reach the root of the tree without encountering a 476 successor. An appropriate strategy in this case is to pick one of 477 the RedirServiceProvider entries stored in the dictionary of the root 478 node at random. 480 Since RedirServiceProvider records are expiring and registrations are 481 being refreshed periodically, there can be certain rare situations in 482 which a service lookup may fail even if there is a valid successor 483 present in the ReDiR tree. An example is a case in which a ReDiR 484 tree node is fetched just after a RedirServiceProvider entry of the 485 only successor of k present in the tree node has expired and just 486 before a Store request that has been sent to refresh the entry 487 reaches the peer storing the tree node. In this rather unlikely 488 scenario, the successor that should have been present in the tree 489 node is temporarily missing. Thus, the service lookup will fail and 490 needs to be carried out again. 492 To recover from the kinds of situations described above, a ReDiR 493 implementation MAY choose to use the optimization described next. 494 The ReDiR implementation MAY implement a local temporary cache that 495 is maintained for the duration of a service lookup operation in a 496 RELOAD node. The temporary cache is used to store all 497 RedirServiceProvider entries that have been fetched during the upward 498 and downward walks of a service lookup operation. Should it happen 499 that a service lookup operation fails due to the downward walk 500 reaching a level that does not contain a successor, the cache is 501 searched for successors of the search key. If there are successors 502 present in the cache, the closest one of them is selected as the 503 service provider. 505 4.6. Removing Registrations 507 Before leaving the RELOAD Overlay Instance, a service provider MUST 508 remove the RedirServiceProvider records it has stored by storing 509 exists=False values in their place, as described in 510 [I-D.ietf-p2psip-base]. 512 5. Access Control Rules 513 As specified in RELOAD base [I-D.ietf-p2psip-base], every kind which 514 is storable in an overlay must be associated with an access control 515 policy. This policy defines whether a request from a given node to 516 operate on a given value should succeed or fail. Usages can define 517 any access control rules they choose, including publicly writable 518 values. 520 ReDiR requires an access control policy that allows multiple nodes in 521 the overlay read and write access to the ReDiR tree nodes stored in 522 the overlay. Therefore, none of the access control policies 523 specified in RELOAD base [I-D.ietf-p2psip-base] is sufficient. 525 This document defines a new access control policy, called NODE-ID- 526 MATCH. In this policy, a given value MUST be written and overwritten 527 only if the the request is signed with a key associated with a 528 certificate whose Node-ID is equal to the dictionary key. In 529 addition, provided that exists=TRUE, the Node-ID MUST belong to one 530 of the intervals associated with the tree node (the number of 531 intervals each tree node has is determined by the branching-factor 532 parameter). Finally, provided that exists=TRUE, 533 H(namespace,level,node), where namespace, level, and node are taken 534 from the RedirServiceProvider structure being stored, MUST be equal 535 to the Resource-ID for the resource. The NODE-ID-MATCH policy may 536 only be used with dictionary types. 538 6. REDIR Kind Definition 540 This section defines the REDIR kind. 542 REDIR 544 The Resource Name for the REDIR Kind-ID is created by 545 concatenating three pieces of information: namespace, level, and 546 node number. Namespace is an opaque UTF-8 encoded string 547 identifying a service, such as "turn-server". Level is an integer 548 specifying a level in the ReDiR tree. Node number is an integer 549 identifying a ReDiR tree node at a specific level. The data 550 stored is a RedirServiceProvider structure that was defined in 551 Section 4.1. 553 The data model for the REDIR Kind-ID is dictionary. The 554 dictionary key is the Node-ID of the service provider. 556 The access control policy for the REDIR kind is the NODE-ID-MATCH 557 policy that was defined in Section 5. 559 7. Examples 560 7.1. Service Registration 562 Figure 4 shows an example of a ReDiR tree containing information 563 about four different service providers whose Node-IDs are 2, 3, 4, 564 and 7. In the example, numBitsInNodeID=4. Initially, the ReDiR tree 565 is empty; Figure 4 shows the state of the tree at the point when all 566 the service providers have registered. 568 Level 0 ____2_3___4_____7_|__________________ 569 | | 570 Level 1 ____2_3_|_4_____7 ________|________ 571 | | | | 572 Level 2 ___|2_3 4__|__7 ___|___ ___|___ 573 | | | | | | | | 574 Level 3 _|_ _|3 _|_ _|_ _|_ _|_ _|_ _|_ 576 Figure 4: Example of a ReDiR tree 578 First, peer 2 whose Node-ID is 2 joins the namespace. Since this is 579 the first registration peer 2 performs, peer 2 sets the starting 580 level Lstart to 2, as was described in Section 4.2. Also all other 581 peers in this example will start from level 2. First, peer 2 fetches 582 the contents of the tree node associated with interval I(2,2) from 583 the RELOAD Overlay Instance. This tree node is the first tree node 584 from the left at Level 2 since key 2 is associated with the second 585 interval of the first tree node. Peer 2 also stores its 586 RedirServiceProvider record in that tree node. Since peer 2's Node- 587 ID is the only Node-ID stored in the tree node (i.e., peer 2's Node- 588 ID fulfills the condition in Section 4.3 that it is the numerically 589 lowest or highest among the keys stored in the node), peer 2 590 continues up the tree. In fact, peer 2 continues up in the tree all 591 the way to the root inserting its own Node-ID in all levels since the 592 tree is empty (which means that peer 2's Node-ID always fulfills the 593 condition that it is the numerically lowest or highest Node-ID in the 594 interval I(level, 2) during the upward walk). As described in 595 Section 4.3, peer 2 also walks down the tree. The downward walk peer 596 2 does ends at level 2 since peer 2 is the only node in its interval 597 at that level. 599 The next peer to join the namespace is peer 3, whose Node-ID is 3. 600 Peer 3 starts from level 2. At that level, peer 3 stores its 601 RedirServiceProvider entry in the same interval I(2,3) that already 602 contains the RedirServiceProvider entry of peer 2. Interval I(2,3), 603 that is, the interval at Level 2 enclosing key 3, is associated with 604 the right hand side interval of the first tree node. Since peer 3 605 has the numerically highest Node-ID in the tree node associated with 606 I(2,3), peer 3 continues up the tree. Peer 3 stores its 607 RedirServiceProvider record also at levels 1 and 0 since its Node-ID 608 is numerically highest among the Node-IDs stored in the intervals to 609 which its own Node-ID belongs. Peer 3 also does a downward walk 610 which starts from level 2 (i.e., the starting level). Since peer 3 611 is not the only node in interval I(2,3), it continues down the tree 612 to level 3. The downward walk ends at this level since peer 3 is the 613 only service provider in the interval I(3,3). 615 The third peer to join the namespace is peer 7, whose Node-ID is 7. 616 Like the two earlier peers, also peer 7 starts from level 2 because 617 this is the first registration it performs. Peer 7 stores its 618 RedirServiceProvider record at level 2. At level 1, peer 7 has the 619 numerically highest (and lowest) Node-ID in its interval I(1,7) 620 (because it is the only node in interval I(1,7); peers 2 and 3 are 621 stored in the same tree node but in a different interval) and 622 therefore it stores its Node-ID in the tree node associated with that 623 interval. Peer 7 also has the numerically highest Node-ID in the 624 interval I(0,7) associated with its Node-ID at level 0. Finally, 625 peer 7 performs a downward walk, which ends at level 2 because peer 7 626 is the only node in its interval at that level. 628 The final peer to join the ReDiR tree is peer 4, whose Node-ID is 4. 629 Peer 4 starts by storing its RedirServiceProvider record at level 2. 630 Since it has the numerically lowest Node-ID in the tree node 631 associated with interval I(2,4), it continues up in the tree to level 632 1. At level 1, peer 4 stores its record in the tree node associated 633 with interval I(1,4) because it has the numerically lowest Node-ID in 634 that interval. Next, peer 4 continues to the root level, at which it 635 stores its RedirServiceProvider record and finishes the upward walk 636 since the root level was reached. Peer 4 also does a downward walk 637 starting from level 2. The downward walk stops at level 2 because 638 peer 4 is the only peer in the interval I(2,4). 640 7.2. Service Lookup 642 This subsection gives an example of peer 5 whose Node-ID is 5 643 performing a service lookup operation in the ReDiR tree shown in 644 Figure 4. This is the first service lookup peer 5 carries out and 645 thus the service lookup starts from the default starting level 2. As 646 the first action, peer 5 fetches the tree node corresponding to the 647 interval I(2,5) from the starting level. This interval maps to the 648 second tree node from the left at level 2 since that tree node is 649 responsible for the interval (third interval from left) to which 650 Node-ID 5 falls at level 2. Having fetched the tree node, peer 5 651 checks its contents. First, there is a successor, peer 7, present in 652 the tree node. Therefore, condition 1 of Section 4.5 is false and 653 there is no need to perform an upward walk. Second, Node-ID 5 is the 654 highest Node-ID in its interval, so condition 2 of Section 4.5 is 655 also false and there is no need to perform a downward walk. Thus, 656 the service lookup finishes at level 2 since Node-ID 7 is the closest 657 successor of peer 5. 659 Note that the service lookup procedure would be slightly different if 660 peer 5 used level 3 as the starting level. Peer 5 might use this 661 starting level for instance if it has already carried out service 662 lookups in the past and follows the heuristic in Section 4.2 to 663 select the starting level. In this case, peer 5's first action is to 664 fetch the tree node at level 3 that is responsible for I(3,5). Thus, 665 peer 5 fetches the third tree node from the left. Since this tree 666 node is empty, peer 5 decreases the current level by one to 2 and 667 thus continues up in the tree. The next action peer 5 performs is 668 identical to the single action in the previous example of fetching 669 the node associated with I(2,5) from level 2. Thus, the service 670 lookup finishes at level 2. 672 8. Overlay Configuration Document Extension 674 This document extends the RELOAD overlay configuration document by 675 adding a new element "branching-factor" inside the new "REDIR" kind 676 element: 678 redir:branching-factor: The branching factor of the ReDir tree. The 679 default value is 10. 681 This new element is formally defined as follows: 683 namespace redir = "urn:ietf:params:xml:ns:p2p:service-discovery" 685 parameter &= element redir:branching-factor { xsd:unsignedInt } 687 The 'redir' namespace is added into the element 688 in the overlay configuration file. 690 9. Security Considerations 692 There are no new security considerations introduced in this document. 693 The security considerations of RELOAD [I-D.ietf-p2psip-base] apply. 695 10. IANA Considerations 697 10.1. Access Control Policies 699 This document introduces one additional access control policy to the 700 "RELOAD Access Control Policy" Registry: 702 NODE-ID-MATCH 704 This access control policy was described in Section 5. 706 10.2. Data Kind-ID 708 This document introduces one additional data Kind-ID to the "RELOAD 709 Data Kind-ID" Registry: 711 +--------------+------------+----------+ 712 | Kind | Kind-ID | RFC | 713 +--------------+------------+----------+ 714 | REDIR | 104 | RFC-AAAA | 715 +--------------+------------+----------+ 717 This Kind-ID was defined in Section 6. 719 Note to RFC Editor: please replace AAAA with the RFC number for this 720 specification. 722 10.3. ReDiR Namespaces 724 IANA SHALL create a "ReDiR Namespaces" Registry. Entries in this 725 registry are strings denoting ReDiR namespace values. The initial 726 contents of this registry are: 728 +----------------+----------+ 729 | Namespace | RFC | 730 +----------------+----------+ 731 | turn-server | RFC-AAAA | 732 +----------------+----------+ 734 The namespace 'turn-server' is used by nodes that wish to register as 735 providers of a TURN relay service in the RELOAD overlay and by nodes 736 that wish to discover providers of a TURN relay service from the 737 RELOAD overlay. 739 Note to RFC Editor: please replace AAAA with the RFC number for this 740 specification. 742 11. Acknowledgments 743 The authors would like to thank Marc Petit-Huguenin and Joscha 744 Schneider for their comments on the draft. 746 12. References 748 12.1. Normative References 750 [I-D.ietf-p2psip-base] 751 Jennings, C., Lowekamp, B., Rescorla, E., Baset, S., and 752 H. Schulzrinne, "REsource LOcation And Discovery (RELOAD) 753 Base Protocol", draft-ietf-p2psip-base-26 (work in 754 progress), February 2013. 756 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 757 Requirement Levels ", BCP 14, RFC 2119, March 1997. 759 12.2. Informative References 761 [I-D.ietf-p2psip-concepts] 762 Bryan, D., Matthews, P., Shim, E., Willis, D., and S. 763 Dawkins, "Concepts and Terminology for Peer to Peer SIP", 764 draft-ietf-p2psip-concepts-05 (work in progress), July 765 2013. 767 [Redir] Rhea, S., Godfrey, P., Karp, B., Kubiatowicz, J., 768 Ratnasamy, S., Shenker, S., Stoica, I., and H. Yu, "Open 769 DHT: A Public DHT Service and Its Uses", October 2005. 771 Authors' Addresses 773 Jouni Maenpaa 774 Ericsson 775 Hirsalantie 11 776 Jorvas 02420 777 Finland 779 Email: Jouni.Maenpaa@ericsson.com 781 Gonzalo Camarillo 782 Ericsson 783 Hirsalantie 11 784 Jorvas 02420 785 Finland 787 Email: Gonzalo.Camarillo@ericsson.com