idnits 2.17.1 draft-ietf-p2psip-reload-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 21. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 5858. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 5869. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 5876. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 5882. 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 : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 1926 has weird spacing: '...Options optio...' == Line 2355 has weird spacing: '...tyValue ide...' == Line 2996 has weird spacing: '...ionType typ...' == Line 3528 has weird spacing: '...naryKey key...' == Line 3963 has weird spacing: '...ionType type...' == (1 more instance...) == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: flags Three flags are defined FORWARD_CRITICAL(0x01), DESTINATION_CRITICAL(0x02), and RESPONSE_COPY(0x04). These flags MUST not be set in a response. If the FORWARD_CRITICAL flag is set, any node that would forward the message but does not understand this options MUST reject the request with an 757 error resonse. If the DESTINATION_CRITICAL flag is set, any node generates a response to the message but does not understand the forwarding option MUST reject the request with an 757 error resonse. If the RESPONSE_COPY flag is set, any node generating a response MUST copy the option from the request to the response and clear the RESPONSE_COPY, FORWARD_CRITICAL and DESTINATION_CRITICAL flags. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: If peer N which is responsible for a resource-id R discovers that the replica set for R (the next two nodes in its successor set) has changed, it MUST send a Store for any data associated with R to any new node in the replica set. It SHOULD not delete data from peers which have left the replica set. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 11, 2008) is 5739 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: '16' on line 1827 == Missing Reference: 'REF' is mentioned on line 5546, but not defined == Unused Reference: 'I-D.cheshire-dnsext-multicastdns' is defined on line 5695, but no explicit reference was found in the text == Unused Reference: 'I-D.camarillo-hip-bone' is defined on line 5715, but no explicit reference was found in the text == Unused Reference: 'I-D.zheng-p2psip-diagnose' is defined on line 5772, but no explicit reference was found in the text == Unused Reference: 'I-D.song-p2psip-security-eval' is defined on line 5777, but no explicit reference was found in the text == Unused Reference: 'I-D.matthews-p2psip-id-loc' is defined on line 5783, but no explicit reference was found in the text == Unused Reference: 'I-D.zheng-p2psip-client-protocol' is defined on line 5788, but no explicit reference was found in the text == Unused Reference: 'I-D.hardie-p2poverlay-pointers' is defined on line 5793, but no explicit reference was found in the text == Outdated reference: A later version (-19) exists of draft-ietf-mmusic-ice-16 == Outdated reference: A later version (-18) exists of draft-ietf-behave-rfc3489bis-06 == Outdated reference: A later version (-16) exists of draft-ietf-behave-turn-03 == Outdated reference: A later version (-08) exists of draft-ietf-pkix-cmc-trans-05 == Outdated reference: A later version (-07) exists of draft-ietf-pkix-2797-bis-04 ** Downref: Normative reference to an Informational draft: draft-ietf-tls-srp (ref. 'I-D.ietf-tls-srp') == Outdated reference: A later version (-16) exists of draft-ietf-mmusic-ice-tcp-03 ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) ** Downref: Normative reference to an Experimental RFC: RFC 4828 == Outdated reference: A later version (-08) exists of draft-ietf-behave-tcp-07 == Outdated reference: A later version (-09) exists of draft-ietf-p2psip-concepts-00 -- Obsolete informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 3280 (Obsoleted by RFC 5280) == Outdated reference: A later version (-15) exists of draft-cheshire-dnsext-multicastdns-06 == Outdated reference: A later version (-11) exists of draft-cheshire-dnsext-dns-sd-04 == Outdated reference: A later version (-01) exists of draft-camarillo-hip-bone-00 == Outdated reference: A later version (-04) exists of draft-zheng-p2psip-diagnose-02 Summary: 4 errors (**), 0 flaws (~~), 29 warnings (==), 12 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 P2PSIP C. Jennings 3 Internet-Draft Cisco 4 Intended status: Standards Track B. Lowekamp 5 Expires: January 12, 2009 SIPeerior Technologies 6 E. Rescorla 7 Network Resonance 8 S. Baset 9 H. Schulzrinne 10 Columbia University 11 July 11, 2008 13 REsource LOcation And Discovery (RELOAD) 14 draft-ietf-p2psip-reload-00 16 Status of this Memo 18 By submitting this Internet-Draft, each author represents that any 19 applicable patent or other IPR claims of which he or she is aware 20 have been or will be disclosed, and any of which he or she becomes 21 aware will be disclosed, in accordance with Section 6 of BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF), its areas, and its working groups. Note that 25 other groups may also distribute working documents as Internet- 26 Drafts. 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 The list of current Internet-Drafts can be accessed at 34 http://www.ietf.org/ietf/1id-abstracts.txt. 36 The list of Internet-Draft Shadow Directories can be accessed at 37 http://www.ietf.org/shadow.html. 39 This Internet-Draft will expire on January 12, 2009. 41 Copyright Notice 43 Copyright (C) The IETF Trust (2008). 45 Abstract 47 This document defines REsource LOcation And Discovery (RELOAD), a 48 peer-to-peer (P2P) signaling protocol for use on the Internet. A P2P 49 signaling protocol provides its clients with an abstract storage and 50 messaging service between a set of cooperating peers that form the 51 overlay network. RELOAD is designed to support a P2P Session 52 Initiation Protocol (P2PSIP) network, but can be utilized by other 53 applications with similar requirements by defining new usages that 54 specify the kinds of data that must be stored for a particular 55 application. RELOAD defines a security model based on a certificate 56 enrollment service that provides unique identities. NAT traversal is 57 a fundamental service of the protocol. RELOAD also allows access 58 from "client" nodes which do not need to route traffic or store data 59 for others. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 64 1.1. Basic Setting . . . . . . . . . . . . . . . . . . . . . 7 65 1.2. Architecture . . . . . . . . . . . . . . . . . . . . . . 8 66 1.2.1. Usage Layer . . . . . . . . . . . . . . . . . . . . 10 67 1.2.2. Routing Layer . . . . . . . . . . . . . . . . . . . 10 68 1.2.3. Storage . . . . . . . . . . . . . . . . . . . . . . 11 69 1.2.4. Topology Plugin . . . . . . . . . . . . . . . . . . 11 70 1.2.5. Forwarding Layer . . . . . . . . . . . . . . . . . . 12 71 1.3. SIP Usage . . . . . . . . . . . . . . . . . . . . . . . 12 72 1.4. Security . . . . . . . . . . . . . . . . . . . . . . . . 13 73 1.5. Structure of This Document . . . . . . . . . . . . . . . 13 74 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 14 75 3. Overlay Management Overview . . . . . . . . . . . . . . . . . 16 76 3.1. Security and Identification . . . . . . . . . . . . . . 16 77 3.1.1. Shared-Key Security . . . . . . . . . . . . . . . . 17 78 3.2. Clients . . . . . . . . . . . . . . . . . . . . . . . . 17 79 3.2.1. Client Routing . . . . . . . . . . . . . . . . . . . 18 80 3.2.2. Client Behavior . . . . . . . . . . . . . . . . . . 18 81 3.2.2.1. Why Not Only Peers? . . . . . . . . . . . . . . . 18 82 3.2.2.2. Minimum Functionality Requirements for Clients . 19 83 3.2.2.3. Clients as Application-Level Agents . . . . . . . 20 84 3.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . 20 85 3.3.1. Routing Alternatives . . . . . . . . . . . . . . . . 22 86 3.3.1.1. Iterative vs Recursive . . . . . . . . . . . . . 23 87 3.3.1.2. Symmetric vs Forward response . . . . . . . . . . 23 88 3.3.1.3. Direct Response . . . . . . . . . . . . . . . . . 23 89 3.3.1.4. Relay Peers . . . . . . . . . . . . . . . . . . . 24 90 3.3.1.5. Symmetric Route Stability . . . . . . . . . . . . 25 91 3.4. Connectivity Management . . . . . . . . . . . . . . . . 26 92 3.5. Overlay Algorithm Support . . . . . . . . . . . . . . . 26 93 3.5.1. Support for Pluggable Overlay Algorithms . . . . . . 27 94 3.5.2. Joining, Leaving, and Maintenance Overview . . . . . 27 95 3.6. First-Time Setup . . . . . . . . . . . . . . . . . . . . 28 96 3.6.1. Initial Configuration . . . . . . . . . . . . . . . 28 97 3.6.2. Enrollment . . . . . . . . . . . . . . . . . . . . . 29 98 4. Application Support Overview . . . . . . . . . . . . . . . . 29 99 4.1. Data Storage . . . . . . . . . . . . . . . . . . . . . . 29 100 4.1.1. Storage Permissions . . . . . . . . . . . . . . . . 31 101 4.1.2. Usages . . . . . . . . . . . . . . . . . . . . . . . 31 102 4.1.3. Replication . . . . . . . . . . . . . . . . . . . . 32 103 4.2. Service Discovery . . . . . . . . . . . . . . . . . . . 33 104 4.3. Application Connectivity . . . . . . . . . . . . . . . . 33 105 5. P2PSIP Integration Overview . . . . . . . . . . . . . . . . . 33 106 6. Overlay Management Protocol . . . . . . . . . . . . . . . . . 34 107 6.1. Message Routing . . . . . . . . . . . . . . . . . . . . 35 108 6.1.1. Request Origination . . . . . . . . . . . . . . . . 35 109 6.1.2. Message Receipt and Forwarding . . . . . . . . . . . 36 110 6.1.2.1. Responsible ID . . . . . . . . . . . . . . . . . 36 111 6.1.2.2. Other ID . . . . . . . . . . . . . . . . . . . . 37 112 6.1.2.3. Private ID . . . . . . . . . . . . . . . . . . . 38 113 6.1.3. Response Origination . . . . . . . . . . . . . . . . 38 114 6.2. Message Structure . . . . . . . . . . . . . . . . . . . 38 115 6.2.1. Presentation Language . . . . . . . . . . . . . . . 39 116 6.2.1.1. Common Definitions . . . . . . . . . . . . . . . 40 117 6.2.2. Forwarding Header . . . . . . . . . . . . . . . . . 42 118 6.2.2.1. Destination and Via Lists . . . . . . . . . . . . 44 119 6.2.2.2. Route Logging . . . . . . . . . . . . . . . . . . 46 120 6.2.2.3. Forwarding Options . . . . . . . . . . . . . . . 48 121 6.2.3. Message Contents Format . . . . . . . . . . . . . . 49 122 6.2.3.1. Response Codes and Response Errors . . . . . . . 50 123 6.2.4. Signature . . . . . . . . . . . . . . . . . . . . . 51 124 6.3. Overlay Topology . . . . . . . . . . . . . . . . . . . . 53 125 6.3.1. Topology Plugin Requirements . . . . . . . . . . . . 53 126 6.3.2. Methods and types for use by topology plugins . . . 54 127 6.3.2.1. Join . . . . . . . . . . . . . . . . . . . . . . 54 128 6.3.2.2. Leave . . . . . . . . . . . . . . . . . . . . . . 54 129 6.3.2.3. Update . . . . . . . . . . . . . . . . . . . . . 55 130 6.3.2.4. Route_Query . . . . . . . . . . . . . . . . . . . 55 131 6.4. Forwarding Layer . . . . . . . . . . . . . . . . . . . . 56 132 6.4.1. Transports . . . . . . . . . . . . . . . . . . . . . 56 133 6.4.1.1. Future Support for HIP . . . . . . . . . . . . . 57 134 6.4.1.2. Reliability for Unreliable Transports . . . . . . 57 135 6.4.1.3. Fragmentation and Reassembly . . . . . . . . . . 59 136 6.4.2. Connection Management Methods . . . . . . . . . . . 59 137 6.4.2.1. Attach . . . . . . . . . . . . . . . . . . . . . 60 138 6.4.2.2. Ping . . . . . . . . . . . . . . . . . . . . . . 65 139 6.4.2.3. Tunnel . . . . . . . . . . . . . . . . . . . . . 67 140 7. Data Storage Protocol . . . . . . . . . . . . . . . . . . . . 69 141 7.1. Data Signature Computation . . . . . . . . . . . . . . . 70 142 7.2. Data Models . . . . . . . . . . . . . . . . . . . . . . 71 143 7.2.1. Single Value . . . . . . . . . . . . . . . . . . . . 71 144 7.2.2. Array . . . . . . . . . . . . . . . . . . . . . . . 72 145 7.2.3. Dictionary . . . . . . . . . . . . . . . . . . . . . 72 146 7.3. Data Storage Methods . . . . . . . . . . . . . . . . . . 73 147 7.3.1. Store . . . . . . . . . . . . . . . . . . . . . . . 73 148 7.3.1.1. Request Definition . . . . . . . . . . . . . . . 73 149 7.3.1.2. Response Definition . . . . . . . . . . . . . . . 77 150 7.3.2. Fetch . . . . . . . . . . . . . . . . . . . . . . . 78 151 7.3.2.1. Request Definition . . . . . . . . . . . . . . . 78 152 7.3.2.2. Response Definition . . . . . . . . . . . . . . . 80 153 7.3.3. Remove . . . . . . . . . . . . . . . . . . . . . . . 81 154 7.3.3.1. Single Value . . . . . . . . . . . . . . . . . . 82 155 7.3.3.2. Array . . . . . . . . . . . . . . . . . . . . . . 82 156 7.3.3.3. Dictionary . . . . . . . . . . . . . . . . . . . 82 157 7.3.3.4. Response Definition . . . . . . . . . . . . . . . 82 158 7.3.4. Find . . . . . . . . . . . . . . . . . . . . . . . . 82 159 7.3.4.1. Request Definition . . . . . . . . . . . . . . . 82 160 7.3.4.2. Response Definition . . . . . . . . . . . . . . . 83 161 7.3.4.3. Defining New Kinds . . . . . . . . . . . . . . . 84 162 8. Certificate Store Usage . . . . . . . . . . . . . . . . . . . 84 163 9. TURN Server Usage . . . . . . . . . . . . . . . . . . . . . . 85 164 10. SIP Usage . . . . . . . . . . . . . . . . . . . . . . . . . . 86 165 10.1. Registering AORs . . . . . . . . . . . . . . . . . . . . 87 166 10.2. Looking up an AOR . . . . . . . . . . . . . . . . . . . 89 167 10.3. Forming a Direct Connection . . . . . . . . . . . . . . 90 168 10.4. GRUUs . . . . . . . . . . . . . . . . . . . . . . . . . 90 169 10.5. SIP-REGISTRATION Kind Definition . . . . . . . . . . . . 90 170 11. Diagnostic Usage . . . . . . . . . . . . . . . . . . . . . . 91 171 11.1. Diagnostic Metrics for a P2PSIP Deployment . . . . . . . 93 172 12. Chord Algorithm . . . . . . . . . . . . . . . . . . . . . . . 93 173 12.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 93 174 12.2. Routing . . . . . . . . . . . . . . . . . . . . . . . . 94 175 12.3. Redundancy . . . . . . . . . . . . . . . . . . . . . . . 94 176 12.4. Joining . . . . . . . . . . . . . . . . . . . . . . . . 94 177 12.5. Routing Attaches . . . . . . . . . . . . . . . . . . . . 95 178 12.6. Updates . . . . . . . . . . . . . . . . . . . . . . . . 95 179 12.6.1. Sending Updates . . . . . . . . . . . . . . . . . . 97 180 12.6.2. Receiving Updates . . . . . . . . . . . . . . . . . 97 181 12.6.3. Stabilization . . . . . . . . . . . . . . . . . . . 98 182 12.7. Route Query . . . . . . . . . . . . . . . . . . . . . . 100 183 12.8. Leaving . . . . . . . . . . . . . . . . . . . . . . . . 100 184 13. Enrollment and Bootstrap . . . . . . . . . . . . . . . . . . 100 185 13.1. Discovery . . . . . . . . . . . . . . . . . . . . . . . 101 186 13.2. Overlay Configuration . . . . . . . . . . . . . . . . . 101 187 13.3. Credentials . . . . . . . . . . . . . . . . . . . . . . 104 188 13.3.1. Self-Generated Credentials . . . . . . . . . . . . . 104 189 13.4. Joining the Overlay Peer . . . . . . . . . . . . . . . . 105 190 14. Message Flow Example . . . . . . . . . . . . . . . . . . . . 106 191 15. Security Considerations . . . . . . . . . . . . . . . . . . . 111 192 15.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 111 193 15.2. Attacks on P2P Overlays . . . . . . . . . . . . . . . . 112 194 15.3. Certificate-based Security . . . . . . . . . . . . . . . 112 195 15.4. Shared-Secret Security . . . . . . . . . . . . . . . . . 113 196 15.5. Storage Security . . . . . . . . . . . . . . . . . . . . 113 197 15.5.1. Authorization . . . . . . . . . . . . . . . . . . . 114 198 15.5.2. Distributed Quota . . . . . . . . . . . . . . . . . 114 199 15.5.3. Correctness . . . . . . . . . . . . . . . . . . . . 115 200 15.5.4. Residual Attacks . . . . . . . . . . . . . . . . . . 115 201 15.6. Routing Security . . . . . . . . . . . . . . . . . . . . 116 202 15.6.1. Background . . . . . . . . . . . . . . . . . . . . . 116 203 15.6.2. Admissions Control . . . . . . . . . . . . . . . . . 116 204 15.6.3. Peer Identification and Authentication . . . . . . . 117 205 15.6.4. Protecting the Signaling . . . . . . . . . . . . . . 117 206 15.6.5. Residual Attacks . . . . . . . . . . . . . . . . . . 118 207 15.7. SIP-Specific Issues . . . . . . . . . . . . . . . . . . 118 208 15.7.1. Fork Explosion . . . . . . . . . . . . . . . . . . . 118 209 15.7.2. Malicious Retargeting . . . . . . . . . . . . . . . 118 210 15.7.3. Privacy Issues . . . . . . . . . . . . . . . . . . . 119 211 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 119 212 16.1. Overlay Algorithm Types . . . . . . . . . . . . . . . . 119 213 16.2. Data Kind-Id . . . . . . . . . . . . . . . . . . . . . . 119 214 16.3. Data Model . . . . . . . . . . . . . . . . . . . . . . . 120 215 16.4. Message Codes . . . . . . . . . . . . . . . . . . . . . 120 216 16.5. Error Codes . . . . . . . . . . . . . . . . . . . . . . 121 217 16.6. Route Log Extension Types . . . . . . . . . . . . . . . 121 218 16.7. Transport Types . . . . . . . . . . . . . . . . . . . . 121 219 16.8. Forwarding Options . . . . . . . . . . . . . . . . . . . 122 220 16.9. Ping Information Types . . . . . . . . . . . . . . . . . 122 221 16.10. reload: URI Scheme . . . . . . . . . . . . . . . . . . . 122 222 16.10.1. URI Registration . . . . . . . . . . . . . . . . . . 123 223 17. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 123 224 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 124 225 18.1. Normative References . . . . . . . . . . . . . . . . . . 124 226 18.2. Informative References . . . . . . . . . . . . . . . . . 125 227 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 128 228 Intellectual Property and Copyright Statements . . . . . . . . . 130 230 1. Introduction 232 This document defines REsource LOcation And Discovery (RELOAD), a 233 peer-to-peer (P2P) signaling protocol for use on the Internet. It 234 provides a generic, self-organizing overlay network service, allowing 235 nodes to efficiently route messages to other nodes and to efficiently 236 store and retrieve data in the overlay. RELOAD provides several 237 features that are critical for a successful P2P protocol for the 238 Internet: 240 Security Framework: A P2P network will often be established among a 241 set of peers that do not trust each other. RELOAD leverages a 242 central enrollment server to provide credentials for each peer 243 which can then be used to authenticate each operation. This 244 greatly reduces the possible attack surface. 246 Usage Model: RELOAD is designed to support a variety of 247 applications, including P2P multimedia communications with the 248 Session Initiation Protocol [I-D.ietf-p2psip-concepts]. RELOAD 249 allows the definition of new application usages, each of which can 250 define its own data types, along with the rules for their use. 251 This allows RELOAD to be used with new applications through a 252 simple documentation process that supplies the details for each 253 application. 255 NAT Traversal: RELOAD is designed to function in environments where 256 many if not most of the nodes are behind NATs or firewalls. 257 Operations for NAT traversal are part of the base design, 258 including using ICE to establish new RELOAD or application 259 protocol connections as well as tunneling application protocols 260 across the overlay. 262 High Performance Routing: The very nature of overlay algorithms 263 introduces a requirement that peers participating in the P2P 264 network route requests on behalf of other peers in the network. 265 This introduces a load on those other peers, in the form of 266 bandwidth and processing power. RELOAD has been defined with a 267 simple, lightweight forwarding header, thus minimizing the amount 268 of effort required by intermediate peers. 270 Pluggable overlay Algorithms: RELOAD has been designed with an 271 abstract interface to the overlay layer to simplify implementing a 272 variety of structured (DHT) and unstructured overlay algorithms. 273 This specification also defines how RELOAD is used with Chord, 274 which is mandatory to implement. Specifying a default "must 275 implement" overlay algorithm will allow interoperability, while 276 the extensibility allows selection of overlay algorithms optimized 277 for a particular application. 279 These properties were designed specifically to meet the requirements 280 for a P2P protocol to support SIP, and this document defines a SIP 281 Usage of RELOAD. However, RELOAD is not limited to usage by SIP and 282 could serve as a tool for supporting other P2P applications with 283 similar needs. RELOAD is also based on the concepts introduced in 284 [I-D.ietf-p2psip-concepts]. 286 1.1. Basic Setting 288 In this section, we provide a brief overview of the operational 289 setting for RELOAD. See the concepts document for more details. A 290 RELOAD Overlay Instance consists of a set of nodes arranged in a 291 partly connected graph. Each node in the overlay is assigned a 292 numeric Node-ID which, together with the specific overlay algorithm 293 in use, determines its position in the graph and the set of nodes it 294 connects to. The figure below shows a trivial example which isn't 295 drawn from any particular overlay algorithm, but was chosen for 296 convenience of representation. 298 +--------+ +--------+ +--------+ 299 | Node 10|--------------| Node 20|--------------| Node 30| 300 +--------+ +--------+ +--------+ 301 | | | 302 | | | 303 +--------+ +--------+ +--------+ 304 | Node 40|--------------| Node 50|--------------| Node 60| 305 +--------+ +--------+ +--------+ 306 | | | 307 | | | 308 +--------+ +--------+ +--------+ 309 | Node 70|--------------| Node 80|--------------| Node 90| 310 +--------+ +--------+ +--------+ 311 | 312 | 313 +--------+ 314 | Node 85| 315 |(Client)| 316 +--------+ 318 Because the graph is not fully connected, when a node wants to send a 319 message to another node, it may need to route it through the network. 320 For instance, Node 10 can talk directly to nodes 20 and 40, but not 321 to Node 70. In order to send a message to Node 70, it would first 322 send it to Node 40 with instructions to pass it along to Node 70. 323 Different overlay algorithms will have different connectivity graphs, 324 but the general idea behind all of them is to allow any node in the 325 graph to efficiently reach every other node within a small number of 326 hops. 328 The RELOAD network is not only a messaging network. It is also a 329 storage network. Records are stored under numeric addresses which 330 occupy the same space as node identifiers. Nodes are responsible for 331 storing the data associated with some set of addresses as determined 332 by their Node-Id. For instance, we might say that every node is 333 responsible for storing any data value which has an address less than 334 or equal to its own Node-Id, but greater than the next lowest 335 Node-Id. Thus, Node-20 would be responsible for storing values 336 11-20. 338 RELOAD also supports clients. These are nodes which have Node-Ids 339 but do not participate in routing or storage. For instance, in the 340 figure above Node 85 is a client. It can route to the rest of the 341 RELOAD network via Node 80, but no other node will route through it 342 and Node 90 is still responsible for all addresses between 81-90. We 343 refer to non-client nodes as peers. 345 Other applications (for instance, SIP) can be defined on top of 346 RELOAD and use these two basic RELOAD services to provide their own 347 services. 349 1.2. Architecture 351 Architecturally RELOAD is divided into several layers, as shown in 352 the following figure: 354 Application 356 +-------+ +-------+ 357 | SIP | | XMPP | ... 358 | Usage | | Usage | 359 +-------+ +-------+ 360 -------------------------------------- Message Routing API 361 +------------------+ +---------+ 362 | |<->| Storage | 363 | | +---------+ 364 | Routing | ^ 365 | Layer | v 366 | | +---------+ 367 | |<->|Topology | 368 | | | Plugin | 369 +------------------+ +---------+ 370 ^ ^ 371 v | 372 +------------------+ <------+ 373 | Forwarding | 374 | Layer | 375 +------------------+ 376 -------------------------------------- Transport API 377 +-------+ +------+ 378 |TLS | |DTLS | ... 379 +-------+ +------+ 381 The major components of RELOAD are: 383 Usage Layer: Each application defines a RELOAD usage; a set of data 384 kinds and behaviors which describe how to use the services 385 provided by RELOAD. These usages all talk to RELOAD through a 386 common Message Routing API. 388 Routing Layer: The Routing Layer is responsible for routing messages 389 through the overlay. It also manages request state for the usages 390 and forwards Store and Fetch operations to the Storage component. 391 It talks directly to the Topology Plugin, which is responsible for 392 implementing the specific topology defined by the overlay 393 algorithm being used. 395 Storage: The Storage component is responsible for processing 396 messages relating to the storage and retrieval of data. It talks 397 directly to the Topology Plugin and the routing layer in order to 398 send and receive messages and manage data replication and 399 migration. 401 Topology Plugin: The Topology Plugin is responsible for implementing 402 the specific overlay algorithm being used. It talks directly to 403 the Routing Layer to send and receive overlay management messages, 404 to the Storage component to manage data replication, and directly 405 to the Forwarding Layer to control hop-by-hop message forwarding. 407 Forwarding Layer: The Forwarding Layer provides packet forwarding 408 services between nodes. It also handles setting up connections 409 across NATs using ICE. 411 1.2.1. Usage Layer 413 The top layer, called the Usage Layer, has application usages---such 414 as the SIP Location Usage---that use the abstract Message Routing API 415 provided by RELOAD. The goal of this layer is to implement 416 application-specific usages of the generic overlay services provided 417 by RELOAD. The usage defines how a specific application maps its 418 data into something that can be stored in the overlay, where to store 419 the data, how to secure the data, and finally how applications can 420 retrieve and use the data. 422 The architecture diagram shows both a SIP usage and an XMPP usage. A 423 single application may require multiple usages, for example a SIP 424 application may also require a voicemail usage. A usage may define 425 multiple kinds of data that are stored in the overlay and may also 426 rely on kinds originally defined by other usages. 428 This draft also defines a Diagnostics Usage, which can be used to 429 obtain diagnostic information about a peer in the overlay. The 430 Diagnostics Usage is interesting both to administrators monitoring 431 the overlay as well as to some overlay algorithms that base their 432 decisions on capabilities and current load of nodes in the overlay. 434 1.2.2. Routing Layer 436 The Routing Layer provides a generic message routing service for the 437 overlay. Each peer is identified by its location in the overlay as 438 determined by its Node-ID. A component which is a client of the 439 Routing Layer can perform two basic functions: 441 o Send a message to a given peer, specified by Node-Id or 442 Resource-Id. 443 o Receive messages that other peers sent to a Node-Id or Resource-Id 444 for which this peer is responsible. 446 All usages are clients of the Routing Layer and use RELOAD's services 447 by sending and receiving messages from peers. For instance, when a 448 usage wants to store data, it does so by sending Store requests. 449 Note that the Storage component and the Topology Plugin are 450 themselves clients of the Routing Layer, because they need to send 451 and receive messages from other peers. 453 The Routing Layer provides a fairly generic interface that allows the 454 topology plugin control the overlay and resource operations and 455 messages. Since each overlay algorithm is defined and functions 456 differently, we generically refer to the table of other peers that 457 the overlay algorithm maintains and uses to route requests 458 (neighbors) as a Routing Table. The Routing Layer component makes 459 queries to the overlay algorithm to determine the next hop, then 460 encodes and sends the message itself. Similarly, the overlay 461 algorithm issues periodic update requests through the logic component 462 to maintain and update its Routing Table. 464 1.2.3. Storage 466 One of the major functions of RELOAD is to allow nodes to store data 467 in the overlay and to retrieve data stored by other nodes or by 468 themselves. The Storage component is responsible for processing data 469 storage and retrieval messages. For instance, the Storage component 470 might receive a Store request for a given resource from the Routing 471 Layer. It would then store the data value(s) in its local data store 472 and sends a response to the Routing Layer for delivery to the 473 requesting peer. Typically, these messages will come for other 474 nodes, but depending on the overlay topology, a node might be 475 responsible for storing data for itself as well, especially if the 476 overlay is small. 478 The node's Node-ID determines the set of resources which it will be 479 responsible for storing. However, the exact mapping between these is 480 determined by the overlay algorithm used by the overlay, therefore 481 the Storage component always the queries the topology plugin to 482 determine where a particular resource should be stored. 484 1.2.4. Topology Plugin 486 RELOAD is explicitly designed to work with a variety of overlay 487 algorithms. In order to facilitate this, the overlay algorithm 488 implementation is provided by a Topology Plugin so that each overlay 489 can select an appropriate overlay algorithm that relies on the common 490 RELOAD core protocols and code. 492 The Topology Plugin is responsible for maintaining the overlay 493 algorithm Routing Table, which is consulted by the Routing Layer 494 before routing a message. When connections are made or broken, the 495 Forwarding Layer notifies the Topology Plugin, which adjusts the 496 routing table as appropriate. The Topology Plugin will also instruct 497 the Forwarding Layer to form new connections as dictated by the 498 requirements of the overlay algorithm Topology. 500 As peers enter and leave, resources may be stored on different peers, 501 so the Topology Plugin also keeps track of which peers are 502 responsible for which resources. As peers join and leave, the 503 Topology Plugin issues resource migration requests as appropriate, in 504 order to ensure that other peers have whatever resources they are now 505 responsible for. The Topology Plugin is also responsible for 506 providing redundant data storage to protect against loss of 507 information in the event of a peer failure and to protect against 508 compromised or subversive peers. 510 1.2.5. Forwarding Layer 512 The Forwarding Layer is responsible for getting a packet to the next 513 peer, as determined by the Routing and Storage Layer. The Forwarding 514 Layer establishes and maintains the network connections as required 515 by the Topology Plugin. This layer is also responsible for setting 516 up connections to other peers through NATs and firewalls using ICE, 517 and it can elect to forward traffic using relays for NAT and firewall 518 traversal. 520 The Forwarding Layer sits on top of transport layer protocols which 521 carry the actual traffic. This specification defines how to use DTLS 522 and TLS to carry RELOAD messages. 524 1.3. SIP Usage 526 The SIP Usage of RELOAD allows SIP user agents to provide a peer-to- 527 peer telephony service without the requirement for permanent proxy or 528 registration servers. In such a network, the RELOAD overlay itself 529 performs the registration and rendezvous functions ordinarily 530 associated with such servers. 532 The SIP Usage involves two basic functions: 533 Registration: SIP UAs can use the RELOAD data storage 534 functionality to store a mapping from their AOR to their Node-Id 535 in the overlay, and to retrieve the Node-Id of other UAs. 536 Rendezvous: Once a SIP UA has identified the Node-Id for an AOR it 537 wishes to call, it can use the RELOAD message routing system to 538 set up a direct connection which can be used to exchange SIP 539 messages. 541 For instance, Bob could register his Node-Id, "1234", under his AOR, 542 "sip:bob@dht.example.com". When Alice wants to call Bob, she queries 543 the overlay for "sip:bob@dht.example.com" and gets back Node-Id 1234. 545 She then uses the overlay to establish a direct connection with Bob 546 and can use that direct connection to perform a standard SIP INVITE. 548 1.4. Security 550 RELOAD's security model is based on each node having one or more 551 public key certificates. In general, these certificates will be 552 assigned by a central server which also assigns Node-Ids, although 553 self-signed certificates can be used in closed networks. These 554 credentials can be leveraged to provide communications security for 555 RELOAD messages. RELOAD provides communications security at three 556 levels: 558 Connection Level: Connections between peers are secured with TLS 559 or DTLS. 560 Message Level: Each RELOAD message must be signed. 561 Object Level: Stored objects must be signed by the storing peer. 563 These three levels of security work together to allow peers to verify 564 the origin and correctness of data they receive from other peers, 565 even in the face of malicious activity by other peers in the overlay. 566 RELOAD also provides access control built on top of these 567 communications security features. Because the peer responsible for 568 storing a piece of data can validate the signature on the data being 569 stored, the responsible peer can determine whether a given operation 570 is permitted or not. 572 RELOAD also provides a shared secret based admission control feature 573 using shared secrets and TLS-PSK. In order to form a TLS connection 574 to any node in the overlay, a new node needs to know the shared 575 overlay key, thus restricting access to authorized users. 577 1.5. Structure of This Document 579 The remainder of this document is structured as follows. 581 o Section 2 provides definitions of terms used in this document. 582 o Section 3 provides an overview of the mechanisms used to establish 583 and maintain the overlay. 584 o Section 4 provides an overview of the mechanism RELOAD provides to 585 support other applications. 586 o Section 5 provides an overview of the SIP usage for RELOAD. 587 o Section 6 defines the protocol messages that RELOAD uses to 588 establish and maintain the overlay. 589 o Section 7 defines the protocol messages that are used to store and 590 retrieve data using RELOAD. 592 o Sections 8-10 define three Usages of RELOAD that provide 593 certificate storage, SIP, and Diagnostics. 594 o Section 11 defines a specific Topology Plugin using Chord. 595 o Section 12 defines the mechanisms that new RELOAD nodes use to 596 join the overlay for the first time. 597 o Section 13 provides an extended example. 598 o Sections 14 and 15 provide Security and IANA considerations. 600 2. Terminology 602 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 603 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 604 document are to be interpreted as described in RFC 2119 [RFC2119]. 606 We use the terminology and definitions from the Concepts and 607 Terminology for Peer to Peer SIP [I-D.ietf-p2psip-concepts] draft 608 extensively in this document. Other terms used in this document are 609 defined inline when used and are also defined below for reference. 610 Terms which are new to this document (and perhaps should be added to 611 the concepts document) are marked with a (*). 613 DHT: A distributed hash table. A DHT is an abstract hash table 614 service realized by storing the contents of the hash table across 615 a set of peers. 617 Overlay Algorithm: An overlay algorithm defines the rules for 618 determining which peers in an overlay store a particular piece of 619 data and for determining a topology of interconnections amongst 620 peers in order to find a piece of data. 622 Overlay Instance: A specific overlay algorithm and the collection of 623 peers that are collaborating to provide read and write access to 624 it. There can be any number of overlay instances running in an IP 625 network at a time, and each operates in isolation of the others. 627 Peer: A host that is participating in the overlay. Peers are 628 responsible for holding some portion of the data that has been 629 stored in the overlay and also route messages on behalf of other 630 hosts as required by the Overlay Algorithm. 632 Client: A host that is able to store data in and retrieve data from 633 the overlay but which is not participating in routing or data 634 storage for the overlay. 636 Node: We use the term "Node" to refer to a host that may be either a 637 Peer or a Client. Because RELOAD uses the same protocol for both 638 clients and peers, much of the text applies equally to both. 639 Therefore we use "Node" when the text applies to both Clients and 640 Peers and the more specific term when the text applies only to 641 Clients or only to Peers. 643 Node-ID: A 128-bit value that uniquely identifies a node. Node-IDs 644 0 and 2^128 - 1 are reserved and are invalid Node-IDs. A value of 645 zero is not used in the wire protocol but can be used to indicate 646 an invalid node in implementations and APIs. The Node-ID of 647 2^128-1 is used on the wire protocol as a wildcard. (*) 649 Resource: An object or group of objects associated with a string 650 identifier see "Resource Name" below. 652 Resource Name: The (potentially) human readable name by which a 653 resource is identified. In unstructured P2P networks, the 654 resource name is used directly as a Resource-Id. In structured 655 P2P networks the resource name can be mapped into a Resource-ID by 656 using the string as the input to hash function. A SIP resource, 657 for example, is often identified by its AOR (see Resource Name 658 below).(*) 660 Resource-ID: A value that identifies some resources and which is 661 used as a key for storing and retrieving the resource. Often this 662 is not human friendly/readable. One way to generate a Resource-ID 663 is by applying a mapping function to some other unique name (e.g., 664 user name or service name) for the resource. The Resource-ID is 665 used by the distributed database algorithm to determine the peer 666 or peers that are responsible for storing the data for the 667 overlay. In structured P2P networks, resource-IDs are generally 668 fixed length and are formed by hashing the resource identifier. 669 In unstructured networks, resource identifiers may be used 670 directly as resource-IDs and may have variable length. 672 Connection Table: The set of peers to which a node is directly 673 connected. This includes nodes with which Attach handshakes have 674 been done but which have not sent any Updates. 676 Routing Table: The set of peers which a node can use to route 677 overlay messages. In general, these peers will all be on the 678 connection table but not vice versa, because some peers will have 679 Attached but not sent updates. Peers may send messages directly 680 to peers which are on the connection table but may only route 681 messages to other peers through peers which are on the routing 682 table. (*) 684 Destination List: A list of IDs through which a message is to be 685 routed. A single Node-ID is a trivial form of destination list. 686 (*) 688 Usage: A usage is an application that wishes to use the overlay for 689 some purpose. Each application wishing to use the overlay defines 690 a set of data kinds that it wishes to use. The SIP usage defines 691 the location, certificate, STUN server and TURN server data kinds. 692 (*) 694 3. Overlay Management Overview 696 The most basic function of RELOAD is as a generic overlay network. 697 Nodes need to be able to join the overlay, form connections to other 698 nodes, and route messages through the overlay to nodes to which they 699 are not directly connected. This section provides an overview of the 700 mechanisms that perform these functions. 702 3.1. Security and Identification 704 Every node in the RELOAD overlay is identified by a Node-ID. The 705 Node-ID is used for three major purposes: 707 o To address the node itself. 708 o To determine its position in the overlay topology when the overlay 709 is structured. 710 o To determine the set of resources for which the node is 711 responsible. 713 Each node has a certificate [RFC3280] containing a Node-ID, which is 714 globally unique. 716 The certificate serves multiple purposes: 718 o It entitles the user to store data at specific locations in the 719 Overlay Instance. Each data kind defines the specific rules for 720 determining which certificates can access each resource-ID/kind-id 721 pair. For instance, some kinds might allow anyone to write at a 722 given location, whereas others might restrict writes to the owner 723 of a single certificate. 724 o It entitles the user to operate a node that has a Node-ID found in 725 the certificate. When the node forms a connection to another 726 peer, it can use this certificate so that a node connecting to it 727 knows it is connected to the correct node. In addition, the node 728 can sign messages, thus providing integrity and authentication for 729 messages which are sent from the node. 731 o It entitles the user to use the user name found in the 732 certificate. 734 If a user has more than one device, typically they would get one 735 certificate for each device. This allows each device to act as a 736 separate peer. 738 RELOAD supports two certificate issuance models. The first is based 739 on a central enrollment process which allocates a unique name and 740 Node-Id to the node a certificate for a public/private key pair for 741 the user. All peers in a particular Overlay Instance have the 742 enrollment server as a trust anchor and so can verify any other 743 peer's certificate. 745 In some settings, a group of users want to set up an overlay network 746 but are not concerned about attack by other users in the network. 747 For instance, users on a LAN might want to set up a short term ad hoc 748 network without going to the trouble of setting up an enrollment 749 server. RELOAD supports the use of self-generated and self-signed 750 certificates. When self-signed certificates are used, the node also 751 generates its own Node-Id and username. The Node-Id is computed as a 752 digest of the public key, to prevent Node-Id theft, however this 753 model is still subject to a number of known attacks (most notably 754 Sybil attacks [Sybil]) and can only be safely used in closed networks 755 where users are mutually trusting. 757 3.1.1. Shared-Key Security 759 RELOAD also provides an admission control system based on shared 760 keys. In this model, the peers all share a single key which is used 761 to authenticate the peer-to-peer connections via TLS-PSK/TLS-SRP. 763 3.2. Clients 765 RELOAD defines a single protocol that is used both as the peer 766 protocol and the client protocol for the overlay. This simplifies 767 implementation, particularly for devices that may act in either role, 768 and allows clients to inject messages directly into the overlay. 770 We use the term "peer" to identify a node in the overlay that routes 771 messages for nodes other than those to which it is directly 772 connected. Peers typically also have storage responsibilities. We 773 use the term "client" to refer to nodes that do not have routing or 774 storage responsibilities. When text applies to both peers and 775 clients, we will simply refer to such a device as a "node." 777 RELOAD's client support allows nodes that are not participating in 778 the overlay as peers to utilize the same implementation and to 779 benefit from the same security mechanisms as the peers. Clients 780 possess and use certificates that authorize the user to store data at 781 its locations in the overlay. The Node-ID in the certificate is used 782 to identify the particular client as a member of the overlay and to 783 authenticate its messages. 785 The remainder of this section discusses how RELOAD supports clients 786 in terms of routing issues specific to clients, minimum functionality 787 requirements for clients, and alternatives for devices not capable of 788 meeting those requirements. 790 3.2.1. Client Routing 792 There are two routing options by which a client may be located in an 793 overlay. 795 o Establish a connection to the peer responsible for the client's 796 Node-ID in the overlay. Then requests may be sent from/to the 797 client using its Node-ID in the same manner as if it were a peer, 798 because the responsible peer in the overlay will handle the final 799 step of routing to the client. 800 o Establish a connection with an arbitrary peer in the overlay 801 (perhaps based on network proximity or an inability to establish a 802 direct connection with the responsible peer). In this case, the 803 client will rely on RELOAD's Destination List feature to ensure 804 reachability. The client can initiate requests, and any node in 805 the overlay that knows the Destination List to its current 806 location can reach it, but the client is not directly reachable 807 directly using only its Node-ID. The Destination List required to 808 reach it must be learnable via other mechanisms, such as being 809 stored in the overlay by a usage, if the client is to receive 810 incoming requests from other members of the overlay. 812 3.2.2. Client Behavior 814 There are a wide variety of reasons a node may act as a client rather 815 than as a peer [I-D.pascual-p2psip-clients]. This section outlines 816 some of those scenarios and how the client's behavior changes based 817 on its capabilities. 819 3.2.2.1. Why Not Only Peers? 821 For a number of reasons, a particular node may be forced to act as a 822 client even though it is willing to act as a peer. These include: 824 o The node does not have appropriate network connectivity--- 825 typically because it is behind an overly restrictive NAT, or it 826 has a low-bandwidth network connection. 828 o The node may not have sufficient resources, such as computing 829 power, storage space, or battery power. 830 o The overlay algorithm may dictate specific requirements for peer 831 selection. These may include participation in the overlay to 832 determine trustworthiness, control the number of peers in the 833 overlay to reduce overly-long routing paths, or ensure minimum 834 application uptime before a node can join as a peer. 836 The ultimate criteria for a node to become a peer are determined by 837 the overlay algorithm and specific deployment. A node acting as a 838 client that has a full implementation of RELOAD and the appropriate 839 overlay algorithm is capable of locating its responsible peer in the 840 overlay and using CONNECT to establish a direct connection to that 841 peer. In that way, it may elect to be reachable under either of the 842 routing approaches listed above. Particularly for overlay algorithms 843 that elect nodes to serve as peers based on trustworthiness or 844 population, the overlay algorithm may require such a client to locate 845 itself at a particular place in the overlay. 847 3.2.2.2. Minimum Functionality Requirements for Clients 849 A node may act as a client simply because it does not have the 850 resources or even an implementation of the topology plugin required 851 to acts as a peer in the overlay. In order to exchange RELOAD 852 messages with a peer, a client must meet a minimum level of 853 functionality. Such a client must: 855 o Implement RELOAD's connection-management connections that are used 856 to establish the connection with the peer. 857 o Implement RELOAD's data storage and retrieval methods (with client 858 functionality). 859 o Be able to calculate Resource-IDs used by the overlay. 860 o Possess security credentials required by the overlay it is 861 implementing. 863 A client speaks the same protocol as the peers, knows how to 864 calculate Resource-IDs, and signs its requests in the same manner as 865 peers. While a client does not necessarily require a full 866 implementation of the overlay algorithm, calculating the Resource-ID 867 requires an implementation of the appropriate algorithm for the 868 overlay. 870 RELOAD does not support a separate protocol for clients that do not 871 meet these functionality requirements. Any such extension would 872 either entail compromises on the features of RELOAD or require an 873 entirely new protocol to reimplement the core features of RELOAD. 874 Furthermore, for P2PSIP and many other applications, a native 875 application-level protocol already exists that is sufficient for such 876 a client, as described in the next section. 878 3.2.2.3. Clients as Application-Level Agents 880 SIP defines an extensive protocol for registration and security 881 between a client and its registrar/proxy server(s). Any SIP device 882 can act as a client of a RELOAD-based P2PSIP overlay if it contacts a 883 peer that implements the server-side functionality required by the 884 SIP protocol. In this case, the peer would be acting as if it were 885 the user's peer, and would need the appropriate credentials for that 886 user. 888 Application-level support for clients is defined by a usage. A usage 889 offering support for application-level clients should specify how the 890 security of the system is maintained when the data is moved between 891 the application and RELOAD layers. 893 3.3. Routing 895 This section will discuss the requirements RELOAD's routing 896 capabilities must meet, then describe the routing features in the 897 protocol, and provide a brief overview of how they are used. The 898 section will conclude by discussing some alternative designs and the 899 tradeoffs that would be necessary to support them. 901 RELOAD's routing capabilities must meet the following requirements: 903 NAT Traversal: RELOAD must support establishing and using 904 connections between nodes separated by one or more NATs, including 905 locating peers behind NATs for those overlays allowing/requiring 906 it. 907 Clients: RELOAD must support requests from and to clients that do 908 not participate in overlay routing. 909 Client promotion: RELOAD must support clients that become peers at a 910 later point as determined by the overlay algorithm and deployment. 911 Low state: RELOAD's routing algorithms must not require 912 significant state to be stored on intermediate peers. 913 Return routability in unstable topologies: At some points in 914 times, different nodes may have inconsistent information about the 915 connectivity of the routing graph. In all cases, the response to 916 a request needs to delivered to the node that sent the request and 917 not to some other node. 919 To meet these requirements, RELOAD's routing relies on two basic 920 mechanisms: 922 Via Lists: The forwarding header used by all RELOAD messages 923 contains both a Via List (built hop-by-hop as the message is 924 routed through the overlay) and a Destination List (providing 925 source-routing capabilities for requests and return-path routing 926 for responses). 927 Route_Query: The Route_Query method allows a node to query a peer 928 for the next hop it will use to route a message. This method is 929 useful for diagnostics and for iterative routing. 931 The basic routing mechanism used by RELOAD is Symmetric Recursive. 932 We will first describe symmetric routing and then discuss its 933 advantages in terms of the requirements discussed above. 935 Symmetric recursive routing requires a message follow the path 936 through the overlay to the destination without returning to the 937 originating node: each peer forwards the message closer to its 938 destination. The return path of the response is then the same path 939 followed in reverse. For example, a message following a route from A 940 to Z through B and X: 942 A B X Z 943 ------------------------------- 945 ----------> 946 Dest=Z 947 ----------> 948 Via=A 949 Dest=Z 950 ----------> 951 Via=A, B 952 Dest=Z 954 <---------- 955 Dest=X, B, A 956 <---------- 957 Dest=B, A 958 <---------- 959 Dest=A 961 Note that the preceding Figure does not indicate whether A is a 962 client or peer---A forwards its request to B and the response is 963 returned to A in the same manner regardless of A's role in the 964 overlay. 966 This figure shows use of full via-lists by intermediate peers B and 967 X. However, if B and/or X are willing to store state, then they may 968 elect to truncate the lists, save that information internally (keyed 969 by the transaction id), and return the response message along the 970 path from which it was received when the response is received. This 971 option requires greater state on intermediate peers but saves a small 972 amount of bandwidth and reduces the need for modifying the message 973 enroute. Selection of this mode of operation is a choice for the 974 individual peer---the techniques are mutually interoperable even on a 975 single message. The figure below shows B using full via lists but X 976 truncating them and saving the state internally. 978 A B X Z 979 ------------------------------- 981 ----------> 982 Dest=Z 983 ----------> 984 Via=A 985 Dest=Z 986 ----------> 987 Dest=Z 989 <---------- 990 Dest=X 991 <---------- 992 Dest=B, A 993 <---------- 994 Dest=A 996 For debugging purposes, a Route Log attribute is available that 997 stores information about each peer as the message is forwarded. 999 RELOAD also supports a basic Iterative routing mode (where the 1000 intermediate peers merely return a response indicating the next hop, 1001 but do not actually forward the message to that next hop themselves). 1002 Iterative routing is implemented using the Route_Query method, which 1003 requests this behavior. Note that iterative routing is selected only 1004 by the initiating node. RELOAD does not support an intermediate peer 1005 returning a response that it will not recursively route a normal 1006 request---the willingness to perform that operation is implicit in 1007 its role as a peer in the overlay. 1009 3.3.1. Routing Alternatives 1011 Significant discussion has been focused on the selection of a routing 1012 algorithm for P2PSIP. This section discusses the motivations for 1013 selection of symmetric recursive routing for RELOAD and describes the 1014 extensions that would be required to support additional routing 1015 algorithms. 1017 3.3.1.1. Iterative vs Recursive 1019 Iterative routing has a number of advantages. It is easier to debug, 1020 consumes fewer resources on intermediate peers, and allows the 1021 querying peer to identify and route around misbehaving peers 1022 [stoica-non-transitive-worlds05]. However, in the presence of NATs 1023 iterative routing is intolerably expensive because a new connection 1024 must be established for each hop (using ICE) [bryan-design-hotp2p08]. 1026 Iterative routing is supported through the Route_Query mechanism and 1027 is primarily intended for debugging. It is also allows the querying 1028 peer to evaluate the routing decisions made by the peers at each hop, 1029 consider alternatives, and perhaps detect at what point the 1030 forwarding path fails. 1032 3.3.1.2. Symmetric vs Forward response 1034 An alternative to the symmetric recursive routing method used by 1035 RELOAD is Forward-Only routing, where the response is routed to the 1036 requester as if it is a new message initiating by the responder (in 1037 the previous example, Z sends the response to A as if it were sending 1038 a request). Forward-only routing requires no state in either the 1039 message or intermediate peers. 1041 The drawback of forward-only routing is that it does not work when 1042 the overlay is unstable. For example, if A is in the process of 1043 joining the overlay and is sending a Join request to Z, it is not yet 1044 reachable via forward routing. Even if it is established in the 1045 overlay, if network failures produce temporary instability, A may not 1046 be reachable (and may be trying to stabilize its network connectivity 1047 via Attach messages). 1049 Furthermore, forward-only responses are less likely to reach the 1050 querying peer than symmetric recursive because the forward path is 1051 more likely to have a failed peer than the request path (which was 1052 just tested to route the request) [stoica-non-transitive-worlds05]. 1054 An extension to RELOAD that supports forward-only routing but relies 1055 on symmetric responses as a fallback would be possible, but due to 1056 the complexities of determining when to use forward-only and when to 1057 fallback to symmetric, we have chosen not to include it as an option 1058 at this point. 1060 3.3.1.3. Direct Response 1062 Another routing option is Direct Response routing, in which the 1063 response is returned directly to the querying node. In the previous 1064 example, if A encodes its IP address in the request, then Z can 1065 simply deliver the response directly to A. In the absence of NATs or 1066 other connectivity issues, this is the optimal routing technique. 1068 The challenge of implementing direct response is the presence of 1069 NATs. There are a number of complexities that must be addressed. In 1070 this discussion, we will continue our assumption that A issued the 1071 request and Z is generating the response. 1073 o The IP address listed by A may be unreachable, either due to NAT 1074 or firewall rules. Therefore, a direct response technique must 1075 fallback to symmetric response [stoica-non-transitive-worlds05]. 1076 The hop-by-hop ACKs used by RELOAD allow Z to determine when A has 1077 received the message (and the TLS negotiation will provide earlier 1078 confirmation that A is reachable), but this fallback requires a 1079 timeout that will increase the response latency whenever A is not 1080 reachable from Z. 1081 o Whenever A is behind a NAT it will have multiple candidate IP 1082 addresses, each of which must be advertised to ensure 1083 connectivity, therefore Z will need to attempt multiple 1084 connections to deliver the response. 1085 o One (or all) of A's candidate addresses may route from Z to a 1086 different device on the Internet. In the worst case these nodes 1087 may actually be running RELOAD on the same port. Therefore, 1088 establishing a secure connection to authenticate A before 1089 delivering the response is absolutely necessary. This step 1090 diminishes the efficiency of direct response because multiple 1091 roundtrips are required before the message can be delivered. 1092 o If A is behind a NAT and does not have a connection already 1093 established with Z, there are only two ways the direct response 1094 will work. The first is that A and Z are both behind the same 1095 NAT, in which case the NAT is not involved. In the more common 1096 case, when Z is outside A's NAT, the response will only be 1097 received if A's NAT implements endpoint-independent filtering. As 1098 the choice of filtering mode conflates application transparency 1099 with security [RFC4787], and no clear recommendation is available, 1100 the prevalence of this feature in future devices remains unclear. 1102 An extension to RELOAD that supports direct response routing but 1103 relies on symmetric responses as a fallback would be possible, but 1104 due to the complexities of determining when to use direct response 1105 and when to fallback to symmetric, and the reduced performance for 1106 responses to peers behind restrictive NATs, we have chosen not to 1107 include it as an option at this point. 1109 3.3.1.4. Relay Peers 1111 SEP [I-D.jiang-p2psip-sep] has proposed implementing a form of direct 1112 response by having A identify a peer, Q, that will be directly 1113 reachable by any other peer. A uses Attach to establish a connection 1114 with Q and advertises Q's IP address in the request sent to Z. Z 1115 sends the response to Q, which relays it to A. This then reduces the 1116 latency to two hops, plus Z negotiating a secure connection to Q. 1118 This technique relies on the relative population of nodes such as A 1119 that require relay peers and peers such as Q that are capable of 1120 serving as a relay peer. It also requires nodes to be able to 1121 identify which category they are in. This identification problem has 1122 turned out to be hard to solve and is still an open area of 1123 exploration. 1125 An extension to RELOAD that supports relay peers is possible, but due 1126 to the complexities of implementing such an alternative, we have not 1127 added such a feature to RELOAD at this point. 1129 A concept similar to relay peers, essentially choosing a relay peer 1130 at random, has previously been suggested to solve problems of 1131 pairwise non-transitivity [stoica-non-transitive-worlds05], but 1132 deterministic filtering provided by NATs make random relay peers no 1133 more likely to work than the responding peer. 1135 3.3.1.5. Symmetric Route Stability 1137 A common concern about symmetric recursive routing has been that one 1138 or more peers along the request path may fail before the response is 1139 received. The significance of this problem essentially depends on 1140 the response latency of the overlay---an overlay that produces slow 1141 responses will be vulnerable to churn, whereas responses that are 1142 delivered very quickly are vulnerable only to failures that occur 1143 over that small interval. 1145 The other aspect of this issue is whether the request itself can be 1146 successfully delivered. Assuming typical connection maintenance 1147 intervals, the time period between the last maintenance and the 1148 request being sent will be orders of magnitude greater than the delay 1149 between the request being forwarded and the response being received. 1150 Therefore, if the path was stable enough to be available to route the 1151 request, it is almost certainly going to remain available to route 1152 the response. 1154 An overlay that is unstable enough to suffer this type of failure 1155 frequently is unlikely to be able to support reliable functionality 1156 regardless of the routing mechanism. However, regardless of the 1157 stability of the return path, studies show that in the event of high 1158 churn, iterative routing is a better solution to ensure request 1159 completion [ng-analytical-churn-ieeep2p06] 1160 [stoica-non-transitive-worlds05] 1161 Finally, because RELOAD retries the end-to-end request, that retry 1162 will address the issues of churn that remain. 1164 3.4. Connectivity Management 1166 In order to provide efficient routing, a peer needs to maintain a set 1167 of direct connections to other peers in the Overlay Instance. Due to 1168 the presence of NATs, these connections often cannot be formed 1169 directly. Instead, we use the Attach request to establish a 1170 connection. Attach uses ICE [I-D.ietf-mmusic-ice-tcp] to establish 1171 the connection. It is assumed that the reader is familiar with ICE. 1173 Say that peer A wishes to form a direct connection to peer B. It 1174 gathers ICE candidates and packages them up in an Attach request 1175 which it sends to B through usual overlay routing procedures. B does 1176 its own candidate gathering and sends back a response with its 1177 candidates. A and B then do ICE connectivity checks on the candidate 1178 pairs. The result is a connection between A and B. At this point, A 1179 and B can add each other to their routing tables and send messages 1180 directly between themselves without going through other overlay 1181 peers. 1183 There is one special case in which Attach cannot be used: when a 1184 peer is joining the overlay and is not connected to any peers. In 1185 order to support this case, some small number of "bootstrap nodes" 1186 need to be publicly accessible so that new peers can directly connect 1187 to them. Section 13 contains more detail on this. 1189 In general, a peer needs to maintain connections to all of the peers 1190 near it in the Overlay Instance and to enough other peers to have 1191 efficient routing (the details depend on the specific overlay). If a 1192 peer cannot form a connection to some other peer, this isn't 1193 necessarily a disaster; overlays can route correctly even without 1194 fully connected links. However, a peer should try to maintain the 1195 specified link set and if it detects that it has fewer direct 1196 connections, should form more as required. This also implies that 1197 peers need to periodically verify that the connected peers are still 1198 alive and if not try to reform the connection or form an alternate 1199 one. 1201 3.5. Overlay Algorithm Support 1203 The Topology Plugin allows RELOAD to support a variety of overlay 1204 algorithms. This draft defines a DHT based on Chord [Chord], which 1205 is mandatory to implement, but the base RELOAD protocol is designed 1206 to support a variety of overlay algorithms. 1208 3.5.1. Support for Pluggable Overlay Algorithms 1210 RELOAD defines three methods for overlay maintenance: Join, Update, 1211 and Leave. However, the contents of those messages, when they are 1212 sent, and their precise semantics are specified by the actual overlay 1213 algorithm; RELOAD merely provides a framework of commonly-needed 1214 methods that provides uniformity of notation (and ease of debugging) 1215 for a variety of overlay algorithms. 1217 3.5.2. Joining, Leaving, and Maintenance Overview 1219 When a new peer wishes to join the Overlay Instance, it must have a 1220 Node-ID that it is allowed to use. It uses the Node-ID in the 1221 certificate it received from the enrollment server. The details of 1222 the joining procedure are defined by the overlay algorithm, but the 1223 general steps for joining an Overlay Instance are: 1225 o Forming connections to some other peers. 1226 o Acquiring the data values this peer is responsible for storing. 1227 o Informing the other peers which were previously responsible for 1228 that data that this peer has taken over responsibility. 1230 The first thing the peer needs to do is form a connection to some 1231 "bootstrap node". Because this is the first connection the peer 1232 makes, these nodes must have public IP addresses and therefore can be 1233 connected to directly. Once a peer has connected to one or more 1234 bootstrap nodes, it can form connections in the usual way by routing 1235 Attach messages through the overlay to other nodes. Once a peer has 1236 connected to the overlay for the first time, it can cache the set of 1237 nodes it has connected to with public IP addresses for use as future 1238 bootstrap nodes. 1240 Once the peer has connected to a bootstrap node, it then needs to 1241 take up its appropriate place in the overlay. This requires two 1242 major operations: 1244 o Forming connections to other peers in the overlay to populate its 1245 Routing Table. 1246 o Getting a copy of the data it is now responsible for storing and 1247 assuming responsibility for that data. 1249 The second operation is performed by contacting the Admitting Peer 1250 (AP), the node which is currently responsible for that section of the 1251 overlay. 1253 The details of this operation depend mostly on the overlay algorithm 1254 involved, but a typical case would be: 1256 1. JP (Joining Peer) sends a Join request to AP (Admitting Peer) 1257 announcing its intention to join. 1258 2. AP sends a Join response. 1259 3. AP does a sequence of Stores to JP to give it the data it will 1260 need. 1261 4. AP does Updates to JP and to other peers to tell it about its own 1262 routing table. At this point, both JP and AP consider JP 1263 responsible for some section of the Overlay Instance. 1264 5. JP makes its own connections to the appropriate peers in the 1265 Overlay Instance. 1267 After this process is completed, JP is a full member of the Overlay 1268 Instance and can process Store/Fetch requests. 1270 Note that the first node is a special case. When ordinary nodes 1271 cannot form connections to the bootstrap nodes, then they are not 1272 part of the overlay. However, the first node in the overlay can 1273 obviously not connect to others nodes. In order to support this 1274 case, potential first nodes (which must also serve as bootstrap nodes 1275 initially) must somehow be instructed (perhaps by configuration 1276 settings) that they are the entire overlay, rather than not part of 1277 it. 1279 3.6. First-Time Setup 1281 Previous sections addressed how RELOAD works once a node has 1282 connected. This section provides an overview of how users get 1283 connected to the overlay for the first time. RELOAD is designed so 1284 that users can start with the name of the overlay they wish to join 1285 and perhaps a username and password, and leverage that into having a 1286 working peer with minimal user intervention. This helps avoid the 1287 problems that have been experienced with conventional SIP clients 1288 where users are required to manually configure a large number of 1289 settings. 1291 3.6.1. Initial Configuration 1293 In the first phase of the process, the user starts out with the name 1294 of the overlay and uses this to download an initial set of overlay 1295 configuration parameters. The user does a DNS SRV lookup on the 1296 overlay name to get the address of a configuration server. It can 1297 then connect to this server with HTTPS to download a configuration 1298 document which contains the basic overlay configuration parameters as 1299 well as a set of bootstrap nodes which can be used to join the 1300 overlay. 1302 3.6.2. Enrollment 1304 If the overlay is using centralized enrollment, then a user needs to 1305 acquire a certificate before joining the overlay. The certificate 1306 attests both to the user's name within the overlay and to the node- 1307 ids which they are permitted to operate. In that case, the 1308 configuration document will contain the address of an enrollment 1309 server which can be used to obtain such a certificate. The 1310 enrollment server may (and probably will) require some sort of 1311 username and password before issuing the certificate. The enrollment 1312 server's ability to restrict attackers' access to certificates in the 1313 overlay is one of the cornerstones of RELOAD's security. 1315 4. Application Support Overview 1317 RELOAD is not intended to be used alone, but rather as a substrate 1318 for other applications. These applications can use RELOAD for a 1319 variety of purposes: 1321 o To store data in the overlay and retrieve data stored by other 1322 nodes. 1323 o As a discovery mechanism for services such as TURN. 1324 o To form direct connections which can be used to transmit 1325 application-level messages. 1327 This section provides an overview of these services. 1329 4.1. Data Storage 1331 RELOAD provides operations to Store, Fetch, and Remove data. Each 1332 location in the Overlay Instance is referenced by a Resource-ID. 1333 However, each location may contain data elements corresponding to 1334 multiple kinds (e.g., certificate, SIP registration). Similarly, 1335 there may be multiple elements of a given kind, as shown below: 1337 +--------------------------------+ 1338 | Resource-ID | 1339 | | 1340 | +------------+ +------------+ | 1341 | | Kind 1 | | Kind 2 | | 1342 | | | | | | 1343 | | +--------+ | | +--------+ | | 1344 | | | Value | | | | Value | | | 1345 | | +--------+ | | +--------+ | | 1346 | | | | | | 1347 | | +--------+ | | +--------+ | | 1348 | | | Value | | | | Value | | | 1349 | | +--------+ | | +--------+ | | 1350 | | | +------------+ | 1351 | | +--------+ | | 1352 | | | Value | | | 1353 | | +--------+ | | 1354 | +------------+ | 1355 +--------------------------------+ 1357 Each kind is identified by a kind-id, which is a code point assigned 1358 by IANA. As part of the kind definition, protocol designers may 1359 define constraints, such as limits on size, on the values which may 1360 be stored. For many kinds, the set may be restricted to a single 1361 value; some sets may be allowed to contain multiple identical items 1362 while others may only have unique items. Note that a kind may be 1363 employed by multiple usages and new usages are encouraged to use 1364 previously defined kinds where possible. We define the following 1365 data models in this document, though other usages can define their 1366 own structures: 1368 single value: There can be at most one item in the set and any value 1369 overwrites the previous item. 1371 array: Many values can be stored and addressed by a numeric index. 1373 dictionary: The values stored are indexed by a key. Often this key 1374 is one of the values from the certificate of the peer sending the 1375 Store request. 1377 In order to protect stored data from tampering, by other nodes, each 1378 stored value is digitally signed by the node which created it. When 1379 a value is retrieved, the digital signature can be verified to detect 1380 tampering. 1382 4.1.1. Storage Permissions 1384 A major issue in peer-to-peer storage networks is minimizing the 1385 burden of becoming a peer, and in particular minimizing the amount of 1386 data which any peer is required to store for other nodes. RELOAD 1387 addresses this issue by only allowing any given node to store data at 1388 a small number of locations in the overlay, with those locations 1389 being determined by the node's certificate. When a peer uses a Store 1390 request to place data at a location authorized by its certificate, it 1391 signs that data with the private key that corresponds to its 1392 certificate. Then the peer responsible for storing the data is able 1393 to verify that the peer issuing the request is authorized to make 1394 that request. Each data kind defines the exact rules for determining 1395 what certificate is appropriate. 1397 The most natural rule is that a certificate authorizes a user to 1398 store data keyed with their user name X. This rules is used for all 1399 the kinds defined in this specification. Thus, only a user with a 1400 certificate for "alice@example.org" could write to that location in 1401 the overlay. However, other usages can define any rules they choose, 1402 including publicly writable values. 1404 The digital signature over the data serves two purposes. First, it 1405 allows the peer responsible for storing the data to verify that this 1406 Store is authorized. Second, it provides integrity for the data. 1407 The signature is saved along with the data value (or values) so that 1408 any reader can verify the integrity of the data. Of course, the 1409 responsible peer can "lose" the value but it cannot undetectable 1410 modify it. 1412 The size requirements of the data being stored in the overlay are 1413 variable. For instance, a SIP AoR and voicemail differ widely in the 1414 storage size. RELOAD leaves it to the Usage and overlay 1415 configuration to address the size imbalance of various kinds. 1417 4.1.2. Usages 1419 By itself, the distributed storage layer just provides infrastructure 1420 on which applications are built. In order to do anything useful, a 1421 usage must be defined. Each Usage specifies several things: 1423 o Registers kind-id code points for any kinds that the Usage 1424 defines. 1425 o Defines the data structure for each of the kinds. 1426 o Defines access control rules for each kinds. 1427 o Defines how the Resource Name is formed that is hashed to form the 1428 Resource-ID where each kind is stored. 1430 o Describes how values will be merged after a network partition. 1431 Unless otherwise specified, the default merging rule is to act as 1432 if all the values that need to be merged were stored and that the 1433 order they were stored in corresponds to the stored time values 1434 associated with (and carried in) their values. Because the stored 1435 time values are those associated with the peer which did the 1436 writing, clock skew is generally not an issue. If two nodes are 1437 on different partitions, clocks, this can create merge conflicts. 1438 However because RELOAD deliberately segregates storage so that 1439 data from different users and peers is stored in different 1440 locations, and a single peer will typically only be in a single 1441 network partition, this case will generally not arise. 1443 The kinds defined by a usage may also be applied to other usages. 1444 However, a need for different parameters, such as different size 1445 limits, would imply the need to create a new kind. 1447 4.1.3. Replication 1449 Replication in P2P overlays can be used to provide: 1451 persistence: if the responsible peer crashes and/or if the storing 1452 peer leaves the overlay 1453 security: to guard against DoS attacks by the responsible peer or 1454 routing attacks to that responsible peer 1455 load balancing: to balance the load of queries for popular 1456 resources. 1458 A variety of schemes are used in P2P overlays to achieve some of 1459 these goals. Common techniques include replicating on neighbors of 1460 the responsible peer, randomly locating replicas around the overlay, 1461 or replicating along the path to the responsible peer. 1463 The core RELOAD specification does not specify a particular 1464 replication strategy. Instead, the first level of replication 1465 strategies are determined by the overlay algorithm, which can base 1466 the replication strategy on the its particular topology. For 1467 example, Chord places replicas on successor peers, which will take 1468 over responsibility should the responsible peer fail [Chord]. 1470 If additional replication is needed, for example if data persistence 1471 is particularly important for a particular usage, then that usage may 1472 specify additional replication, such as implementing random 1473 replications by inserting a different well known constant into the 1474 Resource Name used to store each replicated copy of the resource. 1475 Such replication strategies can be added independent of the 1476 underlying algorithm, and their usage can be determined based on the 1477 needs of the particular usage. 1479 4.2. Service Discovery 1481 RELOAD does not currently define a generic service discovery 1482 algorithm as part of the base protocol--although a TURN-specific 1483 discovery mechanism is provided. A variety of service discovery 1484 algorithm can be implemented as extensions to the base protocol, such 1485 as ReDIR [opendht-sigcomm05]. 1487 4.3. Application Connectivity 1489 There is no requirement that a RELOAD usage must use RELOAD's 1490 primitives for establishing its own communication if it already 1491 possesses its own means of establishing connections. For example, 1492 one could design a RELOAD-based resource discovery protocol which 1493 used HTTP to retrieve the actual data. 1495 For more common situations, however, the overlay itself is used to 1496 establish a connection rather than an external authority such as DNS, 1497 RELOAD provides connectivity to applications using the same Attach 1498 method as is used for the overlay maintenance. For example, if a 1499 P2PSIP node wishes to establish a SIP dialog with another P2PSIP 1500 node, it will use Attach to establish a direct connection with the 1501 other node. This new connection is separate from the peer protocol 1502 connection, it is a dedicated UDP or TCP flow used only for the SIP 1503 dialog. Each usage specifies which types of connections can be 1504 initiated using Attach. 1506 5. P2PSIP Integration Overview 1508 The SIP Usage of RELOAD allows SIP user agents to provide a peer-to- 1509 peer telephony service without the requirement for permanent proxy or 1510 registration servers. In such a network, the RELOAD overlay itself 1511 performs the registration and rendezvous functions ordinarily 1512 associated with such servers. 1514 The basic function of the SIP usage is to allow Alice to start with a 1515 SIP URI (e.g., "bob@dht.example.com") and end up with a connection 1516 which Alice's SIP UA can use to pass SIP messages back and forth to 1517 Bob's SIP UA. The way this works is as follows: 1519 1. Bob, operating Node-ID 1234, stores a mapping from his URI to his 1520 Node-ID in the overlay. I.e., "sip:bob@dht.example.com -> 1234". 1521 2. Alice, operating Node-ID 5678, decides to call Bob. She looks up 1522 "sip:bob@dht.example.com" in the overlay and retrieves "1234". 1523 3. Alice uses the overlay to route an Attach message to Bob's peer. 1524 Bob responds with his own Attach and they set up a direct 1525 connection, as shown below. 1527 Alice Peer1 Overlay PeerN Bob 1528 (5678) (1234) 1529 ------------------------------------------------- 1530 Attach -> 1531 Attach -> 1532 Attach -> 1533 Attach -> 1534 <- Attach 1535 <- Attach 1536 <- Attach 1537 <- Attach 1539 <------------------ ICE Checks -----------------> 1540 INVITE -----------------------------------------> 1541 <--------------------------------------------- OK 1542 ACK --------------------------------------------> 1543 <------------ ICE Checks for media -------------> 1544 <-------------------- RTP ----------------------> 1546 It is important to note that RELOAD's only role here is to set up the 1547 direct connection between Alice and Bob. As soon as the ICE checks 1548 complete and the connection is established, then ordinary SIP is 1549 used. In particular, the establishment of the media channel for the 1550 phone call happens via the usual SIP mechanisms, and RELOAD is not 1551 involved. Media never goes over the overlay. After the successful 1552 exchange of SIP messages, call peers run ICE connectivity checks for 1553 media. 1555 As well as allowing mappings from AORs to Node-IDs, the SIP Usage 1556 also allows mappings from AORs to other AORs. For instance, if Bob 1557 wanted his phone calls temporarily forwarded to Charlie, he could 1558 store the mapping "sip:bob@dht.example.com -> 1559 sip:charlie@dht.example.com". When Alice wants to call Bob, she 1560 retrieves this mapping and can then fetch Charlie's AOR to retrieve 1561 his Node-ID. 1563 6. Overlay Management Protocol 1565 This section defines the basic protocols used to create, maintain, 1566 and use the RELOAD overlay network. We start by defining how 1567 messages are transmitted, received, and routed in an existing 1568 overlay, then define the message structure, and then finally define 1569 the messages used to join and maintain the overlay. 1571 6.1. Message Routing 1573 This section describes procedures used by nodes to route messages 1574 through the overlay. 1576 6.1.1. Request Origination 1578 In order to originate a message to a given Node-ID or resource-id, a 1579 node constructs an appropriate destination list. The simplest such 1580 destination list is a single entry containing the peer or 1581 resource-id. The resulting message will use the normal overlay 1582 routing mechanisms to forward the message to that destination. The 1583 node can also construct a more complicated destination list for 1584 source routing. 1586 Once the message is constructed, the node sends the message to some 1587 adjacent peer. If the first entry on the destination list is 1588 directly connected, then the message MUST be routed down that 1589 connection. Otherwise, the topology plugin MUST be consulted to 1590 determine the appropriate next hop. 1592 Parallel searches for the resource are a common solution to improve 1593 reliability in the face of churn or of subversive peers. Parallel 1594 searches for usage-specified replicas are managed by the usage layer. 1595 However, a single request can also be routed through multiple 1596 adjacent peers, even when known to be sub-optimal, to improve 1597 reliability [vulnerabilities-acsac04]. Such parallel searches MAY BE 1598 specified by the topology plugin. 1600 Because messages may be lost in transit through the overlay, RELOAD 1601 incorporates an end-to-end reliability mechanism. When an 1602 originating node transmits a request it MUST set a 3 second timer. 1603 If a response has not been received when the timer fires, the request 1604 is retransmitted with the same transaction identifier. The request 1605 MAY be retransmitted up to 4 times (for a total of 5 messages). 1606 After the timer for the fifth transmission fires, the message SHALL 1607 be considered to have failed. Note that this retransmission 1608 procedure is not followed by intermediate nodes. They follow the 1609 hop-by-hop reliability procedure described in Section 6.4.1.2. 1611 The above algorithm can result in multiple requests being delivered 1612 to a node. Receiving nodes MUST generate semantically equivalent 1613 responses to retransmissions of the same request (this can be 1614 determined by transaction id) if the request is received within the 1615 maximum request lifetime (15 seconds). For some requests (e.g., 1616 FETCH) this can be accomplished merely by processing the request 1617 again. For other requests, (e.g., STORE) it may be necessary to 1618 maintain state for the duration of the request lifetime. 1620 6.1.2. Message Receipt and Forwarding 1622 When a peer receives a message, it first examines the overlay, 1623 version, and other header fields to determine whether the message is 1624 one it can process. If any of these are incorrect (e.g., the message 1625 is for an overlay in which the peer does not participate) it is an 1626 error. The peer SHOULD generate an appropriate error but if local 1627 policy can override this in which case the messages is silently 1628 dropped. 1630 Once the peer has determined that the message is correctly formatted, 1631 it examines the first entry on the destination list. There are three 1632 possible cases here: 1634 o The first entry on the destination list is an id for which the 1635 peer is responsible. 1636 o The first entry on the destination list is a an id for which 1637 another peer is responsible. 1638 o The first entry on the destination list is a private id which is 1639 being used for destination list compression. 1641 These cases are handled as discussed below. 1643 6.1.2.1. Responsible ID 1645 If the first entry on the destination list is a ID for which the node 1646 is responsible, there are several sub-cases. 1647 o If the entry is a Resource-Id, then it MUST be the only entry on 1648 the destination list. If there are other entries, the message 1649 MUST be silently dropped. Otherwise, the message is destined for 1650 this node and it passes it up to the upper layers. 1651 o If the entry is a Node-Id which belongs to this node, then the 1652 message is destined for this node. If this is the only entry on 1653 the destination list, the message is destined for this node and is 1654 passed up to the upper layers. Otherwise the entry is removed 1655 from the destination list and the message is passed it to the 1656 routing layer. If the message is a response and there is state 1657 for the transaction ID, the state is reinserted into the 1658 destination list first. 1659 o If the entry is a Node-Id which is not equal to this node, then 1660 the node MUST drop the message silently unless the Node-Id 1661 corresponds to a node which is directly connected to this node 1662 (i.e., a client). In that case, it MUST forward the message to 1663 the destination node as described in the next section. 1665 Note that this implies that in order to address a message to "the 1666 peer that controls region X", a sender sends to resource-id X, not 1667 Node-ID X. 1669 6.1.2.2. Other ID 1671 If neither of the other two cases applies, then the peer MUST forward 1672 the message towards the first entry on the destination list. This 1673 means that it MUST select one of the peers to which it is connected 1674 and which is likely to be responsible for the first entry on the 1675 destination list. If the first entry on the destination list is in 1676 the peer's connection table, then it SHOULD forward the message to 1677 that peer directly. Otherwise, it consult the routing table to 1678 forward the message. 1680 Any intermediate peer which forwards a RELOAD message MUST arrange 1681 that if it receives a response to that message the response can be 1682 routed back through the set of nodes through which the request 1683 passed. This may be arranged in one of two ways: 1685 o The peer MAY add an entry to the via list in the forwarding header 1686 that will enable it to determine the correct node. 1687 o The peer MAY keep per-transaction state which will allow it to 1688 determine the correct node. 1690 As an example of the first strategy, if node D receives a message 1691 from node C with via list (A, B), then D would forward to the next 1692 node (E) with via list (A, B, C). Now, if E wants to respond to the 1693 message, it reverses the via list to produce the destination list, 1694 resulting in (D, C, B, A). When D forwards the response to C, the 1695 destination list will contain (C, B, A). 1697 As an example of the second strategy, if node D receives a message 1698 from node C with transaction ID X and via list (A, B), it could store 1699 (X, C) in its state database and forward the message with the via 1700 list unchanged. When D receives the response, it consults its state 1701 database for transaction id X, determines that the request came from 1702 C, and forwards the response to C. 1704 Intermediate peer which modify the via list are not required to 1705 simply add entries. The only requirement is that the peer be able to 1706 reconstruct the correct destination list on the return route. RELOAD 1707 provides explicit support for this functionality in the form of 1708 private IDs, which can replace any number of via list entries. For 1709 instance, in the above example, Node D might send E a via list 1710 containing only the private ID (I). E would then use the destination 1711 list (D, I) to send its return message. When D processes this 1712 destination list, it would detect that I is a private ID, recover the 1713 via list (A, B, C), and reverse that to produce the correct 1714 destination list (C, B, A) before sending it to C. This feature is 1715 called List Compression. I MAY either be a compressed version of the 1716 original via list or an index into a state database containing the 1717 original via list. 1719 Note that if an intermediate peer exits the overlay, then on the 1720 return trip the message cannot be forwarded and will be dropped. The 1721 ordinary timeout and retransmission mechanisms provide stability over 1722 this type of failure. 1724 6.1.2.3. Private ID 1726 If the first entry on the destination list is a private id (e.g., a 1727 compressed via list), the peer MUST that entry with the original via 1728 list that it replaced indexes and then re-examine the destination 1729 list to determine which case now applies. 1731 6.1.3. Response Origination 1733 When a peer sends a response to a request, it MUST construct the 1734 destination list by reversing the order of the entries on the via 1735 list. This has the result that the response traverses the same peers 1736 as the request traversed, except in reverse order (symmetric 1737 routing). Note that this rule will need to be relaxed if other 1738 routing algorithms are supported. 1740 6.2. Message Structure 1742 RELOAD is a message-oriented request/response protocol. The messages 1743 are encoded using binary fields. All integers are represented in 1744 network byte order. The general philosophy behind the design was to 1745 use Type, Length, Value fields to allow for extensibility. However, 1746 for the parts of a structure that were required in all messages, we 1747 just define these in a fixed position as adding a type and length for 1748 them is unnecessary and would simply increase bandwidth and 1749 introduces new potential for interoperability issues. 1751 Each message has three parts, concatenated as shown below: 1753 +-------------------------+ 1754 | Forwarding Header | 1755 +-------------------------+ 1756 | Message Contents | 1757 +-------------------------+ 1758 | Signature | 1759 +-------------------------+ 1761 The contents of these parts are as follows: 1763 Forwarding Header: Each message has a generic header which is used 1764 to forward the message between peers and to its final destination. 1765 This header is the only information that an intermediate peer 1766 (i.e., one that is not the target of a message) needs to examine. 1768 Message Contents: The message being delivered between the peers. 1769 From the perspective of the forwarding layer, the contents is 1770 opaque, however, it is interpreted by the higher layers. 1772 Signature: A digital signature over the message contents and parts 1773 of the header of the message. Note that this signature can be 1774 computed without parsing the message contents. 1776 The following sections describe the format of each part of the 1777 message. 1779 6.2.1. Presentation Language 1781 The structures defined in this document are defined using a C-like 1782 syntax based on the presentation language used to define TLS. 1783 Advantages of this style include: 1785 o It is easy to write and familiar enough looking that most readers 1786 can grasp it quickly. 1787 o The ability to define nested structures allows a separation 1788 between high-level and low level message structures. 1789 o It has a straightforward wire encoding that allows quick 1790 implementation, but the structures can be comprehended without 1791 knowing the encoding. 1792 o The ability to mechanically (compile) encoders and decoders. 1794 This presentation is to some extent a placeholder. We consider it an 1795 open question what the final protocol definition method and encodings 1796 use. We expect this to be a question for the WG to decide. 1798 Several idiosyncrasies of this language are worth noting. 1800 o All lengths are denoted in bytes, not objects. 1801 o Variable length values are denoted like arrays with angle 1802 brackets. 1803 o "select" is used to indicate variant structures. 1805 For instance, "uint16 array<0..2^8-2>;" represents up to 254 bytes 1806 but only up to 127 values of two bytes (16 bits) each.. 1808 6.2.1.1. Common Definitions 1810 The following definitions are used throughout RELOAD and so are 1811 defined here. They also provide a convenient introduction to how to 1812 read the presentation language. 1814 An enum represents an enumerated type. The values associated with 1815 each possibility are represented in parentheses and the maximum value 1816 is represented as a nameless value, for purposes of describing the 1817 width of the containing integral type. For instance, Boolean 1818 represents a true or false: 1820 enum { false (0), true(1), (255)} Boolean; 1822 A boolean value is either a 1 or a 0 and is represented as a single 1823 byte on the wire. 1825 The NodeId, shown below, represents a single Node-ID. 1827 typedef opaque NodeId[16]; 1829 A NodeId is a fixed-length 128-bit structure represented as a series 1830 of bytes, most significant byte first. Note: the use of "typedef" 1831 here is an extension to the TLS language, but its meaning should be 1832 relatively obvious. 1834 A ResourceId, shown below, represents a single resource-id. 1836 typedef opaque ResourceId<0..2^8-1>; 1838 Like a NodeId, a resource-id is an opaque string of bytes, but unlike 1839 Node-IDs, resource-ids are variable length, up to 255 bytes (2048 1840 bits) in length. On the wire, each ResourceId is preceded by a 1841 single length byte (allowing lengths up to 255). Thus, the 3-byte 1842 value "Foo" would be encoded as: 03 46 4f 4f. 1844 A more complicated example is IpAddressPort, which represents a 1845 network address and can be used to carry either an IPv6 or IPv4 1846 address: 1848 enum {reserved_addr(0), ipv4_address (1), ipv6_address (2), 1849 (255)} AddressType; 1851 struct { 1852 uint32 addr; 1853 uint16 port; 1854 } IPv4AddrPort; 1856 struct { 1857 uint128 addr; 1858 uint16 port; 1859 } IPv6AddrPort; 1861 struct { 1862 AddressType type; 1863 uint8 length; 1865 select (type) { 1866 case ipv4_address: 1867 IPv4AddrPort v4addr_port; 1869 case ipv6_address: 1870 IPv6AddrPort v6addr_port; 1872 /* This structure can be extended */ 1874 } IpAddressPort; 1876 The first two fields in the structure are the same no matter what 1877 kind of address is being represented: 1879 type 1880 the type of address (v4 or v6). 1882 length 1883 the length of the rest of the structure. 1885 By having the type and the length appear at the beginning of the 1886 structure regardless of the kind of address being represented, an 1887 implementation which does not understand new address type X can still 1888 parse the IpAddressPort field and then discard it if it is not 1889 needed. 1891 The rest of the IpAddressPort structure is either an IPv4AddrPort or 1892 an IPv6AddrPort. Both of these simply consist of an address 1893 represented as an integer and a 16-bit port. As an example, here is 1894 the wire representation of the IPv4 address "192.0.2.1" with port 1895 "6100". 1897 01 ; type = IPv4 1898 06 ; length = 6 1899 c0 00 02 01 ; address = 192.0.2.1 1900 17 d4 ; port = 6100 1902 6.2.2. Forwarding Header 1904 The forwarding header is defined as a ForwardingHeader structure, as 1905 shown below. 1907 struct { 1908 uint32 relo_token; 1909 uint32 overlay; 1910 uint8 ttl; 1911 uint8 reserved; 1912 uint16 fragment; 1913 uint8 version; 1914 uint24 length; 1915 uint64 transaction_id; 1916 uint16 flags; 1918 uint16 via_list_length; 1919 uint16 destination_list_length; 1920 uint16 route_log_length; 1921 uint16 options_length; 1922 Destination via_list[via_list_length]; 1923 Destination destination_list 1924 [destination_list_length]; 1925 RouteLogEntry route_log[route_log_length]; 1926 ForwardingOptions options[options_length]; 1927 } ForwardingHeader; 1929 The contents of the structure are: 1931 relo_token 1932 The first four bytes identify this message as a RELOAD message. 1933 The message is easy to demultiplex from STUN messages by looking 1934 at the first bit. This field MUST contain the value 0xc2454c4f 1935 (the string 'RELO' with the high bit of the first byte set.). 1937 overlay 1938 The 32 bit checksum/hash of the overlay being used. The variable 1939 length string representing the overlay name is hashed with SHA-1 1940 and the low order 32 bits are used. The purpose of this field is 1941 to allow nodes to participate in multiple overlays and to detect 1942 accidental misconfiguration. This is not a security critical 1943 function. 1945 ttl 1946 An 8 bit field indicating the number of iterations, or hops, a 1947 message can experience before it is discarded. The TTL value MUST 1948 be decremented by one at every hop along the route the message 1949 traverses. If the TTL is 0, the message MUST NOT be propagated 1950 further and MUST be discarded. The initial value of the TTL 1951 should be TBD. 1953 fragment 1954 This field is used to handle fragmentation. The high order two 1955 bits are used to indicate the fragmentation status: If the high 1956 bit (0x8000) is set, it indicates that the message is a fragment. 1957 If the next bit (0x4000) is set, it indicates that this is the 1958 last fragment. 1959 The remainder of the field is used to indicate the fragment 1960 offset. [[Open Issue: This is conceptually clear, but the 1961 details are still lacking. Need to define the fragment offset and 1962 total length be encoded in the header. Right now we have 14 bits 1963 reserved with the intention that they be used for fragmenting, 1964 though additional bytes in the header might be needed for 1965 fragmentation.]] 1967 version 1968 The version of the RELOAD protocol being used. This document 1969 describes version 0.1, with a value of 0x01. 1971 length 1972 The count in bytes of the size of the message, including the 1973 header. 1975 transaction_id 1976 A unique 64 bit number that identifies this transaction and also 1977 serves as a salt to randomize the request and the response. 1978 Responses use the same Transaction ID as the request they 1979 correspond to. Transaction IDs are also used for fragment 1980 reassembly. 1982 flags 1983 The flags word contains control flags. Which are ORed together. 1984 There is two currently defined flags: ROUTE-LOG (0x1) and 1985 RESPONSE-ROUTE-LOG (0x2). These flags indicate that the route log 1986 should be included (see Section 6.2.2.2.). 1988 via_list_length 1989 The length of the via list in bytes. Note that in this field and 1990 the following two length fields we depart from the usual variable- 1991 length convention of having the length immediately precede the 1992 value in order to make it easier for hardware decoding engines to 1993 quickly determine the length of the header. 1995 destination_list_length 1996 The length of the destination list in bytes. 1998 route_log_length 1999 The length of the route log in bytes. 2001 options_length 2002 The length of the header options in bytes. 2004 via_list 2005 The via_list contains the sequence of destinations through which 2006 the message has passed. The via_list starts out empty and grows 2007 as the message traverses each peer. 2009 destination_list 2010 The destination_list contains a sequence of destinations which the 2011 message should pass through. The destination list is constructed 2012 by the message originator. The first element in the destination 2013 list is where the message goes next. The list shrinks as the 2014 message traverses each listed peer. 2016 route_log 2017 Contains a series of route log entries. See Section 6.2.2.2. 2019 options 2020 Contains a series of ForwardingOptions entries. See 2021 Section 6.2.2.3. 2023 6.2.2.1. Destination and Via Lists 2025 The destination list and via lists are sequences of Destination 2026 values: 2028 enum {reserved(0), peer(1), resource(2), compressed(3), (255) } 2029 DestinationType; 2031 select (destination_type) { 2032 case peer: 2033 NodeId node_id; 2035 case resource: 2036 ResourceId resource_id; 2038 case compressed: 2039 opaque compressed_id<0..2^8-1>; 2041 /* This structure may be extended with new types */ 2043 } DestinationData; 2045 struct { 2046 DestinationType type; 2047 uint8 length; 2048 DestinationData destination_data; 2049 } Destination; 2051 This is a TLV structure with the following contents: 2053 type 2054 The type of the DestinationData PDU. This may be one of "peer", 2055 "resource", or "compressed". 2057 length 2058 The length of the destination_data. 2060 destination_value 2061 The destination value itself, which is an encoded DestinationData 2062 structure, depending on the value of "type". 2064 Note: This structure encodes a type, length, value. The length 2065 field specifies the length of the DestinationData values, which 2066 allows the addition of new DestinationTypes. This allows an 2067 implementation which does not understand a given DestinationType 2068 to skip over it. 2070 A DestinationData can be one of three types: 2072 peer 2073 A Node-ID. 2075 compressed 2076 A compressed list of Node-IDs and/or resources. Because this 2077 value was compressed by one of the peers, it is only meaningful to 2078 that peer and cannot be decoded by other peers. Thus, it is 2079 represented as an opaque string. 2081 resource 2082 The Resource-ID of the resource which is desired. This type MUST 2083 only appear in the final location of a destination list and MUST 2084 NOT appear in a via list. It is meaningless to try to route 2085 through a resource. 2087 6.2.2.2. Route Logging 2089 The route logging feature provides diagnostic information about the 2090 path taken by the message so far and in this manner it is similar in 2091 function to SIP's [RFC3261] Via header field. If the ROUTE-LOG flag 2092 is set in the Flags word, at each hop peers MUST append a route log 2093 entry to the route log element in the header or reject the request. 2094 The order of the route log entry elements in the message is 2095 determined by the order of the peers were traversed along the path. 2096 The first route log entry corresponds to the peer at the first hop 2097 along the path, and each subsequent entry corresponds to the peer at 2098 the next hop along the path. If the ROUTE-LOG flag is set, the route 2099 log entries in the request MUST be copied to the response or the 2100 request rejected. If, and only if, the ROUTE-LOG-RESPONSE flag is 2101 set in a request, the ROUTE-LOG flag MUST be set in the response. 2103 Note that use of the ROUTE-LOG-RESPONSE flag means that the response 2104 will grow on the return path, which may potentially mean that it gets 2105 dropped due to becoming too large for some intermediate hop. Thus, 2106 this option must be used with care. 2108 The route log is defined as follows: 2110 enum { (255) } RouteLogExtensionType; 2112 struct { 2113 RouteLogExtensionType type; 2114 uint16 length; 2116 select (type){ 2117 /* Extension values go here */ 2118 } extension; 2119 } RouteLogExtension; 2121 enum { reserved(0), tcp_tls(1), udp_dtls(2), (255)} Transport; 2123 struct { 2124 opaque version<0..2^8-1>; /* A string */ 2125 Transport transport; /* TCP or UDP */ 2126 NodeId id; 2127 uint32 uptime; 2128 IpAddressPort address; 2129 opaque certificate<0..2^16-1>; 2130 RouteLogExtension extensions<0..2^16-1>; 2131 } RouteLogEntry; 2133 struct { 2134 RouteLogEntry entries<0..2^16-1>; 2135 } RouteLog; 2137 The route log consists of an arbitrary number of RouteLogEntry 2138 values, each representing one node through which the message has 2139 passed. 2141 Each RouteLogEntry consists of the following values: 2143 version 2144 A textual representation of the software version 2146 transport 2147 The transport type, currently either "tcp_tls" or "udp_dtls". 2149 id 2150 The Node-ID of the peer. 2152 uptime 2153 The uptime of the peer in seconds. 2155 address 2156 The address and port of the peer. 2158 certificate 2159 The peer's certificate. Note that this may be omitted by setting 2160 the length to zero. 2162 extensions 2163 Extensions, if any. 2165 Extensions are defined using a RouteLogExtension structure. New 2166 extensions are defined by defining a new code point for 2167 RouteLogExtensionType and adding a new arm to the RouteLogExtension 2168 structure. The contents of that structure are: 2170 type 2171 The type of the extension. 2173 length 2174 The length of the rest of the structure. 2176 extension 2177 The extension value. 2179 6.2.2.3. Forwarding Options 2181 The Forwarding header can be extended with forwarding header options, 2182 which are a series of ForwardingOptions structures: 2184 enum { (255) } ForwardingOptionsType; 2186 struct { 2187 ForwardingOptionsType type; 2188 uint8 flags; 2189 uint16 length; 2190 select (type) { 2191 /* Option values go here */ 2192 } option; 2193 } ForwardingOption; 2195 Each ForwardingOption consists of the following values: 2197 type 2198 The type of the option. 2200 length 2201 The length of the rest of the structure. 2203 flags 2204 Three flags are defined FORWARD_CRITICAL(0x01), 2205 DESTINATION_CRITICAL(0x02), and RESPONSE_COPY(0x04). These flags 2206 MUST not be set in a response. If the FORWARD_CRITICAL flag is 2207 set, any node that would forward the message but does not 2208 understand this options MUST reject the request with an 757 error 2209 resonse. If the DESTINATION_CRITICAL flag is set, any node 2210 generates a response to the message but does not understand the 2211 forwarding option MUST reject the request with an 757 error 2212 resonse. If the RESPONSE_COPY flag is set, any node generating a 2213 response MUST copy the option from the request to the response and 2214 clear the RESPONSE_COPY, FORWARD_CRITICAL and DESTINATION_CRITICAL 2215 flags. 2217 option 2218 The option value. 2220 6.2.3. Message Contents Format 2222 The second major part of a RELOAD message is the contents part, which 2223 is defined by MessageContents: 2225 struct { 2226 MessageCode message_code; 2227 opaque payload<0..2^24-1>; 2228 } MessageContents; 2230 The contents of this structure are as follows: 2232 message_code 2233 This indicates the message that is being sent. The code space is 2234 broken up as follows. 2236 0 Reserved 2238 1 .. 0x7fff Requests and responses. These code points are always 2239 paired, with requests being odd and the corresponding response 2240 being the request code plus 1. Thus, "ping_request" (the Ping 2241 request) has value 1 and "ping_answer" (the Ping response) has 2242 value 2 2244 0xffff Error 2246 message_body 2247 The message body itself, represented as a variable-length string 2248 of bytes. The bytes themselves are dependent on the code value. 2249 See the sections describing the various RELOAD methods (Join, 2250 Update, Attach, Store, Fetch, etc.) for the definitions of the 2251 payload contents. 2253 6.2.3.1. Response Codes and Response Errors 2255 A peer processing a request returns its status in the message_code 2256 field. If the request was a success, then the message code is the 2257 response code that matches the request (i.e., the next code up). The 2258 response payload is then as defined in the request/response 2259 descriptions. 2261 If the request failed, then the message code is set to 0xffff (error) 2262 and the payload MUST be an error_response PDU, as shown below. 2264 When the message code is 0xffff, the payload MUST be an 2265 ErrorResponse. 2267 public struct { 2268 uint16 error_code; 2269 opaque reason_phrase<0..2^8-1>; /* String*/ 2270 opaque error_info<0..2^16-1>; 2271 } ErrorResponse; 2273 The contents of this structure are as follows: 2275 error_code 2276 A numeric error code indicating the error that occurred. 2278 reason_phrase 2279 A free form text string indicating the reason for the response. 2280 The reason phrase SHOULD BE as indicated in the error code list 2281 below (e.g., "Moved Temporarily"). [[Open Issue: These reason 2282 phrases are pretty useless. Like the rest of this error system, 2283 They're a holdover from SIP. Should we remove?]] 2285 error_info 2286 Payload specific error information. This MUST be empty (zero 2287 length) except as specified below. 2289 The following error code values are defined. [[TODO: These are 2290 currently semi-aligned with SIP codes. that's probably bad and we 2291 need to fix.] 2293 302 (Moved Temporarily): The requesting peer SHOULD retry the 2294 request at the new address specified in the 302 response message. 2296 401 (Unauthorized): The requesting peer needs to sign and provide a 2297 certificate. [[TODO: The semantics here don't seem quite 2298 right.]] 2300 403 (Forbidden): The requesting peer does not have permission to 2301 make this request. 2303 404 (Not Found): The resource or peer cannot be found or does not 2304 exist. 2306 408 (Request Timeout): A response to the request has not been 2307 received in a suitable amount of time. The requesting peer MAY 2308 resend the request at a later time. 2310 412 (Precondition Failed): A request can't be completed because some 2311 precondition was incorrect. For instance, the wrong generation 2312 counter was provided 2314 498 (Incompatible with Overlay) A peer receiving the request is 2315 using a different overlay, overlay algorithm, or hash algorithm. 2316 [[Open Issue: What is the best error number and reason phrase to 2317 use?]] 2319 757 (Unsupported Forwarding Option) A peer receiving the request 2320 with a forwarnding options flaged as critical but the peer does 2321 not support this option. See section Section 6.2.2.3. [[Open 2322 Issue: What is the best error number and reason phrase to use?]] 2324 6.2.4. Signature 2326 The third part of a RELOAD message is the signature, represented by a 2327 Signature structure. The message signature is computed over the 2328 payload and parts of forwarding header. The payload, in case of a 2329 Store, may contain an additional signature computed over a StoreReq 2330 structure. All signatures are formatted using the Signature element. 2331 This element is also used in other contexts where signatures are 2332 needed. The input structure to the signature computation varies 2333 depending on the data element being signed. 2335 enum {reserved(0), signer_identity_peer (1), 2336 signer_identity_name (2), signer_identity_certificate (3), 2337 (255)} SignerIdentityType; 2339 select (identity_type) { 2340 case signer_identity_peer: 2341 NodeId id; 2343 case signer_identity_name: 2344 opaque name<0..2^16-1>; 2346 case signer_identity_certificate: 2347 opaque certificate<0..2^16-1>; 2349 /* This structure may be extended with new types */ 2350 } SignerIdentityValue; 2352 struct { 2353 SignerIdentityType identity_type; 2354 uint16 length; 2355 SignerIdentityValue identity[SignerIdentity.length]; 2356 } SignerIdentity; 2358 struct { 2359 SignatureAndHashAlgorithm algorithm; 2360 SignerIdentity identity; 2361 opaque signature_value<0..2^16-1>; 2362 } Signature; 2364 The signature construct contains the following values: 2366 algorithm 2367 The signature algorithm in use. The algorithm definitions are 2368 found in the IANA TLS SignatureAlgorithm Registry. 2370 identity 2371 The identity or certificate used to form the signature 2373 signature_value 2374 The value of the signature 2376 A number of possible identity formats are permitted. The current 2377 possibilities are: a Node-ID, a user name, and a certificate. 2379 For signatures over messages the input to the signature is computed 2380 over: 2382 overlay + transaction_id + MessageContents + SignerIdentity 2384 Where overlay and transaction_id come from the forwarding header and 2385 + indicates concatenation. 2387 [[TODO: Check the inputs to this carefully.]] 2389 The input to signatures over data values is different, and is 2390 described in Section 7.1. 2392 6.3. Overlay Topology 2394 As discussed in previous sections, RELOAD does not itself implement 2395 any overlay topology. Rather, it relies on Topology Plugins, which 2396 allow a variety of overlay algorithms to be used while maintaining 2397 the same RELOAD core. This section describes the requirements for 2398 new topology plugins and the methods that RELOAD provides for overlay 2399 topology maintenance. 2401 6.3.1. Topology Plugin Requirements 2403 When specifying a new overlay algorithm, at least the following need 2404 to be described: 2406 o Joining procedures, including the contents of the Join message. 2407 o Stabilization procedures, including the contents of the Update 2408 message, the frequency of topology probes and keepalives, and the 2409 mechanism used to detect when peers have disconnected. 2410 o Exit procedures, including the contents of the Leave message. 2411 o The length of the Resource-IDs and Node-IDs. For DHTs, the hash 2412 algorithm to compute the hash of an identifier. 2413 o The procedures that peers use to route messages. 2414 o The replication strategy used to ensure data redundancy. 2416 6.3.2. Methods and types for use by topology plugins 2418 This section describes the methods that topology plugins use to join, 2419 leave, and maintain the overlay. 2421 6.3.2.1. Join 2423 A new peer (but which already has credentials) uses the JoinReq 2424 message to join the overlay. The JoinReq is sent to the responsible 2425 peer depending on the routing mechanism described in the topology 2426 plugin. This notifies the responsible peer that the new peer is 2427 taking over some of the overlay and it needs to synchronize its 2428 state. 2430 struct { 2431 NodeId joining_peer_id; 2432 opaque overlay_specific_data<0..2^16-1>; 2433 } JoinReq; 2435 The minimal JoinReq contains only the Node-ID which the sending peer 2436 wishes to assume. Overlay algorithms MAY specify other data to 2437 appear in this request. 2439 If the request succeeds, the responding peer responds with a JoinAns 2440 message, as defined below: 2442 struct { 2443 opaque overlay_specific_data<0..2^16-1>; 2444 } JoinAns; 2446 If the request succeeds, the responding peer MUST follow up by 2447 executing the right sequence of Stores and Updates to transfer the 2448 appropriate section of the overlay space to the joining peer. In 2449 addition, overlay algorithms MAY define data to appear in the 2450 response payload that provides additional info. 2452 In general, nodes which cannot form connections SHOULD report an 2453 error. However, implementations MUST provide some mechanism whereby 2454 nodes can determine they are potentially the first node and take 2455 responsibility for the overlay. This specification does not mandate 2456 any particular mechanism, but a configuration flag or setting seems 2457 appropriate. 2459 6.3.2.2. Leave 2461 The LeaveReq message is used to indicate that a node is exiting the 2462 overlay. A node SHOULD send this message to each peer with which it 2463 is directly connected prior to exiting the overlay. 2465 public struct { 2466 NodeId leaving_peer_id; 2467 opaque overlay_specific_data<0..2^16-1>; 2468 } LeaveReq; 2470 LeaveReq contains only the Node-ID of the leaving peer. Overlay 2471 algorithms MAY specify other data to appear in this request. 2473 Upon receiving a Leave request, a peer MUST update its own routing 2474 table, and send the appropriate Store/Update sequences to re- 2475 stabilize the overlay. 2477 6.3.2.3. Update 2479 Update is the primary overlay-specific maintenance message. It is 2480 used by the sender to notify the recipient of the sender's view of 2481 the current state of the overlay (its routing state) and it is up to 2482 the recipient to take whatever actions are appropriate to deal with 2483 the state change. 2485 The contents of the UpdateReq message are completely overlay- 2486 specific. The UpdateAns response is expected to be either success or 2487 an error. 2489 6.3.2.4. Route_Query 2491 The Route_Query request allows the sender to ask a peer where they 2492 would route a message directed to a given destination. In other 2493 words, a RouteQuery for a destination X requests the Node-ID where 2494 the receiving peer would next route to get to X. A RouteQuery can 2495 also request that the receiving peer initiate an Update request to 2496 transfer his routing table. 2498 One important use of the RouteQuery request is to support iterative 2499 routing. The sender selects one of the peers in its routing table 2500 and sends it a RouteQuery message with the destination_object set to 2501 the Node-ID or Resource-ID it wishes to route to. The receiving peer 2502 responds with information about the peers to which the request would 2503 be routed. The sending peer MAY then Attaches to that peer(s), and 2504 repeats the RouteQuery. Eventually, the sender gets a response from 2505 a peer that is closest to the identifier in the destination_object as 2506 determined by the topology plugin. At that point, the sender can 2507 send messages directly to that peer. 2509 6.3.2.4.1. Request Definition 2511 A RouteQueryReq message indicates the peer or resource that the 2512 requesting peer is interested in. It also contains a "send_update" 2513 option allowing the requesting peer to request a full copy of the 2514 other peer's routing table. 2516 struct { 2517 Boolean send_update; 2518 Destination destination; 2519 opaque overlay_specific_data<0..2^16-1>; 2520 } RouteQueryReq; 2522 The contents of the RouteQueryReq message are as follows: 2524 send_update 2525 A single byte. This may be set to "true" to indicate that the 2526 requester wishes the responder to initiate an Update request 2527 immediately. Otherwise, this value MUST be set to "false". 2529 destination 2530 The destination which the requester is interested in. This may be 2531 any valid destination object, including a Node-ID, compressed ids, 2532 or resource-id. 2534 overlay_specific_data 2535 Other data as appropriate for the overlay. 2537 6.3.2.4.2. Response Definition 2539 A response to a successful RouteQueryReq request is a RouteQueryAns 2540 message. This is completely overlay specific. 2542 6.4. Forwarding Layer 2544 Each node maintains connections to a set of other nodes defined by 2545 the topology plugin. 2547 6.4.1. Transports 2549 RELOAD can use multiple transports to send its messages. Because ICE 2550 is used to establish connections (see Section 6.4.2.1.3), RELOAD 2551 nodes are able to detect which transports are offered by other nodes 2552 and establish connections between each other. Any transport protocol 2553 needs to be able to establish a secure, authenticated connection, and 2554 provide data origin authentication and message integrity for 2555 individual data elements. RELOAD currently supports two transport 2556 protocols: 2558 o TLS [REF] over TCP 2559 o DTLS [RFC4347] over UDP 2561 Note that although UDP does not properly have "connections", both TLS 2562 and DTLS have a handshake which establishes a stateful association, a 2563 similar stateful construct, and we simply refer to these as 2564 "connections" for the purposes of this document. 2566 6.4.1.1. Future Support for HIP 2568 The P2PSIP Working Group has expressed interest in supporting a HIP- 2569 based transport. Such support would require specifying such details 2570 as: 2572 o How to issue certificates which provided identities meaningful to 2573 the HIP base exchange. We anticipate that this would require a 2574 mapping between ORCHIDs and NodeIds. 2575 o How to carry the HIP I1 and I2 messages. We anticipate that this 2576 would require defining a HIP Tunnel usage. 2577 o How to carry RELOAD messages over HIP. 2579 We leave this work as a topic for another draft. 2581 6.4.1.2. Reliability for Unreliable Transports 2583 When RELOAD is carried over DTLS or another unreliable transport, it 2584 needs to be used with a reliability and congestion control mechanism, 2585 which is provided on a hop-by-hop basis, matching the semantics if 2586 TCP were used. The basic principle is that each message, regardless 2587 of if it carries a request or responses, will get an ACK and be 2588 reliably retransmitted. The receiver's job is very simple, limited 2589 to just sending ACKs. All the complexity is at the sender side. 2590 This allows the sending implementation to trade off performance 2591 versus implementation complexity without affecting the wire protocol. 2593 In order to support unreliable transport, each message is wrapped in 2594 a very simple framing layer (FramedMessage) which is only used for 2595 each hop. This layer contains a sequence number which can then be 2596 used for ACKs. 2598 6.4.1.2.1. Framed Message Format 2600 The definition of FramedMessage is: 2602 enum {data (128), ack (129), (255)} FramedMessageType; 2604 struct { 2605 FramedMessageType type; 2607 select (type) { 2608 case data: 2609 uint24 sequence; 2610 opaque message<0..2^24-1>; 2612 case ack: 2613 uint24 ack_sequence; 2614 uint32 received; 2615 }; 2616 } FramedMessage; 2618 The type field of the PDU is set to indicate whether the message is 2619 data or an acknowledgement. Note that these values have been set to 2620 force the first bit to be high, thus allowing easy demultiplexing 2621 with STUN. All FramedMessageType values must be > 128. 2623 If the message is of type "data", then the remainder of the PDU is as 2624 follows: 2626 sequence 2627 the sequence number 2629 message 2630 the original message that is being transmitted. 2632 Each connection has it own sequence number. Initially the value is 2633 zero and it increments by exactly one for each message sent over that 2634 connection. 2636 When the receiver receive a message, it SHOULD immediately send an 2637 ACK message. The receiver MUST keep track of the 32 most recent 2638 sequence numbers received on this association in order to generate 2639 the appropriate ack. 2641 If the PDU is of type "ack", the contents are as follows: 2643 ack_sequence 2644 The sequence number of the message being acknowledged. 2646 received 2647 A bitmask indicating whether or not each of the previous 32 2648 packets has been received before the sequence number in 2649 ack_sequence. The high order bit represents the first packet in 2650 the sequence space. 2652 The received field bits in the ACK provide a very high degree of 2653 redundancy for the sender to figure out which packets the receiver 2654 received and can then estimate packet loss rates. If the sender also 2655 keeps track of the time at which recent sequence numbers were sent, 2656 the RTT can be estimated. 2658 6.4.1.2.2. Retransmission and Flow Control 2660 Because the receiver's role is limited to providing packet 2661 acknowledgements, a wide variety of congestion control algorithms can 2662 be implemented on the sender side while using the same basic wire 2663 protocol. It is RECOMMENDED that senders implement TFRC-SP [RFC4828] 2664 and use the received bitmask to allow the sender to compute packet 2665 loss event rates. Senders MUST implement a retransmission and 2666 congestion control scheme no more aggressive then TFRC-SP. 2668 6.4.1.3. Fragmentation and Reassembly 2670 In order to allow transport over datagram protocols, RELOAD messages 2671 may be fragmented. If a message is too large for a peer to transmit 2672 to the next peer it MUST fragment the message. Note that this 2673 implies that intermediate peers may re-fragment messages if the 2674 incoming and outgoing paths have different maximum datagram sizes. 2675 Intermediate peers SHOULD NOT reassemble fragments. 2677 Upon receipt of a fragmented message by the intended peer, the peer 2678 holds the fragments in a holding buffer until the entire message has 2679 been received. The message is then reassembled into a single 2680 unfragmented message and processed. In order to mitigate denial of 2681 service attacks, receivers SHOULD time out incomplete fragments. 2682 [[TODO: Describe algorithm]] 2684 6.4.2. Connection Management Methods 2686 This section defines the methods RELOAD uses to form and maintain 2687 connections between nodes in the overlay. Three methods are defined: 2689 Attach: used to form connections between nodes. When node A wants 2690 to connect to node B, it sends an Attach message to node B through 2691 the overlay. The Attach contains A's ICE parameters. B responds 2692 with its ICE parameters and the two nodes perform ICE to form 2693 connection. 2694 Ping: is a simple request/response which is used to verify 2695 connectivity (analogous to the UNIX ping command) along a path and 2696 to gather a small amount of information about the resources held 2697 by the target peer 2698 Tunnel: in some cases, it will be too expensive for an application 2699 layer protocol to set up a connection in order to send a small 2700 number of messages. The Tunnel message allows applications to 2701 route individual application layer protocol messages through the 2702 overlay. 2704 6.4.2.1. Attach 2706 A node sends an Attach request when it wishes to establish a direct 2707 TCP or UDP connection to another node for the purposes of sending 2708 RELOAD messages or application layer protocol messages, such as SIP. 2709 Detailed procedures for the Attach and its response are described in 2710 Section 6.4.2.1. 2712 An Attach in and of itself does not result in updating the routing 2713 table of either node. That function is performed by Updates. If 2714 node A has Attached to node B, but not received any Updates from B, 2715 it MAY route messages which are directly addressed to B through that 2716 channel but MUST NOT route messages through B to other peers via that 2717 channel. The process of Attaching is separate from the process of 2718 becoming a peer (using Update) to prevent half-open states where a 2719 node has started to form connections but is not really ready to act 2720 as a peer. 2722 6.4.2.1.1. Request Definition 2724 An AttachReq message contains the requesting peer's ICE connection 2725 parameters formatted into a binary structure. 2727 typedef opaque IceCandidate<0..2^16-1>; 2729 struct { 2730 opaque ufrag<0..2^8-1>; 2731 opaque password<0..2^8-1>; 2732 uint16 application; 2733 opaque role<0..2^8-1>; 2734 IceCandidate candidates<0..2^16-1>; 2735 } AttachReqAns; 2737 The values contained in AttachReq and AttachAns are: 2739 ufrag 2740 The username fragment (from ICE) 2742 password 2743 The ICE password. 2745 application 2746 A 16-bit port number. This port number represents the IANA 2747 registered port of the protocol that is going to be sent on this 2748 connection. For SIP, this is 5060 or 5061, and for RELOAD is TBD. 2749 By using the IANA registered port, we avoid the need for an 2750 additional registry and allow RELOAD to be used to set up 2751 connections for any existing or future application protocol. 2753 role 2754 An active/passive/actpass attribute from RFC 4145 [RFC4145]. 2756 candidates 2757 One or more ICE candidate values in the string representation used 2758 in ordinary ICE. [[OPEN ISSUE: This is convenient for stacks, 2759 but unaesthetic.]] Each candidate has an IP address, IP address 2760 family, port, transport protocol, priority, foundation, component 2761 ID, STUN type and related address. The candidate_list is a list 2762 of string candidate values from ICE. 2764 These values should be generated using the procedures described in 2765 Section 6.4.2.1.3. 2767 6.4.2.1.2. Response Definition 2769 If a peer receives an Attach request, it SHOULD follow the process 2770 the request and generate its own response with a AttachReqAns. It 2771 should then begin ICE checks. When a peer receives an Attach 2772 response, it SHOULD parse the response and begin its own ICE checks. 2774 6.4.2.1.3. Using ICE With RELOAD 2776 This section describes the profile of ICE that is used with RELOAD. 2777 RELOAD implementations MUST implement full ICE. Because RELOAD 2778 always tries to use TCP and then UDP as a fallback, there will be 2779 multiple candidates of the same IP version, which requires full ICE. 2781 In ICE as defined by [I-D.ietf-mmusic-ice], SDP is used to carry the 2782 ICE parameters. In RELOAD, this function is performed by a binary 2783 encoding in the Attach method. This encoding is more restricted than 2784 the SDP encoding because the RELOAD environment is simpler: 2786 o Only a single media stream is supported. 2787 o In this case, the "stream" refers not to RTP or other types of 2788 media, but rather to a connection for RELOAD itself or for SIP 2789 signaling. 2790 o RELOAD only allows for a single offer/answer exchange. Unlike the 2791 usage of ICE within SIP, there is never a need to send a 2792 subsequent offer to update the default candidates to match the 2793 ones selected by ICE. 2795 An agent follows the ICE specification as described in 2796 [I-D.ietf-mmusic-ice] and [I-D.ietf-mmusic-ice-tcp] with the changes 2797 and additional procedures described in the subsections below. 2799 6.4.2.1.4. Collecting STUN Servers 2801 ICE relies on the node having one or more STUN servers to use. In 2802 conventional ICE, it is assumed that nodes are configured with one or 2803 more STUN servers through some out-of-band mechanism. This is still 2804 possible in RELOAD but RELOAD also learns STUN servers as it connects 2805 to other peers. Because all RELOAD peers implement ICE and use STUN 2806 keepalives, every peer is a STUN server [I-D.ietf-behave-rfc3489bis]. 2807 Accordingly, any peer a node knows will be willing to be a STUN 2808 server -- though of course it may be behind a NAT. 2810 A peer on a well-provisioned wide-area overlay will be configured 2811 with one or more bootstrap peers. These peers make an initial list 2812 of STUN servers. However, as the peer forms connections with 2813 additional peers, it builds more peers it can use as STUN servers. 2815 Because complicated NAT topologies are possible, a peer may need more 2816 than one STUN server. Specifically, a peer that is behind a single 2817 NAT will typically observe only two IP addresses in its STUN checks: 2818 its local address and its server reflexive address from a STUN server 2819 outside its NAT. However, if there are more NATs involved, it may 2820 discover that it learns additional server reflexive addresses (which 2821 vary based on where in the topology the STUN server is). To maximize 2822 the chance of achieving a direct connection, a peer SHOULD group 2823 other peers by the peer-reflexive addresses it discovers through 2824 them. It SHOULD then select one peer from each group to use as a 2825 STUN server for future connections. 2827 Only peers to which the peer currently has connections may be used. 2828 If the connection to that host is lost, it MUST be removed from the 2829 list of stun servers and a new server from the same group SHOULD be 2830 selected. 2832 6.4.2.1.5. Gathering Candidates 2834 When a node wishes to establish a connection for the purposes of 2835 RELOAD signaling or SIP signaling (or any other application protocol 2836 for that matter), it follows the process of gathering candidates as 2837 described in Section 4 of ICE [I-D.ietf-mmusic-ice]. RELOAD utilizes 2838 a single component, as does SIP. Consequently, gathering for these 2839 "streams" requires a single component. 2841 An agent MUST implement ICE-tcp [I-D.ietf-mmusic-ice], and MUST 2842 gather at least one UDP and one TCP host candidate for RELOAD and for 2843 SIP. 2845 The ICE specification assumes that an ICE agent is configured with, 2846 or somehow knows of, TURN and STUN servers. RELOAD provides a way 2847 for an agent to learn these by querying the overlay, as described in 2848 Section 6.4.2.1.4 and Section 9. 2850 The agent SHOULD prioritize its TCP-based candidates over its UDP- 2851 based candidates in the prioritization described in Section 4.1.2 of 2852 ICE [I-D.ietf-mmusic-ice]. 2854 The default candidate selection described in Section 4.1.3 of ICE is 2855 ignored; defaults are not signaled or utilized by RELOAD. 2857 6.4.2.1.6. Encoding the Attach Message 2859 Section 4.3 of ICE describes procedures for encoding the SDP for 2860 conveying RELOAD or SIP ICE candidates. Instead of actually encoding 2861 an SDP, the candidate information (IP address and port and transport 2862 protocol, priority, foundation, component ID, type and related 2863 address) is carried within the attributes of the Attach request or 2864 its response. Similarly, the username fragment and password are 2865 carried in the Attach message or its response. Section 6.4.2.1 2866 describes the detailed attribute encoding for Attach. The Attach 2867 request and its response do not contain any default candidates or the 2868 ice-lite attribute, as these features of ICE are not used by RELOAD. 2869 The Attach request and its response also contain a application 2870 attribute, with a value of SIP or RELOAD, which indicates what 2871 protocol is to be run over the connection. The RELOAD Attach request 2872 MUST only be utilized to set up connections for application protocols 2873 that can be multiplexed with STUN. 2875 Since the Attach request contains the candidate information and short 2876 term credentials, it is considered as an offer for a single media 2877 stream that happens to be encoded in a format different than SDP, but 2878 is otherwise considered a valid offer for the purposes of following 2879 the ICE specification. Similarly, the Attach response is considered 2880 a valid answer for the purposes of following the ICE specification. 2882 6.4.2.1.7. Verifying ICE Support 2884 An agent MUST skip the verification procedures in Section 5.1 and 6.1 2885 of ICE. Since RELOAD requires full ICE from all agents, this check 2886 is not required. 2888 6.4.2.1.8. Role Determination 2890 The roles of controlling and controlled as described in Section 5.2 2891 of ICE are still utilized with RELOAD. However, the offerer (the 2892 entity sending the Attach request) will always be controlling, and 2893 the answerer (the entity sending the Attach response) will always be 2894 controlled. The connectivity checks MUST still contain the ICE- 2895 CONTROLLED and ICE-CONTROLLING attributes, however, even though the 2896 role reversal capability for which they are defined will never be 2897 needed with RELOAD. This is to allow for a common codebase between 2898 ICE for RELOAD and ICE for SDP. 2900 6.4.2.1.9. Connectivity Checks 2902 The processes of forming check lists in Section 5.7 of ICE, 2903 scheduling checks in Section 5.8, and checking connectivity checks in 2904 Section 7 are used with RELOAD without change. 2906 6.4.2.1.10. Concluding ICE 2908 The controlling agent MUST utilize regular nomination. This is to 2909 ensure consistent state on the final selected pairs without the need 2910 for an updated offer, as RELOAD does not generate additional offer/ 2911 answer exchanges. 2913 The procedures in Section 8 of ICE are followed to conclude ICE, with 2914 the following exceptions: 2916 o The controlling agent MUST NOT attempt to send an updated offer 2917 once the state of its single media stream reaches Completed. 2918 o Once the state of ICE reaches Completed, the agent can immediately 2919 free all unused candidates. This is because RELOAD does not have 2920 the concept of forking, and thus the three second delay in Section 2921 8.3 of ICE does not apply. 2923 6.4.2.1.11. Subsequent Offers and Answers 2925 An agent MUST NOT send a subsequent offer or answer. Thus, the 2926 procedures in Section 9 of ICE MUST be ignored. 2928 6.4.2.1.12. Media Keepalives 2930 STUN MUST be utilized for the keepalives described in Section 10 of 2931 ICE. 2933 6.4.2.1.13. Sending Media 2935 The procedures of Section 11 apply to RELOAD as well. However, in 2936 this case, the "media" takes the form of application layer protocols 2937 (RELOAD or SIP for example) over TLS or DTLS. Consequently, once ICE 2938 processing completes, the agent will begin TLS or DTLS procedures to 2939 establish a secure connection. The node which sent the Attach 2940 request MUST be the TLS server. The other node MUST be the TLS 2941 client. The nodes MUST verify that the certificate presented in the 2942 handshake matches the identity of the other peer as found in the 2943 Attach message. Once the TLS or DTLS signaling is complete, the 2944 application protocol is free to use the connection. 2946 The concept of a previous selected pair for a component does not 2947 apply to RELOAD, since ICE restarts are not possible with RELOAD. 2949 6.4.2.1.14. Receiving Media 2951 An agent MUST be prepared to receive packets for the application 2952 protocol (TLS or DTLS carrying RELOAD, SIP or anything else) at any 2953 time. The jitter and RTP considerations in Section 11 of ICE do not 2954 apply to RELOAD or SIP. 2956 6.4.2.2. Ping 2958 Ping provides a number of primitive "exploration" services: (1) it 2959 is used to test connectivity along a path (2) it allows node to 2960 determine which resources another node is responsible for (3) it 2961 allows some discovery services in multicast settings. A ping can be 2962 addressed to a specific Node-ID, the peer controlling a given 2963 location (by using a resource ID) or to the broadcast Node-ID (all 2964 1s). In either case, the target Node-IDs respond with a simple 2965 response containing some status information. 2967 6.4.2.2.1. Request Definition 2969 The PingReq message contains a list (potentially empty) of the pieces 2970 of status information that the requester would like the responder to 2971 provide. 2973 enum { responsible_set(1), num_resources(2), (255)} 2974 PingInformationType; 2976 struct { 2977 PingInformationType requested_info<0..2^8-1>; 2978 } PingReq 2980 The two currently defined values for PingInformation are: 2982 responsible_set 2983 indicates that the peer should Respond with the fraction of the 2984 overlay for which the responding peer is responsible. 2986 num_resources 2987 indicates that the peer should Respond with the number of 2988 resources currently being stored by the peer. 2990 6.4.2.2.2. Response Definition 2992 A successful PingAns response contains the information elements 2993 requested by the peer. 2995 struct { 2996 PingInformationType type; 2998 select (type) { 2999 case responsible_set: 3000 uint32 responsible_ppb; 3002 case num_resources: 3003 uint32 num_resources; 3005 /* This type may be extended */ 3007 }; 3008 } PingInformation; 3010 struct { 3011 uint64 response_id; 3012 PingInformation ping_info<0..2^16-1>; 3013 } PingAns; 3015 A PingAns message contains the following elements: 3017 response_id 3018 A randomly generated 64-bit response ID. This is used to 3019 distinguish Ping responses in cases where the Ping request is 3020 multicast. 3022 ping_info 3023 A sequence of PingInformation structures, as shown below. 3025 Each of the current possible Ping information types is a 32-bit 3026 unsigned integer. For type "responsible_ppb", it is the fraction of 3027 the overlay for which the peer is responsible in parts per billion. 3028 For type "num_resources", it is the number of resources the peer is 3029 storing. 3031 The responding peer SHOULD include any values that the requesting 3032 peer requested and that it recognizes. They SHOULD be returned in 3033 the requested order. Any other values MUST NOT be returned. 3035 6.4.2.3. Tunnel 3037 A node sends a Tunnel request when it wishes to exchange application- 3038 layer protocol messages without the expense of establishing a direct 3039 connection via Attach or when ICE is unable to establish a direct 3040 connection via Attach and a TURN relay is not available. The 3041 application-level protocols that are routed via the Tunnel request 3042 are defined by that application's usage. 3044 Note: The decision of whether to route application-level traffic 3045 across the overlay or to open a direct connection requires careful 3046 consideration of the overhead involved in each transaction. 3047 Establishing a direct connection requires greater initial setup 3048 costs, but after setup, communication is faster and imposes no 3049 overhead on the overlay. For example, for the SIP usage, an 3050 INVITE request to establish a voice call might be routed over the 3051 overlay, a SUBSCRIBE with regular updates would be better used 3052 with a Attach, and media would both impose too great a load on the 3053 overlay and likely receive unacceptable performance. However, 3054 there may be a tradeoff between locating TURN servers and relying 3055 on Tunnel for packet routing. 3057 When a usage requires the Tunnel method, it must specify the specific 3058 application protocol(s) that will be Tunneled and for each protocol, 3059 specify: 3061 o An application attribute that indicates the protocol being 3062 tunneled. This the IANA-registered port of the application 3063 protocol. 3064 o The conditions under which the application will be Tunneled over 3065 the overlay rather than using a direct Attach. 3066 o A mechanism for moving future application-level communication from 3067 Tunneling on the overlay to a direct Connection, or an explanation 3068 why this is unnecessary. 3069 o A means of associating messages together as required for dialog- 3070 oriented or request/response-oriented protocols. 3071 o How the Tunneled message (and associated responses) will be 3072 delivered to the correct application. This is particularly 3073 important if there might be multiple instances of the application 3074 on or behind a single peer. 3076 6.4.2.3.1. Request Definition 3078 The TunnelReq message contains the application PDU that the 3079 requesting peer wishes to transmit, along with some control 3080 information identifying the handling of the PDU. 3082 struct { 3083 uint16 application; 3084 opaque dialog_id<0..2^8-1>; 3085 opaque application_pdu<0..2^24-1>; 3086 } TunnelReq; 3088 The values contained in the TunnelReq are: 3090 application 3091 A 16-bit port number. This port number represents the IANA 3092 registered port of the protocol that is going to be sent on this 3093 connection. For SIP, this is 5060 or 5061, and for RELOAD is TBD. 3094 By using the IANA registered port, we avoid the need for an 3095 additional registry and allow RELOAD to be used to set up 3096 connections for any existing or future application protocol. 3098 dialog_id 3099 An arbitrary string providing an application-defined way of 3100 associating related Tunneled messages. This attribute may also 3101 encode sequence information as required by the application 3102 protocol. 3104 application_pdu 3105 An application PDU in the format specified by the application. 3107 6.4.2.3.2. Response Definition 3109 A TunnelAns message serves as confirmation that the message was 3110 received by the destination peer. It implies nothing about the 3111 processing of the application. If the application protocol specifies 3112 an acknowledgement or confirmation, that must be sent with a separate 3113 Tunnel request. The TunnelAns message is empty (has a zero length 3114 payload) 3116 7. Data Storage Protocol 3118 RELOAD provides a set of generic mechanisms for storing and 3119 retrieving data in the Overlay Instance. These mechanisms can be 3120 used for new applications simply by defining new code points and a 3121 small set of rules. No new protocol mechanisms are required. 3123 The basic unit of stored data is a single StoredData structure: 3125 struct { 3126 uint32 length; 3127 uint64 storage_time; 3128 uint32 lifetime; 3129 StoredDataValue value; 3130 Signature signature; 3131 } StoredData; 3133 The contents of this structure are as follows: 3135 length 3136 The length of the rest of the structure in octets. 3138 storage_time 3139 The time when the data was stored in absolute time, represented in 3140 seconds since the Unix epoch. Any attempt to store a data value 3141 with a storage time before that of a value already stored at this 3142 location MUST generate a 412 error. This prevents rollback 3143 attacks. Note that this does not require synchronized clocks: 3144 the receiving peer uses the storage time in the previous store, 3145 not its own clock. 3147 lifetime 3148 The validity period for the data, in seconds, starting from the 3149 time of store. 3151 value 3152 The data value itself, as described in Section 7.2. 3154 signature 3155 A signature over the data value. Section 7.1 describes the 3156 signature computation. The element is formatted as described in 3157 Section 6.2.4 3159 Each resource-id specifies a single location in the Overlay Instance. 3160 However, each location may contain multiple StoredData values 3161 distinguished by kind-id. The definition of a kind describes both 3162 the data values which may be stored and the data model of the data. 3163 Some data models allow multiple values to be stored under the same 3164 kind-id. Section Section 7.2 describes the available data models. 3165 Thus, for instance, a given resource-id might contain a single-value 3166 element stored under kind-id X and an array containing multiple 3167 values stored under kind-id Y. 3169 7.1. Data Signature Computation 3171 Each StoredData element is individually signed. However, the 3172 signature also must be self-contained and cover the kind-id and 3173 resource-id even though they are not present in the StoredData 3174 structure. The input to the signature algorithm is: 3176 resource_id + kind + StoredData 3178 Where these values are: 3180 resource 3181 The resource ID where this data is stored. 3183 kind 3184 The kind-id for this data. 3186 StoredData 3187 The contents of the stored data value, as described in the 3188 previous sections. 3190 [OPEN ISSUE: Should we include the identity in the string that forms 3191 the input to the signature algorithm?.] 3193 Once the signature has been computed, the signature is represented 3194 using a signature element, as described in Section 6.2.4. 3196 7.2. Data Models 3198 The protocol currently defines the following data models: 3200 o single value 3201 o array 3202 o dictionary 3204 These are represented with the StoredDataValue structure: 3206 enum { reserved(0), single_value(1), array(2), 3207 dictionary(3), (255)} DataModel; 3209 struct { 3210 Boolean exists; 3211 opaque value<0..2^32-1>; 3212 } DataValue; 3214 struct { 3215 DataModel model; 3217 select (model) { 3218 case single_value: 3219 DataValue single_value_entry; 3221 case array: 3222 ArrayEntry array_entry; 3224 case dictionary: 3225 DictionaryEntry dictionary_entry; 3227 /* This structure may be extended */ 3228 } ; 3229 } StoredDataValue; 3231 We now discuss the properties of each data model in turn: 3233 7.2.1. Single Value 3235 A single-value element is a simple, opaque sequence of bytes. There 3236 may be only one single-value element for each resource-id, kind-id 3237 pair. 3239 A single value element is represented as a DataValue, which contains 3240 the following two elements: 3242 exists 3243 This value indicates whether the value exists at all. If it is 3244 set to False, it means that no value is present. If it is True, 3245 that means that a value is present. This gives the protocol a 3246 mechanism for indicating nonexistence as opposed to emptiness. 3248 value 3249 The stored data. 3251 7.2.2. Array 3253 An array is a set of opaque values addressed by an integer index. 3254 Arrays are zero based. Note that arrays can be sparse. For 3255 instance, a Store of "X" at index 2 in an empty array produces an 3256 array with the values [ NA, NA, "X"]. Future attempts to fetch 3257 elements at index 0 or 1 will return values with "exists" set to 3258 False. 3260 A array element is represented as an ArrayEntry: 3262 struct { 3263 uint32 index; 3264 DataValue value; 3265 } ArrayEntry; 3267 The contents of this structure are: 3269 index 3270 The index of the data element in the array. 3272 value 3273 The stored data. 3275 7.2.3. Dictionary 3277 A dictionary is a set of opaque values indexed by an opaque key with 3278 one value for each key. single dictionary entry is represented as 3279 follows 3281 A dictionary element is represented as a DictionaryEntry: 3283 typedef opaque DictionaryKey<0..2^16-1>; 3285 struct { 3286 DictionaryKey key; 3287 DataValue value; 3288 } DictionaryEntry; 3290 The contents of this structure are: 3292 key 3293 The dictionary key for this value. 3295 value 3296 The stored data. 3298 7.3. Data Storage Methods 3300 RELOAD provides several methods for storing and retrieving data: 3302 o Store values in the overlay 3303 o Fetch values from the overlay 3304 o Remove values from the overlay 3305 o Find the values stored at an individual peer 3307 These methods are each described in the following sections. 3309 7.3.1. Store 3311 The Store method is used to store data in the overlay. The format of 3312 the Store request depends on the data model which is determined by 3313 the kind. 3315 7.3.1.1. Request Definition 3317 A StoreReq message is a sequence of StoreKindData values, each of 3318 which represents a sequence of stored values for a given kind. The 3319 same kind-id MUST NOT be used twice in a given store request. Each 3320 value is then processed in turn. These operations MUST be atomic. 3321 If any operation fails, the state MUST be rolled back to before the 3322 request was received. 3324 The store request is defined by the StoreReq structure: 3326 struct { 3327 KindId kind; 3328 DataModel data_model; 3329 uint64 generation_counter; 3330 StoredData values<0..2^32-1>; 3331 } StoreKindData; 3333 struct { 3334 ResourceId resource; 3335 uint8 replica_number; 3336 StoreKindData kind_data<0..2^32-1>; 3337 } StoreReq; 3339 A single Store request stores data of a number of kinds to a single 3340 resource location. The contents of the structure are: 3342 resource 3343 The resource to store at. 3345 replica_number 3346 The number of this replica. When a storing peer saves replicas to 3347 other peers each peer is assigned a replica number starting from 1 3348 and sent in the Store message. This field is set to 0 when a node 3349 is storing its own data. This allows peers to distinguish replica 3350 writes from original writes. 3352 kind_data 3353 A series of elements, one for each kind of data to be stored. 3355 If the replica number is zero, then the peer MUST check that it is 3356 responsible for the resource and if not reject the request. If the 3357 replica number is nonzero, then the peer MUST check that it expects 3358 to be a replica for the resource and if not reject the request. 3360 Each StoreKindData element represents the data to be stored for a 3361 single kind-id. The contents of the element are: 3363 kind 3364 The kind-id. Implementations SHOULD reject requests corresponding 3365 to unknown kinds unless specifically configured otherwise. 3367 data_model 3368 The data model of the data. The kind defines what this has to be 3369 so this is redundant in the case where the software interpreting 3370 the messages understands the kind. 3372 generation 3373 The expected current state of the generation counter 3374 (approximately the number of times this object has been written, 3375 see below for details). 3377 values 3378 The value or values to be stored. This may contain one or more 3379 stored_data values depending on the data model associated with 3380 each kind. 3382 The peer MUST perform the following checks: 3384 o The kind_id is known and supported. 3385 o The data_model matches the kind_id. 3386 o The signatures over each individual data element (if any) are 3387 valid. 3388 o Each element is signed by a credential which is authorized to 3389 write this kind at this resource-id 3390 o For original (non-replica) stores, the peer MUST check that if the 3391 generation-counter is non-zero, it equals the current value of the 3392 generation-counter for this kind. This feature allows the 3393 generation counter to be used in a way similar to the HTTP Etag 3394 feature. 3395 o The storage time values are greater than that of any value which 3396 would be replaced by this Store. [[OPEN ISSUE: do peers need to 3397 save the storage time of Removes to prevent reinsertion?]] 3399 If all these checks succeed, the peer MUST attempt to store the data 3400 values. For non-replica stores, if the store succeeds and the data 3401 is changed, then the peer must increase the generation counter by at 3402 least one. If there are multiple stored values in a single 3403 StoreKindData, it is permissible for the peer to increase the 3404 generation counter by only 1 for the entire kind-id, or by 1 or more 3405 than one for each value. Accordingly, all stored data values must 3406 have a generation counter of 1 or greater. 0 is used by other nodes 3407 to indicate that they are indifferent to the generation counter's 3408 current value. For replica Stores, the peer MUST set the generation 3409 counter to match the generation_counter in the message. Replica 3410 Stores MUST NOT use a generation counter of 0. 3412 The properties of stores for each data model are as follows: 3414 Single-value: 3416 A store of a new single-value element creates the element if it 3417 does not exist and overwrites any existing value. with the new 3418 value. 3420 Array: 3421 A store of an array entry replaces (or inserts) the given value at 3422 the location specified by the index. Because arrays are sparse, a 3423 store past the end of the array extends it with nonexistent values 3424 (exists=False) as required. A store at index 0xffffffff places 3425 the new value at the end of the array regardless of the length of 3426 the the array. The resulting StoredData has the correct index 3427 value when it is subsequently fetched. 3429 Dictionary: 3430 A store of a dictionary entry replaces (or inserts) the given 3431 value at the location specified by the dictionary key. 3433 The following figure shows the relationship between these structures 3434 for an example store which stores the following values at resource 3435 "1234" 3437 o The value "abc" in the single value slot for kind X 3438 o The value "foo" at index 0 in the array for kind Y 3439 o The value "bar" at index 1 in the array for kind Y 3441 Store 3442 resource=1234 3443 / \ 3444 / \ 3445 StoreKindData StoreKindData 3446 kind=X kind=Y 3447 model=Single-Value model=Array 3448 | /\ 3449 | / \ 3450 StoredData / \ 3451 | / \ 3452 | StoredData StoredData 3453 StoredDataValue | | 3454 value="abc" | | 3455 | | 3456 StoredDataValue StoredDataValue 3457 index=0 index=1 3458 value="foo" value="bar" 3460 7.3.1.2. Response Definition 3462 In response to a successful Store request the peer MUST return a 3463 StoreAns message containing a series of StoreKindResponse elements 3464 containing the current value of the generation counter for each 3465 kind-id, as well as a list of the peers where the data was 3466 replicated. 3468 struct { 3469 KindId kind; 3470 uint64 generation_counter; 3471 NodeId replicas<0..2^16-1>; 3472 } StoreKindResponse; 3474 struct { 3475 StoreKindResponse kind_responses<0..2^16-1>; 3476 } StoreAns; 3478 The contents of each StoreKindResponse are: 3480 kind 3481 The kind-id being represented. 3483 generation 3484 The current value of the generation counter for that kind-id. 3486 replicas 3487 The list of other peers at which the data was/will-be replicated. 3488 In overlays and applications where the responsible peer is 3489 intended to store redundant copies, this allows the storing peer 3490 to independently verify that the replicas were in fact stored by 3491 doing its own Fetch. 3493 The response itself is just StoreKindResponse values packed end-to- 3494 end. 3496 If any of the generation counters in the request precede the 3497 corresponding stored generation counter, then the peer MUST fail the 3498 entire request and respond with a 412 error. The error_info in the 3499 ErrorResponse MUST be a StoreAns response containing the correct 3500 generation counter for each kind and empty replicas lists. 3502 7.3.2. Fetch 3504 The Fetch request retrieves one or more data elements stored at a 3505 given resource-id. A single Fetch request can retrieve multiple 3506 different kinds. 3508 7.3.2.1. Request Definition 3510 struct { 3511 int32 first; 3512 int32 last; 3513 } ArrayRange; 3515 struct { 3516 KindId kind; 3517 DataModel model; 3518 uint64 generation; 3519 uint16 length; 3521 select (model) { 3522 case single_value: ; /* Empty */ 3524 case array: 3525 ArrayRange indices<0..2^16-1>; 3527 case dictionary: 3528 DictionaryKey keys<0..2^16-1>; 3530 /* This structure may be extended */ 3532 } model_specifier; 3533 } StoredDataSpecifier; 3535 struct { 3536 ResourceId resource; 3537 StoredDataSpecifier specifiers<0..2^16-1>; 3538 } FetchReq; 3540 The contents of the Fetch requests are as follows: 3542 resource 3543 The resource ID to fetch from. 3545 specifiers 3546 A sequence of StoredDataSpecifier values, each specifying some of 3547 the data values to retrieve. 3549 Each StoredDataSpecifier specifies a single kind of data to retrieve 3550 and (if appropriate) the subset of values that are to be retrieved. 3551 The contents of the StoredDataSpecifier structure are as follows: 3553 kind 3554 The kind-id of the data being fetched. Implementations SHOULD 3555 reject requests corresponding to unknown kinds unless specifically 3556 configured otherwise. 3558 model 3559 The data model of the data. This must be checked against the 3560 kind-id. 3562 generation 3563 The last generation counter that the requesting peer saw. This 3564 may be used to avoid unnecessary fetches or it may be set to zero. 3566 length 3567 The length of the rest of the structure, thus allowing 3568 extensibility. 3570 model_specifier 3571 A reference to the data value being requested within the data 3572 model specified for the kind. For instance, if the data model is 3573 "array", it might specify some subset of the values. 3575 The model_specifier is as follows: 3577 o If the data is of data model single value, the specifier is empty. 3578 o If the data is of data model array, the specifier contains of a 3579 list of ArrayRange elements, each of which contains two integers. 3580 two integers. The first integer is the beginning of the range and 3581 the second is the end of the range. 0 is used to indicate the 3582 first element and 0xffffffff is used to indicate the final 3583 element. The beginning of the range MUST be earlier in the array 3584 then the end. The ranges MUST be non-overlapping. 3585 o If the data is of data model dictionary then the specifier 3586 contains a list of the dictionary keys being requested. If no 3587 keys are specified, than this is a wildcard fetch and all key- 3588 value pairs are returned. [[TODO: We really need a way to return 3589 only the keys. We'll need to modify this.]] 3591 The generation-counter is used to indicate the requester's expected 3592 state of the storing peer. If the generation-counter in the request 3593 matches the stored counter, then the storing peer returns a response 3594 with no StoredData values. 3596 Note that because the certificate for a user is typically stored at 3597 the same location as any data stored for that user, a requesting peer 3598 which does not already have the user's certificate should request the 3599 certificate in the Fetch as an optimization. 3601 7.3.2.2. Response Definition 3603 The response to a successful Fetch request is a FetchAns message 3604 containing the data requested by the requester. 3606 struct { 3607 KindId kind; 3608 uint64 generation; 3609 StoredData values<0..2^32-1>; 3610 } FetchKindResponse; 3612 struct { 3613 FetchKindResponse kind_responses<0..2^32-1>; 3614 } FetchAns; 3616 The FetchAns structure contains a series of FetchKindResponse 3617 structures. There MUST be one FetchKindResponse element for each 3618 kind-id in the request. 3620 The contents of the FetchKindResponse structure are as follows: 3622 kind 3623 the kind that this structure is for. 3625 generation 3626 the generation counter for this kind. 3628 values 3629 the relevant values. If the generation counter in the request 3630 matches the generation-counter in the stored data, then no 3631 StoredData values are returned. Otherwise, all relevant data 3632 values MUST be returned. A nonexistent value is represented with 3633 "exists" set to False. 3635 There is one subtle point about signature computation on arrays. If 3636 the storing node uses the append feature (where the 3637 index=0xffffffff), then the index in the StoredData that is returned 3638 will not match that used by the storing node, which would break the 3639 signature. In order to avoid this issue, the index value in array is 3640 set to zero before the signature is computed. This implies that 3641 malicious storing nodes can reorder array entries without being 3642 detected. [[OPEN ISSUE: We've considered a number of alternate 3643 designs here that would preserve security against this attack if the 3644 storing node did not use the append feature. However, they are more 3645 complicated for one or both sides. If this attack is considered 3646 serious, we can introduce one of them.]] 3648 7.3.3. Remove 3650 The Remove request is used to remove a stored element or elements 3651 from the storing peer. Any successful remove of an existing element 3652 for a given kind MUST increment the generation counter by at least 1. 3654 struct { 3655 ResourceId resource; 3656 StoredDataSpecifier specifiers<0..2^16-1>; 3657 } RemoveReq; 3659 A RemoveReq has exactly the same syntax as a Fetch request except 3660 that each entry represents a set of values to be removed rather than 3661 returned. The same kind-id MUST NOT be used twice in a given 3662 RemoveReq. Each specifier is then processed in turn. These 3663 operations MUST be atomic. If any operation fails, the state MUST be 3664 rolled back to before the request was received. 3666 Before processing the Remove request, the peer MUST perform the 3667 following checks. 3669 o The kind-id is known. 3670 o The signature over the message is valid or (depending on overlay 3671 policy) no signature is required. 3672 o The signer of the message has permissions which permit him to 3673 remove this kind of data. Although each kind defines its own 3674 access control requirements, in general only the original signer 3675 of the data should be allowed to remove it. 3676 o If the generation-counter is non-zero, it must equal the current 3677 value of the generation-counter for this kind. This feature 3678 allows the generation counter to be used in a way similar to the 3679 HTTP Etag feature. 3681 Assuming that the request is permitted, the operations proceed as 3682 follows. 3684 7.3.3.1. Single Value 3686 A Remove of a single value element causes it not to exist. If no 3687 such element exists, then this is a silent success. 3689 7.3.3.2. Array 3691 A Remove of an array element (or element range) replaces those 3692 elements with null elements. Note that this does not cause the array 3693 to be packed. An array which contains ["A", "B", "C"] and then has 3694 element 0 removed produces an array containing [NA, "B", "C"]. Note, 3695 however, that the removal of the final element of the array shortens 3696 the array, so in the above case, the removal of element 2 makes the 3697 array ["A", "B"]. 3699 7.3.3.3. Dictionary 3701 A Remove of a dictionary element (or elements) replaces those 3702 elements with null elements. If no such elements exist, then this is 3703 a silent success. 3705 7.3.3.4. Response Definition 3707 The response to a successful Remove simply contains a list of the new 3708 generation counters for each kind-id, using the same syntax as the 3709 response to a Store request. Note that if the generation counter 3710 does not change, that means that the requested items did not exist. 3711 However, if the generation counter does change, that does not mean 3712 that the items existed. 3714 struct { 3715 StoreKindResponse kind_responses<0..2^16-1>; 3716 } RemoveAns; 3718 7.3.4. Find 3720 The Find request can be used to explore the Overlay Instance. A Find 3721 request for a resource-id R and a kind-id T retrieves the resource-id 3722 (if any) of the resource of kind T known to the target peer which is 3723 closes to R. This method can be used to walk the Overlay Instance by 3724 interactively fetching R_n+1=nearest(1 + R_n). 3726 7.3.4.1. Request Definition 3728 The FindReq message contains a series of resource-IDs and kind-ids 3729 identifying the resource the peer is interested in. 3731 struct { 3732 ResourceID resource; 3733 KindId kinds<0..2^8-1>; 3734 } FindReq; 3736 The request contains a list of kind-ids which the Find is for, as 3737 indicated below: 3739 resource 3740 The desired resource-id 3742 kinds 3743 The desired kind-ids. Each value MUST only appear once. 3745 7.3.4.2. Response Definition 3747 A response to a successful Find request is a FindAns message 3748 containing the closest resource-id for each kind specified in the 3749 request. 3751 struct { 3752 KindId kind; 3753 ResourceID closest; 3754 } FindKindData; 3756 struct { 3757 FindKindData results<0..2^16-1>; 3758 } FindAns; 3760 If the processing peer is not responsible for the specified 3761 resource-id, it SHOULD return a 404 error. 3763 For each kind-id in the request the response MUST contain a 3764 FindKindData indicating the closest resource-id for that kind-id 3765 unless the kind is not allowed to be used with Find in which case a 3766 FindKindData for that kind-id MUST NOT be included in the response. 3767 If a kind-id is not known, then the corresponding resource-id MUST be 3768 0. Note that different kind-ids may have different closest resource- 3769 ids. 3771 The response is simply a series of FindKindData elements, one per 3772 kind, concatenated end-to-end. The contents of each element are: 3774 kind 3775 The kind-id. 3777 closest 3778 The closest resource ID to the specified resource ID. This is 0 3779 if no resource ID is known. 3781 Note that the response does not contain the contents of the data 3782 stored at these resource-ids. If the requester wants this, it must 3783 retrieve it using Fetch. 3785 7.3.4.3. Defining New Kinds 3787 A new kind MUST define: 3789 o The meaning of the data to be stored. 3790 o The kind-id. 3791 o The data model (single value, array, dictionary, etc.) 3792 o Access control rules for indicating what credentials are allowed 3793 to read and write that kind-id at a given location. 3795 While each kind MUST define what data model is used for its data, 3796 that does not mean that it must define new data models. Where 3797 practical, kinds SHOULD use the built-in data models. However, they 3798 MAY define any new required data models. The intention is that the 3799 basic data model set be sufficient for most applications/usages. 3801 8. Certificate Store Usage 3803 The Certificate Store usage allows a peer to store its certificate in 3804 the overlay, thus avoiding the need to send a certificate in each 3805 message - a reference may be sent instead. 3807 A user/peer MUST store its certificate at resource-ids derived from 3808 two Resource Names: 3810 o The user name in the certificate. 3811 o The Node-ID in the certificate. 3813 Note that in the second case the certificate is not stored at the 3814 peer's Node-ID but rather at a hash of the peer's Node-ID. The 3815 intention here (as is common throughout RELOAD) is to avoid making a 3816 peer responsible for its own data. 3818 A peer MUST ensure that the user's certificates are stored in the 3819 Overlay Instance. New certificates are stored at the end of the 3820 list. This structure allows users to store and old and new 3821 certificate the both have the same node-id which allows for migration 3822 of certificates when they are renewed. 3824 Kind IDs This usage defines the CERTIFICATE kind-id to store a peer 3825 or user's certificate. 3827 Data Model The data model for CERTIFICATE data is array. 3829 Access Control The CERTIFICATE MUST contain a Node-ID or user name 3830 which, when hashed, maps to the resource-id at which the value is 3831 being stored. 3833 9. TURN Server Usage 3835 The TURN server usage allows a RELOAD peer to advertise that it is 3836 prepared to be a TURN server as defined in [I-D.ietf-behave-turn]. 3837 When a node starts up, it joins the overlay network and forms several 3838 connection in the process. If the ICE stage in any of these 3839 connection return a reflexive address that is not the same as the 3840 peers perceived address, then the peers is behind a NAT and not an 3841 candidate for a TURN server. Additionally, if the peers IP address 3842 is in the private address space range, then it is not a candidate for 3843 a TURN server. Otherwise, the peer SHOULD assume it is a potential 3844 TURN server and follow the procedures below. 3846 If the node is a candidate for a TURN server it will insert some 3847 pointers in the overlay so that other peers can find it. The overlay 3848 configuration file specifies a turnDensity parameter that indicates 3849 how many times each TURN server should record itself in the overlay. 3850 Typically this should be set to the reciprocal of the estimate of 3851 what percentage of peers will act as TURN servers. For each value, 3852 called d, between 1 and turnDensity, the peer forms a Resource Name 3853 by concatenating its peer-ID and the value d. This Resource Name is 3854 hashed to form a Resource-ID. The address of the peer is stored at 3855 that Resource-ID using type TURN-SERVICE and the TurnServer object: 3857 struct { 3858 uint8 iteration; 3859 IpAddressAndPort server_address; 3860 } TurnServer; 3862 The contents of this structure are as follows: 3864 iteration 3865 the d value 3867 server_address 3868 the address at which the TURN server can be contacted. 3870 Note: Correct functioning of this algorithm depends critically on 3871 having turnDensity be an accurate estimate of the true density of 3872 TURN servers. If turnDensity is too high, then the process of 3873 finding TURN servers becomes extremely expensive as multiple 3874 candidate resource-ids must be probed. 3876 Peers peers that provide this service need to support the TURN 3877 extensions to STUN for media relay of both UDP and TCP traffic as 3878 defined in [I-D.ietf-behave-turn] and [I-D.ietf-behave-tcp]. 3880 [[OPEN ISSUE: This structure only works for TURN servers that have 3881 public addresses. It may be possible to use TURN servers that are 3882 behind well-behaved NATs by first ICE connecting to them. If we 3883 decide we want to enable that, this structure will need to change to 3884 either be a peer-id or include that as an option.]] 3886 Kind IDs This usage defines the TURN-SERVICE kind-id to indicate 3887 that a peer is willing to act as a TURN server. The Find command 3888 MUST return results for the TURN-SERVICE kind-id. 3889 Data Model The TURN-SERVICE stores a single value for each 3890 resource-id. 3891 Access Control If certificate-based access control is being used, 3892 stored data of kind TURN-SERVICE MUST be authenticated by a 3893 certificate which contains a peer-id which when hashed with the 3894 iteration counter produces the resource-id being stored at. 3896 Peers can find other servers by selecting a random Resource-ID and 3897 then doing a Find request for the appropriate server type with that 3898 Resource-ID. The Find request gets routed to a random peer based on 3899 the Resource-ID. If that peer knows of any servers, they will be 3900 returned. The returned response may be empty if the peer does not 3901 know of any servers, in which case the process gets repeated with 3902 some other random Resource-ID. As long as the ratio of servers 3903 relative to peers is not too low, this approach will result in 3904 finding a server relatively quickly. 3906 10. SIP Usage 3908 The SIP usage allows a RELOAD overlay to be used as a distributed SIP 3909 registrar/proxy network augmenting the functionality of [RFC3263]. 3911 This entails three primary operations: 3913 o Registering one's own AOR with the overlay. 3914 o Looking up a given AOR in the overlay. 3915 o Forming a direct connection to a given peer. 3917 10.1. Registering AORs 3919 In ordinary SIP, a UA registers its AOR and location with a 3920 registrar. In RELOAD, this registrar function is provided by the 3921 overlay as a whole. To register its location, a RELOAD peer stores a 3922 SipRegistration structure under its own AOR. This uses the SIP- 3923 REGISTRATION kind-id, which is formally defined in Section 10.5. 3924 Note: GRUUs are handled via a separate mechanism, as described in 3925 Section 10.4. 3927 As a simple example, if Alice's AOR were "sip:alice@dht.example.com" 3928 and her Node-ID were "1234", she might store the mapping 3929 "sip:alice@example.org -> 1234". This would tell anyone who wanted 3930 to call Alice to contact node "1234". 3932 RELOAD peers MAY store two kinds of SIP mappings: 3934 o From AORs to destination lists (a single Node-ID is just a trivial 3935 destination list.) 3936 o From AORs to other AORs. 3938 The meaning of the first kind of mapping is "in order to contact me, 3939 form a connection with this peer." The meaning of the second kind of 3940 mapping is "in order to contact me, dereference this AOR". This 3941 allows for forwarding. For instance, if Alice wants calls to her to 3942 be forwarded to her secretary, Sam, she might insert the following 3943 mapping "sip:alice@dht.example.org -> sip:sam@dht.example.org". 3945 The contents of a SipRegistration structure are as follows: 3947 enum {sip_registration_uri (1), sip_registration_route (2), 3948 (255)} SipRegistrationType; 3950 select (SipRegistration.type) { 3951 case sip_registration_uri: 3952 opaque uri<0..2^16-1>; 3954 case sip_registration_route: 3955 opaque contact_prefs<0..2^16-1>; 3956 Destination destination_list<0..2^16-1>; 3958 /* This type can be extended */ 3960 } SipRegistrationData; 3962 struct { 3963 SipRegistrationType type; 3964 uint16 length; 3965 SipRegistrationData data; 3966 } SipRegistration; 3968 The contents of the SipRegistration PDU are: 3970 type 3971 the type of the registration 3973 length 3974 the length of the rest of the PDU 3976 data 3977 the registration data 3979 o If the registration is of type "sip_registration_uri", then the 3980 contents are an opaque string containing the URI. 3981 o If the registration is of type "sip_registration_route", then the 3982 contents are an opaque string containing the callee's contact 3983 preferences and a destination list for the peer. 3985 RELOAD explicitly supports multiple registrations for a single AOR. 3986 The registrations are stored in a Dictionary with the dictionary keys 3987 being Node-IDs. Consider, for instance, the case where Alice has two 3988 peers: 3990 o her desk phone (1234) 3991 o her cell phone (5678) 3993 Alice might store the following in the overlay at resource 3994 "sip:alice@dht.example.com". 3996 o A SipRegistration of type "sip_registration_route" with dictionary 3997 key "1234" and value "1234". 3998 o A SipRegistration of type "sip_registration_route" with dictionary 3999 key "5678" and value "5678". 4001 Note that this structure explicitly allows one Node-ID to forward to 4002 another Node-ID. For instance, Alice could set calls to her desk 4003 phone to ring at her cell phone. It's not clear that this is useful 4004 in this case, but may be useful if Alice has two AORs. 4006 In order to prevent hijacking, registrations are subject to access 4007 control rules. Before a Store is permitted, the storing peer MUST 4008 check that: 4010 o The certificate contains a username that is a SIP AOR that hashes 4011 to the resource-id being stored at. 4012 o The certificate contains a Node-ID that is the same as the 4013 dictionary key being stored at. 4015 Note that these rules permit Alice to forward calls to Bob without 4016 his permission. However, they do not permit Alice to forward Bob's 4017 calls to her. See Section 15.7.2 for more on this point. 4019 10.2. Looking up an AOR 4021 When a RELOAD user wishes to call another user, starting with a non- 4022 GRUU AOR, he follows the following procedure. (GRUUs are discussed 4023 in Section 10.4). 4025 1. Check to see if the domain part of the AOR matches the domain 4026 name of an overlay of which he is a member. If not, then this is 4027 an external AOR, and he MUST do one of the following: 4028 * Fail the call. 4029 * Use ordinary SIP procedures. 4030 * Attempt to become a member of the overlay indicated by the 4031 domain part (only possible if the enrollment procedure defined 4032 in Section 13.1 indicates that this is a RELOAD overlay.) 4033 2. Perform a Fetch for kind SIP-REGISTRATION at the resource-id 4034 corresponding to the AOR. This Fetch SHOULD NOT indicate any 4035 dictionary keys, which will result in fetching all the stored 4036 values. 4038 3. If any of the results of the Fetch are non-GRUU AORs, then repeat 4039 step 1 for that AOR. 4040 4. Once only GRUUs and destination lists remain, the peer removes 4041 duplicate destination lists and GRUUs from the list and forms a 4042 SIP connection to the appropriate peers as described in the 4043 following sections. If there are also external AORs, the peer 4044 follows the appropriate procedure for contacting them as well. 4046 10.3. Forming a Direct Connection 4048 Once the peer has translated the AOR into a set of destination lists, 4049 it then uses the overlay to route Attach messages to each of those 4050 peers. The "application" field MUST be 5060 to indicate SIP. If 4051 certificate-based authentication is in use, the responding peer MUST 4052 present a certificate with a Node-ID matching the terminal entry in 4053 the route list. Note that it is possible that the peers already have 4054 a RELOAD connection between them. This MUST NOT be used for SIP 4055 messages. However, if a SIP connection already exists, that MAY be 4056 used. Once the Attach succeeds, the peer sends SIP messages over the 4057 connection as in normal SIP. 4059 10.4. GRUUs 4061 GRUUs do not require storing data in the Overlay Instance. Rather, 4062 they are constructed by embedding a base64-encoded destination list 4063 in the gr URI parameter of the GRUU. The base64 encoding is done 4064 with the alphabet specified in table 1 of RFC 4648 with the exception 4065 that ~ is used in place of =. An example GRUU is 4066 "sip:alice@example.com;gr=MDEyMzQ1Njc4OTAxMjM0NTY3ODk~". When a peer 4067 needs to route a message to a GRUU in the same P2P network, it simply 4068 uses the destination list and connects to that peer. 4070 Because a GRUU contains a destination list, it MAY have the same 4071 contents as a destination list stored elsewhere in the resource 4072 dictionary. 4074 Anonymous GRUUs are done in roughly the same way but require either 4075 that the enrollment server issue a different Node-ID for each 4076 anonymous GRUU required or that a destination list be used that 4077 includes a peer that compresses the destination list to stop the 4078 Node-ID from being revealed. 4080 10.5. SIP-REGISTRATION Kind Definition 4082 The first mapping is provided using the SIP-REGISTRATION kind-id: 4084 Kind IDs The Resource Name for the SIP-REGISTRATION kind-id is the 4085 AOR of the user. The data stored is a SipRegistrationData, which 4086 can contain either another URI or a destination list to the peer 4087 which is acting for the user. 4089 Data Model The data model for the SIP-REGISTRATION kind-id is 4090 dictionary. The dictionary key is the Node-ID of the storing 4091 peer. This allows each peer (presumably corresponding to a single 4092 device) to store a single route mapping. 4094 Access Control If certificate-based access control is being used, 4095 stored data of kind-id SIP-REGISTRATION must be signed by a 4096 certificate which (1) contains user name matching the storing URI 4097 used as the Resource Name for the resource-id and (2) contains a 4098 Node-ID matching the storing dictionary key. 4100 Data stored under the SIP-REGISTRATION kind is of type 4101 SipRegistration. This comes in two varieties: 4103 sip_registration_uri 4104 a URI which the user can be reached at. 4106 sip_registration_route 4107 a destination list which can be used to reach the user's peer. 4109 11. Diagnostic Usage 4111 The Diagnostic Usage allows a node to report various statistics about 4112 itself that may be useful for diagnostics or performance management. 4113 It can be used to discover information such as the software version, 4114 uptime, routing table, stored resource-objects, and performance 4115 statistics of a peer. The usage defines several new kinds which can 4116 be retrieved to get the statistics and also allows to retrieve other 4117 kinds that a node stores. In essence, the usage allows querying a 4118 node's state such as storage and network to obtain the relevant 4119 information. 4121 The access control model for all kinds is a local policy defined by 4122 the peer or the overlay policy. The peer may be configured with a 4123 list of users that it is willing to return the information for and 4124 restrict access to users with that name. Unless specific policy 4125 overrides it, data SHOULD NOT be returned for users not on the list. 4126 The access control can also be determined on a per kind basis - for 4127 example, a node may be willing to return the software version to any 4128 users while specific information about performance may not be 4129 returned. 4131 The following kinds are defined: 4133 ROUTING_TABLE_SIZE A single value element containing an unsigned 32- 4134 bit integer representing the number of peers in the peer's routing 4135 table. 4137 SOFTWARE_VERSION A single value element containing a US-ASCII string 4138 that identifies the manufacture, model, and version of the 4139 software. 4141 MACHINE_UPTIME A single value element containing an unsigned 64-bit 4142 integer specifying the time the nodes has been up in seconds. 4144 APP_UPTIME A single value element containing an unsigned 64-bit 4145 integer specifying the time the p2p application has been up in 4146 seconds. 4148 MEMORY_FOOTPRINT A single value element containing an unsigned 32- 4149 bit integer representing the memory footprint of the peer program 4150 in kilo bytes. 4152 Note: What's a kilo byte? 1000 or 1024? -- Cullen 4153 Note: Good question. 1000 seems like not quite enough room but 4154 1024 is too much? -- EKR 4156 DATASIZE_STORED An unsigned 64-bit integer representing the number 4157 of bytes of data being stored by this node. 4159 INSTANCES_STORED An array element containing the number of instances 4160 of each kind stored. The array is index by kind-id. Each entry 4161 is an unsigned 64-bit integer. 4163 MESSAGES_SENT_RCVD An array element containing the number of 4164 messages sent and received. The array is indexed by method code. 4165 Each entry in the array is a pair of unsigned 64-bit integers 4166 (packed end to end) representing sent and received. 4168 EWMA_BYTES_SENT A single value element containing an unsigned 32-bit 4169 integer representing an exponential weighted average of bytes sent 4170 per second by this peer. 4171 sent = alpha x sent_present + (1 - alpha) x sent 4172 where sent_present represents the bytes sent per second since the 4173 last calculation and sent represents the last calculation of bytes 4174 sent per second. A suitable value for alpha is 0.8. This value 4175 is calculated every five seconds. 4177 EWMA_BYTES_RCVD A single value element containing an unsigned 32-bit 4178 integer representing an exponential weighted average of bytes 4179 received per second by this peer. Same calculation as above. 4181 [[TODO: We would like some sort of bandwidth measurement, but we're 4182 kind of unclear on the units and representation.]] 4184 11.1. Diagnostic Metrics for a P2PSIP Deployment 4186 (OPEN QUESTION: any other metrics?) 4188 Below, we sketch how these metrics can be used. A peer can use 4189 EWMA_BYTES_SENT and EWMA_BYTES_RCVD of another peer to infer whether 4190 it is acting as a media relay. It may then choose not to forward any 4191 requests for media relay to this peer. Similarly, among the various 4192 candidates for filling up routing table, a peer may prefer a peer 4193 with a large UPTIME value, small RTT, and small LAST_CONTACT value. 4195 12. Chord Algorithm 4197 This algorithm is assigned the name chord-128-2-16+ to indicate it is 4198 based on Chord, uses SHA-1 then truncates that to 128 bit for the 4199 hash function, stores 2 redundant copies of all data, and has finger 4200 tables with at least 16 entries. 4202 12.1. Overview 4204 The algorithm described here is a modified version of the Chord 4205 algorithm. Each peer keeps track of a finger table of 16 entries and 4206 a neighborhood table of 6 entries. The neighborhood table contains 4207 the 3 peers before this peer and the 3 peers after it in the DHT 4208 ring. The first entry in the finger table contains the peer half-way 4209 around the ring from this peer; the second entry contains the peer 4210 that is 1/4 of the way around; the third entry contains the peer that 4211 is 1/8th of the way around, and so on. Fundamentally, the chord data 4212 structure can be thought of a doubly-linked list formed by knowing 4213 the successors and predecessor peers in the neighborhood table, 4214 sorted by the Node-ID. As long as the successor peers are correct, 4215 the DHT will return the correct result. The pointers to the prior 4216 peers are kept to enable inserting of new peers into the list 4217 structure. Keeping multiple predecessor and successor pointers makes 4218 it possible to maintain the integrity of the data structure even when 4219 consecutive peers simultaneously fail. The finger table forms a skip 4220 list, so that entries in the linked list can be found in O(log(N)) 4221 time instead of the typical O(N) time that a linked list would 4222 provide. 4224 A peer, n, is responsible for a particular Resource-ID k if k is less 4225 than or equal to n and k is greater than p, where p is the peer id of 4226 the previous peer in the neighborhood table. Care must be taken when 4227 computing to note that all math is modulo 2^128. 4229 12.2. Routing 4231 If a peer is not responsible for a Resource-ID k, but is directly 4232 connected to a node with Node-Id k, then it routes the message to 4233 that node. Otherwise, it routes the request to the peer in the 4234 routing table that has the largest Node-ID that is in the interval 4235 between the peer and k. 4237 12.3. Redundancy 4239 When a peer receives a Store request for Resource-ID k, and it is 4240 responsible for Resource-ID k, it stores the data and returns a 4241 success response. [[Open Issue: should it delay sending this 4242 success until it has successfully stored the redundant copies?]]. It 4243 then sends a Store request to its successor in the neighborhood table 4244 and to that peers successor. Note that these Store requests are 4245 addressed to those specific peers, even though the Resource-ID they 4246 are being asked to store is outside the range that they are 4247 responsible for. The peers receiving these check they came from an 4248 appropriate predecessor in their neighborhood table and that they are 4249 in a range that this predecessor is responsible for, and then they 4250 store the data. They do not themselves perform further Stores 4251 because they can determine that they are not responsible for the 4252 resource-ID. 4254 Note that a malicious node can return a success response but not 4255 store the data locally or in the replica set. Requesting peers which 4256 wish to ensure that the replication actually occurred SHOULD contact 4257 each peer listed in the replicas field of the Store response and 4258 retrieve a copy of the data. [[TODO: Do we want to have some 4259 optimization in Fetch where they can retrieve just a digest instead 4260 of the data values?]] 4262 12.4. Joining 4264 The join process for a joining party (JP) with Node-ID n is as 4265 follows. 4267 1. JP connects to its chosen bootstrap node. 4268 2. JP uses a series of Pings to populate its routing table. 4269 3. JP sends Attach requests to initiate connections to each of the 4270 peers in the connection table as well as to the desired finger 4271 table entries. Note that this does not populate their routing 4272 tables, but only their connection tables, so JP will not get 4273 messages that it is expected to route to other nodes. 4274 4. JP enters all the peers it contacted into its routing table. 4275 5. JP sends a Join to its immediate successor, the admitting peer 4276 (AP) for Node-ID n. The AP sends the response to the Join. 4277 6. AP does a series of Store requests to JP to store the data that 4278 JP will be responsible for. 4279 7. AP sends JP an Update explicitly labeling JP as its predecessor. 4280 At this point, JP is part of the ring and responsible for a 4281 section of the overlay. AP can now forget any data which is 4282 assigned to JP and not AP. 4283 8. AP sends an Update to all of its neighbors with the new values of 4284 its neighbor set (including JP). 4285 9. JP sends UpdateS to all the peers in its routing table. 4287 In order to populate its routing table, JP sends a Ping via the 4288 bootstrap node directed at resource-id n+1 (directly after its own 4289 resource-id). This allows it to discover its own successor. Call 4290 that node p0. It then sends a ping to p0+1 to discover its successor 4291 (p1). This process can be repeated to discover as many successors as 4292 desired. The values for the two peers before p will be found at a 4293 later stage when n receives an Update. 4295 In order to set up its neighbor table entry for peer i, JP simply 4296 sends an Attach to peer (n+2^(numBitsInNodeId-i). This will be 4297 routed to a peer in approximately the right location around the ring. 4299 12.5. Routing Attaches 4301 When a peer needs to Attach to a new peer in its neighborhood table, 4302 it MUST source-route the Attach request through the peer from which 4303 it learned the new peer's Node-ID. Source-routing these requests 4304 allows the overlay to recover from instability. 4306 All other Attach requests, such as those for new finger table 4307 entries, are routed conventionally through the overlay. 4309 If a peer is unable to successfully Attach with a peer that should be 4310 in its neighborhood, it MUST locate either a TURN server or another 4311 peer in the overlay, but not in its neighborhood, through which it 4312 can exchange messages with its neighbor peer 4314 12.6. Updates 4316 A chord Update is defined as 4317 enum { reserved (0), 4318 peer_ready(1), neighbors(2), full(3), (255) } 4319 ChordUpdateType; 4321 struct { 4322 ChordUpdateType type; 4324 select(type){ 4325 case peer_ready: /* Empty */ 4326 ; 4328 case neighbors: 4329 NodeId predecessors<0..2^16-1>; 4330 NodeId successors<0..2^16-1>; 4332 case full: 4333 NodeId predecessors<0..2^16-1>; 4334 NodeId successors<0..2^16-1>; 4335 NodeId fingers<0..2^16-1>; 4336 }; 4337 } ChordUpdate; 4339 The "type" field contains the type of the update, which depends on 4340 the reason the update was sent. 4342 peer_ready: this peer is ready to receive messages. This message 4343 is used to indicate that a node which has Attached is a peer and 4344 can be routed through. It is also used as a connectivity check to 4345 non-neighbor pers. 4346 neighbors: this version is sent to members of the Chord neighbor 4347 table. 4348 full: this version is sent to peers which request an Update with a 4349 RouteQueryReq. 4351 If the message is of type "neighbors", then the contents of the 4352 message will be: 4354 predecessors 4355 The predecessor set of the Updating peer. 4357 successors 4358 The successor set of the Updating peer. 4360 If the message is of type "full", then the contents of the message 4361 will be: 4363 predecessors 4364 The predecessor set of the Updating peer. 4366 successors 4367 The successor set of the Updating peer. 4369 fingers 4370 The finger table if the Updating peer, in numerically ascending 4371 order. 4373 A peer MUST maintain an association (via Attach) to every member of 4374 its neighbor set. A peer MUST attempt to maintain at least three 4375 predecessors and three successors. However, it MUST send its entire 4376 set in any Update message sent to neighbors. 4378 12.6.1. Sending Updates 4380 Every time a connection to a peer in the neighborhood set is lost (as 4381 determined by connectivity pings or failure of some request), the 4382 peer should remove the entry from its neighborhood table and replace 4383 it with the best match it has from the other peers in its routing 4384 table. It then sends an Update to all its remaining neighbors. The 4385 update will contain all the Node-IDs of the current entries of the 4386 table (after the failed one has been removed). Note that when 4387 replacing a successor the peer SHOULD delay the creation of new 4388 replicas for 30 seconds after removing the failed entry from its 4389 neighborhood table in order to allow a triggered update to inform it 4390 of a better match for its neighborhood table. 4392 If connectivity is lost to all three of the peers that succeed this 4393 peer in the ring, then this peer should behave as if it is joining 4394 the network and use Pings to find a peer and send it a Join. If 4395 connectivity is lost to all the peers in the finger table, this peer 4396 should assume that it has been disconnected from the rest of the 4397 network, and it should periodically try to join the DHT. 4399 12.6.2. Receiving Updates 4401 When a peer, N, receives an Update request, it examines the Node-IDs 4402 in the UpdateReq and at its neighborhood table and decides if this 4403 UpdateReq would change its neighborhood table. This is done by 4404 taking the set of peers currently in the neighborhood table and 4405 comparing them to the peers in the update request. There are three 4406 major cases: 4408 o The UpdateReq contains peers that would not change the neighbor 4409 set because they match the neighborhood table. 4410 o The UpdateReq contains peers closer to N than those in its 4411 neighborhood table. 4412 o The UpdateReq defines peers that indicate a neighborhood table 4413 further away from N than some of its neighborhood table. Note 4414 that merely receiving peers further away does not demonstrate 4415 this, since the update could be from a node far away from N. 4416 Rather, the peers would need to bracket N. 4418 In the first case, no change is needed. 4420 In the second case, N MUST attempt to Attach to the new peers and if 4421 it is successful it MUST adjust its neighbor set accordingly. Note 4422 that it can maintain the now inferior peers as neighbors, but it MUST 4423 remember the closer ones. 4425 The third case implies that a neighbor has disappeared, most likely 4426 because it has simply been disconnected but perhaps because of 4427 overlay instability. N MUST Ping the questionable peers to discover 4428 if they are indeed missing and if so, remove them from its 4429 neighborhood table. 4431 After any Pings and Attaches are done, if the neighborhood table 4432 changes, the peer sends an Update request to each of its neighbors 4433 that was in either the old table or the new table. These Update 4434 requests are what ends up filling in the predecessor/successor tables 4435 of peers that this peer is a neighbor to. A peer MUST NOT enter 4436 itself in its successor or predecessor table and instead should leave 4437 the entries empty. 4439 If peer N which is responsible for a resource-id R discovers that the 4440 replica set for R (the next two nodes in its successor set) has 4441 changed, it MUST send a Store for any data associated with R to any 4442 new node in the replica set. It SHOULD not delete data from peers 4443 which have left the replica set. 4445 When a peer N detects that it is no longer in the replica set for a 4446 resource R (i.e., there are three predecessors between N and R), it 4447 SHOULD delete all data associated with R from its local store. 4449 12.6.3. Stabilization 4451 There are four components to stabilization: 4453 1. exchange Updates with all peers in its routing table to exchange 4454 state 4455 2. search for better peers to place in its finger table 4456 3. search to determine if the current finger table size is 4457 sufficiently large 4458 4. search to determine if the overlay has partitioned and needs to 4459 recover 4461 A peer MUST periodically send an Update request to every peer in its 4462 routing table. The purpose of this is to keep the predecessor and 4463 successor lists up to date and to detect connection failures. The 4464 default time is about every ten minutes, but the enrollment server 4465 SHOULD set this in the configuration document using the "chord-128-2- 4466 16+-update-frequency" element (denominated in seconds.) A peer 4467 SHOULD randomly offset these Update requests so they do not occur all 4468 at once. If an Update request fails or times out, the peer MUST mark 4469 that entry in the neighbor table invalid and attempt to reestablish a 4470 connection. If no connection can be established, the peer MUST 4471 attempt to establish a new peer as its neighbor and do whatever 4472 replica set adjustments are required. 4474 Periodically a peer should select a random entry i from the finger 4475 table and do a Ping to resource (n+2^(numBitsInNodeId-i). The 4476 purpose of this is to find a more accurate finger table entry if 4477 there is one. This is done less frequently than the connectivity 4478 checks in the previous section because forming new connections is 4479 somewhat expensive and the cost needs to be balanced against the cost 4480 of not having the most optimal finger table entries. The default 4481 time is about every hour, but the enrollment server SHOULD set this 4482 in the configuration document using the "chord-128-2-16+-ping- 4483 frequency" element (denominated in seconds). If this returns a 4484 different peer than the one currently in this entry of the peer 4485 table, then a new connection should be formed to this peer and it 4486 should replace the old peer in the finger table. 4488 As an overlay grows, more than 16 entries may be required in the 4489 finger table for efficient routing. To determine if its finger table 4490 is sufficiently large, one an hour the peer should perform a Ping to 4491 determine whether growing its finger table by four entries would 4492 result in it learning at least two peers that it does not already 4493 have in its neighbor table. If so, then the finger table SHOULD be 4494 grown by four entries. Similarly, if the peer observes that its 4495 closest finger table entries are also in its neighbor table, it MAY 4496 shrink its finger table to the minimum size of 16 entries. [[OPEN 4497 ISSUE: there are a variety of algorithms to gauge the population of 4498 the overlay and select an appropriate finger table size. Need to 4499 consider which is the best combination of effectiveness and 4500 simplicity.]] 4501 To detect that a partitioning has occurred and to heal the overlay, a 4502 peer P MUST periodically repeat the discovery process used in the 4503 initial join for the overlay to locate an appropriate bootstrap peer, 4504 B. If an overlay has multiple mechanisms for discovery it should 4505 randomly select a method to locate a bootstrap peer. P should then 4506 send a Ping for its own Node-ID routed through B. If a response is 4507 received from a peer S', which is not P's successor, then the overlay 4508 is partitioned and P should send a Attach to S' routed through B, 4509 followed by an Update sent to S'. (Note that S' may not be in P's 4510 neighborhood table once the overlay is healed, but the connection 4511 will allow S' to discover appropriate neighbor entries for itself via 4512 its own stabilization.) 4514 12.7. Route Query 4516 For this topology plugin, the RouteQueryReq contains no additional 4517 information. The RouteQueryAns contains the single node ID of the 4518 next peer to which the responding peer would have routed the request 4519 message in recursive routing: 4521 struct { 4522 NodeId next_id; 4523 } ChordRouteQueryAns; 4525 The contents of this structure are as follows: 4527 next_peer 4528 The peer to which the responding peer would route the message to 4529 in order to deliver it to the destination listed in the request. 4531 If the requester set the send_update flag, the responder SHOULD 4532 initiate an Update immediately after sending the RouteQueryAns. 4534 12.8. Leaving 4536 Peers SHOULD send a Leave request prior to exiting the Overlay 4537 Instance. Any peer which receives a Leave for a peer n in its 4538 neighbor set must remove it from the neighbor set, update its replica 4539 sets as appropriate (including Stores of data to new members of the 4540 replica set) and send Updates containing its new predecessor and 4541 successor tables. 4543 13. Enrollment and Bootstrap 4544 13.1. Discovery 4546 When a peer first joins a new overlay, it starts with a discovery 4547 process to find an enrollment server. Related work to the approach 4548 used here is described in [I-D.garcia-p2psip-dns-sd-bootstrapping] 4549 and [I-D.matthews-p2psip-bootstrap-mechanisms]. The peer first 4550 determines the overlay name. This value is provided by the user or 4551 some other out of band provisioning mechanism. If the name is an IP 4552 address, that is directly used otherwise the peer MUST do a DNS SRV 4553 query using a Service name of "p2p_enroll" and a protocol of tcp to 4554 find an enrollment server. 4556 If the overlay name ends in .local, then a DNS SRV lookup using 4557 implement [I-D.cheshire-dnsext-dns-sd] with a Service name of 4558 "p2p_menroll" can also be tried to find an enrollment server. If 4559 they implement this, the user name MAY be used as the Instance 4560 Identifier label. 4562 Once an address for the enrollment servers is determined, the peer 4563 forms an HTTPS connection to that IP address. The certificate MUST 4564 match the overlay name as described in [RFC2818]. The peer then 4565 performs a GET to the URL formed by appending a path of "/p2psip/ 4566 enroll" to the overlay name. For example, if the overlay name was 4567 example.com, the URL would be "https://example.com/p2psip/enroll". 4569 The result is an XML configuration file with the syntax described in 4570 the following section. 4572 13.2. Overlay Configuration 4574 This specification defines a new content type "application/ 4575 p2p-overlay+xml" for an MIME entity that contains overlay 4576 information. This information is fetched from the enrollment server, 4577 as described above. An example document is shown below. 4579 4580 4581 4582 [PEM encoded certificate here] 4583 4585 4586 4587 4588 4589 4590 4592 The file MUST be a well formed XML document and it SHOULD contain an 4593 encoding declaration in the XML declaration. If the charset 4594 parameter of the MIME content type declaration is present and it is 4595 different from the encoding declaration, the charset parameter takes 4596 precedence. Every application conferment to this specification MUST 4597 accept the UTF-8 character encoding to ensure minimal 4598 interoperability. The namespace for the elements defined in this 4599 specification is urn:ietf:params:xml:ns:p2p:overlay. 4601 The file can contain multiple "overlay" elements where each one 4602 contains the configuration information for a different overlay. Each 4603 "overlay" has the following attributes: 4605 instance-name: name of the overlay 4607 expiration: time in future at which this overlay configuration is 4608 not longer valid and need to be retrieved again. This is 4609 expressed in seconds from the current time. 4611 Inside each overlay element, the following elements can occur: 4613 topology-plugin 4614 This element has an attribute called algorithm-name that describes 4615 the overlay-algorithm being used. 4617 root-cert 4618 This element contains a PEM encoded X.509v3 certificate that is 4619 the root trust store used to sign all certificates in this 4620 overlay. There can be more than one of these. 4622 required-kinds 4623 This element indicates the kinds that members must support. It 4624 has three attributes: 4625 * name: a string representing the kind. 4626 * max-count: the maximum number of values which members of the 4627 overlay must support. 4628 * max-size: the maximum size of individual values. 4629 For instance, the example above indicates that members must 4630 support SIP-REGISTRATION with a maximum of 10 values of up to 1000 4631 bytes each. Multiple required-kinds elements MAY be present. 4633 credential-server 4634 This element contains the URL at which the credential server can 4635 be reached in a "url" element. This URL MUST be of type "https:". 4636 More than one credential-server element may be present. 4638 self-signed-permitted 4639 This element indicates whether self-signed certificates are 4640 permitted. If it is set to "TRUE", then self-signed certificates 4641 are allowed, in which case the credential-server and root-cert 4642 elements may be absent. Otherwise, it SHOULD be absent, but MAY 4643 be set "FALSE". This element also contains an attribute "digest" 4644 which indicates the digest to be used to compute the Node-ID. 4645 Valid values for this parameter are "SHA-1" and "SHA-256". 4647 bootstrap-peer 4648 This elements represents the address of one of the bootstrap 4649 peers. It has an attribute called "address" that represents the 4650 IP address (either IPv4 or IPv6, since they can be distinguished) 4651 and an attribute called "port" that represents the port. More 4652 than one bootstrap-peer element may be present. 4654 multicast-bootstrap 4655 This element represents the address of a multicast address and 4656 port that may be used for bootstrap and that peers SHOULD listen 4657 on to enable bootstrap. It has an attributed called "address" 4658 that represents the IP address and an attribute called "port" that 4659 represents the port. More than one "multicast-bootstrap" element 4660 may be present. 4662 clients-permitted 4663 This element represents whether clients are permitted or whether 4664 all nodes must be peers. If it is set to "TRUE" or absent, this 4665 indicates that clients are permitted. If it is set to "FALSE" 4666 then nodes MUST join as peers. 4668 chord-128-2-16+-update-frequency 4669 The update frequency for the Chord-128-2-16+ topology plugin (see 4670 Section 12). 4672 chord-128-2-16+-ping-frequency 4673 The ping frequency for the Chord-128-2-16+ topology plugin (see 4674 Section 12). 4676 credential-server 4677 Base URL for credential server. 4679 shared-secret 4680 If shared secret mode is used, this contains the shared secret. 4682 [[TODO: Do a RelaxNG grammar.]] 4684 13.3. Credentials 4686 If the configuration document contains a credential-server element, 4687 credentials are required to join the Overlay Instance. A peer which 4688 does not yet have credentials MUST contact the credential server to 4689 acquire them. 4691 In order to acquire credentials, the peer generates an asymmetric key 4692 pair and then generates a "Simple Enrollment Request" (as defined in 4693 [I-D.ietf-pkix-2797-bis]) and sends this over HTTPS as defined in 4694 [I-D.ietf-pkix-cmc-trans] to the URL in the credential-server 4695 element. The subjectAltName in the request MUST contain the required 4696 user name. 4698 The credential server MUST authenticate the request using the 4699 provided user name and password. If the authentication succeeds and 4700 the requested user name is acceptable, the server and returns a 4701 certificate. The SubjectAltName field in the certificate contains 4702 the following values: 4704 o One or more Node-IDs which MUST be cryptographically random 4705 [RFC4086]. These MUST be chosen by the credential server in such 4706 a way that they are unpredictable to the requesting user. These 4707 are of type URI and MUST contain RELOAD URIs as described in 4708 Section 16.10 and MUST contain a Destination list with a single 4709 entry of type "node_id". 4710 o The names this user is allowed to use in the overlay, using type 4711 rfc822Name. 4713 The certificate is returned in a "Simple Enrollment Response". 4714 [[TODO: REF]] 4716 The client MUST check that the certificate returned was signed by one 4717 of the certificates received in the "root-cert" list of the overlay 4718 configuration data. The peer then reads the certificate to find the 4719 Node-IDs it can use. 4721 13.3.1. Self-Generated Credentials 4723 If the "self-signed-permitted" element is present and set to "TRUE", 4724 then a node MUST generate its own self-signed certificate to join the 4725 overlay. The self-signed certificate MAY contain any user name of 4726 the users choice. Users SHOULD make some attempt to make it unique 4727 but this document does not specify any mechanisms for that. 4729 The Node-Id MUST be computed by applying the digest specified in the 4730 self-signed-permitted element to the DER representation of the user's 4731 public key. When accepting a self-signed certificate, nodes MUST 4732 check that the Node-ID and public keys match. This prevents Node-ID 4733 theft. 4735 Once the node has constructed a self-signed certificate, it MAY join 4736 the overlay. Before storing its certificate in the overlay 4737 (Section 8) it SHOULD look to see if the user name is already taken 4738 and if so choose another user name. Note that this only provides 4739 protection against accidental name collisions. Name theft is still 4740 possible. If protection against name theft is desired, then the 4741 enrollment service must be used. 4743 13.4. Joining the Overlay Peer 4745 In order to join the overlay, the peer MUST contact a peer. 4746 Typically this means contacting the bootstrap peers, since they are 4747 guaranteed to have public IP addresses (the system should not 4748 advertise them as bootstrap peers otherwise). If the peer has cached 4749 peers it SHOULD contact them first by sending a Ping request to the 4750 known peer address with the destination Node-ID set to that peer's 4751 Node-ID. 4753 If no cached peers are available, then the peer SHOULD send a Ping 4754 request to the address and port found in the broadcast-peers element 4755 in the configuration document. This MAY be a multicast or anycast 4756 address. The Ping should use the wildcard Node-ID as the destination 4757 Node-ID. 4759 The responder peer that receives the Ping request SHOULD check that 4760 the overlay name is correct and that the requester peer sending the 4761 request has appropriate credentials for the overlay before responding 4762 to the Ping request even if the response is only an error. 4764 When the requester peer finally does receive a response from some 4765 responding peer, it can note the Node-ID in the response and use this 4766 Node-ID to start sending requests to join the Overlay Instance as 4767 described in Section 6.3. 4769 After a peer has successfully joined the overlay network, it SHOULD 4770 periodically look at any peers to which it has managed to form direct 4771 connections. Some of these peers MAY be added to the cached-peers 4772 list and used in future boots. Peers that are not directly connected 4773 MUST NOT be cached. The RECOMMENDED number of peers to cache is 10. 4775 14. Message Flow Example 4777 In the following example, we assume that JP has formed a connection 4778 to one of the bootstrap peers. JP then sends an Attach through that 4779 peer to the admitting peer (AP) to initiate a connection. When AP 4780 responds, JP and AP use ICE to set up a connection and then set up 4781 TLS. 4783 JP PPP PP AP NP NNP BP 4784 | | | | | | | 4785 | | | | | | | 4786 | | | | | | | 4787 |Attach Dest=JP | | | | | 4788 |---------------------------------------------------------->| 4789 | | | | | | | 4790 | | | | | | | 4791 | | |Attach Dest=JP | | | 4792 | | |<--------------------------------------| 4793 | | | | | | | 4794 | | | | | | | 4795 | | |Attach Dest=JP | | | 4796 | | |-------->| | | | 4797 | | | | | | | 4798 | | | | | | | 4799 | | |AttachAns | | | 4800 | | |<--------| | | | 4801 | | | | | | | 4802 | | | | | | | 4803 | | |AttachAns | | | 4804 | | |-------------------------------------->| 4805 | | | | | | | 4806 | | | | | | | 4807 |AttachAns | | | | | 4808 |<----------------------------------------------------------| 4809 | | | | | | | 4810 | | | | | | | 4811 |TLS | | | | | | 4812 |.............................| | | | 4813 | | | | | | | 4814 | | | | | | | 4815 | | | | | | | 4816 | | | | | | | 4818 Once JP has connected to AP, it needs to populate its Routing Table. 4819 In Chord, this means that it needs to populate its neighbor table and 4820 its finger table. To populate its neighbor table, it needs the 4821 successor of AP, NP. It sends an Attach to the Resource-IP AP+1, 4822 which gets routed to NP. When NP responds, JP and NP use ICE and TLS 4823 to set up a connection. 4825 JP PPP PP AP NP NNP BP 4826 | | | | | | | 4827 | | | | | | | 4828 | | | | | | | 4829 |Attach AP+1 | | | | | 4830 |---------------------------->| | | | 4831 | | | | | | | 4832 | | | | | | | 4833 | | | |Attach AP+1 | | 4834 | | | |-------->| | | 4835 | | | | | | | 4836 | | | | | | | 4837 | | | |AttachAns | | 4838 | | | |<--------| | | 4839 | | | | | | | 4840 | | | | | | | 4841 |AttachAns | | | | | 4842 |<----------------------------| | | | 4843 | | | | | | | 4844 | | | | | | | 4845 |Attach | | | | | | 4846 |-------------------------------------->| | | 4847 | | | | | | | 4848 | | | | | | | 4849 |TLS | | | | | | 4850 |.......................................| | | 4851 | | | | | | | 4852 | | | | | | | 4853 | | | | | | | 4854 | | | | | | | 4856 JP also needs to populate its finger table (for Chord). It issues a 4857 Attach to a variety of locations around the overlay. The diagram 4858 below shows it sending an Attach halfway around the Chord ring the JP 4859 + 2^127. 4861 JP NP XX TP 4862 | | | | 4863 | | | | 4864 | | | | 4865 |Attach JP+2<<126 | | 4866 |-------->| | | 4867 | | | | 4868 | | | | 4869 | |Attach JP+2<<126 | 4870 | |-------->| | 4871 | | | | 4872 | | | | 4873 | | |Attach JP+2<<126 4874 | | |-------->| 4875 | | | | 4876 | | | | 4877 | | |AttachAns| 4878 | | |<--------| 4879 | | | | 4880 | | | | 4881 | |AttachAns| | 4882 | |<--------| | 4883 | | | | 4884 | | | | 4885 |AttachAns| | | 4886 |<--------| | | 4887 | | | | 4888 | | | | 4889 |TLS | | | 4890 |.............................| 4891 | | | | 4892 | | | | 4893 | | | | 4894 | | | | 4896 Once JP has a reasonable set of connections he is ready to take his 4897 place in the DHT. He does this by sending a Join to AP. AP does a 4898 series of Store requests to JP to store the data that JP will be 4899 responsible for. AP then sends JP an Update explicitly labeling JP 4900 as its predecessor. At this point, JP is part of the ring and 4901 responsible for a section of the overlay. AP can now forget any data 4902 which is assigned to JP and not AP. 4904 JP PPP PP AP NP NNP BP 4905 | | | | | | | 4906 | | | | | | | 4907 | | | | | | | 4908 |JoinReq | | | | | | 4909 |---------------------------->| | | | 4910 | | | | | | | 4911 | | | | | | | 4912 |JoinAns | | | | | | 4913 |<----------------------------| | | | 4914 | | | | | | | 4915 | | | | | | | 4916 |StoreReq Data A | | | | | 4917 |<----------------------------| | | | 4918 | | | | | | | 4919 | | | | | | | 4920 |StoreAns | | | | | | 4921 |---------------------------->| | | | 4922 | | | | | | | 4923 | | | | | | | 4924 |StoreReq Data B | | | | | 4925 |<----------------------------| | | | 4926 | | | | | | | 4927 | | | | | | | 4928 |StoreAns | | | | | | 4929 |---------------------------->| | | | 4930 | | | | | | | 4931 | | | | | | | 4932 |UpdateReq| | | | | | 4933 |<----------------------------| | | | 4934 | | | | | | | 4935 | | | | | | | 4936 |UpdateAns| | | | | | 4937 |---------------------------->| | | | 4938 | | | | | | | 4939 | | | | | | | 4940 | | | | | | | 4941 | | | | | | | 4943 In Chord, JP's neighbor table needs to contain its own predecessors. 4944 It couldn't connect to them previously because Chord has no way to 4945 route immediately to your predecessors. However, now that it has 4946 received an Update from AP, it has APs predecessors, which are also 4947 its own, so it sends Attaches to them. Below it is shown connecting 4948 to its closest predecessor, PP. 4950 JP PPP PP AP NP NNP BP 4951 | | | | | | | 4952 | | | | | | | 4953 | | | | | | | 4954 |Attach Dest=PP | | | | | 4955 |---------------------------->| | | | 4956 | | | | | | | 4957 | | | | | | | 4958 | | |Attach Dest=PP | | | 4959 | | |<--------| | | | 4960 | | | | | | | 4961 | | | | | | | 4962 | | |AttachAns| | | | 4963 | | |-------->| | | | 4964 | | | | | | | 4965 | | | | | | | 4966 |AttachAns| | | | | | 4967 |<----------------------------| | | | 4968 | | | | | | | 4969 | | | | | | | 4970 |TLS | | | | | | 4971 |...................| | | | | 4972 | | | | | | | 4973 | | | | | | | 4974 |UpdateReq| | | | | | 4975 |------------------>| | | | | 4976 | | | | | | | 4977 | | | | | | | 4978 |UpdateAns| | | | | | 4979 |<------------------| | | | | 4980 | | | | | | | 4981 | | | | | | | 4982 |UpdateReq| | | | | | 4983 |---------------------------->| | | | 4984 | | | | | | | 4985 | | | | | | | 4986 |UpdateAns| | | | | | 4987 |<----------------------------| | | | 4988 | | | | | | | 4989 | | | | | | | 4990 |UpdateReq| | | | | | 4991 |-------------------------------------->| | | 4992 | | | | | | | 4993 | | | | | | | 4994 |UpdateAns| | | | | | 4995 |<--------------------------------------| | | 4996 | | | | | | | 4997 | | | | | | | 4999 Finally, now that JP has a copy of all the data and is ready to route 5000 messages and receive requests, it sends Updates to everyone in its 5001 Routing Table to tell them it is ready to go. Below, it is shown 5002 sending such an update to TP. 5004 JP NP XX TP 5005 | | | | 5006 | | | | 5007 | | | | 5008 |Update | | | 5009 |---------------------------->| 5010 | | | | 5011 | | | | 5012 |UpdateAns| | | 5013 |<----------------------------| 5014 | | | | 5015 | | | | 5016 | | | | 5017 | | | | 5019 15. Security Considerations 5021 15.1. Overview 5023 RELOAD provides a generic storage service, albeit one designed to be 5024 useful for P2PSIP. In this section we discuss security issues that 5025 are likely to be relevant to any usage of RELOAD. In Section 15.7 we 5026 describe issues that are specific to SIP. 5028 In any Overlay Instance, any given user depends on a number of peers 5029 with which they have no well-defined relationship except that they 5030 are fellow members of the Overlay Instance. In practice, these other 5031 nodes may be friendly, lazy, curious, or outright malicious. No 5032 security system can provide complete protection in an environment 5033 where most nodes are malicious. The goal of security in RELOAD is to 5034 provide strong security guarantees of some properties even in the 5035 face of a large number of malicious nodes and to allow the overlay to 5036 function correctly in the face of a modest number of malicious nodes. 5038 P2PSIP deployments require the ability to authenticate both peers and 5039 resources (users) without the active presence of a trusted entity in 5040 the system. We describe two mechanisms. The first mechanism is 5041 based on public key certificates and is suitable for general 5042 deployments. The second is an admission control mechanism based on 5043 an overlay-wide shared symmetric key. 5045 15.2. Attacks on P2P Overlays 5047 The two basic functions provided by overlay nodes are storage and 5048 routing: some node is responsible for storing a peer's data and for 5049 allowing a peer to fetch other peer's data. Some other set of nodes 5050 are responsible for routing messages to and from the storing nodes. 5051 Each of these issues is covered in the following sections. 5053 P2P overlays are subject to attacks by subversive nodes that may 5054 attempt to disrupt routing, corrupt or remove user registrations, or 5055 eavesdrop on signaling. The certificate-based security algorithms we 5056 describe in this draft are intended to protect overlay routing and 5057 user registration information in RELOAD messages. 5059 To protect the signaling from attackers pretending to be valid peers 5060 (or peers other than themselves), the first requirement is to ensure 5061 that all messages are received from authorized members of the 5062 overlay. For this reason, RELOAD transports all messages over a 5063 secure channel (TLS and DTLS are defined in this document) which 5064 provides message integrity and authentication of the directly 5065 communicating peer. In addition, messages and data are digitally 5066 signed with the sender's private key, providing end-to-end security 5067 for communications. 5069 15.3. Certificate-based Security 5071 This specification stores users' registrations and possibly other 5072 data in an overlay network. This requires a solution to securing 5073 this data as well as securing, as well as possible, the routing in 5074 the overlay. Both types of security are based on requiring that 5075 every entity in the system (whether user or peer) authenticate 5076 cryptographically using an asymmetric key pair tied to a certificate. 5078 When a user enrolls in the Overlay Instance, they request or are 5079 assigned a unique name, such as "alice@dht.example.net". These names 5080 are unique and are meant to be chosen and used by humans much like a 5081 SIP Address of Record (AOR) or an email address. The user is also 5082 assigned one or more Node-IDs by the central enrollment authority. 5083 Both the name and the peer ID are placed in the certificate, along 5084 with the user's public key. 5086 Each certificate enables an entity to act in two sorts of roles: 5088 o As a user, storing data at specific Resource-IDs in the Overlay 5089 Instance corresponding to the user name. 5090 o As a overlay peer with the peer ID(s) listed in the certificate. 5092 Note that since only users of this Overlay Instance need to validate 5093 a certificate, this usage does not require a global PKI. Instead, 5094 certificates are signed by require a central enrollment authority 5095 which acts as the certificate authority for the Overlay Instance. 5096 This authority signs each peer's certificate. Because each peer 5097 possesses the CA's certificate (which they receive on enrollment) 5098 they can verify the certificates of the other entities in the overlay 5099 without further communication. Because the certificates contain the 5100 user/peer's public key, communications from the user/peer can be 5101 verified in turn. 5103 If self-signed certificates are used, then the security provided is 5104 significantly decreased, since attackers can mount Sybil attacks. In 5105 addition, attackers cannot trust the user names in certificates 5106 (though they can trust the Node-Ids because they are 5107 cryptographically verifiable). This scheme is only appropriate for 5108 small deployments, such as a small office or ad hoc overlay set up 5109 among participants in a meeting. Some additional security can be 5110 provided by using the shared secret admission control scheme as well. 5112 Because all stored data is signed by the owner of the data the 5113 storing peer can verify that the storer is authorized to perform a 5114 store at that resource-id and also allows any consumer of the data to 5115 verify the provenance and integrity of the data when it retrieves it. 5117 All implementations MUST implement certificate-based security. 5119 15.4. Shared-Secret Security 5121 RELOAD also supports a shared secret admission control scheme that 5122 relies on a single key that is shared among all members of the 5123 overlay. It is appropriate for small groups that wish to form a 5124 private network without complexity. In shared secret mode, all the 5125 peers share a single symmetric key which is used to key TLS-PSK 5126 [RFC4279] or TLS-SRP [I-D.ietf-tls-srp] mode. A peer which does not 5127 know the key cannot form TLS connections with any other peer and 5128 therefore cannot join the overlay. 5130 One natural approach to a shared-secret scheme is to use a user- 5131 entered password as the key. The difficulty with this is that in 5132 TLS-PSK mode, such keys are very susceptible to dictionary attacks. 5133 If passwords are used as the source of shared-keys, then TLS-SRP is a 5134 superior choice because it is not subject to dictionary attacks. 5136 15.5. Storage Security 5138 When certificate-based security is used in RELOAD, any given 5139 Resource-ID/kind-id pair (a slot) is bound to some small set of 5140 certificates. In order to write data in a slot, the writer must 5141 prove possession of the private key for one of those certificates. 5142 Moreover, all data is stored signed by the certificate which 5143 authorized its storage. This set of rules makes questions of 5144 authorization and data integrity - which have historically been 5145 thorny for overlays - relatively simple. 5147 15.5.1. Authorization 5149 When a client wants to store some value in a slot, it first digitally 5150 signs the value with its own private key. It then sends a Store 5151 request that contains both the value and the signature towards the 5152 storing peer (which is defined by the Resource Name construction 5153 algorithm for that particular kind of value). 5155 When the storing peer receives the request, it must determine whether 5156 the storing client is authorized to store in this slot. In order to 5157 do so, it executes the Resource Name construction algorithm for the 5158 specified kind based on the user's certificate information. It then 5159 computes the Resource-ID from the Resource Name and verifies that it 5160 matches the slot which the user is requesting to write to. If it 5161 does, the user is authorized to write to this slot, pending quota 5162 checks as described in the next section. 5164 For example, consider the certificate with the following properties: 5166 User name: alice@dht.example.com 5167 Node-ID: 013456789abcdef 5168 Serial: 1234 5170 If Alice wishes to Store a value of the "SIP Location" kind, the 5171 Resource Name will be the SIP AOR "sip:alice@dht.example.com". The 5172 Resource-ID will be determined by hashing the Resource Name. When a 5173 peer receives a request to store a record at Resource-ID X, it takes 5174 the signing certificate and recomputes the Resource Name, in this 5175 case "alice@dht.example.com". If H("alice@dht.example.com")=X then 5176 the Store is authorized. Otherwise it is not. Note that the 5177 Resource Name construction algorithm may be different for other 5178 kinds. 5180 15.5.2. Distributed Quota 5182 Being a peer in a Overlay Instance carries with it the responsibility 5183 to store data for a given region of the Overlay Instance. However, 5184 if clients were allowed to store unlimited amounts of data, this 5185 would create unacceptable burdens on peers, as well as enabling 5186 trivial denial of service attacks. RELOAD addresses this issue by 5187 requiring configurations to define maximum sizes for each kind of 5188 stored data. Attempts to store values exceeding this size MUST be 5189 rejected (if peers are inconsistent about this, then strange 5190 artifacts will happen when the zone of responsibility shifts and a 5191 different peer becomes responsible for overlarge data). Because each 5192 slot is bound to a small set of certificates, these size restrictions 5193 also create a distributed quota mechanism, with the quotas 5194 administered by the central enrollment server. 5196 Allowing different kinds of data to have different size restrictions 5197 allows new usages the flexibility to define limits that fit their 5198 needs without requiring all usages to have expansive limits. 5200 15.5.3. Correctness 5202 Because each stored value is signed, it is trivial for any retrieving 5203 peer to verify the integrity of the stored value. Some more care 5204 needs to be taken to prevent version rollback attacks. Rollback 5205 attacks on storage are prevented by the use of store times and 5206 lifetime values in each store. A lifetime represents the latest time 5207 at which the data is valid and thus limits (though does not 5208 completely prevent) the ability of the storing node to perform a 5209 rollback attack on retrievers. In order to prevent a rollback attack 5210 at the time of the Store request, we require that storage times be 5211 monotonically increasing. Storing peers MUST reject Store requests 5212 with storage times smaller than or equal to those they are currently 5213 storing. In addition, a fetching node which receives a data value 5214 with a storage time older than the result of the previous fetch knows 5215 a rollback has occurred. 5217 15.5.4. Residual Attacks 5219 The mechanisms described here provide a high degree of security, but 5220 some attacks remain possible. Most simply, it is possible for 5221 storing nodes to refuse to store a value (i.e., reject any request). 5222 In addition, a storing node can deny knowledge of values which it 5223 previously accepted. To some extent these attacks can be ameliorated 5224 by attempting to store to/retrieve from replicas, but a retrieving 5225 client does not know whether it should try this or not, since there 5226 is a cost to doing so. 5228 Although the certificate-based authentication scheme prevents a 5229 single peer from being able to forge data owned by other peers. 5230 Furthermore, although a subversive peer can refuse to return data 5231 resources for which it is responsible it cannot return forged data 5232 because it cannot provide authentication for such registrations. 5233 Therefore parallel searches for redundant registrations can mitigate 5234 most of the affects of a compromised peer. The ultimate reliability 5235 of such an overlay is a statistical question based on the replication 5236 factor and the percentage of compromised peers. 5238 In addition, when a kind is is multivalued (e.g., an array data 5239 model), the storing node can return only some subset of the values, 5240 thus biasing its responses. This can be countered by using single 5241 values rather than sets, but that makes coordination between multiple 5242 storing agents much more difficult. This is a tradeoff that must be 5243 made when designing any usage. 5245 15.6. Routing Security 5247 Because the storage security system guarantees (within limits) the 5248 integrity of the stored data, routing security focuses on stopping 5249 the attacker from performing a DOS attack on the system by misrouting 5250 requests in the overlay. There are a few obvious observations to 5251 make about this. First, it is easy to ensure that an attacker is at 5252 least a valid peer in the Overlay Instance. Second, this is a DOS 5253 attack only. Third, if a large percentage of the peers on the 5254 Overlay Instance are controlled by the attacker, it is probably 5255 impossible to perfectly secure against this. 5257 15.6.1. Background 5259 In general, attacks on DHT routing are mounted by the attacker 5260 arranging to route traffic through or two nodes it controls. In the 5261 Eclipse attack [Eclipse] the attacker tampers with messages to and 5262 from nodes for which it is on-path with respect to a given victim 5263 node. This allows it to pretend to be all the nodes that are 5264 reachable through it. In the Sybil attack [Sybil], the attacker 5265 registers a large number of nodes and is therefore able to capture a 5266 large amount of the traffic through the DHT. 5268 Both the Eclipse and Sybil attacks require the attacker to be able to 5269 exercise control over her peer IDs. The Sybil attack requires the 5270 creation of a large number of peers. The Eclipse attack requires 5271 that the attacker be able to impersonate specific peers. In both 5272 cases, these attacks are limited by the use of centralized, 5273 certificate-based admission control. 5275 15.6.2. Admissions Control 5277 Admission to an RELOAD Overlay Instance is controlled by requiring 5278 that each peer have a certificate containing its peer ID. The 5279 requirement to have a certificate is enforced by using certificate- 5280 based mutual authentication on each connection. Thus, whenever a 5281 peer connects to another peer, each side automatically checks that 5282 the other has a suitable certificate. These peer IDs are randomly 5283 assigned by the central enrollment server. This has two benefits: 5285 o It allows the enrollment server to limit the number of peer IDs 5286 issued to any individual user. 5287 o It prevents the attacker from choosing specific peer IDs. 5289 The first property allows protection against Sybil attacks (provided 5290 the enrollment server uses strict rate limiting policies). The 5291 second property deters but does not completely prevent Eclipse 5292 attacks. Because an Eclipse attacker must impersonate peers on the 5293 other side of the attacker, he must have a certificate for suitable 5294 peer IDs, which requires him to repeatedly query the enrollment 5295 server for new certificates which only will match by chance. From 5296 the attacker's perspective, the difficulty is that if he only has a 5297 small number of certificates the region of the Overlay Instance he is 5298 impersonating appears to be very sparsely populated by comparison to 5299 the victim's local region. 5301 15.6.3. Peer Identification and Authentication 5303 In general, whenever a peer engages in overlay activity that might 5304 affect the routing table it must establish its identity. This 5305 happens in two ways. First, whenever a peer establishes a direct 5306 connection to another peer it authenticates via certificate-based 5307 mutual authentication. All messages between peers are sent over this 5308 protected channel and therefore the peers can verify the data origin 5309 of the last hop peer for requests and responses without further 5310 cryptography. 5312 In some situations, however, it is desirable to be able to establish 5313 the identity of a peer with whom one is not directly connected. The 5314 most natural case is when a peer Updates its state. At this point, 5315 other peers may need to update their view of the overlay structure, 5316 but they need to verify that the Update message came from the actual 5317 peer rather than from an attacker. To prevent this, all overlay 5318 routing messages are signed by the peer that generated them. 5320 [OPEN ISSUE: this allows for replay attacks on requests. There are 5321 two basic defenses here. The first is global clocks and loose anti- 5322 replay. The second is to refuse to take any action unless you verify 5323 the data with the relevant node. This issue is undecided.] 5325 [TODO: I think we are probably going to end up with generic 5326 signatures or at least optional signatures on all overlay messages.] 5328 15.6.4. Protecting the Signaling 5330 The goal here is to stop an attacker from knowing who is signaling 5331 what to whom. An attacker being able to observe the activities of a 5332 specific individual is unlikely given the randomization of IDs and 5333 routing based on the present peers discussed above. Furthermore, 5334 because messages can be routed using only the header information, the 5335 actual body of the RELOAD message can be encrypted during 5336 transmission. 5338 There are two lines of defense here. The first is the use of TLS or 5339 DTLS for each communications link between peers. This provides 5340 protection against attackers who are not members of the overlay. The 5341 second line of defense, if certificate-based security is used, is to 5342 digitally sign each message. This prevents adversarial peers from 5343 modifying messages in flight, even if they are on the routing path. 5345 15.6.5. Residual Attacks 5347 The routing security mechanisms in RELOAD are designed to contain 5348 rather than eliminate attacks on routing. It is still possible for 5349 an attacker to mount a variety of attacks. In particular, if an 5350 attacker is able to take up a position on the overlay routing between 5351 A and B it can make it appear as if B does not exist or is 5352 disconnected. It can also advertise false network metrics in attempt 5353 to reroute traffic. However, these are primarily DoS attacks. 5355 The certificate-based security scheme secures the namespace, but if 5356 an individual peer is compromised or if an attacker obtains a 5357 certificate from the CA, then a number of subversive peers can still 5358 appear in the overlay. While these peers cannot falsify responses to 5359 resource queries, they can respond with error messages, effecting a 5360 DoS attack on the resource registration. They can also subvert 5361 routing to other compromised peers. To defend against such attacks, 5362 a resource search must still consist of parallel searches for 5363 replicated registrations. 5365 15.7. SIP-Specific Issues 5367 15.7.1. Fork Explosion 5369 Because SIP includes a forking capability (the ability to retarget to 5370 multiple recipients), fork bombs are a potential DoS concern. 5371 However, in the SIP usage of RELOAD, fork bombs are a much lower 5372 concern because the calling party is involved in each retargeting 5373 event and can therefore directly measure the number of forks and 5374 throttle at some reasonable number. 5376 15.7.2. Malicious Retargeting 5378 Another potential DoS attack is for the owner of an attractive number 5379 to retarget all calls to some victim. This attack is difficult to 5380 ameliorate without requiring the target of a SIP registration to 5381 authorize all stores. The overhead of that requirement would be 5382 excessive and in addition there are good use cases for retargeting to 5383 a peer without there explicit cooperation. 5385 15.7.3. Privacy Issues 5387 All RELOAD SIP registration data is public. Methods of providing 5388 location and identity privacy are still being studied. 5390 16. IANA Considerations 5392 This section contains the new code points registered by this 5393 document. 5395 [[TODO - add IANA registration for p2p_enroll SRV and p2p_menroll]] 5397 16.1. Overlay Algorithm Types 5399 IANA SHALL create/(has created) a "RELOAD Overlay Algorithm Type" 5400 Registry. Entries in this registry are strings denoting the names of 5401 overlay algorithms. The registration policy for this registry is RFC 5402 5226 IETF Review. 5404 The initial contents of this registry are: 5406 chord-128-2-16+ 5407 The algorithm defined in Section 12 of this document. 5409 16.2. Data Kind-Id 5411 IANA SHALL create/(has created) a "RELOAD Data Kind-Id" Registry. 5412 Entries in this registry are 32-bit integers denoting data kinds, as 5413 described in Section 4.1.2. Code points in the range 0x00000000 to 5414 0x7fffffff SHALL be registered via RFC 5226 Standards Action. Code 5415 points in the range 0x8000000 to 0xffffffff SHALL be registered via 5416 RFC 5226 Expert Review. 5418 The initial contents of this registry are: 5420 +--------------------+---------+ 5421 | Kind | Kind-Id | 5422 +--------------------+---------+ 5423 | SIP-REGISTRATION | 1 | 5424 | TURN_SERVICE | 2 | 5425 | CERTIFICATE | 3 | 5426 | ROUTING_TABLE_SIZE | 4 | 5427 | SOFTWARE_VERSION | 5 | 5428 | MACHINE_UPTIME | 6 | 5429 | APP_UPTIME | 7 | 5430 | MEMORY_FOOTPRINT | 8 | 5431 | DATASIZE_StoreD | 9 | 5432 | INSTANCES_StoreD | 10 | 5433 | MESSAGES_SENT_RCVD | 11 | 5434 | EWMA_BYTES_SENT | 12 | 5435 | EWMA_BYTES_RCVD | 13 | 5436 | LAST_CONTACT | 14 | 5437 | RTT | 15 | 5438 +--------------------+---------+ 5440 16.3. Data Model 5442 IANA SHALL create/(has created) a "RELOAD Data Model" Registry. 5443 Entries in this registry are 8-bit integers denoting data models, as 5444 described in Section 7.2. Code points in this registry SHALL be 5445 registered via RFC 5226 IETF Review. 5447 +--------------+------------+ 5448 | Data Model | Identifier | 5449 +--------------+------------+ 5450 | SINGLE_VALUE | 1 | 5451 | ARRAY | 2 | 5452 | DICTIONARY | 3 | 5453 +--------------+------------+ 5455 16.4. Message Codes 5457 IANA SHALL create/(has created) a "RELOAD Message Code" Registry. 5458 Entries in this registry are 16-bit integers denoting method codes as 5459 described in Section 6.2.3. These codes SHALL be registred via RFC 5460 5226 Standards Track. 5462 The initial contents of this registry are: 5464 +-------------------+----------------+ 5465 | Message Code Name | Code Value | 5466 +-------------------+----------------+ 5467 | reserved | 0 | 5468 | ping_req | 1 | 5469 | ping_ans | 2 | 5470 | attach_req | 3 | 5471 | attach_ans | 4 | 5472 | tunnel_req | 5 | 5473 | tunnel_ans | 6 | 5474 | store_req | 7 | 5475 | store_ans | 8 | 5476 | fetch_req | 9 | 5477 | fetch_ans | 10 | 5478 | remove_req | 11 | 5479 | remove_ans | 12 | 5480 | find_req | 13 | 5481 | find_ans | 14 | 5482 | join_req | 15 | 5483 | join_ans | 16 | 5484 | leave_req | 17 | 5485 | leave_ans | 18 | 5486 | update_req | 19 | 5487 | update_ans | 20 | 5488 | route_query_req | 21 | 5489 | route_query_ans | 22 | 5490 | reserved | 0x8000..0xfffe | 5491 | error | 0xffff | 5492 +-------------------+----------------+ 5494 16.5. Error Codes 5496 IANA SHALL create/(has created) a "RELOAD Error Code" Registry. 5497 Entries in this registry are 16-bit integers denoting error codes. 5498 New entries SHALL be defined via RFC 5226 Standards Track. 5500 16.6. Route Log Extension Types 5502 IANA SHALL create/(has created) a "RELOAD Route Log Extension Type 5503 Registry. This registry is currently empty. New entries SHALL be 5504 defined via RFC 5226 Expert Review. 5506 16.7. Transport Types 5508 IANA shall create/(has created) a "RELOAD Transport Type Registry." 5509 This registry SHALL be initially populated with the following values: 5511 reserved 0 5512 tcp_tls 1 5513 udp_dtls 2 5515 New entries SHALL be defined via RFC 5226 Standards Action. 5517 16.8. Forwarding Options 5519 IANA shall create/(has created) a "RELOAD Forwarding Option 5520 Registry". Entries in this registry between 0 and 127 SHALL be 5521 defined via RFC 5226 Standards Track. Entries in this registry 5522 between 128 and 255 SHALL be defined via RFC 5226 Specification 5523 Required. 5525 16.9. Ping Information Types 5527 IANA shall create/(has created) a "RELOAD Ping Information Type 5528 Registry". This registry SHALL be initially populated with the 5529 following values: 5531 responsible_set 1 5532 requested_info 2 5534 Entries in this registry SHALL be defined via RFC 5226 Standards 5535 Track. 5537 16.10. reload: URI Scheme 5539 This section describes the scheme for a reload: URI, which can be 5540 used to refer to either: 5542 o A peer. 5543 o A resource inside a peer. 5545 The reload: URI is defined using a subset of the URI schema 5546 specified in Appendix A. of RFC 3986 [REF] and the associated URI 5547 Guidelines [REF: RFC4395] per the following ABNF syntax: 5549 RELOAD-URI = "reload://" destination "@" overlay "/" 5550 [specifier] 5552 destination = 1 * HEXDIG 5553 overlay = reg-name 5554 specifier = 1*HEXDIG 5556 The definitions of these productions are as follows: 5558 destination: a hex-encoded Destination List object. 5560 overlay: the name of the overlay. 5562 specifier : a hex-encoded StoredDataSpecifier indicating the data 5563 element. 5565 If no specifier is present than this URI addresses the peer which can 5566 be reached via the indicated destination list at the indicated 5567 overlay name. If a specifier is present, then the URI addresses the 5568 data value. 5570 16.10.1. URI Registration 5572 The following summarizes the information necessary to register the 5573 reload: URI. [NOTE TO IANA/RFC-EDITOR: Please replace XXXX with 5574 the RFC number for this specification in the following list.] 5576 URI Scheme Name: reload 5577 Status: permanent 5578 URI Scheme Syntax: see Section 16.10. 5579 URI Scheme Semantics: The reload: URI is intended to be used as a 5580 reference to a RELOAD peer or resource. 5581 Encoding Considerations: The reload: URI is not intended to be 5582 human-readable text, therefore they are encoded entirely in US- 5583 ASCII. 5584 Applications/protocols that use this URI scheme: The RELOAD 5585 protocol described in RFC XXXX. 5586 TBD for the rest of this template. 5588 17. Acknowledgments 5590 This draft is a merge of the "REsource LOcation And Discovery 5591 (RELOAD)" draft by David A. Bryan, Marcia Zangrilli and Bruce B. 5592 Lowekamp, the "Address Settlement by Peer to Peer" draft by Cullen 5593 Jennings, Jonathan Rosenberg, and Eric Rescorla, the "Security 5594 Extensions for RELOAD" draft by Bruce B. Lowekamp and James Deverick, 5595 the "A Chord-based DHT for Resource Lookup in P2PSIP" by Marcia 5596 Zangrilli and David A. Bryan, and the Peer-to-Peer Protocol (P2PP) 5597 draft by Salman A. Baset, Henning Schulzrinne, and Marcin 5598 Matuszewski. 5600 Thanks to the many people who contributed including: Michael Chen, 5601 TODO - fill in. 5603 18. References 5604 18.1. Normative References 5606 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 5607 Requirement Levels", BCP 14, RFC 2119, March 1997. 5609 [I-D.ietf-mmusic-ice] 5610 Rosenberg, J., "Interactive Connectivity Establishment 5611 (ICE): A Protocol for Network Address Translator (NAT) 5612 Traversal for Offer/Answer Protocols", 5613 draft-ietf-mmusic-ice-16 (work in progress), June 2007. 5615 [I-D.ietf-behave-rfc3489bis] 5616 Rosenberg, J., "Session Traversal Utilities for (NAT) 5617 (STUN)", draft-ietf-behave-rfc3489bis-06 (work in 5618 progress), March 2007. 5620 [I-D.ietf-behave-turn] 5621 Rosenberg, J., "Obtaining Relay Addresses from Simple 5622 Traversal Underneath NAT (STUN)", 5623 draft-ietf-behave-turn-03 (work in progress), March 2007. 5625 [I-D.ietf-pkix-cmc-trans] 5626 Schaad, J. and M. Myers, "Certificate Management over CMS 5627 (CMC) Transport Protocols", draft-ietf-pkix-cmc-trans-05 5628 (work in progress), May 2006. 5630 [I-D.ietf-pkix-2797-bis] 5631 Myers, M. and J. Schaad, "Certificate Management Messages 5632 over CMS", draft-ietf-pkix-2797-bis-04 (work in progress), 5633 March 2006. 5635 [RFC4279] Eronen, P. and H. Tschofenig, "Pre-Shared Key Ciphersuites 5636 for Transport Layer Security (TLS)", RFC 4279, 5637 December 2005. 5639 [I-D.ietf-tls-srp] 5640 Taylor, D., "Using SRP for TLS Authentication", 5641 draft-ietf-tls-srp-14 (work in progress), June 2007. 5643 [I-D.ietf-mmusic-ice-tcp] 5644 Rosenberg, J., "TCP Candidates with Interactive 5645 Connectivity Establishment (ICE", 5646 draft-ietf-mmusic-ice-tcp-03 (work in progress), 5647 March 2007. 5649 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 5650 A., and J. Peterson, "SIP: Session Initiation Protocol", 5651 RFC 3261, June 2002. 5653 [RFC3263] Rosenberg, J. and H. Schulzrinne, "Session Initiation 5654 Protocol (SIP): Locating SIP Servers", RFC 3263, 5655 June 2002. 5657 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 5658 Security", RFC 4347, April 2006. 5660 [RFC4828] Floyd, S. and E. Kohler, "TCP Friendly Rate Control 5661 (TFRC): The Small-Packet (SP) Variant", RFC 4828, 5662 April 2007. 5664 18.2. Informative References 5666 [I-D.ietf-behave-tcp] 5667 Guha, S., "NAT Behavioral Requirements for TCP", 5668 draft-ietf-behave-tcp-07 (work in progress), April 2007. 5670 [I-D.ietf-p2psip-concepts] 5671 Bryan, D., "Concepts and Terminology for Peer to Peer 5672 SIP", draft-ietf-p2psip-concepts-00 (work in progress), 5673 July 2007. 5675 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 5676 the Session Description Protocol (SDP)", RFC 4145, 5677 September 2005. 5679 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 5681 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 5682 Requirements for Security", BCP 106, RFC 4086, June 2005. 5684 [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet 5685 X.509 Public Key Infrastructure Certificate and 5686 Certificate Revocation List (CRL) Profile", RFC 3280, 5687 April 2002. 5689 [Sybil] Douceur, J., "The Sybil Attack", IPTPS 02, March 2002. 5691 [Eclipse] Singh, A., Ngan, T., Druschel, T., and D. Wallach, 5692 "Eclipse Attacks on Overlay Networks: Threats and 5693 Defenses", INFOCOM 2006, April 2006. 5695 [I-D.cheshire-dnsext-multicastdns] 5696 Cheshire, S. and M. Krochmal, "Multicast DNS", 5697 draft-cheshire-dnsext-multicastdns-06 (work in progress), 5698 August 2006. 5700 [I-D.cheshire-dnsext-dns-sd] 5701 Krochmal, M. and S. Cheshire, "DNS-Based Service 5702 Discovery", draft-cheshire-dnsext-dns-sd-04 (work in 5703 progress), August 2006. 5705 [I-D.matthews-p2psip-bootstrap-mechanisms] 5706 Cooper, E., "Bootstrap Mechanisms for P2PSIP", 5707 draft-matthews-p2psip-bootstrap-mechanisms-00 (work in 5708 progress), February 2007. 5710 [I-D.garcia-p2psip-dns-sd-bootstrapping] 5711 Garcia, G., "P2PSIP bootstrapping using DNS-SD", 5712 draft-garcia-p2psip-dns-sd-bootstrapping-00 (work in 5713 progress), October 2007. 5715 [I-D.camarillo-hip-bone] 5716 Camarillo, G., Nikander, P., and J. Hautakorpi, "HIP BONE: 5717 Host Identity Protocol (HIP) Based Overlay Networking 5718 Environment", draft-camarillo-hip-bone-00 (work in 5719 progress), December 2007. 5721 [I-D.pascual-p2psip-clients] 5722 Pascual, V., Matuszewski, M., Shim, E., Zhang, H., and S. 5723 Yongchao, "P2PSIP Clients", 5724 draft-pascual-p2psip-clients-01 (work in progress), 5725 February 2008. 5727 [RFC4787] Audet, F. and C. Jennings, "Network Address Translation 5728 (NAT) Behavioral Requirements for Unicast UDP", BCP 127, 5729 RFC 4787, January 2007. 5731 [I-D.jiang-p2psip-sep] 5732 Jiang, X. and H. Zhang, "Service Extensible P2P Peer 5733 Protocol", draft-jiang-p2psip-sep-01 (work in progress), 5734 February 2008. 5736 [stoica-non-transitive-worlds05] 5737 Freedman, M., Lakshminarayanan, K., Rhea, S., and I. 5738 Stoica, "Non-Transitive Connectivity and DHTs", 5739 WORLDS'05. 5741 [stoica-geometry-sigcomm03] 5742 Gummadi, K., Gummadi, R., Gribble, S., Ratnasamy, S., 5743 Shenker, S., and I. Stoica, "The Impact of DHT Routing 5744 Geometry on Resilience and Proximity", SIGCOMM'03. 5746 [ng-analytical-churn-ieeep2p06] 5747 Wu, D., Tian, Y., and K. Ng, "Analytical Study on 5748 Improving DHT Lookup Performance under Churn", IEEE 5749 P2P'06. 5751 [bryan-design-hotp2p08] 5752 Bryan, D., Lowekamp, B., and M. Zangrilli, "The Design of 5753 a Versatile, Secure P2PSIP Communications Architecture for 5754 the Public Internet", Hot-P2P'08. 5756 [opendht-sigcomm05] 5757 Rhea, S., Godfrey, B., Karp, B., Kubiatowicz, J., 5758 Ratnasamy, S., Shenker, S., Stoica, I., and H. Yu, 5759 "OpenDHT: A Public DHT and its Uses", SIGCOMM'05. 5761 [Chord] Stoica, I., Morris, R., Liben-Nowell, D., Karger, D., 5762 Kaashoek, M., Dabek, F., and H. Balakrishnan, "Chord: A 5763 Scalable Peer-to-peer Lookup Service for Internet 5764 Applications", IEEE/ACM Transactions on Networking Volume 5765 11, Issue 1, 17-32, Feb 2003. 5767 [vulnerabilities-acsac04] 5768 Srivatsa, M. and L. Liu, "Vulnerabilities and Security 5769 Threats in Structured Peer-to-Peer Systems: A Quantitative 5770 Analysis", ACSAC 2004. 5772 [I-D.zheng-p2psip-diagnose] 5773 Yongchao, S., Zhang, H., and X. Jiang, "Diagnose P2PSIP 5774 Overlay Network Failures", draft-zheng-p2psip-diagnose-02 5775 (work in progress), July 2008. 5777 [I-D.song-p2psip-security-eval] 5778 Yongchao, S., Zhao, B., Jiang, X., and J. Haifeng, "P2PSIP 5779 Security Analysis and Evaluation", 5780 draft-song-p2psip-security-eval-00 (work in progress), 5781 February 2008. 5783 [I-D.matthews-p2psip-id-loc] 5784 Cooper, E., Johnston, A., and P. Matthews, "An ID/Locator 5785 Architecture for P2PSIP", draft-matthews-p2psip-id-loc-01 5786 (work in progress), February 2008. 5788 [I-D.zheng-p2psip-client-protocol] 5789 Yongchao, S., Jiang, X., Zhang, H., and H. Deng, "P2PSIP 5790 Client Protocol", draft-zheng-p2psip-client-protocol-01 5791 (work in progress), February 2008. 5793 [I-D.hardie-p2poverlay-pointers] 5794 Hardie, T., "Mechanisms for use in pointing to overlay 5795 networks, nodes, or resources", 5796 draft-hardie-p2poverlay-pointers-00 (work in progress), 5797 January 2008. 5799 Authors' Addresses 5801 Cullen Jennings 5802 Cisco 5803 170 West Tasman Drive 5804 MS: SJC-21/2 5805 San Jose, CA 95134 5806 USA 5808 Phone: +1 408 421-9990 5809 Email: fluffy@cisco.com 5811 Bruce B. Lowekamp 5812 SIPeerior Technologies 5813 3000 Easter Circle 5814 Williamsburg, VA 23188 5815 USA 5817 Phone: +1 757 565 0101 5818 Email: lowekamp@sipeerior.com 5820 Eric Rescorla 5821 Network Resonance 5822 2064 Edgewood Drive 5823 Palo Alto, CA 94303 5824 USA 5826 Phone: +1 650 320-8549 5827 Email: ekr@networkresonance.com 5829 Salman A. Baset 5830 Columbia University 5831 1214 Amsterdam Avenue 5832 New York, NY 5833 USA 5835 Email: salman@cs.columbia.edu 5836 Henning Schulzrinne 5837 Columbia University 5838 1214 Amsterdam Avenue 5839 New York, NY 5840 USA 5842 Email: hgs@cs.columbia.edu 5844 Full Copyright Statement 5846 Copyright (C) The IETF Trust (2008). 5848 This document is subject to the rights, licenses and restrictions 5849 contained in BCP 78, and except as set forth therein, the authors 5850 retain all their rights. 5852 This document and the information contained herein are provided on an 5853 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 5854 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 5855 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 5856 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 5857 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 5858 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 5860 Intellectual Property 5862 The IETF takes no position regarding the validity or scope of any 5863 Intellectual Property Rights or other rights that might be claimed to 5864 pertain to the implementation or use of the technology described in 5865 this document or the extent to which any license under such rights 5866 might or might not be available; nor does it represent that it has 5867 made any independent effort to identify any such rights. Information 5868 on the procedures with respect to rights in RFC documents can be 5869 found in BCP 78 and BCP 79. 5871 Copies of IPR disclosures made to the IETF Secretariat and any 5872 assurances of licenses to be made available, or the result of an 5873 attempt made to obtain a general license or permission for the use of 5874 such proprietary rights by implementers or users of this 5875 specification can be obtained from the IETF on-line IPR repository at 5876 http://www.ietf.org/ipr. 5878 The IETF invites any interested party to bring to its attention any 5879 copyrights, patents or patent applications, or other proprietary 5880 rights that may cover technology that may be required to implement 5881 this standard. Please address the information to the IETF at 5882 ietf-ipr@ietf.org. 5884 Acknowledgment 5886 Funding for the RFC Editor function is provided by the IETF 5887 Administrative Support Activity (IASA).