idnits 2.17.1 draft-ietf-p2psip-base-24.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- 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 and authors Copyright Line does not match the current year == Line 2085 has weird spacing: '...gOption opti...' == Line 2350 has weird spacing: '...ionType type;...' == Line 2605 has weird spacing: '...tyValue ide...' == Line 2940 has weird spacing: '...ionType typ...' == Line 2942 has weird spacing: '...ionData val...' == (3 more instances...) -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (January 19, 2013) is 4114 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) == Missing Reference: 'A' is mentioned on line 1765, but not defined == Missing Reference: 'B' is mentioned on line 1765, but not defined == Missing Reference: 'C' is mentioned on line 1765, but not defined == Missing Reference: 'X' is mentioned on line 1749, but not defined == Missing Reference: 'D' is mentioned on line 1762, but not defined == Missing Reference: 'I' is mentioned on line 1762, but not defined == Missing Reference: 'NodeIdLength' is mentioned on line 1979, but not defined -- Looks like a reference, but probably isn't: '0' on line 5016 == Missing Reference: 'RFC-AAAA' is mentioned on line 6819, but not defined ** Obsolete normative reference: RFC 2388 (Obsoleted by RFC 7578) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3023 (Obsoleted by RFC 7303) ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 4395 (Obsoleted by RFC 7595) ** Obsolete normative reference: RFC 5245 (Obsoleted by RFC 8445, RFC 8839) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 5389 (Obsoleted by RFC 8489) ** Obsolete normative reference: RFC 5405 (Obsoleted by RFC 8085) ** Obsolete normative reference: RFC 5766 (Obsoleted by RFC 8656) ** Downref: Normative reference to an Informational RFC: RFC 6091 ** Downref: Normative reference to an Informational RFC: RFC 6234 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) == Outdated reference: A later version (-10) exists of draft-ietf-hip-reload-instance-06 == Outdated reference: A later version (-22) exists of draft-ietf-p2psip-diagnostics-09 == Outdated reference: A later version (-11) exists of draft-ietf-p2psip-rpr-03 == Outdated reference: A later version (-15) exists of draft-ietf-p2psip-self-tuning-06 == Outdated reference: A later version (-15) exists of draft-ietf-p2psip-service-discovery-06 == Outdated reference: A later version (-21) exists of draft-ietf-p2psip-sip-08 -- Obsolete informational reference (is this intentional?): RFC 4013 (Obsoleted by RFC 7613) -- Obsolete informational reference (is this intentional?): RFC 4960 (Obsoleted by RFC 9260) -- Obsolete informational reference (is this intentional?): RFC 5201 (Obsoleted by RFC 7401) -- Obsolete informational reference (is this intentional?): RFC 5785 (Obsoleted by RFC 8615) Summary: 14 errors (**), 0 flaws (~~), 21 warnings (==), 9 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, Ed. 5 Expires: July 23, 2013 Skype 6 E. Rescorla 7 RTFM, Inc. 8 S. Baset 9 H. Schulzrinne 10 Columbia University 11 January 19, 2013 13 REsource LOcation And Discovery (RELOAD) Base Protocol 14 draft-ietf-p2psip-base-24 16 Abstract 18 This specification defines REsource LOcation And Discovery (RELOAD), 19 a peer-to-peer (P2P) signaling protocol for use on the Internet. A 20 P2P signaling protocol provides its clients with an abstract storage 21 and messaging service between a set of cooperating peers that form 22 the overlay network. RELOAD is designed to support a P2P Session 23 Initiation Protocol (P2PSIP) network, but can be utilized by other 24 applications with similar requirements by defining new usages that 25 specify the kinds of data that needs to be stored for a particular 26 application. RELOAD defines a security model based on a certificate 27 enrollment service that provides unique identities. NAT traversal is 28 a fundamental service of the protocol. RELOAD also allows access 29 from "client" nodes that do not need to route traffic or store data 30 for others. 32 Status of this Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at http://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on July 23, 2013. 49 Copyright Notice 51 Copyright (c) 2013 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (http://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 This document may contain material from IETF Documents or IETF 65 Contributions published or made publicly available before November 66 10, 2008. The person(s) controlling the copyright in some of this 67 material may not have granted the IETF Trust the right to allow 68 modifications of such material outside the IETF Standards Process. 69 Without obtaining an adequate license from the person(s) controlling 70 the copyright in such materials, this document may not be modified 71 outside the IETF Standards Process, and derivative works of it may 72 not be created outside the IETF Standards Process, except to format 73 it for publication as an RFC or to translate it into languages other 74 than English. 76 Table of Contents 78 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 8 79 1.1. Basic Setting . . . . . . . . . . . . . . . . . . . . . 9 80 1.2. Architecture . . . . . . . . . . . . . . . . . . . . . . 11 81 1.2.1. Usage Layer . . . . . . . . . . . . . . . . . . . . 13 82 1.2.2. Message Transport . . . . . . . . . . . . . . . . . 14 83 1.2.3. Storage . . . . . . . . . . . . . . . . . . . . . . 15 84 1.2.4. Topology Plugin . . . . . . . . . . . . . . . . . . 16 85 1.2.5. Forwarding and Link Management Layer . . . . . . . . 16 86 1.3. Security . . . . . . . . . . . . . . . . . . . . . . . . 17 87 1.4. Structure of This Document . . . . . . . . . . . . . . . 18 88 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 18 89 3. Overlay Management Overview . . . . . . . . . . . . . . . . . 21 90 3.1. Security and Identification . . . . . . . . . . . . . . 22 91 3.1.1. Shared-Key Security . . . . . . . . . . . . . . . . 23 92 3.2. Clients . . . . . . . . . . . . . . . . . . . . . . . . 24 93 3.2.1. Client Routing . . . . . . . . . . . . . . . . . . . 24 94 3.2.2. Minimum Functionality Requirements for Clients . . . 25 95 3.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . 26 96 3.4. Connectivity Management . . . . . . . . . . . . . . . . 29 97 3.5. Overlay Algorithm Support . . . . . . . . . . . . . . . 30 98 3.5.1. Support for Pluggable Overlay Algorithms . . . . . . 30 99 3.5.2. Joining, Leaving, and Maintenance Overview . . . . . 30 100 3.6. First-Time Setup . . . . . . . . . . . . . . . . . . . . 31 101 3.6.1. Initial Configuration . . . . . . . . . . . . . . . 32 102 3.6.2. Enrollment . . . . . . . . . . . . . . . . . . . . . 32 103 3.6.3. Diagnostics . . . . . . . . . . . . . . . . . . . . 32 104 4. Application Support Overview . . . . . . . . . . . . . . . . 32 105 4.1. Data Storage . . . . . . . . . . . . . . . . . . . . . . 33 106 4.1.1. Storage Permissions . . . . . . . . . . . . . . . . 34 107 4.1.2. Replication . . . . . . . . . . . . . . . . . . . . 35 108 4.2. Usages . . . . . . . . . . . . . . . . . . . . . . . . . 35 109 4.3. Service Discovery . . . . . . . . . . . . . . . . . . . 36 110 4.4. Application Connectivity . . . . . . . . . . . . . . . . 36 111 5. RFC 2119 Terminology . . . . . . . . . . . . . . . . . . . . 36 112 6. Overlay Management Protocol . . . . . . . . . . . . . . . . . 37 113 6.1. Message Receipt and Forwarding . . . . . . . . . . . . . 37 114 6.1.1. Responsible ID . . . . . . . . . . . . . . . . . . . 37 115 6.1.2. Other ID . . . . . . . . . . . . . . . . . . . . . . 38 116 6.1.3. Opaque ID . . . . . . . . . . . . . . . . . . . . . 40 117 6.2. Symmetric Recursive Routing . . . . . . . . . . . . . . 40 118 6.2.1. Request Origination . . . . . . . . . . . . . . . . 41 119 6.2.2. Response Origination . . . . . . . . . . . . . . . . 42 120 6.3. Message Structure . . . . . . . . . . . . . . . . . . . 42 121 6.3.1. Presentation Language . . . . . . . . . . . . . . . 43 122 6.3.1.1. Common Definitions . . . . . . . . . . . . . . . 43 123 6.3.2. Forwarding Header . . . . . . . . . . . . . . . . . 46 124 6.3.2.1. Processing Configuration Sequence Numbers . . . . 48 125 6.3.2.2. Destination and Via Lists . . . . . . . . . . . . 49 126 6.3.2.3. Forwarding Option . . . . . . . . . . . . . . . . 51 127 6.3.3. Message Contents Format . . . . . . . . . . . . . . 52 128 6.3.3.1. Response Codes and Response Errors . . . . . . . 54 129 6.3.4. Security Block . . . . . . . . . . . . . . . . . . . 56 130 6.4. Overlay Topology . . . . . . . . . . . . . . . . . . . . 60 131 6.4.1. Topology Plugin Requirements . . . . . . . . . . . . 60 132 6.4.2. Methods and types for use by topology plugins . . . 61 133 6.4.2.1. Join . . . . . . . . . . . . . . . . . . . . . . 61 134 6.4.2.2. Leave . . . . . . . . . . . . . . . . . . . . . . 62 135 6.4.2.3. Update . . . . . . . . . . . . . . . . . . . . . 62 136 6.4.2.4. RouteQuery . . . . . . . . . . . . . . . . . . . 63 137 6.4.2.5. Probe . . . . . . . . . . . . . . . . . . . . . . 64 138 6.5. Forwarding and Link Management Layer . . . . . . . . . . 66 139 6.5.1. Attach . . . . . . . . . . . . . . . . . . . . . . . 66 140 6.5.1.1. Request Definition . . . . . . . . . . . . . . . 67 141 6.5.1.2. Response Definition . . . . . . . . . . . . . . . 70 142 6.5.1.3. Using ICE With RELOAD . . . . . . . . . . . . . . 71 143 6.5.1.4. Collecting STUN Servers . . . . . . . . . . . . . 71 144 6.5.1.5. Gathering Candidates . . . . . . . . . . . . . . 72 145 6.5.1.6. Prioritizing Candidates . . . . . . . . . . . . . 72 146 6.5.1.7. Encoding the Attach Message . . . . . . . . . . . 73 147 6.5.1.8. Verifying ICE Support . . . . . . . . . . . . . . 73 148 6.5.1.9. Role Determination . . . . . . . . . . . . . . . 74 149 6.5.1.10. Full ICE . . . . . . . . . . . . . . . . . . . . 74 150 6.5.1.11. No-ICE . . . . . . . . . . . . . . . . . . . . . 74 151 6.5.1.12. Subsequent Offers and Answers . . . . . . . . . . 75 152 6.5.1.13. Sending Media . . . . . . . . . . . . . . . . . . 75 153 6.5.1.14. Receiving Media . . . . . . . . . . . . . . . . . 75 154 6.5.2. AppAttach . . . . . . . . . . . . . . . . . . . . . 75 155 6.5.2.1. Request Definition . . . . . . . . . . . . . . . 75 156 6.5.2.2. Response Definition . . . . . . . . . . . . . . . 76 157 6.5.3. Ping . . . . . . . . . . . . . . . . . . . . . . . . 77 158 6.5.3.1. Request Definition . . . . . . . . . . . . . . . 77 159 6.5.3.2. Response Definition . . . . . . . . . . . . . . . 77 160 6.5.4. ConfigUpdate . . . . . . . . . . . . . . . . . . . . 78 161 6.5.4.1. Request Definition . . . . . . . . . . . . . . . 78 162 6.5.4.2. Response Definition . . . . . . . . . . . . . . . 79 163 6.6. Overlay Link Layer . . . . . . . . . . . . . . . . . . . 79 164 6.6.1. Future Overlay Link Protocols . . . . . . . . . . . 81 165 6.6.1.1. HIP . . . . . . . . . . . . . . . . . . . . . . . 81 166 6.6.1.2. ICE-TCP . . . . . . . . . . . . . . . . . . . . . 82 167 6.6.1.3. Message-oriented Transports . . . . . . . . . . . 82 168 6.6.1.4. Tunneled Transports . . . . . . . . . . . . . . . 82 169 6.6.2. Framing Header . . . . . . . . . . . . . . . . . . . 82 170 6.6.3. Simple Reliability . . . . . . . . . . . . . . . . . 84 171 6.6.3.1. Stop and Wait Sender Algorithm . . . . . . . . . 85 173 6.6.4. DTLS/UDP with SR . . . . . . . . . . . . . . . . . . 86 174 6.6.5. TLS/TCP with FH, No-ICE . . . . . . . . . . . . . . 86 175 6.6.6. DTLS/UDP with SR, No-ICE . . . . . . . . . . . . . . 86 176 6.7. Fragmentation and Reassembly . . . . . . . . . . . . . . 87 177 7. Data Storage Protocol . . . . . . . . . . . . . . . . . . . . 88 178 7.1. Data Signature Computation . . . . . . . . . . . . . . . 89 179 7.2. Data Models . . . . . . . . . . . . . . . . . . . . . . 90 180 7.2.1. Single Value . . . . . . . . . . . . . . . . . . . . 91 181 7.2.2. Array . . . . . . . . . . . . . . . . . . . . . . . 92 182 7.2.3. Dictionary . . . . . . . . . . . . . . . . . . . . . 92 183 7.3. Access Control Policies . . . . . . . . . . . . . . . . 93 184 7.3.1. USER-MATCH . . . . . . . . . . . . . . . . . . . . . 93 185 7.3.2. NODE-MATCH . . . . . . . . . . . . . . . . . . . . . 93 186 7.3.3. USER-NODE-MATCH . . . . . . . . . . . . . . . . . . 93 187 7.3.4. NODE-MULTIPLE . . . . . . . . . . . . . . . . . . . 94 188 7.4. Data Storage Methods . . . . . . . . . . . . . . . . . . 94 189 7.4.1. Store . . . . . . . . . . . . . . . . . . . . . . . 94 190 7.4.1.1. Request Definition . . . . . . . . . . . . . . . 94 191 7.4.1.2. Response Definition . . . . . . . . . . . . . . . 99 192 7.4.1.3. Removing Values . . . . . . . . . . . . . . . . . 101 193 7.4.2. Fetch . . . . . . . . . . . . . . . . . . . . . . . 101 194 7.4.2.1. Request Definition . . . . . . . . . . . . . . . 102 195 7.4.2.2. Response Definition . . . . . . . . . . . . . . . 103 196 7.4.3. Stat . . . . . . . . . . . . . . . . . . . . . . . . 105 197 7.4.3.1. Request Definition . . . . . . . . . . . . . . . 105 198 7.4.3.2. Response Definition . . . . . . . . . . . . . . . 105 199 7.4.4. Find . . . . . . . . . . . . . . . . . . . . . . . . 107 200 7.4.4.1. Request Definition . . . . . . . . . . . . . . . 107 201 7.4.4.2. Response Definition . . . . . . . . . . . . . . . 108 202 7.4.5. Defining New Kinds . . . . . . . . . . . . . . . . . 109 203 8. Certificate Store Usage . . . . . . . . . . . . . . . . . . . 109 204 9. TURN Server Usage . . . . . . . . . . . . . . . . . . . . . . 110 205 10. Chord Algorithm . . . . . . . . . . . . . . . . . . . . . . . 112 206 10.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 113 207 10.2. Hash Function . . . . . . . . . . . . . . . . . . . . . 113 208 10.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . 114 209 10.4. Redundancy . . . . . . . . . . . . . . . . . . . . . . . 114 210 10.5. Joining . . . . . . . . . . . . . . . . . . . . . . . . 114 211 10.6. Routing Attaches . . . . . . . . . . . . . . . . . . . . 115 212 10.7. Updates . . . . . . . . . . . . . . . . . . . . . . . . 116 213 10.7.1. Handling Neighbor Failures . . . . . . . . . . . . . 117 214 10.7.2. Handling Finger Table Entry Failure . . . . . . . . 118 215 10.7.3. Receiving Updates . . . . . . . . . . . . . . . . . 118 216 10.7.4. Stabilization . . . . . . . . . . . . . . . . . . . 119 217 10.7.4.1. Updating neighbor table . . . . . . . . . . . . . 119 218 10.7.4.2. Refreshing finger table . . . . . . . . . . . . . 120 219 10.7.4.3. Adjusting finger table size . . . . . . . . . . . 120 220 10.7.4.4. Detecting partitioning . . . . . . . . . . . . . 121 222 10.8. Route query . . . . . . . . . . . . . . . . . . . . . . 121 223 10.9. Leaving . . . . . . . . . . . . . . . . . . . . . . . . 122 224 11. Enrollment and Bootstrap . . . . . . . . . . . . . . . . . . 123 225 11.1. Overlay Configuration . . . . . . . . . . . . . . . . . 123 226 11.1.1. RELAX NG Grammar . . . . . . . . . . . . . . . . . . 130 227 11.2. Discovery Through Configuration Server . . . . . . . . . 133 228 11.3. Credentials . . . . . . . . . . . . . . . . . . . . . . 133 229 11.3.1. Self-Generated Credentials . . . . . . . . . . . . . 135 230 11.4. Contacting a Bootstrap Node . . . . . . . . . . . . . . 136 231 12. Message Flow Example . . . . . . . . . . . . . . . . . . . . 136 232 13. Security Considerations . . . . . . . . . . . . . . . . . . . 143 233 13.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 143 234 13.2. Attacks on P2P Overlays . . . . . . . . . . . . . . . . 144 235 13.3. Certificate-based Security . . . . . . . . . . . . . . . 144 236 13.4. Shared-Secret Security . . . . . . . . . . . . . . . . . 145 237 13.5. Storage Security . . . . . . . . . . . . . . . . . . . . 146 238 13.5.1. Authorization . . . . . . . . . . . . . . . . . . . 146 239 13.5.2. Distributed Quota . . . . . . . . . . . . . . . . . 147 240 13.5.3. Correctness . . . . . . . . . . . . . . . . . . . . 147 241 13.5.4. Residual Attacks . . . . . . . . . . . . . . . . . . 147 242 13.6. Routing Security . . . . . . . . . . . . . . . . . . . . 148 243 13.6.1. Background . . . . . . . . . . . . . . . . . . . . . 148 244 13.6.2. Admissions Control . . . . . . . . . . . . . . . . . 149 245 13.6.3. Peer Identification and Authentication . . . . . . . 149 246 13.6.4. Protecting the Signaling . . . . . . . . . . . . . . 150 247 13.6.5. Routing Loops and Dos Attacks . . . . . . . . . . . 150 248 13.6.6. Residual Attacks . . . . . . . . . . . . . . . . . . 151 249 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 151 250 14.1. Well-Known URI Registration . . . . . . . . . . . . . . 151 251 14.2. Port Registrations . . . . . . . . . . . . . . . . . . . 152 252 14.3. Overlay Algorithm Types . . . . . . . . . . . . . . . . 152 253 14.4. Access Control Policies . . . . . . . . . . . . . . . . 152 254 14.5. Application-ID . . . . . . . . . . . . . . . . . . . . . 153 255 14.6. Data Kind-ID . . . . . . . . . . . . . . . . . . . . . . 153 256 14.7. Data Model . . . . . . . . . . . . . . . . . . . . . . . 154 257 14.8. Message Codes . . . . . . . . . . . . . . . . . . . . . 154 258 14.9. Error Codes . . . . . . . . . . . . . . . . . . . . . . 156 259 14.10. Overlay Link Types . . . . . . . . . . . . . . . . . . . 156 260 14.11. Overlay Link Protocols . . . . . . . . . . . . . . . . . 157 261 14.12. Forwarding Options . . . . . . . . . . . . . . . . . . . 157 262 14.13. Probe Information Types . . . . . . . . . . . . . . . . 158 263 14.14. Message Extensions . . . . . . . . . . . . . . . . . . . 158 264 14.15. reload URI Scheme . . . . . . . . . . . . . . . . . . . 159 265 14.15.1. URI Registration . . . . . . . . . . . . . . . . . . 160 266 14.16. Media Type Registration . . . . . . . . . . . . . . . . 160 267 14.17. XML Name Space Registration . . . . . . . . . . . . . . 161 268 14.17.1. Config URL . . . . . . . . . . . . . . . . . . . . . 162 269 14.17.2. Config Chord URL . . . . . . . . . . . . . . . . . . 162 271 15. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 162 272 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 163 273 16.1. Normative References . . . . . . . . . . . . . . . . . . 163 274 16.2. Informative References . . . . . . . . . . . . . . . . . 165 275 Appendix A. Routing Alternatives . . . . . . . . . . . . . . . . 168 276 A.1. Iterative vs Recursive . . . . . . . . . . . . . . . . . 168 277 A.2. Symmetric vs Forward response . . . . . . . . . . . . . 169 278 A.3. Direct Response . . . . . . . . . . . . . . . . . . . . 169 279 A.4. Relay Peers . . . . . . . . . . . . . . . . . . . . . . 170 280 A.5. Symmetric Route Stability . . . . . . . . . . . . . . . 171 281 Appendix B. Why Clients? . . . . . . . . . . . . . . . . . . . . 172 282 B.1. Why Not Only Peers? . . . . . . . . . . . . . . . . . . 172 283 B.2. Clients as Application-Level Agents . . . . . . . . . . 172 284 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 173 286 1. Introduction 288 This document defines REsource LOcation And Discovery (RELOAD), a 289 peer-to-peer (P2P) signaling protocol for use on the Internet. It 290 provides a generic, self-organizing overlay network service, allowing 291 nodes to route messages to other nodes and to store and retrieve data 292 in the overlay. RELOAD provides several features that are critical 293 for a successful P2P protocol for the Internet: 295 Security Framework: A P2P network will often be established among a 296 set of peers that do not trust each other. RELOAD leverages a 297 central enrollment server to provide credentials for each peer 298 which can then be used to authenticate each operation. This 299 greatly reduces the possible attack surface. 301 Usage Model: RELOAD is designed to support a variety of 302 applications, including P2P multimedia communications with the 303 Session Initiation Protocol [I-D.ietf-p2psip-sip]. RELOAD allows 304 the definition of new application usages, each of which can define 305 its own data types, along with the rules for their use. This 306 allows RELOAD to be used with new applications through a simple 307 documentation process that supplies the details for each 308 application. 310 NAT Traversal: RELOAD is designed to function in environments where 311 many if not most of the nodes are behind NATs or firewalls. 312 Operations for NAT traversal are part of the base design, 313 including using Interactive Connectivity Establishment (ICE) 314 [RFC5245] to establish new RELOAD or application protocol 315 connections. 317 Optimized Routing: The very nature of overlay algorithms introduces 318 a requirement that peers participating in the P2P network route 319 requests on behalf of other peers in the network. This introduces 320 a load on those other peers, in the form of bandwidth and 321 processing power. RELOAD has been defined with a simple, 322 lightweight forwarding header, thus minimizing the amount of 323 effort for intermediate peers. 325 Pluggable Overlay Algorithms: RELOAD has been designed with an 326 abstract interface to the overlay layer to simplify implementing a 327 variety of structured (e.g., distributed hash tables) and 328 unstructured overlay algorithms. The idea here is that RELOAD 329 provides a generic structure that can fit most types of overlay 330 topologies (ring, hyperspace, etc.). To instantiate an actual 331 network, you combine RELOAD with a specific overlay algorithm, 332 which defines how to construct the overlay topology and route 333 messages efficiently within it. This specification also defines 334 how RELOAD is used with the Chord [Chord] based DHT algorithm, 335 which is mandatory to implement. Specifying a default "mandatory 336 to implement" overlay algorithm promotes interoperability, while 337 extensibility allows selection of overlay algorithms optimized for 338 a particular application. 340 Support for Clients: RELOAD clients differ from RELOAD peers 341 primarily in that they do not store information on behalf of other 342 nodes in the overlay, but only use the overlay to locate users and 343 resources as well as store information. 345 These properties were designed specifically to meet the requirements 346 for a P2P protocol to support SIP. This document defines the base 347 protocol for the distributed storage and location service, as well as 348 critical usage for NAT traversal. The SIP Usage itself is described 349 separately in [I-D.ietf-p2psip-sip]. RELOAD is not limited to usage 350 by SIP and could serve as a tool for supporting other P2P 351 applications with similar needs. 353 1.1. Basic Setting 355 In this section, we provide a brief overview of the operational 356 setting for RELOAD. A RELOAD Overlay Instance consists of a set of 357 nodes arranged in a partly connected graph. Each node in the overlay 358 is assigned a numeric Node-ID for the lifetime of the node which, 359 together with the specific overlay algorithm in use, determines its 360 position in the graph and the set of nodes it connects to. The 361 Node-ID is also tightly coupled to the certificate (see 362 Section 13.3). The figure below shows a trivial example which isn't 363 drawn from any particular overlay algorithm, but was chosen for 364 convenience of representation. 366 +--------+ +--------+ +--------+ 367 | Node 10|--------------| Node 20|--------------| Node 30| 368 +--------+ +--------+ +--------+ 369 | | | 370 | | | 371 +--------+ +--------+ +--------+ 372 | Node 40|--------------| Node 50|--------------| Node 60| 373 +--------+ +--------+ +--------+ 374 | | | 375 | | | 376 +--------+ +--------+ +--------+ 377 | Node 70|--------------| Node 80|--------------| Node 90| 378 +--------+ +--------+ +--------+ 379 | 380 | 381 +--------+ 382 | Node 85| 383 |(Client)| 384 +--------+ 386 Because the graph is not fully connected, when a node wants to send a 387 message to another node, it may need to route it through the network. 388 For instance, Node 10 can talk directly to nodes 20 and 40, but not 389 to Node 70. In order to send a message to Node 70, it would first 390 send it to Node 40 with instructions to pass it along to Node 70. 391 Different overlay algorithms will have different connectivity graphs, 392 but the general idea behind all of them is to allow any node in the 393 graph to efficiently reach every other node within a small number of 394 hops. 396 The RELOAD network is not only a messaging network. It is also a 397 storage network, albeit one designed for small-scale transient 398 storage rather than for bulk storage of large objects. Records are 399 stored under numeric addresses which occupy the same space as node 400 identifiers. Peers are responsible for storing the data associated 401 with some set of addresses as determined by their Node-ID. For 402 instance, we might say that every peer is responsible for storing any 403 data value which has an address less than or equal to its own 404 Node-ID, but greater than the next lowest Node-ID. Thus, Node-20 405 would be responsible for storing values 11-20. 407 RELOAD also supports clients. These are nodes which have Node-IDs 408 but do not participate in routing or storage. For instance, in the 409 figure above Node 85 is a client. It can route to the rest of the 410 RELOAD network via Node 80, but no other node will route through it 411 and Node 90 is still responsible for all addresses between 81-90. We 412 refer to non-client nodes as peers. 414 Other applications (for instance, SIP) can be defined on top of 415 RELOAD and use these two basic RELOAD services to provide their own 416 services. 418 1.2. Architecture 420 RELOAD is fundamentally an overlay network. The following figure 421 shows the layered RELOAD architecture. 423 Application 425 +-------+ +-------+ 426 | SIP | | XMPP | ... 427 | Usage | | Usage | 428 +-------+ +-------+ 429 ------------------------------------ Messaging Service Boundary 430 +------------------+ +---------+ 431 | Message |<--->| Storage | 432 | Transport | +---------+ 433 +------------------+ ^ 434 ^ ^ | 435 | v v 436 | +-------------------+ 437 | | Topology | 438 | | Plugin | 439 | +-------------------+ 440 | ^ 441 v v 442 +------------------+ 443 | Forwarding & | 444 | Link Management | 445 +------------------+ 446 ------------------------------------ Overlay Link Service Boundary 447 +-------+ +-------+ 448 |TLS | |DTLS | ... 449 |Overlay| |Overlay| 450 |Link | |Link | 451 +-------+ +-------+ 453 The major components of RELOAD are: 455 Usage Layer: Each application defines a RELOAD usage; a set of data 456 Kinds and behaviors which describe how to use the services 457 provided by RELOAD. These usages all talk to RELOAD through a 458 common Message Transport Service. 460 Message Transport: Handles end-to-end reliability, manages request 461 state for the usages, and forwards Store and Fetch operations to 462 the Storage component. Delivers message responses to the 463 component initiating the request. 465 Storage: The Storage component is responsible for processing 466 messages relating to the storage and retrieval of data. It talks 467 directly to the Topology Plugin to manage data replication and 468 migration, and it talks to the Message Transport component to send 469 and receive messages. 471 Topology Plugin: The Topology Plugin is responsible for implementing 472 the specific overlay algorithm being used. It uses the Message 473 Transport component to send and receive overlay management 474 messages, the Storage component to manage data replication, and 475 the Forwarding Layer to control hop-by-hop message forwarding. 476 This component superficially parallels conventional routing 477 algorithms, but is more tightly coupled to the Forwarding Layer 478 because there is no single "routing table" equivalent used by all 479 overlay algorithms. The topology plugin has two functions, 480 constructing the local forwarding instructions, and selecting the 481 operational topology (i.e. creating links by sending overlay 482 management messages). 484 Forwarding and Link Management Layer: Stores and implements the 485 routing table by providing packet forwarding services between 486 nodes. It also handles establishing new links between nodes, 487 including setting up connections across NATs using ICE. 489 Overlay Link Layer: Responsible for actually transporting traffic 490 directly between nodes. TLS [RFC5246] and DTLS [RFC6347] are the 491 currently defined "link layer" protocols used by RELOAD for hop- 492 by-hop communication. Each such protocol includes the appropriate 493 provisions for per-hop framing or hop-by-hop ACKs needed by 494 unreliable underlying transports. New protocols can be defined, 495 as described in Section 6.6.1 and Section 11.1. As this document 496 defines only TLS and DTLS, we use those terms throughout the 497 remainder of the document with the understanding that some future 498 specification may add new overlay link layers. 500 To further clarify the roles of the various layers, this figure 501 parallels the architecture with each layer's role from an overlay 502 perspective and implementation layer in the internet: 504 Internet | Internet Model | 505 Model | Equivalent | Reload 506 | in Overlay | Architecture 507 -------------+-----------------+------------------------------------ 508 | | +-------+ +-------+ 509 | Application | | SIP | | XMPP | ... 510 | | | Usage | | Usage | 511 | | +-------+ +-------+ 512 | | ---------------------------------- 513 | |+------------------+ +---------+ 514 | Transport || Message |<--->| Storage | 515 | || Transport | +---------+ 516 | |+------------------+ ^ 517 | | ^ ^ | 518 | | | v v 519 Application | | | +-------------------+ 520 | (Routing) | | | Topology | 521 | | | | Plugin | 522 | | | +-------------------+ 523 | | | ^ 524 | | v v 525 | Network | +------------------+ 526 | | | Forwarding & | 527 | | | Link Management | 528 | | +------------------+ 529 | | ---------------------------------- 530 Transport | Link | +-------+ +------+ 531 | | |TLS | |DTLS | ... 532 | | +-------+ +------+ 533 -------------+-----------------+------------------------------------ 534 Network | 535 | 536 Link | 538 In addition to the above components, nodes communicate with a central 539 provisioning infrastructure (not shown) to get configuration 540 information, authentication credentials, and the initial set of nodes 541 to communicate with to join the overlay. 543 1.2.1. Usage Layer 545 The top layer, called the Usage Layer, has application usages, such 546 as the SIP Registration Usage [I-D.ietf-p2psip-sip], that use the 547 abstract Message Transport Service provided by RELOAD. The goal of 548 this layer is to implement application-specific usages of the generic 549 overlay services provided by RELOAD. The usage defines how a 550 specific application maps its data into something that can be stored 551 in the overlay, where to store the data, how to secure the data, and 552 finally how applications can retrieve and use the data. 554 The architecture diagram shows both a SIP usage and an XMPP usage. A 555 single application may require multiple usages; for example a 556 softphone application may also require a voicemail usage. A usage 557 may define multiple Kinds of data that are stored in the overlay and 558 may also rely on Kinds originally defined by other usages. 560 Because the security and storage policies for each Kind are dictated 561 by the usage defining the Kind, the usages may be coupled with the 562 Storage component to provide security policy enforcement and to 563 implement appropriate storage strategies according to the needs of 564 the usage. The exact implementation of such an interface is outside 565 the scope of this specification. 567 1.2.2. Message Transport 569 The Message Transport component provides a generic message routing 570 service for the overlay. The Message Transport layer is responsible 571 for end-to-end message transactions. Each peer is identified by its 572 location in the overlay as determined by its Node-ID. A component 573 that is a client of the Message Transport can perform two basic 574 functions: 576 o Send a message to a given peer specified by Node-ID or to the peer 577 responsible for a particular Resource-ID. 578 o Receive messages that other peers sent to a Node-ID or Resource-ID 579 for which the receiving peer is responsible. 581 All usages rely on the Message Transport component to send and 582 receive messages from peers. For instance, when a usage wants to 583 store data, it does so by sending Store requests. Note that the 584 Storage component and the Topology Plugin are themselves clients of 585 the Message Transport, because they need to send and receive messages 586 from other peers. 588 The Message Transport Service is responsible for end-to-end 589 reliability, accomplished by timer-based retransmissions. Unlike the 590 Internet transport layer, however, this layer does not provide 591 congestion control. RELOAD is a request-response protocol, with no 592 more than two pairs of request-response messages used in typical 593 transactions between pairs of nodes, therefore there are no 594 opportunities to observe and react to end-to-end congestion. As with 595 all Internet applications, implementers are strongly discouraged from 596 writing applications that react to loss by immediately retrying the 597 transaction. 599 The Message Transport Service is similar to those described as 600 providing "Key based routing" (KBR)[wikiKBR], although as RELOAD 601 supports different overlay algorithms (including non-DHT overlay 602 algorithms) that calculate keys (storage indices, not encryption 603 keys) in different ways, the actual interface needs to accept 604 Resource Names rather than actual keys. 606 Stability of the underlying network supporting the overlay (the 607 Internet) and congestion control between overlay neighbors, which 608 exchange routing updates and data replicas in addition to forwarding 609 end-to-end messages, is handled by the Forwarding and Link Management 610 layer described below. 612 Real-world experience has shown that a fixed timeout for the end-to- 613 end retransmission timer is sufficient for practical overlay 614 networks. This timer is adjustable via the overlay configuration. 615 As the overlay configuration can be rapidly updated, this value could 616 be dynamically adjusted at coarse time scales, although algorithms 617 for determining how to accomplish this are beyond the scope of this 618 specification. In many cases, however, more appropriate means of 619 improving network performance, such as the Topology Plugin removing 620 lossy links from use in overlay routing or reducing the overall hop- 621 count of end-to-end paths will be more effective than simply 622 increasing the retransmission timer. 624 1.2.3. Storage 626 One of the major functions of RELOAD is to allow nodes to store data 627 in the overlay and to retrieve data stored by other nodes or by 628 themselves. The Storage component is responsible for processing data 629 storage and retrieval messages. For instance, the Storage component 630 might receive a Store request for a given resource from the Message 631 Transport. It would then query the appropriate usage before storing 632 the data value(s) in its local data store and sending a response to 633 the Message Transport for delivery to the requesting node. 634 Typically, these messages will come from other nodes, but depending 635 on the overlay topology, a node might be responsible for storing data 636 for itself as well, especially if the overlay is small. 638 A peer's Node-ID determines the set of resources that it will be 639 responsible for storing. However, the exact mapping between these is 640 determined by the overlay algorithm in use. The Storage component 641 will only receive a Store request from the Message Transport if this 642 peer is responsible for that Resource-ID. The Storage component is 643 notified by the Topology Plugin when the Resource-IDs for which it is 644 responsible change, and the Storage component is then responsible for 645 migrating resources to other peers. 647 1.2.4. Topology Plugin 649 RELOAD is explicitly designed to work with a variety of overlay 650 algorithms. In order to facilitate this, the overlay algorithm 651 implementation is provided by a Topology Plugin so that each overlay 652 can select an appropriate overlay algorithm that relies on the common 653 RELOAD core protocols and code. 655 The Topology Plugin is responsible for maintaining the overlay 656 algorithm Routing Table, which is consulted by the Forwarding and 657 Link Management Layer before routing a message. When connections are 658 made or broken, the Forwarding and Link Management Layer notifies the 659 Topology Plugin, which adjusts the routing table as appropriate. The 660 Topology Plugin will also instruct the Forwarding and Link Management 661 Layer to form new connections as dictated by the requirements of the 662 overlay algorithm Topology. The Topology Plugin issues periodic 663 update requests through Message Transport to maintain and update its 664 Routing Table. 666 As peers enter and leave, resources may be stored on different peers, 667 so the Topology Plugin also keeps track of which peers are 668 responsible for which resources. As peers join and leave, the 669 Topology Plugin instructs the Storage component to issue resource 670 migration requests as appropriate, in order to ensure that other 671 peers have whatever resources they are now responsible for. The 672 Topology Plugin is also responsible for providing for redundant data 673 storage to protect against loss of information in the event of a peer 674 failure and to protect against compromised or subversive peers. 676 1.2.5. Forwarding and Link Management Layer 678 The Forwarding and Link Management Layer is responsible for getting a 679 message to the next peer, as determined by the Topology Plugin. This 680 Layer establishes and maintains the network connections as needed by 681 the Topology Plugin. This layer is also responsible for setting up 682 connections to other peers through NATs and firewalls using ICE, and 683 it can elect to forward traffic using relays for NAT and firewall 684 traversal. 686 Congestion control is implemented at this layer to protect the 687 Internet paths used to form the link in the overlay. Additionally, 688 retransmission is performed to improve the reliability of end-to-end 689 transactions. This layer is to the Message Transport Layer as link- 690 level congestion control and retransmission in modern wireless 691 networks is to Internet transport protocols. 693 This layer provides a generic interface that allows the topology 694 plugin to control the overlay and resource operations and messages. 696 Since each overlay algorithm is defined and functions differently, we 697 generically refer to the table of other peers that the overlay 698 algorithm maintains and uses to route requests (neighbors) as a 699 Routing Table. The Topology Plugin actually owns the Routing Table, 700 and forwarding decisions are made by querying the Topology Plugin for 701 the next hop for a particular Node-ID or Resource-ID. If this node 702 is the destination of the message, the message is delivered to the 703 Message Transport. 705 This layer also utilizes a framing header to encapsulate messages as 706 they are forwarded along each hop. This header aids reliability 707 congestion control, flow control, etc. It has meaning only in the 708 context of that individual link. 710 The Forwarding and Link Management Layer sits on top of the Overlay 711 Link Layer protocols that carry the actual traffic. This 712 specification defines how to use DTLS and TLS protocols to carry 713 RELOAD messages. 715 1.3. Security 717 RELOAD's security model is based on each node having one or more 718 public key certificates. In general, these certificates will be 719 assigned by a central server which also assigns Node-IDs, although 720 self-signed certificates can be used in closed networks. These 721 credentials can be leveraged to provide communications security for 722 RELOAD messages. RELOAD provides communications security at three 723 levels: 725 Connection Level: Connections between nodes are secured with TLS, 726 DTLS, or potentially some to be defined future protocol. 728 Message Level: Each RELOAD message is signed. 730 Object Level: Stored objects are signed by the creating node. 732 These three levels of security work together to allow nodes to verify 733 the origin and correctness of data they receive from other nodes, 734 even in the face of malicious activity by other nodes in the overlay. 735 RELOAD also provides access control built on top of these 736 communications security features. Because the peer responsible for 737 storing a piece of data can validate the signature on the data being 738 stored, the responsible peer can determine whether a given operation 739 is permitted or not. 741 RELOAD also provides an optional shared secret based admission 742 control feature using shared secrets and TLS-PSK. In order to form a 743 TLS connection to any node in the overlay, a new node needs to know 744 the shared overlay key, thus restricting access to authorized users 745 only. This feature is used together with certificate-based access 746 control, not as a replacement for it. It is typically used when 747 self-signed certificates are being used but would generally not be 748 used when the certificates were all signed by an enrollment server. 750 1.4. Structure of This Document 752 The remainder of this document is structured as follows. 754 o Section 2 provides definitions of terms used in this document. 755 o Section 3 provides an overview of the mechanisms used to establish 756 and maintain the overlay. 757 o Section 4 provides an overview of the mechanism RELOAD provides to 758 support other applications. 759 o Section 6 defines the protocol messages that RELOAD uses to 760 establish and maintain the overlay. 761 o Section 7 defines the protocol messages that are used to store and 762 retrieve data using RELOAD. 763 o Section 8 defines the Certificate Store Usages. 764 o Section 9 defines the TURN Server Usage needed to locate TURN 765 servers for NAT traversal. 766 o Section 10 defines a specific Topology Plugin using Chord based 767 algorithm. 768 o Section 11 defines the mechanisms that new RELOAD nodes use to 769 join the overlay for the first time. 770 o Section 12 provides an extended example. 772 2. Terminology 774 Terms used in this document are defined inline when used and are also 775 defined below for reference. The definitions in this section use 776 terminology and concepts that are not explained until later in the 777 specification. 779 Admitting Peer: A Peer in the Overlay which helps the Joining Node 780 join the Overlay. 782 Bootstrap Node: A network node used by Joining Nodes to help locate 783 the Admitting Peer. 785 Client: A host that is able to store data in and retrieve data from 786 the overlay but which is not participating in routing or data 787 storage for the overlay. 789 Configuration Document: An XML document containing all the Overlay 790 Parameters for one overlay instance. 792 Connection Table: The set of nodes to which a node is directly 793 connected, which include nodes that are not yet available for 794 routing. 796 Destination List: A list of Node-IDs, Resource-ID and Opaque IDs 797 through which a message is to be routed, in strict order. A 798 single Node-ID, Resource-ID or Opaque ID is a trivial form of 799 destination list. When multiple Node-IDs are specified, a 800 Destination List is a loose source route. The list is reduced 801 hop-by-hop, does not include the source but includes the 802 destination. 804 DHT: A distributed hash table. A DHT is an abstract hash table 805 service realized by storing the contents of the hash table across 806 a set of peers. 808 ID: A generic term for any kind of identifiers in an Overlay. This 809 document specifies an ID as being a Application-ID, Kind-ID , 810 Node-ID, Transaction ID, component ID, response ID, Resource-ID, 811 or an Opaque ID. 813 Joining Node: A node that is attempting to become a Peer in a 814 particular Overlay. 816 Kind: A Kind defines a particular type of data that can be stored in 817 the overlay. Applications define new Kinds to store the data they 818 use. Each Kind is identified with a unique integer called a 819 Kind-ID. 821 Kind-ID: A unique 32 bit value identifying a Kind. Kind-IDs are 822 either private or allocated by IANA (see Section 14.6). 824 Maximum Request Lifetime: The maximum time a request will wait for a 825 response; it defaults to 15 seconds. 827 Node: The term "Node" is used to refer to a host that may be either 828 a Peer or a Client. Because RELOAD uses the same protocol for 829 both clients and peers, much of the text applies equally to both. 830 Therefore we use "Node" when the text applies to both Clients and 831 Peers and the more specific term (i.e. client or peer) when the 832 text applies only to Clients or only to Peers. 834 Node-ID: A value of fixed but configurable length that uniquely 835 identifies a node. Node-IDs of all 0s and all 1s are reserved and 836 are invalid Node-IDs. A value of zero is not used in the wire 837 protocol but can be used to indicate an invalid node in 838 implementations and APIs. The Node-ID of all 1s is used on the 839 wire protocol as a wildcard. 841 Overlay Algorithm: An overlay algorithm defines the rules for 842 determining which peers in an overlay store a particular piece of 843 data and for determining a topology of interconnections amongst 844 peers in order to find a piece of data. 846 Overlay Instance: A specific overlay algorithm and the collection of 847 peers that are collaborating to provide read and write access to 848 it. There can be any number of overlay instances running in an IP 849 network at a time, and each operates in isolation of the others. 851 Overlay Parameters: A set of values that are shared between all 852 nodes in an overlay. The overlay parameters are distributed in an 853 XML document called the Configuration Document. 855 Peer: A host that is participating in the overlay. Peers are 856 responsible for holding some portion of the data that has been 857 stored in the overlay and also route messages on behalf of other 858 hosts as needed by the Overlay Algorithm. 860 Peer Admission: The act of admitting a node (the "Joining Node") 861 into an Overlay. After the admission process is over, the joining 862 node is a fully-functional peer of the overlay. During the 863 admission process, the joining node may need to present 864 credentials to prove that it has sufficient authority to join the 865 overlay. 867 Resource: An object or group of objects stored in a P2P network. 869 Resource-ID: A value that identifies some resources and which is 870 used as a key for storing and retrieving the resource. Often this 871 is not human friendly/readable. One way to generate a Resource-ID 872 is by applying a mapping function to some other unique name (e.g., 873 user name or service name) for the resource. The Resource-ID is 874 used by the distributed database algorithm to determine the peer 875 or peers that are responsible for storing the data for the 876 overlay. In structured P2P networks, Resource-IDs are generally 877 fixed length and are formed by hashing the resource name. In 878 unstructured networks, resource names may be used directly as 879 Resource-IDs and may be variable lengths. 881 Resource Name: The name by which a resource is identified. In 882 unstructured P2P networks, the resource name is sometimes used 883 directly as a Resource-ID. In structured P2P networks the 884 resource name is typically mapped into a Resource-ID by using the 885 string as the input to hash function. Structured and unstructured 886 P2P networks are described in [RFC5694]. A SIP resource, for 887 example, is often identified by its AOR which is an example of a 888 Resource Name. 890 Responsible Peer: The peer that is responsible for a specific 891 resource, as defined by the plugin algorithm. 893 Routing Table: The set of directly connected peers which a node can 894 use to forward overlay messages. In normal operation, these peers 895 will all be on the connection table but not vice versa, because 896 some peers may not yet be available for routing. Peers may send 897 messages directly to peers that are in their connection tables but 898 may only forward messages to peers that are not in their 899 connection table through peers that are in the routing table. 901 Successor Replacement Hold-Down Time: The amount of time to wait 902 before starting replication when a new successor is found; it 903 defaults to 30 seconds. 905 Transaction ID: A randomly chosen identifier selected by the 906 originator of a request and used to correlate requests and 907 responses. 909 Usage: An usage is the definition of a set of data structures (data 910 Kinds) that an application wants to store in the overlay. An 911 usage may also define a set of network protocols (application IDs) 912 that can be used over direct connections between nodes. E.g. the 913 SIP usage defines a SIP registration data Kind that contains 914 information on how to reach a SIP endpoint and two application IDs 915 corresponding to the SIP and SIPS protocols. 917 User: A user is a physical person identified by the certificates 918 assigned to them. 920 User Name: A name identifying a user of the overlay, typically used 921 as a Resource Name, or as a label on a Resource that identifies 922 the user owning the resource. 924 3. Overlay Management Overview 926 The most basic function of RELOAD is as a generic overlay network. 928 Nodes need to be able to join the overlay, form connections to other 929 nodes, and route messages through the overlay to nodes to which they 930 are not directly connected. This section provides an overview of the 931 mechanisms that perform these functions. 933 3.1. Security and Identification 935 The overlay parameters are specified in a configuration document. 936 Because the parameters include security critical information such as 937 the certificate signing trust anchors, the configuration document 938 needs to be retrieved securely. The initial configuration document 939 is either initially fetched over HTTPS or manually provisioned; 940 subsequent configuration document updates are received either by 941 periodically refreshing from the configuration server, or, more 942 commonly, by being flood filled through the overlay, which allows for 943 fast propagation once an update is pushed. In the latter case, 944 updates are via digital signatures tracing back to the initial 945 configuration document. 947 Every node in the RELOAD overlay is identified by a Node-ID. The 948 Node-ID is used for three major purposes: 950 o To address the node itself. 951 o To determine its position in the overlay topology (if the overlay 952 is structured; topology plugins do not need to be structured). 953 o To determine the set of resources for which the node is 954 responsible. 956 Each node has a certificate [RFC5280] containing this Node-ID in a 957 subjectAltName extension, which is unique within an overlay instance. 959 The certificate serves multiple purposes: 961 o It entitles the user to store data at specific locations in the 962 Overlay Instance. Each data Kind defines the specific rules for 963 determining which certificates can access each Resource-ID/Kind-ID 964 pair. For instance, some Kinds might allow anyone to write at a 965 given location, whereas others might restrict writes to the owner 966 of a single certificate. 967 o It entitles the user to operate a node that has a Node-ID found in 968 the certificate. When the node forms a connection to another 969 peer, it uses this certificate so that a node connecting to it 970 knows it is connected to the correct node (technically: a (D)TLS 971 association with client authentication is formed.) In addition, 972 the node can sign messages, thus providing integrity and 973 authentication for messages which are sent from the node. 975 o It entitles the user to use the user name found in the 976 certificate. 978 If a user has more than one device, typically they would get one 979 certificate for each device. This allows each device to act as a 980 separate peer. 982 RELOAD supports multiple certificate issuance models. The first is 983 based on a central enrollment process which allocates a unique name 984 and Node-ID and puts them in a certificate for the user. All peers 985 in a particular Overlay Instance have the enrollment server as a 986 trust anchor and so can verify any other peer's certificate. 988 In some settings, a group of users want to set up an overlay network 989 but are not concerned about attack by other users in the network. 990 For instance, users on a LAN might want to set up a short term ad hoc 991 network without going to the trouble of setting up an enrollment 992 server. RELOAD supports the use of self-generated, self-signed 993 certificates. When self-signed certificates are used, the node also 994 generates its own Node-ID and user name. The Node-ID is computed as 995 a digest of the public key, to prevent Node-ID theft. Note that the 996 relevant cryptographic property for the digest is preimage 997 resistance. Collision-resistance is not needed since an attacker who 998 can create two nodes with the same Node-ID but different public key 999 obtains no advantage. This model is still subject to a number of 1000 known attacks (most notably Sybil attacks [Sybil]) and can only be 1001 safely used in closed networks where users are mutually trusting. 1002 Another drawback of this approach is that user's data is then tied to 1003 their keys, so if a key is changed any data stored under their 1004 Node-ID needs to be re-stored. This is not an issue for centrally- 1005 issued Node-IDs provided that the CA re-issues the same Node-ID when 1006 a new certificate is generated. 1008 The general principle here is that the security mechanisms (TLS at 1009 the data link layer and message signatures at the message transport 1010 layer) are always used, even if the certificates are self-signed. 1011 This allows for a single set of code paths in the systems with the 1012 only difference being whether certificate verification is used to 1013 chain to a single root of trust. 1015 3.1.1. Shared-Key Security 1017 RELOAD also provides an admission control system based on shared 1018 keys. In this model, the peers all share a single key which is used 1019 to authenticate the peer-to-peer connections via TLS-PSK [RFC4279] or 1020 TLS-SRP [RFC5054]. 1022 3.2. Clients 1024 RELOAD defines a single protocol that is used both as the peer 1025 protocol and as the client protocol for the overlay. This simplifies 1026 implementation, particularly for devices that may act in either role, 1027 and allows clients to inject messages directly into the overlay. 1029 We use the term "peer" to identify a node in the overlay that routes 1030 messages for nodes other than those to which it is directly 1031 connected. Peers also have storage responsibilities. We use the 1032 term "client" to refer to nodes that do not have routing or storage 1033 responsibilities. When text applies to both peers and clients, we 1034 will simply refer to such devices as "nodes." 1036 RELOAD's client support allows nodes that are not participating in 1037 the overlay as peers to utilize the same implementation and to 1038 benefit from the same security mechanisms as the peers. Clients 1039 possess and use certificates that authorize the user to store data at 1040 certain locations in the overlay. The Node-ID in the certificate is 1041 used to identify the particular client as a member of the overlay and 1042 to authenticate its messages. 1044 In RELOAD, unlike some other designs, clients are not a first-class 1045 entity. From the perspective of a peer, a client is a node that has 1046 connected to the overlay, but has not yet taken steps to insert 1047 itself into the overlay topology. It might never do so (if it's a 1048 client) or it might eventually do so (if it's just a node that's 1049 taking a long time to join). The routing and storage rules for 1050 RELOAD provide for correct behavior by peers regardless of whether 1051 other nodes attached to them are clients or peers. Of course, a 1052 client implementation needs to know that it intends to be a client, 1053 but this localizes complexity only to that node. 1055 For more discussion of the motivation for RELOAD's client support, 1056 see Appendix B. 1058 3.2.1. Client Routing 1060 Clients may insert themselves in the overlay in two ways: 1062 o Establish a connection to the peer responsible for the client's 1063 Node-ID in the overlay. Then requests may be sent from/to the 1064 client using its Node-ID in the same manner as if it were a peer, 1065 because the responsible peer in the overlay will handle the final 1066 step of routing to the client. This may require a TURN [RFC5766] 1067 relay in cases where NATs or firewalls prevent a client from 1068 forming a direct connection with its responsible peer. Note that 1069 clients that choose this option need to process Update messages 1070 from the peer. Those updates can indicate that the peer no longer 1071 is responsible for the Client's Node-ID. The client would then 1072 need to form a connection to the appropriate peer. Failure to do 1073 so will result in the client no longer receiving messages. 1074 o Establish a connection with an arbitrary peer in the overlay 1075 (perhaps based on network proximity or an inability to establish a 1076 direct connection with the responsible peer). In this case, the 1077 client will rely on RELOAD's Destination List (Section 6.3.2.2) 1078 feature to ensure reachability. The client can initiate requests, 1079 and any node in the overlay that knows the Destination List to its 1080 current location can reach it, but the client is not directly 1081 reachable using only its Node-ID. If the client is to receive 1082 incoming requests from other members of the overlay, the 1083 Destination List needed to reach the client needs to be learnable 1084 via other mechanisms, such as being stored in the overlay by a 1085 usage. A client connected this way using a certificate with only 1086 a single Node-ID can proceed to use the connection without 1087 performing an Attach. A client wishing to connect using this 1088 mechanism with a certificate with multiple Node-IDs can use a Ping 1089 (Section 6.5.3) to probe the Node-ID of the node to which it is 1090 connected before doing the Attach (Section 6.5.1). 1092 3.2.2. Minimum Functionality Requirements for Clients 1094 A node may act as a client simply because it does not have the 1095 capacity, or even an implementation of the topology plugin defined in 1096 Section 6.4.1, needed to act as a peer in the overlay. In order to 1097 exchange RELOAD messages with a peer, a client needs to meet a 1098 minimum level of functionality. Such a client will: 1100 o Implement RELOAD's connection-management operations that are used 1101 to establish the connection with the peer. 1102 o Implement RELOAD's data retrieval methods (with client 1103 functionality). 1104 o Be able to calculate Resource-IDs used by the overlay. 1105 o Possess security credentials needed by the overlay it is 1106 implementing. 1108 A client speaks the same protocol as the peers, knows how to 1109 calculate Resource-IDs, and signs its requests in the same manner as 1110 peers. While a client does not necessarily require a full 1111 implementation of the overlay algorithm, calculating the Resource-ID 1112 requires an implementation of the appropriate algorithm for the 1113 overlay. 1115 3.3. Routing 1117 This section will discuss the capabilities of RELOAD's routing layer, 1118 the protocol features used to implement them, and a brief overview of 1119 how they are used. Appendix A discusses some alternative designs and 1120 the tradeoffs that would be necessary to support them. 1122 RELOAD's routing provides the following capabilities: 1124 Resource-based routing: RELOAD supports routing messages based 1125 solely on the name of the resource. Such messages are delivered 1126 to a node that is responsible for that resource. Both structured 1127 and unstructured overlays are supported, so the route may not be 1128 deterministic for all Topology Plugins. 1130 Node-based routing: RELOAD supports routing messages to a specific 1131 node in the overlay. 1133 Clients: RELOAD supports requests from and to clients that do not 1134 participate in overlay routing, located via either of the 1135 mechanisms described above. 1137 NAT Traversal: RELOAD supports establishing and using connections 1138 between nodes separated by one or more NATs, including locating 1139 peers behind NATs for those overlays allowing/requiring it. 1141 Low state: RELOAD's routing algorithms do not require significant 1142 state (i.e., state linear or greater in the number of outstanding 1143 messages that have passed through it) to be stored on intermediate 1144 peers. 1146 Routability in unstable topologies: Overlay topology changes 1147 constantly in an overlay of moderate size due to the failure of 1148 individual nodes and links in the system. RELOAD's routing allows 1149 peers to re-route messages when a failure is detected, and replies 1150 can be returned to the requesting node as long as the peers that 1151 originally forwarded the successful request do not fail before the 1152 response is returned. 1154 RELOAD's routing utilizes three basic mechanisms: 1156 Destination Lists: While in principle it is possible to just 1157 inject a message into the overlay with a single Node-ID as the 1158 destination, RELOAD provides a source routing capability in the 1159 form of "Destination Lists". A Destination List provides a list 1160 of the nodes through which a message flows in order (i.e., it is 1161 loose source routed). The minimal destination list contains just 1162 a single value. 1164 Via Lists: In order to allow responses to follow the same path as 1165 requests, each message also contains a "Via List", which is 1166 appended to by each node a message traverses. This via list can 1167 then be inverted and used as a destination list for the response. 1169 RouteQuery: The RouteQuery method allows a node to query a peer 1170 for the next hop it will use to route a message. This method is 1171 useful for diagnostics and for iterative routing (see 1172 Section 6.4.2.4). 1174 The basic routing mechanism used by RELOAD is Symmetric Recursive. 1175 We will first describe symmetric recursive routing and then discuss 1176 its advantages in terms of the requirements discussed above. 1178 Symmetric recursive routing requires that a request message follow a 1179 path through the overlay to the destination: each peer forwards the 1180 message closer to its destination. The return path of the response 1181 is then the same path followed in reverse. If there is a failure on 1182 the reverse path caused by topology change since the request was 1183 sent, this will be handled by the end-to-end retransmission of the 1184 response as described in Section 6.2.1. For example, a message 1185 following a route from A to Z through B and X: 1187 A B X Z 1188 ------------------------------- 1190 ----------> 1191 Dest=Z 1192 ----------> 1193 Via=A 1194 Dest=Z 1195 ----------> 1196 Via=A,B 1197 Dest=Z 1199 <---------- 1200 Dest=X,B,A 1201 <---------- 1202 Dest=B,A 1203 <---------- 1204 Dest=A 1206 Note that the preceding Figure does not indicate whether A is a 1207 client or peer: A forwards its request to B and the response is 1208 returned to A in the same manner regardless of A's role in the 1209 overlay. 1211 This figure shows use of full via lists by intermediate peers B and 1212 X. However, if B and/or X are willing to store state, then they may 1213 elect to truncate the lists, save that information internally (keyed 1214 by the transaction ID), and return the response message along the 1215 path from which it was received when the response is received. This 1216 option requires greater state to be stored on intermediate peers but 1217 saves a small amount of bandwidth and reduces the need for modifying 1218 the message en route. Selection of this mode of operation is a 1219 choice for the individual peer; the techniques are interoperable even 1220 on a single message. The figure below shows B using full via lists 1221 but X truncating them to X1 and saving the state internally. 1223 A B X Z 1224 ------------------------------- 1226 ----------> 1227 Dest=Z 1228 ----------> 1229 Via=A 1230 Dest=Z 1231 ----------> 1232 Via=X1 1233 Dest=Z 1235 <---------- 1236 Dest=X,X1 1237 <---------- 1238 Dest=B,A 1239 <---------- 1240 Dest=A 1242 As before, when B receives the message, B creates a via list 1243 consisting of [A]. However, instead of sending [A, B], X creates an 1244 opaque ID X1 which maps internally to [A, B] (perhaps by being an 1245 encryption of [A, B] and forwards to Z with only X1 as the via list. 1246 When the response arrives at X, it maps X1 back to [A, B] and then 1247 inverts it to produce the new destination list [B, A] and routes it 1248 to B. 1250 RELOAD also supports a basic Iterative "routing" mode (where the 1251 intermediate peers merely return a response indicating the next hop, 1252 but do not actually forward the message to that next hop themselves). 1253 Iterative "routing" is implemented using the RouteQuery method, which 1254 requests this behavior. Note that iterative "routing" is selected 1255 only by the initiating node. 1257 3.4. Connectivity Management 1259 In order to provide efficient routing, a peer needs to maintain a set 1260 of direct connections to other peers in the Overlay Instance. Due to 1261 the presence of NATs, these connections often cannot be formed 1262 directly. Instead, we use the Attach request to establish a 1263 connection. Attach uses Interactive Connectivity Establishment (ICE) 1264 [RFC5245] to establish the connection. It is assumed that the reader 1265 is familiar with ICE. 1267 Say that peer A wishes to form a direct connection to peer B, either 1268 to join the overlay or to add more connections in its routing table. 1269 It gathers ICE candidates and packages them up in an Attach request 1270 which it sends to B through usual overlay routing procedures. B does 1271 its own candidate gathering and sends back a response with its 1272 candidates. A and B then do ICE connectivity checks on the candidate 1273 pairs. The result is a connection between A and B. At this point, A 1274 and B MAY send messages directly between themselves without going 1275 through other overlay peers. In other words, A and B are on each 1276 other's connection tables. They MAY then execute an Update process, 1277 resulting in additions to each other's routing tables, and become 1278 able to route messages through each other to other overlay nodes 1280 There are two cases where Attach is not used. The first is when a 1281 peer is joining the overlay and is not connected to any peers. In 1282 order to support this case, some small number of "bootstrap nodes" 1283 typically need to be publicly accessible so that new peers can 1284 directly connect to them. Section 11 contains more detail on this. 1285 The second case is when a client connects to a peer at an arbitrary 1286 IP address, rather than to its responsible peer, as described in the 1287 second bullet point of Section 3.2.1. 1289 In general, a peer needs to maintain connections to all of the peers 1290 near it in the Overlay Instance and to enough other peers to have 1291 efficient routing (the details, e.g. on what "enough" or "near" 1292 means, depend on the specific overlay). If a peer cannot form a 1293 connection to some other peer, this is not necessarily a disaster; 1294 overlays can route correctly even without fully connected links. 1295 However, a peer needs to try to maintain the specified routing table 1296 defined by the topology plugin algorithm and needs to form new 1297 connections if it detects that it has fewer direct connections that 1298 the specified by the algorithm. This also implies that peers, in 1299 accord with the topology plugin algorithm, need to periodically 1300 verify that the connected peers are still alive and if not try to 1301 reform the connection or form an alternate one. See Section 10.7.4.3 1302 for an example on how a specific overlay algorithm implements these 1303 constraints. 1305 3.5. Overlay Algorithm Support 1307 The Topology Plugin allows RELOAD to support a variety of overlay 1308 algorithms. This specification defines a DHT based on Chord, which 1309 is mandatory to implement, but the base RELOAD protocol is designed 1310 to support a variety of overlay algorithms. The information needed 1311 to implement this DHT is fully contained in this specification but it 1312 is easier to understand if you are familiar with Chord [Chord] based 1313 DHTs. A nice tutorial can be found at [wikiChord]. 1315 3.5.1. Support for Pluggable Overlay Algorithms 1317 RELOAD defines three methods for overlay maintenance: Join, Update, 1318 and Leave. However, the contents of those messages, when they are 1319 sent, and their precise semantics are specified by the actual overlay 1320 algorithm, which is specified by configuration for all nodes in the 1321 overlay, and thus known to nodes prior to their attempting to join 1322 the overlay. RELOAD merely provides a framework of commonly-needed 1323 methods that provides uniformity of notation (and ease of debugging) 1324 for a variety of overlay algorithms. 1326 3.5.2. Joining, Leaving, and Maintenance Overview 1328 When a new peer wishes to join the Overlay Instance, it will need a 1329 Node-ID that it is allowed to use and a set of credentials which 1330 match that Node-ID. When an enrollment server is used, the Node-ID 1331 used is the Node-ID found in the certificate received from the 1332 enrollment server. The details of the joining procedure are defined 1333 by the overlay algorithm, but the general steps for joining an 1334 Overlay Instance are: 1336 o Forming connections to some other peers. 1337 o Acquiring the data values this peer is responsible for storing. 1338 o Informing the other peers which were previously responsible for 1339 that data that this peer has taken over responsibility. 1341 The first thing the peer needs to do is to form a connection to some 1342 "bootstrap node". Because this is the first connection the peer 1343 makes, these nodes will need public IP addresses so that they can be 1344 connected to directly. Once a peer has connected to one or more 1345 bootstrap nodes, it can form connections in the usual way by routing 1346 Attach messages through the overlay to other nodes. Once a peer has 1347 connected to the overlay for the first time, it can cache the set of 1348 past adjacencies which have public IP address and attempt to use them 1349 as future bootstrap nodes. Note that this requires some notion of 1350 which addresses are likely to be public as discussed in Section 9. 1352 Once a peer has connected to a bootstrap node, it then needs to take 1353 up its appropriate place in the overlay. This requires two major 1354 operations: 1356 o Forming connections to other peers in the overlay to populate its 1357 Routing Table. 1358 o Getting a copy of the data it is now responsible for storing and 1359 assuming responsibility for that data. 1361 The second operation is performed by contacting the Admitting Peer 1362 (AP), the node which is currently responsible for that section of the 1363 overlay. 1365 The details of this operation depend mostly on the overlay algorithm 1366 involved, but a typical case would be: 1368 1. JN (Joining Node) sends a Join request to AP (Admitting Peer) 1369 announcing its intention to join. 1370 2. AP sends a Join response. 1371 3. AP does a sequence of Stores to JN to give it the data it will 1372 need. 1373 4. AP does Updates to JN and to other peers to tell it about its own 1374 routing table. At this point, both JN and AP consider JN 1375 responsible for some section of the Overlay Instance. 1376 5. JN makes its own connections to the appropriate peers in the 1377 Overlay Instance. 1379 After this process is completed, JN is a full member of the Overlay 1380 Instance and can process Store/Fetch requests. 1382 Note that the first node is a special case. When ordinary nodes 1383 cannot form connections to the bootstrap nodes, then they are not 1384 part of the overlay. However, the first node in the overlay can 1385 obviously not connect to other nodes. In order to support this case, 1386 potential first nodes (which can also serve as bootstrap nodes 1387 initially) need to somehow be instructed that they are the entire 1388 overlay, rather than not part of it. (e.g. by comparing their IP 1389 address to the bootstrap IP addresses in the configuration file) 1391 Note that clients do not perform either of these operations. 1393 3.6. First-Time Setup 1395 Previous sections addressed how RELOAD works once a node has 1396 connected. This section provides an overview of how users get 1397 connected to the overlay for the first time. RELOAD is designed so 1398 that users can start with the name of the overlay they wish to join 1399 and perhaps an account name and password, and leverage that into 1400 having a working peer with minimal user intervention. This helps 1401 avoid the problems that have been experienced with conventional SIP 1402 clients where users need to manually configure a large number of 1403 settings. 1405 3.6.1. Initial Configuration 1407 In the first phase of the process, the user starts out with the name 1408 of the overlay and uses this to download an initial set of overlay 1409 configuration parameters. The node does a DNS SRV [RFC2782] lookup 1410 on the overlay name to get the address of a configuration server. It 1411 can then connect to this server with HTTPS [RFC2818] to download a 1412 configuration document which contains the basic overlay configuration 1413 parameters as well as a set of bootstrap nodes which can be used to 1414 join the overlay. The details of the relations between names in the 1415 HTTPS certificates, and the overlay names are described in 1416 Section 11.2. 1418 If a node already has the valid configuration document that it 1419 received by some out of band method, this step can be skipped. Note 1420 that that out of band method needs to provide authentication and 1421 integrity, because the configuration document contains the trust 1422 anchors used by the overlay. 1424 3.6.2. Enrollment 1426 If the overlay is using centralized enrollment, then a user needs to 1427 acquire a certificate before joining the overlay. The certificate 1428 attests both to the user's name within the overlay and to the Node- 1429 IDs which they are permitted to operate. In that case, the 1430 configuration document will contain the address of an enrollment 1431 server which can be used to obtain such a certificate, and will also 1432 contain the trust anchor, so this document must be retrieved securely 1433 (see Section 11.2). The enrollment server may (and probably will) 1434 require some sort of account name for the user and password before 1435 issuing the certificate. The enrollment server's ability to ensure 1436 attackers can not get a large number of certificates for the overlay 1437 is one of the cornerstones of RELOAD's security. 1439 3.6.3. Diagnostics 1441 Significant advice around managing a RELOAD overlay and extensions 1442 for diagnostics are described in [I-D.ietf-p2psip-diagnostics]. 1444 4. Application Support Overview 1446 RELOAD is not intended to be used alone, but rather as a substrate 1447 for other applications. These applications can use RELOAD for a 1448 variety of purposes: 1450 o To store data in the overlay and retrieve data stored by other 1451 nodes. 1452 o As a discovery mechanism for services such as TURN. 1453 o To form direct connections which can be used to transmit 1454 application-level messages without using the overlay. 1456 This section provides an overview of these services. 1458 4.1. Data Storage 1460 RELOAD provides operations to Store and Fetch data. Each location in 1461 the Overlay Instance is referenced by a Resource-ID. However, each 1462 location may contain data elements corresponding to multiple Kinds 1463 (e.g., certificate, SIP registration). Similarly, there may be 1464 multiple elements of a given Kind, as shown below: 1466 +--------------------------------+ 1467 | Resource-ID | 1468 | | 1469 | +------------+ +------------+ | 1470 | | Kind 1 | | Kind 2 | | 1471 | | | | | | 1472 | | +--------+ | | +--------+ | | 1473 | | | Value | | | | Value | | | 1474 | | +--------+ | | +--------+ | | 1475 | | | | | | 1476 | | +--------+ | | +--------+ | | 1477 | | | Value | | | | Value | | | 1478 | | +--------+ | | +--------+ | | 1479 | | | +------------+ | 1480 | | +--------+ | | 1481 | | | Value | | | 1482 | | +--------+ | | 1483 | +------------+ | 1484 +--------------------------------+ 1486 Each Kind is identified by a Kind-ID, which is a code point either 1487 assigned by IANA or allocated out of a private range. As part of the 1488 Kind definition, protocol designers may define constraints, such as 1489 limits on size, on the values which may be stored. For many Kinds, 1490 the set may be restricted to a single value; some sets may be allowed 1491 to contain multiple identical items while others may only have unique 1492 items. Note that a Kind may be employed by multiple usages and new 1493 usages are encouraged to use previously defined Kinds where possible. 1494 We define the following data models in this document, though other 1495 usages can define their own structures: 1497 single value: There can be at most one item in the set and any value 1498 overwrites the previous item. 1500 array: Many values can be stored and addressed by a numeric index. 1502 dictionary: The values stored are indexed by a key. Often this key 1503 is one of the values from the certificate of the peer sending the 1504 Store request. 1506 In order to protect stored data from tampering, by other nodes, each 1507 stored value is individually digitally signed by the node which 1508 created it. When a value is retrieved, the digital signature can be 1509 verified to detect tampering. If the certificate used to sign the 1510 stored value expires, it can no longer be retrieved (though may not 1511 be immediately garbage collected by the storing node) and the 1512 creating node will need to store it again if it desires that stored 1513 value to continue to be available. 1515 4.1.1. Storage Permissions 1517 A major issue in peer-to-peer storage networks is minimizing the 1518 burden of becoming a peer, and in particular minimizing the amount of 1519 data which any peer needs to to store for other nodes. RELOAD 1520 addresses this issue by only allowing any given node to store data at 1521 a small number of locations in the overlay, with those locations 1522 being determined by the node's certificate. When a peer uses a Store 1523 request to place data at a location authorized by its certificate, it 1524 signs that data with the private key that corresponds to its 1525 certificate. Then the peer responsible for storing the data is able 1526 to verify that the peer issuing the request is authorized to make 1527 that request. Each data Kind defines the exact rules for determining 1528 what certificate is appropriate. 1530 The most natural rule is that a certificate authorizes a user to 1531 store data keyed with their user name X. Thus, only a user with a 1532 certificate for "alice@example.org" could write to that location in 1533 the overlay (see Section 11.3). However, other usages can define any 1534 rules they choose, including publicly writable values. 1536 The digital signature over the data serves two purposes. First, it 1537 allows the peer responsible for storing the data to verify that this 1538 Store is authorized. Second, it provides integrity for the data. 1539 The signature is saved along with the data value (or values) so that 1540 any reader can verify the integrity of the data. Of course, the 1541 responsible peer can "lose" the value but it cannot undetectably 1542 modify it. 1544 The size requirements of the data being stored in the overlay are 1545 variable. For instance, a SIP AOR and voicemail differ widely in the 1546 storage size. RELOAD leaves it to the Usage and overlay 1547 configuration to limit size imbalance of various Kinds. 1549 4.1.2. Replication 1551 Replication in P2P overlays can be used to provide: 1553 persistence: if the responsible peer crashes and/or if the storing 1554 peer leaves the overlay 1556 security: to guard against DoS attacks by the responsible peer or 1557 routing attacks to that responsible peer 1559 load balancing: to balance the load of queries for popular 1560 resources. 1562 A variety of schemes are used in P2P overlays to achieve some of 1563 these goals. Common techniques include replicating on neighbors of 1564 the responsible peer, randomly locating replicas around the overlay, 1565 or replicating along the path to the responsible peer. 1567 The core RELOAD specification does not specify a particular 1568 replication strategy. Instead, the first level of replication 1569 strategies are determined by the overlay algorithm, which can base 1570 the replication strategy on its particular topology. For example, 1571 Chord places replicas on successor peers, which will take over 1572 responsibility if the responsible peer fail [Chord]. 1574 If additional replication is needed, for example if data persistence 1575 is particularly important for a particular usage, then that usage may 1576 specify additional replication, such as implementing random 1577 replications by inserting a different well known constant into the 1578 Resource Name used to store each replicated copy of the resource. 1579 Such replication strategies can be added independent of the 1580 underlying algorithm, and their usage can be determined based on the 1581 needs of the particular usage. 1583 4.2. Usages 1585 By itself, the distributed storage layer just provides infrastructure 1586 on which applications are built. In order to do anything useful, a 1587 usage needs to be defined. Each Usage needs to specify several 1588 things: 1590 o Register Kind-ID code points for any Kinds that the Usage defines 1591 (Section 14.6). 1592 o Defines the data structure for each of the Kinds (the value member 1593 in Section 7.2). If the data structure contains character string, 1594 conversion rules between characters and the binary storage need to 1595 be specified. 1596 o Define access control rules for each of the Kinds (Section 7.3). 1597 o Define how the Resource Name is used to form the Resource-ID where 1598 each Kind is stored. 1599 o Describe how values will be merged when a network partition is 1600 being healed. 1602 The Kinds defined by a usage may also be applied to other usages. 1603 However, a need for different parameters, such as different size 1604 limits, would imply the need to create a new Kind. 1606 4.3. Service Discovery 1608 RELOAD does not currently define a generic service discovery 1609 algorithm as part of the base protocol, although a simplistic TURN- 1610 specific discovery mechanism is provided. A variety of service 1611 discovery algorithms can be implemented as extensions to the base 1612 protocol, such as the service discovery algorithm ReDIR 1613 [opendht-sigcomm05] or [I-D.ietf-p2psip-service-discovery]. 1615 4.4. Application Connectivity 1617 There is no requirement that a RELOAD usage needs to use RELOAD's 1618 primitives for establishing its own communication if it already 1619 possesses its own means of establishing connections. For example, 1620 one could design a RELOAD-based resource discovery protocol which 1621 used HTTP to retrieve the actual data. 1623 For more common situations, however, it is the overlay itself - 1624 rather than an external authority such as DNS - which is used to 1625 establish a connection. RELOAD provides connectivity to applications 1626 using the AppAttach method. For example, if a P2PSIP node wishes to 1627 establish a SIP dialog with another P2PSIP node, it will use 1628 AppAttach to establish a direct connection with the other node. This 1629 new connection is separate from the peer protocol connection. It is 1630 a dedicated UDP or TCP flow used only for the SIP dialog. 1632 5. RFC 2119 Terminology 1634 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 1635 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 1636 document are to be interpreted as described in RFC 2119 [RFC2119]. 1638 6. Overlay Management Protocol 1640 This section defines the basic protocols used to create, maintain, 1641 and use the RELOAD overlay network. We start by defining the basic 1642 concept of how message destinations are interpreted when routing 1643 messages. We then describe the symmetric recursive routing model, 1644 which is RELOAD's default routing algorithm. We then define the 1645 message structure and then finally define the messages used to join 1646 and maintain the overlay. 1648 6.1. Message Receipt and Forwarding 1650 When a node receives a message, it first examines the overlay, 1651 version, and other header fields to determine whether the message is 1652 one it can process. If any of these are incorrect, as defined in 1653 Section 6.3.2, it is an error and the message MUST be discarded. The 1654 peer SHOULD generate an appropriate error but local policy can 1655 override this and cause the messages to be silently dropped. 1657 Once the peer has determined that the message is correctly formatted 1658 (note that this does not include signature checking on intermediate 1659 nodes as the message may be fragmented) it examines the first entry 1660 on the destination list. There are three possible cases here: 1662 o The first entry on the destination list is an ID for which the 1663 peer is responsible. A peer is always responsible for the 1664 wildcard Node-ID. Handling of this case is described in 1665 Section 6.1.1. 1666 o The first entry on the destination list is an ID for which another 1667 peer is responsible. Handling of this case is described in 1668 Section 6.1.2. 1669 o The first entry on the destination list is an opaque ID that is 1670 being used for destination list compression. Handling of this 1671 case is described in Section 6.1.3. Note that opaque IDs can be 1672 distinguished from Node-IDs and Resource-IDs on the wire as 1673 described in Section 6.3.2.2). 1675 These cases are handled as discussed below. 1677 6.1.1. Responsible ID 1679 If the first entry on the destination list is an ID for which the 1680 peer is responsible, there are several (mutually exclusive) sub-cases 1681 to consider. 1683 o If the entry is a Resource-ID, then it MUST be the only entry on 1684 the destination list. If there are other entries, the message 1685 MUST be silently dropped. Otherwise, the message is destined for 1686 this node so it MUST verify the signature as described in 1687 Section 7.1 and MUST pass it up to the upper layers. "Upper 1688 layers" is used here to mean the components above the "Overlay 1689 Link Service Boundary" line in the figure in Section 1.2. 1690 o If the entry is a Node-ID which equals this node's Node-ID, then 1691 the message is destined for this node. If this is the only entry 1692 on the destination list, the message is destined for this node and 1693 so the node passes it up to the upper layers. Otherwise the node 1694 removes the entry from the destination list and repeats the 1695 routing process with the next entry on the destination list. If 1696 the message is a response and list compression was used, then the 1697 node first modifies the destination list to reinsert the saved 1698 state, e.g., by unpacking any opaque IDS. 1699 o If the entry is the wildcard Node-ID (all "1"s), the message is 1700 destined for this node and it passes it up to the upper layers. A 1701 message with a wildcard Node-ID as first entry is never forwarded 1702 and is consumed locally. 1703 o If the entry is a Node-ID which is not equal to this node, then 1704 the node MUST drop the message silently unless the Node-ID 1705 corresponds to a node which is directly connected to this node 1706 (i.e., a client). In the latter case, it MUST forward the message 1707 to the destination node as described in the next section. 1709 Note that this implies that in order to address a message to "the 1710 peer that controls region X", a sender sends to Resource-ID X, not 1711 Node-ID X. 1713 6.1.2. Other ID 1715 If the first entry in the destination list is neither an opaque ID 1716 nor an ID the peer is responsible for, then the peer MUST forward the 1717 message towards this entry. This means that it MUST select one of 1718 the peers to which it is connected and which is most likely to be 1719 responsible (according to the topology plugin) for the first entry on 1720 the destination list. For the CHORD-RELOAD topology, the routing to 1721 the most likely responsible node is explained in Section 10.3. If 1722 the first entry on the destination list is in the peer's connection 1723 table, then it MUST forward the message to that peer directly. 1724 Otherwise, the peer consults the routing table to forward the 1725 message. 1727 Any intermediate peer which forwards a RELOAD request MUST ensure 1728 that if it receives a response to that message the response can be 1729 routed back through the set of nodes through which the request 1730 passed. The peer selects one of these approaches: 1732 o The peer can add an entry to the via list in the forwarding header 1733 that will enable it to determine the correct node. This is done 1734 by appending to the via list the Node-ID of the node that sent the 1735 request to this node. 1736 o The peer can keep per-transaction state which will allow it to 1737 determine the correct node. 1739 As an example of the first strategy, consider an example with nodes 1740 A, B, C, D and E. If node D receives a message from node C with via 1741 list [A, B], then D would forward to the next node E with via list 1742 [A, B, C]. Now, if E wants to respond to the message, it reverses 1743 the via list to produce the destination list, resulting in [D, C, B, 1744 A]. When D forwards the response to C, the destination list will 1745 contain [C, B, A]. 1747 As an example of the second strategy, if node D receives a message 1748 from node C with transaction ID X (as assigned by A) and via list [A, 1749 B], it could store [X, C] in its state database and forward the 1750 message with the via list unchanged. When D receives the response, 1751 it consults its state database for transaction ID X, determines that 1752 the request came from C, and forwards the response to C. 1754 Intermediate peers which modify the via list are not required to 1755 simply add entries. The only requirement is that the peer MUST be 1756 able to reconstruct the correct destination list on the return route. 1757 RELOAD provides explicit support for this functionality in the form 1758 of opaque IDs, which can replace any number of via list entries. 1760 For instance, in the above example, Node D might send E a via list 1761 containing only the opaque ID I. E would then use the destination 1762 list [D, I] to send its return message. When D processes this 1763 destination list, it would detect that I is a opaque ID, recover the 1764 via list [A, B, C], and reverse that to produce the correct 1765 destination list [C, B, A] before sending it to C. This feature is 1766 called List Compression. Possibilities for a opaque ID include a 1767 compressed version of the original via list or an index into a state 1768 database containing the original via list, but the details are a 1769 local matter. 1771 No matter what mechanism for storing via list state is used, if an 1772 intermediate peer exits the overlay, then on the return trip the 1773 message cannot be forwarded and will be dropped. The ordinary 1774 timeout and retransmission mechanisms provide stability over this 1775 type of failure. 1777 Note that if an intermediate peer retains per-transaction state 1778 instead of modifying the via list, it needs some mechanism for timing 1779 out that state, otherwise its state database will grow without bound. 1781 Whatever algorithm is used, unless a FORWARD_CRITICAL forwarding 1782 option (Section 6.3.2.3) or overlay configuration option explicitly 1783 indicates this state is not needed, the state MUST be maintained for 1784 at least the value of the overlay-reliability-timer configuration 1785 parameter and MAY be kept longer. Future extension, such as 1786 [I-D.ietf-p2psip-rpr], may define mechanisms for determining when 1787 this state does not need to be retained. 1789 There is no requirement to ensure that a request issued after the 1790 receipt of a response follows the same path as the response. As a 1791 consequence, there is no requirement to use either of the mechanisms 1792 described above (via list or state retention) when processing a 1793 response message. 1795 An intermediate node receiving a request from another node MUST 1796 return a response to this request with a destination list equal to 1797 the concatenation of the Node-ID of the node that sent the request 1798 with the via list in the request. The intermediate node normally 1799 learns the Node-ID the other node is using via an Attach, but a node 1800 using a certificate with a single Node-ID MAY elect to not send an 1801 Attach (see Section 3.2.1 bullet 2). If a node with a certificate 1802 with multiple Node-IDs attempts to route a message other than a Ping 1803 or Attach through a node without performing an Attach, the receiving 1804 node MUST reject the request with an Error_Forbidden error. The node 1805 MUST implement support for returning responses to a Ping or Attach 1806 request made by a joining node Attaching to its responsible peer. 1808 6.1.3. Opaque ID 1810 If the first entry in the destination list is an opaque ID (e.g., a 1811 compressed via list), the peer MUST replace that entry with the 1812 original via list that it replaced and then re-examine the 1813 destination list to determine which of the three cases in Section 6.1 1814 now applies. 1816 6.2. Symmetric Recursive Routing 1818 This Section defines RELOAD's Symmetric Recursive Routing (SRR) 1819 algorithm, which is the default algorithm used by nodes to route 1820 messages through the overlay. All implementations MUST implement 1821 this routing algorithm. An overlay MAY be configured to use 1822 alternative routing algorithms, and alternative routing algorithms 1823 MAY be selected on a per-message basis. I.e., a node in an overlay 1824 which supports SRR and some other routing algorithm called XXX might 1825 use SRR some of the time and XXX some of the time. 1827 6.2.1. Request Origination 1829 In order to originate a message to a given Node-ID or Resource-ID, a 1830 node MUST construct an appropriate destination list. The simplest 1831 such destination list is a single entry containing the Node-ID or 1832 Resource-ID. The resulting message MUST use the normal overlay 1833 routing mechanisms to forward the message to that destination. The 1834 node MAY also construct a more complicated destination list for 1835 source routing. 1837 Once the message is constructed, the node sends the message to some 1838 adjacent peer. If the first entry on the destination list is 1839 directly connected, then the message MUST be routed down that 1840 connection. Otherwise, the topology plugin MUST be consulted to 1841 determine the appropriate next hop. 1843 Parallel requests for a resource are a common solution to improve 1844 reliability in the face of churn or of subversive peers. Parallel 1845 searches for usage-specified replicas are managed by the usage layer, 1846 for instance by having the usage store data at multiple Resource-IDs 1847 with the requesting node sending requests to each of those Resource- 1848 IDs. However, a single request MAY also be routed through multiple 1849 adjacent peers, even when known to be sub-optimal, to improve 1850 reliability [vulnerabilities-acsac04]. Such parallel searches MAY be 1851 specified by the topology plugin, in which case it would return 1852 multiple next hops and the request would be routed to all of them. 1854 Because messages can be lost in transit through the overlay, RELOAD 1855 incorporates an end-to-end reliability mechanism. When an 1856 originating node transmits a request it MUST set a timer to the 1857 current overlay-reliability-timer. If a response has not been 1858 received when the timer fires, the request MUST be retransmitted with 1859 the same transaction identifier. The request MAY be retransmitted up 1860 to 4 times (for a total of 5 messages). After the timer for the 1861 fifth transmission fires, the message MUST be considered to have 1862 failed. Although the originating node will be doing both end-to-end 1863 and hop-by-hop retransmissions, the end-by-end retransmission 1864 procedure is not followed by intermediate nodes. They follow the 1865 hop-by-hop reliability procedure described in Section 6.6.3. 1867 The above algorithm can result in multiple requests being delivered 1868 to a node. Receiving nodes MUST generate semantically equivalent 1869 responses to retransmissions of the same request (this can be 1870 determined by transaction ID) if the request is received within the 1871 maximum request lifetime (15 seconds). For some requests (e.g., 1872 Fetch) this can be accomplished merely by processing the request 1873 again. For other requests, (e.g., Store) it may be necessary to 1874 maintain state for the duration of the request lifetime. 1876 6.2.2. Response Origination 1878 When a peer sends a response to a request using this routing 1879 algorithm, it MUST construct the destination list by reversing the 1880 order of the entries on the via list. This has the result that the 1881 response traverses the same peers as the request traversed, except in 1882 reverse order (symmetric routing). 1884 6.3. Message Structure 1886 RELOAD is a message-oriented request/response protocol. The messages 1887 are encoded using binary fields. All integers are represented in 1888 network byte order. The general philosophy behind the design was to 1889 use Type, Length, Value fields to allow for extensibility. However, 1890 for the parts of a structure that were required in all messages, we 1891 just define these in a fixed position, as adding a type and length 1892 for them is unnecessary and would simply increase bandwidth and 1893 introduces new potential for interoperability issues. 1895 Each message has three parts, concatenated as shown below: 1897 +-------------------------+ 1898 | Forwarding Header | 1899 +-------------------------+ 1900 | Message Contents | 1901 +-------------------------+ 1902 | Security Block | 1903 +-------------------------+ 1905 The contents of these parts are as follows: 1907 Forwarding Header: Each message has a generic header which is used 1908 to forward the message between peers and to its final destination. 1909 This header is the only information that an intermediate peer 1910 (i.e., one that is not the target of a message) needs to examine. 1911 Section 6.3.2 describes the format of this part. 1913 Message Contents: The message being delivered between the peers. 1914 From the perspective of the forwarding layer, the contents are 1915 opaque, however, they are interpreted by the higher layers. 1916 Section 6.3.3 describes the format of this part. 1918 Security Block: A security block containing certificates and a 1919 digital signature over the "Message Contents" section. Note that 1920 this signature can be computed without parsing the message 1921 contents. All messages MUST be signed by their originator. 1922 Section 6.3.4 describes the format of this part. 1924 6.3.1. Presentation Language 1926 The structures defined in this document are defined using a C-like 1927 syntax based on the presentation language used to define TLS 1928 [RFC5246]. Advantages of this style include: 1930 o It is familiar enough looking that most readers can grasp it 1931 quickly. 1932 o The ability to define nested structures allows a separation 1933 between high-level and low-level message structures. 1934 o It has a straightforward wire encoding that allows quick 1935 implementation, but the structures can be comprehended without 1936 knowing the encoding. 1937 o The ability to mechanically compile encoders and decoders. 1939 Several idiosyncrasies of this language are worth noting. 1941 o All lengths are denoted in bytes, not objects. 1942 o Variable length values are denoted like arrays with angle 1943 brackets. 1944 o "select" is used to indicate variant structures. 1946 For instance, "uint16 array<0..2^8-2>;" represents up to 254 bytes 1947 which corresponds to up to 127 values of two bytes (16 bits) each. 1949 A repetitive structure member shares a common notation with a member 1950 containing a variable length block of data. The latter always starts 1951 with "opaque" whereas the former does not. For instance the 1952 following denotes a variable block of data: 1954 opaque data<0..2^32-1>; 1956 whereas the following denotes a list of 0, 1 or more instances of the 1957 Name element: 1959 Name names<0..2^32-1>; 1961 6.3.1.1. Common Definitions 1963 This section provides an introduction to the presentation language 1964 used throughout RELOAD. 1966 An enum represents an enumerated type. The values associated with 1967 each possibility are represented in parentheses and the maximum value 1968 is represented as a nameless value, for purposes of describing the 1969 width of the containing integral type. For instance, Boolean 1970 represents a true or false: 1972 enum { false(0), true(1), (255) } Boolean; 1974 A boolean value is either a 1 or a 0. The max value of 255 indicates 1975 this is represented as a single byte on the wire. 1977 The NodeId, shown below, represents a single Node-ID. 1979 typedef opaque NodeId[NodeIdLength]; 1981 A NodeId is a fixed-length structure represented as a series of 1982 bytes, with the most significant byte first. The length is set on a 1983 per-overlay basis within the range of 16-20 bytes (128 to 160 bits). 1984 (See Section 11.1 for how NodeIdLength is set.) Note: the use of 1985 "typedef" here is an extension to the TLS language, but its meaning 1986 should be relatively obvious. Note the [ size ] syntax defines a 1987 fixed length element that does not include the length of the element 1988 in the on the wire encoding. 1990 A ResourceId, shown below, represents a single Resource-ID. 1992 typedef opaque ResourceId<0..2^8-1>; 1994 Like a NodeId, a ResourceId is an opaque string of bytes, but unlike 1995 NodeIds, ResourceIds are variable length, up to 254 bytes (2040 bits) 1996 in length. On the wire, each ResourceId is preceded by a single 1997 length byte (allowing lengths up to 255). Thus, the 3-byte value 1998 "FOO" would be encoded as: 03 46 4f 4f. Note the < range > syntax 1999 defines a variable length element that does include the length of the 2000 element in the on the wire encoding. The number of bytes to encode 2001 the length on the wire is derived by range; i.e., it is the minimum 2002 number of bytes which can encode the largest range value. 2004 A more complicated example is IpAddressPort, which represents a 2005 network address and can be used to carry either an IPv6 or IPv4 2006 address: 2008 enum { invalidAddressType(0), ipv4_address(1), ipv6_address(2), 2009 (255) } AddressType; 2011 struct { 2012 uint32 addr; 2013 uint16 port; 2014 } IPv4AddrPort; 2016 struct { 2017 uint128 addr; 2018 uint16 port; 2019 } IPv6AddrPort; 2021 struct { 2022 AddressType type; 2023 uint8 length; 2025 select (type) { 2026 case ipv4_address: 2027 IPv4AddrPort v4addr_port; 2029 case ipv6_address: 2030 IPv6AddrPort v6addr_port; 2032 /* This structure can be extended */ 2033 }; 2034 } IpAddressPort; 2036 The first two fields in the structure are the same no matter what 2037 kind of address is being represented: 2039 type: the type of address (v4 or v6). 2041 length: the length of the rest of the structure. 2043 By having the type and the length appear at the beginning of the 2044 structure regardless of the kind of address being represented, an 2045 implementation which does not understand new address type X can still 2046 parse the IpAddressPort field and then discard it if it is not 2047 needed. 2049 The rest of the IpAddressPort structure is either an IPv4AddrPort or 2050 an IPv6AddrPort. Both of these simply consist of an address 2051 represented as an integer and a 16-bit port. As an example, here is 2052 the wire representation of the IPv4 address "192.0.2.1" with port 2053 "6100". 2055 01 ; type = IPv4 2056 06 ; length = 6 2057 c0 00 02 01 ; address = 192.0.2.1 2058 17 d4 ; port = 6100 2060 Unless a given structure that uses a select explicitly allows for 2061 unknown types in the select, any unknown type SHOULD be treated as an 2062 parsing error and the whole message discarded with no response. 2064 6.3.2. Forwarding Header 2066 The forwarding header is defined as a ForwardingHeader structure, as 2067 shown below. 2069 struct { 2070 uint32 relo_token; 2071 uint32 overlay; 2072 uint16 configuration_sequence; 2073 uint8 version; 2074 uint8 ttl; 2075 uint32 fragment; 2076 uint32 length; 2077 uint64 transaction_id; 2078 uint32 max_response_length; 2079 uint16 via_list_length; 2080 uint16 destination_list_length; 2081 uint16 options_length; 2082 Destination via_list[via_list_length]; 2083 Destination destination_list 2084 [destination_list_length]; 2085 ForwardingOption options[options_length]; 2086 } ForwardingHeader; 2088 The contents of the structure are: 2090 relo_token: The first four bytes identify this message as a RELOAD 2091 message. This field MUST contain the value 0xd2454c4f (the string 2092 'RELO' with the high bit of the first byte set). 2094 overlay: The 32 bit checksum/hash of the overlay being used. This 2095 MUST be formed by taking the lower 32 bits of the SHA-1 [RFC3174] 2096 hash of the overlay name. The purpose of this field is to allow 2097 nodes to participate in multiple overlays and to detect accidental 2098 misconfiguration. This is not a security critical function. The 2099 overlay name MUST consist of a sequence of characters what would 2100 be allowable as a DNS name. Specifically, as it is used in a DNS 2101 lookup, it will need to be compliant with the grammar for the 2102 domain as specified in section 2.3.1 of [RFC1035] . 2104 configuration_sequence: The sequence number of the configuration 2105 file. See Section 6.3.2.1 for details 2107 version: The version of the RELOAD protocol being used. This is a 2108 fixed point integer between 0.1 and 25.4. This document describes 2109 version 1.0, with a value of 0x0a. [Note: Pre-RFC versions used 2110 version number 0.1]. Nodes MUST reject messages with other 2111 versions. 2113 ttl: An 8 bit field indicating the number of iterations, or hops, a 2114 message can experience before it is discarded. The TTL value MUST 2115 be decremented by one at every hop along the route the message 2116 traverses just before transmission. If a received message has a 2117 TTL of 0, and the message is not destined for the receiving node, 2118 then the message MUST NOT be propagated further and a 2119 "Error_TTL_Exceeded" error should be generated. The initial value 2120 of the TTL SHOULD be 100 and MUST NOT exceed 100 unless defined 2121 otherwise by the overlay configuration. Implementations which 2122 receive message with a TTL greater than the current value of 2123 initial-ttl (or the 100 default) MUST discard the message and send 2124 an "Error_TTL_Exceeded" error. 2126 fragment: This field is used to handle fragmentation. The high bit 2127 (0x80000000) MUST be set for historical reasons. If the next bit 2128 (0x40000000) is set to 1, it indicates that this is the last (or 2129 only) fragment. The next six bits (0x20000000 to 0x01000000) are 2130 reserved and SHOULD be set to zero. The remainder of the field is 2131 used to indicate the fragment offset; see Section 6.7. 2133 length: The count in bytes of the size of the message, including the 2134 header. 2136 transaction_id: A unique 64 bit number that identifies this 2137 transaction and also allows receivers to disambiguate transactions 2138 which are otherwise identical. In order to provide a high 2139 probability that transaction IDs are unique, they MUST be randomly 2140 generated. Responses use the same Transaction ID as the request 2141 they correspond to. Transaction IDs are also used for fragment 2142 reassembly. See Section 6.7 for details. 2144 max_response_length: The maximum size in bytes of a response. Used 2145 by requesting nodes to avoid receiving (unexpected) very large 2146 responses. If this value is non-zero, responding peers MUST check 2147 that any response would not exceed it and if so generate an 2148 "Error_Incompatible_with_Overlay" value. This value SHOULD be set 2149 to zero for responses. 2151 via_list_length: The length of the via list in bytes. Note that in 2152 this field and the following two length fields we depart from the 2153 usual variable-length convention of having the length immediately 2154 precede the value in order to make it easier for hardware decoding 2155 engines to quickly determine the length of the header. 2157 destination_list_length: The length of the destination list in 2158 bytes. 2160 options_length: The length of the header options in bytes. 2162 via_list: The via_list contains the sequence of destinations through 2163 which the message has passed. The via_list starts out empty and 2164 grows as the message traverses each peer. In stateless cases, the 2165 previous hop that the message is from is appended to the via list 2166 as specified in Section 6.1.2. 2168 destination_list: The destination_list contains a sequence of 2169 destinations which the message should pass through. The 2170 destination list is constructed by the message originator. The 2171 first element in the destination list is where the message goes 2172 next. The list shrinks as the message traverses each listed peer. 2174 options: Contains a series of ForwardingOption entries. See 2175 Section 6.3.2.3. 2177 6.3.2.1. Processing Configuration Sequence Numbers 2179 In order to be part of the overlay, a node MUST have a copy of the 2180 overlay configuration document. In order to allow for configuration 2181 document changes, each version of the configuration document MUST 2182 contain a sequence number which MUST be monotonically increasing mod 2183 65535. Because the sequence number may in principle wrap, greater 2184 than or less than are interpreted by modulo arithmetic as in TCP. 2186 When a destination node receives a request, it MUST check that the 2187 configuration_sequence field is equal to its own configuration 2188 sequence number. If they do not match, it MUST generate an error, 2189 either Error_Config_Too_Old or Error_Config_Too_New. In addition, if 2190 the configuration file in the request is too old, it MUST generate a 2191 ConfigUpdate message to update the requesting node. This allows new 2192 configuration documents to propagate quickly throughout the system. 2193 The one exception to this rule is that if the configuration_sequence 2194 field is equal to 65535, and the message type is ConfigUpdate, then 2195 the message MUST be accepted regardless of the receiving node's 2196 configuration sequence number. Since 65535 is a special value, peers 2197 sending a new configuration when the configuration sequence is 2198 currently 65534 MUST set the configuration sequence number to 0 when 2199 they send out a new configuration. 2201 6.3.2.2. Destination and Via Lists 2203 The destination list and via list are sequences of Destination 2204 values: 2206 enum { invalidDestinationType(0), node(1), resource(2), 2207 opaque_id_type(3), /* 128-255 not allowed */ (255) } 2208 DestinationType; 2210 select (destination_type) { 2211 case node: 2212 NodeId node_id; 2214 case resource: 2215 ResourceId resource_id; 2217 case opaque_id_type: 2218 opaque opaque_id<0..2^8-1>; 2220 /* This structure may be extended with new types */ 2221 } DestinationData; 2223 struct { 2224 DestinationType type; 2225 uint8 length; 2226 DestinationData destination_data; 2227 } Destination; 2229 struct { 2230 uint16 opaque_id; /* top bit MUST be 1 */ 2231 } Destination; 2233 If the destination structure is a 16 bit integer, then the first bit 2234 MUST be set to 1 and it MUST be treated as if it were a full 2235 structure with a DestinationType of opaque_id_type and a opaque_id 2236 that was 2 bytes long with the value of the 16 bit integer. If the 2237 destination structure is starting with DestinationType, then the 2238 first bit MUST be set to 0 and it is using the TLV structure with the 2239 following contents: 2241 type 2242 The type of the DestinationData Payload Data Unit (PDU). This may 2243 be one of "node", "resource", or "opaque_id_type". 2245 length 2246 The length of the destination_data. 2248 destination_data 2249 The destination value itself, which is an encoded DestinationData 2250 structure, depending on the value of "type". 2252 Note: This structure encodes a type, length, value. The length 2253 field specifies the length of the DestinationData values, which 2254 allows the addition of new DestinationTypes. This allows an 2255 implementation which does not understand a given DestinationType 2256 to skip over it. 2258 A DestinationData can be one of three types: 2260 node 2261 A Node-ID. 2263 opaque 2264 A compressed list of Node-IDs and an eventual Resource-ID. 2265 Because this value was compressed by one of the peers, it is only 2266 meaningful to that peer and cannot be decoded by other peers. 2267 Thus, it is represented as an opaque string. 2269 resource 2270 The Resource-ID of the resource which is desired. This type MUST 2271 only appear in the final location of a destination list and MUST 2272 NOT appear in a via list. It is meaningless to try to route 2273 through a resource. 2275 One possible encoding of the 16 bit integer version as an opaque 2276 identifier is to encode an index into a connection table. To avoid 2277 misrouting responses in the event a response is delayed and the 2278 connection table entry has changed, the identifier SHOULD be split 2279 between an index and a generation counter for that index. At 2280 startup, the generation counters SHOULD be initialized to random 2281 values. An implementation MAY use 12 bits for the connection table 2282 index and 3 bits for the generation counter. (Note that this does 2283 not suggest a 4096 entry connection table for every peer, only the 2284 ability to encode for a larger connection table.) When a connection 2285 table slot is used for a new connection, the generation counter is 2286 incremented (with wrapping). Connection table slots are used on a 2287 rotating basis to maximize the time interval between uses of the same 2288 slot for different connections. When routing a message to an entry 2289 in the destination list encoding a connection table entry, the peer 2290 MUST confirm that the generation counter matches the current 2291 generation counter of that index before forwarding the message. If 2292 it does not match, the message MUST be silently dropped. 2294 6.3.2.3. Forwarding Option 2296 The Forwarding header can be extended with forwarding header options, 2297 which are a series of ForwardingOption structures: 2299 enum { invalidForwardingOptionType(0), (255) } 2300 ForwardingOptionType; 2302 struct { 2303 ForwardingOptionType type; 2304 uint8 flags; 2305 uint16 length; 2306 select (type) { 2307 /* This type may be extended */ 2308 }; 2309 } ForwardingOption; 2311 Each ForwardingOption consists of the following values: 2313 type 2314 The type of the option. This structure allows for unknown options 2315 types. 2317 flags 2318 Three flags are defined FORWARD_CRITICAL(0x01), 2319 DESTINATION_CRITICAL(0x02), and RESPONSE_COPY(0x04). These flags 2320 MUST NOT be set in a response. If the FORWARD_CRITICAL flag is 2321 set, any peer that would forward the message but does not 2322 understand this options MUST reject the request with an 2323 Error_Unsupported_Forwarding_Option error response. If the 2324 DESTINATION_CRITICAL flag is set, any node that generates a 2325 response to the message but does not understand the forwarding 2326 option MUST reject the request with an 2327 Error_Unsupported_Forwarding_Option error response. If the 2328 RESPONSE_COPY flag is set, any node generating a response MUST 2329 copy the option from the request to the response except that the 2330 RESPONSE_COPY, FORWARD_CRITICAL and DESTINATION_CRITICAL flags 2331 MUST be cleared. 2333 length 2334 The length of the rest of the structure. Note that a 0 length may 2335 be reasonable if the mere presence of the option is meaningful and 2336 no value is required. 2338 option 2339 The option value. 2341 6.3.3. Message Contents Format 2343 The second major part of a RELOAD message is the contents part, which 2344 is defined by MessageContents: 2346 enum { invalidMessageExtensionType(0), 2347 (2^16-1) } MessageExtensionType; 2349 struct { 2350 MessageExtensionType type; 2351 Boolean critical; 2352 opaque extension_contents<0..2^32-1>; 2353 } MessageExtension; 2355 struct { 2356 uint16 message_code; 2357 opaque message_body<0..2^32-1>; 2358 MessageExtension extensions<0..2^32-1>; 2359 } MessageContents; 2361 The contents of this structure are as follows: 2363 message_code 2364 This indicates the message that is being sent. The code space is 2365 broken up as follows. 2367 0 Reserved 2369 1 .. 0x7fff Requests and responses. These code points are always 2370 paired, with requests being odd and the corresponding response 2371 being the request code plus 1. Thus, "probe_request" (the 2372 Probe request) has value 1 and "probe_answer" (the Probe 2373 response) has value 2 2375 0x8000 .. 0xfffe Reserved 2377 0xffff Error 2378 The message codes are defined in Section 14.8 2380 message_body 2381 The message body itself, represented as a variable-length string 2382 of bytes. The bytes themselves are dependent on the code value. 2383 See the sections describing the various RELOAD methods (Join, 2384 Update, Attach, Store, Fetch, etc.) for the definitions of the 2385 payload contents. 2387 extensions 2388 Extensions to the message. Currently no extensions are defined, 2389 but new extensions can be defined by the process described in 2390 Section 14.14. 2392 All extensions have the following form: 2394 type 2395 The extension type. 2397 critical 2398 Whether this extension needs to be understood in order to process 2399 the message. If critical = True and the recipient does not 2400 understand the message, it MUST generate an 2401 Error_Unknown_Extension error. If critical = False, the recipient 2402 MAY choose to process the message even if it does not understand 2403 the extension. 2405 extension_contents 2406 The contents of the extension (extension-dependent). 2408 The subsections in Section 6.4.2, Section 6.5 and Section 7 describe 2409 structures that are inserted inside the message_body member, 2410 depending on the value of the message_code value. For example a 2411 message_code value of join_req means that the structure named JoinReq 2412 is inserted inside message_body. This document does not contain a 2413 mapping between message_code values and structure names as the 2414 conversion between the two is obvious. 2416 Similarly this document uses the name of the structure without the 2417 "Req" or "Ans" suffix to mean the execution of a transaction 2418 comprised of the matching request and answer. For example when the 2419 text says "perform an Attach", it must be understood as performing a 2420 transaction composed of an AttachReq and an AttachAns. 2422 6.3.3.1. Response Codes and Response Errors 2424 A node processing a request MUST return its status in the 2425 message_code field. If the request was a success, then the message 2426 code MUST be set to the response code that matches the request (i.e., 2427 the next code up). The response payload is then as defined in the 2428 request/response descriptions. 2430 If the request has failed, then the message code MUST be set to 2431 0xffff (error) and the payload MUST be an error_response message, as 2432 shown below. 2434 When the message code is 0xffff, the payload MUST be an 2435 ErrorResponse. 2437 public struct { 2438 uint16 error_code; 2439 opaque error_info<0..2^16-1>; 2440 } ErrorResponse; 2442 The contents of this structure are as follows: 2444 error_code 2445 A numeric error code indicating the error that occurred. 2447 error_info 2448 An optional arbitrary byte string. Unless otherwise specified, 2449 this will be a UTF-8 text string providing further information 2450 about what went wrong. Developers are encouraged to put enough 2451 diagnostic information to be useful in error_info. The specific 2452 text to be used and any relevant language or encoding thereof is 2453 left to the implementation. 2455 The following error code values are defined. The numeric values for 2456 these are defined in Section 14.9. 2458 Error_Forbidden: The requesting node does not have permission to 2459 make this request. 2461 Error_Not_Found: The resource or node cannot be found or does not 2462 exist. 2464 Error_Request_Timeout: A response to the request has not been 2465 received in a suitable amount of time. The requesting node MAY 2466 resend the request at a later time. 2468 Error_Data_Too_Old: A store cannot be completed because the 2469 storage_time precedes the existing value. 2471 Error_Data_Too_Large: A store cannot be completed because the 2472 requested object exceeds the size limits for that Kind. 2474 Error_Generation_Counter_Too_Low: A store cannot be completed 2475 because the generation counter precedes the existing value. 2477 Error_Incompatible_with_Overlay: A peer receiving the request is 2478 using a different overlay, overlay algorithm, or hash algorithm, 2479 or some other parameter that is inconsistent with the overlay 2480 configuration. 2482 Error_Unsupported_Forwarding_Option: A node receiving the request 2483 with a forwarding options flagged as critical but the node does 2484 not support this option. See section Section 6.3.2.3. 2486 Error_TTL_Exceeded: A peer receiving the request where the TTL got 2487 decremented to zero. See section Section 6.3.2. 2489 Error_Message_Too_Large: A peer receiving the request that was too 2490 large. See section Section 6.6. 2492 Error_Response_Too_Large: A node would have generated a response 2493 that is too large per the max_response_length field. 2495 Error_Config_Too_Old: A destination node received a request with a 2496 configuration sequence that's too old. See Section 6.3.2.1. 2498 Error_Config_Too_New: A destination node received a request with a 2499 configuration sequence that's too new. See Section 6.3.2.1. 2501 Error_Unknown_Kind: A destination peer received a request with an 2502 unknown Kind-ID. See Section 7.4.1.2. 2504 Error_In_Progress: An Attach is already in progress to this peer. 2505 See Section 6.5.1.2. 2507 Error_Unknown_Extension: A destination node received a request with 2508 an unknown extension. 2510 Error_Invalid_Message: Something about this message is invalid but 2511 it doesn't fit the other error codes. When this message is sent, 2512 implementations SHOULD provide some meaningful description in 2513 error_info to aid in debugging. 2515 Error_Exp_A: For the purposes of experimentation. Not meant for 2516 vendor specific use of any sort and MUST NOT be used for 2517 operational deployments. 2519 Error_Exp_B: For the purposes of experimentation. Not meant for 2520 vendor specific use of any sort and MUST NOT be used for 2521 operational deployments. 2523 6.3.4. Security Block 2525 The third part of a RELOAD message is the security block. The 2526 security block is represented by a SecurityBlock structure: 2528 struct { 2529 CertificateType type; 2530 opaque certificate<0..2^16-1>; 2531 } GenericCertificate; 2533 struct { 2534 GenericCertificate certificates<0..2^16-1>; 2535 Signature signature; 2536 } SecurityBlock; 2538 The contents of this structure are: 2540 certificates 2541 A bucket of certificates. 2543 signature 2544 A signature. 2546 The certificates bucket SHOULD contain all the certificates necessary 2547 to verify every signature in both the message and the internal 2548 message objects, except for those certificates in a root-cert element 2549 of the current configuration file. This is the only location in the 2550 message which contains certificates, thus allowing for only a single 2551 copy of each certificate to be sent. In systems that have an 2552 alternative certificate distribution mechanism, some certificates MAY 2553 be omitted. However, unless an alternative mechanism for immediately 2554 generating certificates, such as shared secret security 2555 (Section 13.4) is used, implementors MUST include all referenced 2556 certificates. 2558 NOTE TO IMPLEMENTERS: This requirement implies that a peer storing 2559 data is obligated to retain certificates for the data it holds. 2561 Each certificate is represented by a GenericCertificate structure, 2562 which has the following contents: 2564 type 2565 The type of the certificate, as defined in [RFC6091]. Only the 2566 use of X.509 certificates is defined in this document. 2568 certificate 2569 The encoded version of the certificate. For X.509 certificates, 2570 it is the DER form. 2572 The signature is computed over the payload and parts of the 2573 forwarding header. In case of a Store the payload MUST contain an 2574 additional signature computed as described in Section 7.1. All 2575 signatures MUST be formatted using the Signature element. This 2576 element is also used in other contexts where signatures are needed. 2577 The input structure to the signature computation MAY vary depending 2578 on the data element being signed. 2580 enum { invalidSignerIdentityType(0), 2581 cert_hash(1), cert_hash_node_id(2), 2582 none(3) 2583 (255) } SignerIdentityType; 2585 struct { 2586 select (identity_type) { 2588 case cert_hash; 2589 HashAlgorithm hash_alg; // From TLS 2590 opaque certificate_hash<0..2^8-1>; 2592 case cert_hash_node_id: 2593 HashAlgorithm hash_alg; // From TLS 2594 opaque certificate_node_id_hash<0..2^8-1>; 2596 case none: 2597 /* empty */ 2598 /* This structure may be extended with new types if necessary*/ 2599 }; 2600 } SignerIdentityValue; 2602 struct { 2603 SignerIdentityType identity_type; 2604 uint16 length; 2605 SignerIdentityValue identity[SignerIdentity.length]; 2606 } SignerIdentity; 2608 struct { 2609 SignatureAndHashAlgorithm algorithm; // From TLS 2610 SignerIdentity identity; 2611 opaque signature_value<0..2^16-1>; 2612 } Signature; 2614 The Signature construct contains the following values: 2616 algorithm 2617 The signature algorithm in use. The algorithm definitions are 2618 found in the IANA TLS SignatureAlgorithm and HashAlgorithm 2619 Registries. All implementations MUST support RSASSA-PKCS1-v1_5 2620 [RFC3447] signatures with SHA-256 hashes. 2622 identity 2623 The identity, as defined in the two paragraphes following this 2624 list, used to form the signature. 2626 signature_value 2627 The value of the signature. 2628 Note that storage operations allow for special values of algorithm 2629 and identity. See Store Request Definition (Section 7.4.1.1) and 2630 Fetch Response Definition (Section 7.4.2.2). 2632 There are two permitted identity formats, one for a certificate with 2633 only one Node-ID and one for a certificate with multiple Node-IDs. 2634 In the first case, the cert_hash type MUST be used. The hash_alg 2635 field is used to indicate the algorithm used to produce the hash. 2636 The certificate_hash contains the hash of the certificate object 2637 (i.e., the DER-encoded certificate). 2639 In the second case, the cert_hash_node_id type MUST be used. The 2640 hash_alg is as in cert_hash but the cert_hash_node_id is computed 2641 over the NodeId used to sign concatenated with the certificate. 2642 I.e., H(NodeId || certificate). The NodeId is represented without 2643 any framing or length fields, as simple raw bytes. This is safe 2644 because NodeIds are fixed-length for a given overlay. 2646 For signatures over messages the input to the signature is computed 2647 over: 2649 overlay || transaction_id || MessageContents || SignerIdentity 2651 where overlay and transaction_id come from the forwarding header and 2652 || indicates concatenation. 2654 The input to signatures over data values is different, and is 2655 described in Section 7.1. 2657 All RELOAD messages MUST be signed. Intermediate nodes do not verify 2658 signatures. Upon receipt (and fragment reassembly if needed) the 2659 destination node MUST verify the signature and the authorizing 2660 certificate. If the signature fails, the implementation SHOULD 2661 simply drop the message and MUST NOT process it. This check provides 2662 a minimal level of assurance that the sending node is a valid part of 2663 the overlay as well as cryptographic authentication of the sending 2664 node. In addition, responses MUST be checked as follows by the 2665 requesting node: 2667 1. The response to a message sent to a specific Node-ID MUST have 2668 been sent by that Node-ID. 2670 2. The response to a message sent to a Resource-ID MUST have been 2671 sent by a Node-ID which is as close to or closer to the target 2672 Resource-ID than any node in the requesting node's neighbor 2673 table. 2675 The second condition serves as a primitive check for responses from 2676 wildly wrong nodes but is not a complete check. Note that in periods 2677 of churn, it is possible for the requesting node to obtain a closer 2678 neighbor while the request is outstanding. This will cause the 2679 response to be rejected and the request to be retransmitted. 2681 In addition, some methods (especially Store) have additional 2682 authentication requirements, which are described in the sections 2683 covering those methods. 2685 6.4. Overlay Topology 2687 As discussed in previous sections RELOAD defines a default overlay 2688 topology (CHORD-RELOAD) but allows for other topologies through the 2689 use of Topology Plugins. This section describes the requirements for 2690 new topology plugins and the methods that RELOAD provides for overlay 2691 topology maintenance. 2693 6.4.1. Topology Plugin Requirements 2695 When specifying a new overlay algorithm, at least the following MUST 2696 be described: 2698 o Joining procedures, including the contents of the Join message. 2699 o Stabilization procedures, including the contents of the Update 2700 message, the frequency of topology probes and keepalives, and the 2701 mechanism used to detect when peers have disconnected. 2702 o Exit procedures, including the contents of the Leave message. 2703 o The length of the Resource-IDs. For DHTs, the hash algorithm to 2704 compute the hash of an identifier. 2705 o The procedures that peers use to route messages. 2706 o The replication strategy used to ensure data redundancy. 2708 All overlay algorithms MUST specify maintenance procedures that send 2709 Updates to clients and peers that have established connections to the 2710 peer responsible for a particular ID when the responsibility for that 2711 ID changes. Because tracking this information is difficult, overlay 2712 algorithms MAY simply specify that an Update is sent to all members 2713 of the Connection Table whenever the range of IDs for which the peer 2714 is responsible changes. 2716 6.4.2. Methods and types for use by topology plugins 2718 This section describes the methods that topology plugins use to join, 2719 leave, and maintain the overlay. 2721 6.4.2.1. Join 2723 A new peer (but one that already has credentials) uses the JoinReq 2724 message to join the overlay. The JoinReq is sent to the responsible 2725 peer depending on the routing mechanism described in the topology 2726 plugin. This notifies the responsible peer that the new peer is 2727 taking over some of the overlay and it needs to synchronize its 2728 state. 2730 struct { 2731 NodeId joining_peer_id; 2732 opaque overlay_specific_data<0..2^16-1>; 2733 } JoinReq; 2735 The minimal JoinReq contains only the Node-ID which the sending peer 2736 wishes to assume. Overlay algorithms MAY specify other data to 2737 appear in this request. Receivers of the JoinReq MUST verify that 2738 the joining_peer_id field matches the Node-ID used to sign the 2739 message and if not MUST reject the message with an Error_Forbidden 2740 error. 2742 Because joins may only be executed between nodes which are directly 2743 adjacent, receiving peers MUST verify that any JoinReq they receive 2744 arrives from a transport channel that is bound to the Node-ID to be 2745 assumed by the joining node. This also prevents replay attacks 2746 provided that DTLS anti-replay is used. 2748 If the request succeeds, the responding peer responds with a JoinAns 2749 message, as defined below: 2751 struct { 2752 opaque overlay_specific_data<0..2^16-1>; 2753 } JoinAns; 2755 If the request succeeds, the responding peer MUST follow up by 2756 executing the right sequence of Stores and Updates to transfer the 2757 appropriate section of the overlay space to the joining node. In 2758 addition, overlay algorithms MAY define data to appear in the 2759 response payload that provides additional info. 2761 Joining nodes MUST verify that the signature on the JoinAns message 2762 matches the expected target (i.e., the adjacency over which they are 2763 joining.) If not, they MUST discard the message. 2765 In general, nodes which cannot form connections SHOULD report an 2766 error to the user. However, implementations MUST provide some 2767 mechanism whereby nodes can determine that they are potentially the 2768 first node and take responsibility for the overlay (the idea is to 2769 avoid having ordinary nodes try to become responsible for the entire 2770 overlay during a partition.) This specification does not mandate any 2771 particular mechanism, but a configuration flag or setting seems 2772 appropriate. 2774 6.4.2.2. Leave 2776 The LeaveReq message is used to indicate that a node is exiting the 2777 overlay. A node SHOULD send this message to each peer with which it 2778 is directly connected prior to exiting the overlay. 2780 struct { 2781 NodeId leaving_peer_id; 2782 opaque overlay_specific_data<0..2^16-1>; 2783 } LeaveReq; 2785 LeaveReq contains only the Node-ID of the leaving peer. Overlay 2786 algorithms MAY specify other data to appear in this request. 2787 Receivers of the LeaveReq MUST verify that the leaving_peer_id field 2788 matches the Node-ID used to sign the message and if not MUST reject 2789 the message with an Error_Forbidden error. 2791 Because leaves may only be executed between nodes which are directly 2792 adjacent, receiving peers MUST verify that any LeaveReq they receive 2793 arrives from a transport channel that is bound to the Node-ID to be 2794 assumed by the leaving peer.) This also prevents replay attacks 2795 provided that DTLS anti-replay is used. 2797 Upon receiving a Leave request, a peer MUST update its own routing 2798 table, and send the appropriate Store/Update sequences to re- 2799 stabilize the overlay. 2801 6.4.2.3. Update 2803 Update is the primary overlay-specific maintenance message. It is 2804 used by the sender to notify the recipient of the sender's view of 2805 the current state of the overlay (its routing state), and it is up to 2806 the recipient to take whatever actions are appropriate to deal with 2807 the state change. In general, peers send Update messages to all 2808 their adjacencies whenever they detect a topology shift. 2810 When a peer receives an Attach request with the send_update flag set 2811 to True (Section 6.4.2.4.1), it MUST send an Update message back to 2812 the sender of the Attach request after the completion of the 2813 corresponding ICE check and TLS connection. Note that the sender of 2814 a such Attach request may not have joined the overlay yet. 2816 When a peer detects through an Update that it is no longer 2817 responsible for any data value it is storing, it MUST attempt to 2818 Store a copy to the correct node unless it knows the newly 2819 responsible node already has a copy of the data. This prevents data 2820 loss during large-scale topology shifts such as the merging of 2821 partitioned overlays. 2823 The contents of the UpdateReq message are completely overlay- 2824 specific. The UpdateAns response is expected to be either success or 2825 an error. 2827 6.4.2.4. RouteQuery 2829 The RouteQuery request allows the sender to ask a peer where they 2830 would route a message directed to a given destination. In other 2831 words, a RouteQuery for a destination X requests the Node-ID for the 2832 node that the receiving peer would next route to in order to get to 2833 X. A RouteQuery can also request that the receiving peer initiate an 2834 Update request to transfer the receiving peer's routing table. 2836 One important use of the RouteQuery request is to support iterative 2837 routing. The sender selects one of the peers in its routing table 2838 and sends it a RouteQuery message with the destination field set to 2839 the Node-ID or Resource-ID it wishes to route to. The receiving peer 2840 responds with information about the peers to which the request would 2841 be routed. The sending peer MAY then use the Attach method to attach 2842 to that peer(s), and repeat the RouteQuery. Eventually, the sender 2843 gets a response from a peer that is closest to the identifier in the 2844 destination field as determined by the topology plugin. At that 2845 point, the sender can send messages directly to that peer. 2847 6.4.2.4.1. Request Definition 2849 A RouteQueryReq message indicates the peer or resource that the 2850 requesting node is interested in. It also contains a "send_update" 2851 option allowing the requesting node to request a full copy of the 2852 other peer's routing table. 2854 struct { 2855 Boolean send_update; 2856 Destination destination; 2857 opaque overlay_specific_data<0..2^16-1>; 2859 } RouteQueryReq; 2861 The contents of the RouteQueryReq message are as follows: 2863 send_update 2864 A single byte. This may be set to True to indicate that the 2865 requester wishes the responder to initiate an Update request 2866 immediately. Otherwise, this value MUST be set to False. 2868 destination 2869 The destination which the requester is interested in. This may be 2870 any valid destination object, including a Node-ID, opaque ID, or 2871 Resource-ID. 2873 overlay_specific_data 2874 Other data as appropriate for the overlay. 2876 6.4.2.4.2. Response Definition 2878 A response to a successful RouteQueryReq request is a RouteQueryAns 2879 message. This is completely overlay specific. 2881 6.4.2.5. Probe 2883 Probe provides primitive "exploration" services: it allows a node to 2884 determine which resources another node is responsible for. A probe 2885 can be addressed to a specific Node-ID, or the peer controlling a 2886 given location (by using a Resource-ID). In either case, the target 2887 Node-IDs respond with a simple response containing some status 2888 information. 2890 6.4.2.5.1. Request Definition 2892 The ProbeReq message contains a list (potentially empty) of the 2893 pieces of status information that the requester would like the 2894 responder to provide. 2896 enum { invalidProbeInformationType(0), responsible_set(1), 2897 num_resources(2), uptime(3), (255) } 2898 ProbeInformationType; 2900 struct { 2901 ProbeInformationType requested_info<0..2^8-1>; 2902 } ProbeReq; 2904 The currently defined values for ProbeInformation are: 2906 responsible_set 2907 indicates that the peer should Respond with the fraction of the 2908 overlay for which the responding peer is responsible. 2910 num_resources 2911 indicates that the peer should Respond with the number of 2912 resources currently being stored by the peer. 2914 uptime 2915 indicates that the peer should Respond with how long the peer has 2916 been up in seconds. 2918 6.4.2.5.2. Response Definition 2920 A successful ProbeAns response contains the information elements 2921 requested by the peer. 2923 struct { 2924 select (type) { 2925 case responsible_set: 2926 uint32 responsible_ppb; 2928 case num_resources: 2929 uint32 num_resources; 2931 case uptime: 2932 uint32 uptime; 2934 /* This type may be extended */ 2936 }; 2937 } ProbeInformationData; 2939 struct { 2940 ProbeInformationType type; 2941 uint8 length; 2942 ProbeInformationData value; 2943 } ProbeInformation; 2945 struct { 2946 ProbeInformation probe_info<0..2^16-1>; 2947 } ProbeAns; 2949 A ProbeAns message contains a sequence of ProbeInformation 2950 structures. Each has a "length" indicating the length of the 2951 following value field. This structure allows for unknown option 2952 types. 2954 Each of the current possible Probe information types is a 32-bit 2955 unsigned integer. For type "responsible_ppb", it is the fraction of 2956 the overlay for which the peer is responsible in parts per billion. 2957 For type "num_resources", it is the number of resources the peer is 2958 storing. For the type "uptime" it is the number of seconds the peer 2959 has been up. 2961 The responding peer SHOULD include any values that the requesting 2962 node requested and that it recognizes. They SHOULD be returned in 2963 the requested order. Any other values MUST NOT be returned. 2965 6.5. Forwarding and Link Management Layer 2967 Each node maintains connections to a set of other nodes defined by 2968 the topology plugin. This section defines the methods RELOAD uses to 2969 form and maintain connections between nodes in the overlay. Three 2970 methods are defined: 2972 Attach: used to form RELOAD connections between nodes using ICE 2973 for NAT traversal. When node A wants to connect to node B, it 2974 sends an Attach message to node B through the overlay. The Attach 2975 contains A's ICE parameters. B responds with its ICE parameters 2976 and the two nodes perform ICE to form connection. Attach also 2977 allows two nodes to connect via No-ICE instead of full ICE. 2979 AppAttach: used to form application layer connections between 2980 nodes. 2982 Ping: is a simple request/response which is used to verify 2983 connectivity of the target peer. 2985 6.5.1. Attach 2987 A node sends an Attach request when it wishes to establish a direct 2988 TCP or UDP connection to another node for the purpose of sending 2989 RELOAD messages. A client that can establish a connection directly 2990 need not send an Attach as described in the second bullet of 2991 Section 3.2.1 2993 As described in Section 6.1, an Attach may be routed to either a 2994 Node-ID or to a Resource-ID. An Attach routed to a specific Node-ID 2995 will fail if that node is not reached. An Attach routed to a 2996 Resource-ID will establish a connection with the peer currently 2997 responsible for that Resource-ID, which may be useful in establishing 2998 a direct connection to the responsible peer for use with frequent or 2999 large resource updates. 3001 An Attach in and of itself does not result in updating the routing 3002 table of either node. That function is performed by Updates. If 3003 node A has Attached to node B, but not received any Updates from B, 3004 it MAY route messages which are directly addressed to B through that 3005 channel but MUST NOT route messages through B to other peers via that 3006 channel. The process of Attaching is separate from the process of 3007 becoming a peer (using Join and Update), to prevent half-open states 3008 where a node has started to form connections but is not really ready 3009 to act as a peer. Thus, clients (unlike peers) can simply Attach 3010 without sending Join or Update. 3012 6.5.1.1. Request Definition 3014 An Attach request message contains the requesting node ICE connection 3015 parameters formatted into a binary structure. 3017 enum { invalidOverlayLinkType(0), DTLS-UDP-SR(1), 3018 DTLS-UDP-SR-NO-ICE(3), TLS-TCP-FH-NO-ICE(4), 3019 (255) } OverlayLinkType; 3021 enum { invalidCandType(0), 3022 host(1), srflx(2), prflx(3), relay(4), 3023 (255) } CandType; 3025 struct { 3026 opaque name<0..2^16-1>; 3027 opaque value<0..2^16-1>; 3028 } IceExtension; 3030 struct { 3031 IpAddressPort addr_port; 3032 OverlayLinkType overlay_link; 3033 opaque foundation<0..255>; 3034 uint32 priority; 3035 CandType type; 3036 select (type) { 3037 case host: 3038 ; /* Empty */ 3039 case srflx: 3040 case prflx: 3041 case relay: 3042 IpAddressPort rel_addr_port; 3043 }; 3044 IceExtension extensions<0..2^16-1>; 3045 } IceCandidate; 3047 struct { 3048 opaque ufrag<0..2^8-1>; 3049 opaque password<0..2^8-1>; 3050 opaque role<0..2^8-1>; 3051 IceCandidate candidates<0..2^16-1>; 3052 Boolean send_update; 3053 } AttachReqAns; 3055 The values contained in AttachReqAns are: 3057 ufrag 3058 The username fragment (from ICE). 3060 password 3061 The ICE password. 3063 role 3064 An active/passive/actpass attribute from RFC 4145 [RFC4145]. This 3065 value MUST be 'passive' for the offerer (the peer sending the 3066 Attach request) and 'active' for the answerer (the peer sending 3067 the Attach response). 3069 candidates 3070 One or more ICE candidate values, as described below. 3072 send_update 3073 Has the same meaning as the send_update field in RouteQueryReq. 3075 Each ICE candidate is represented as an IceCandidate structure, which 3076 is a direct translation of the information from the ICE string 3077 structures, with the exception of the component ID. Since there is 3078 only one component, it is always 1, and thus left out of the 3079 structure. The remaining values are specified as follows: 3081 addr_port 3082 corresponds to the ICE connection-address and port productions. 3084 overlay_link 3085 corresponds to the ICE transport production, Overlay Link 3086 protocols used with No-ICE MUST specify "No-ICE" in their 3087 description. Future overlay link values can be added by defining 3088 new OverlayLinkType values in the IANA registry in Section 14.10. 3089 Future extensions to the encapsulation or framing that provide for 3090 backward compatibility with that specified by a previously defined 3091 OverlayLinkType values MUST use that previous value. 3092 OverlayLinkType protocols are defined in Section 6.6 3093 A single AttachReqAns MUST NOT include both candidates whose 3094 OverlayLinkType protocols use ICE (the default) and candidates 3095 that specify "No-ICE". 3097 foundation 3098 corresponds to the ICE foundation production. 3100 priority 3101 corresponds to the ICE priority production. 3103 type 3104 corresponds to the ICE cand-type production. 3106 rel_addr_port 3107 corresponds to the ICE rel-addr and rel-port productions. Only 3108 present for types "relay", "srflx" and "prflx". 3110 extensions 3111 ICE extensions. The name and value fields correspond to binary 3112 translations of the equivalent fields in the ICE extensions. 3114 These values should be generated using the procedures described in 3115 Section 6.5.1.3. 3117 6.5.1.2. Response Definition 3119 If a peer receives an Attach request, it MUST determine how to 3120 process the request as follows: 3122 o If it has not initiated an Attach request to the originating peer 3123 of this Attach request, it MUST process this request and SHOULD 3124 generate its own response with an AttachReqAns. It should then 3125 begin ICE checks. 3126 o If it has already sent an Attach request to and received the 3127 response from the originating peer of this Attach request, and as 3128 a result, an ICE check and TLS connection is in progress, then it 3129 SHOULD generate an Error_In_Progress error instead of an 3130 AttachReqAns. 3131 o If it has already sent an Attach request to but not yet received 3132 the response from the originating peer of this Attach request, it 3133 SHOULD apply the following tie-breaker heuristic to determine how 3134 to handle this Attach request and the incomplete Attach request it 3135 has sent out: 3136 * If the peer's own Node-ID is smaller when compared as big- 3137 endian unsigned integers, it MUST cancel its own incomplete 3138 Attach request. It MUST then process this Attach request, 3139 generate an AttachReqAns response, and proceed with the 3140 corresponding ICE check. 3141 * If the peer's own Node-ID is larger when compared as big-endian 3142 unsigned integers, it MUST generate an Error_In_Progress error 3143 to this Attach request, then proceed to wait for and complete 3144 the Attach and the corresponding ICE check it has originated. 3145 o If the peer is overloaded or detects some other kind of error, it 3146 MAY generate an error instead of an AttachReqAns. 3148 When a peer receives an Attach response, it SHOULD parse the response 3149 and begin its own ICE checks. 3151 6.5.1.3. Using ICE With RELOAD 3153 This section describes the profile of ICE that is used with RELOAD. 3154 RELOAD implementations MUST implement full ICE. 3156 In ICE as defined by [RFC5245], SDP is used to carry the ICE 3157 parameters. In RELOAD, this function is performed by a binary 3158 encoding in the Attach method. This encoding is more restricted than 3159 the SDP encoding because the RELOAD environment is simpler: 3161 o Only a single media stream is supported. 3162 o In this case, the "stream" refers not to RTP or other types of 3163 media, but rather to a connection for RELOAD itself or other 3164 application-layer protocols such as SIP. 3165 o RELOAD only allows for a single offer/answer exchange. Unlike the 3166 usage of ICE within SIP, there is never a need to send a 3167 subsequent offer to update the default candidates to match the 3168 ones selected by ICE. 3170 An agent follows the ICE specification as described in [RFC5245] with 3171 the changes and additional procedures described in the subsections 3172 below. 3174 6.5.1.4. Collecting STUN Servers 3176 ICE relies on the node having one or more STUN servers to use. In 3177 conventional ICE, it is assumed that nodes are configured with one or 3178 more STUN servers through some out of band mechanism. This is still 3179 possible in RELOAD but RELOAD also learns STUN servers as it connects 3180 to other peers. Because all RELOAD peers implement ICE and use STUN 3181 keepalives, every peer is a capable of responding to STUN Binding 3182 requests [RFC5389]. Accordingly, any peer that a node knows about 3183 can be used like a STUN server -- though of course it may be behind a 3184 NAT. 3186 A peer on a well-provisioned wide-area overlay will be configured 3187 with one or more bootstrap nodes. These nodes make an initial list 3188 of STUN servers. However, as the peer forms connections with 3189 additional peers, it builds more peers it can use like STUN servers. 3191 Because complicated NAT topologies are possible, a peer may need more 3192 than one STUN server. Specifically, a peer that is behind a single 3193 NAT will typically observe only two IP addresses in its STUN checks: 3194 its local address and its server reflexive address from a STUN server 3195 outside its NAT. However, if there are more NATs involved, it may 3196 learn additional server reflexive addresses (which vary based on 3197 where in the topology the STUN server is). To maximize the chance of 3198 achieving a direct connection, a peer SHOULD group other peers by the 3199 peer-reflexive addresses it discovers through them. It SHOULD then 3200 select one peer from each group to use as a STUN server for future 3201 connections. 3203 Only peers to which the peer currently has connections may be used. 3204 If the connection to that host is lost, it MUST be removed from the 3205 list of STUN servers and a new server from the same group MUST be 3206 selected unless there are no others servers in the group in which 3207 case some other peer MAY be used. 3209 6.5.1.5. Gathering Candidates 3211 When a node wishes to establish a connection for the purposes of 3212 RELOAD signaling or application signaling, it follows the process of 3213 gathering candidates as described in Section 4 of ICE [RFC5245]. 3214 RELOAD utilizes a single component. Consequently, gathering for 3215 these "streams" requires a single component. In the case where a 3216 node has not yet found a TURN server, the agent would not include a 3217 relayed candidate. 3219 The ICE specification assumes that an ICE agent is configured with, 3220 or somehow knows of, TURN and STUN servers. RELOAD provides a way 3221 for an agent to learn these by querying the overlay, as described in 3222 Section 6.5.1.4 and Section 9. 3224 The default candidate selection described in Section 4.1.4 of ICE is 3225 ignored; defaults are not signaled or utilized by RELOAD. 3227 An alternative to using the full ICE supported by the Attach request 3228 is to use No-ICE mechanism by providing candidates with "No-ICE" 3229 Overlay Link protocols. Configuration for the overlay indicates 3230 whether or not these Overlay Link protocols can be used. An overlay 3231 MUST be either all ICE or all No-ICE. 3233 No-ICE will not work in all of the scenarios where ICE would work, 3234 but in some cases, particularly those with no NATs or firewalls, it 3235 will work. 3237 6.5.1.6. Prioritizing Candidates 3239 However, standardization of additional protocols for use with ICE is 3240 expected, including TCP [RFC6544] and protocols such as SCTP 3241 [RFC4960] and DCCP [RFC4340]. UDP encapsulations for SCTP and DCCP 3242 would expand the available Overlay Link protocols available for 3243 RELOAD. When additional protocols are available, the following 3244 prioritization is RECOMMENDED: 3246 o Highest priority is assigned to protocols that offer well- 3247 understood congestion and flow control without head of line 3248 blocking. For example, SCTP without message ordering, DCCP, or 3249 those protocols encapsulated using UDP. 3250 o Second highest priority is assigned to protocols that offer well- 3251 understood congestion and flow control but have head of line 3252 blocking such as TCP. 3253 o Lowest priority is assigned to protocols encapsulated over UDP 3254 that do not implement well-established congestion control 3255 algorithms. The DTLS/UDP with SR overlay link protocol is an 3256 example of such a protocol. 3258 Head of line blocking is undesirable in an Overlay Link protocol 3259 because the messages carried on a RELOAD link are independent, rather 3260 than stream-oriented. Therefore, if message N on a link is lost, 3261 delaying message N+1 on that same link until N is successfully 3262 retransmitted does nothing other than increase the latency for the 3263 transaction of message N+1 as they are unrelated to each other. 3264 Therefore, while the high quality, performance, and availability of 3265 modern TCP implementations makes them very attractive, their 3266 performance as an Overlay Link protocol is not optimal. 3268 6.5.1.7. Encoding the Attach Message 3270 Section 4.3 of ICE describes procedures for encoding the SDP for 3271 conveying RELOAD candidates. Instead of actually encoding an SDP 3272 message, the candidate information (IP address and port and transport 3273 protocol, priority, foundation, type and related address) is carried 3274 within the attributes of the Attach request or its response. 3275 Similarly, the username fragment and password are carried in the 3276 Attach message or its response. Section 6.5.1 describes the detailed 3277 attribute encoding for Attach. The Attach request and its response 3278 do not contain any default candidates or the ice-lite attribute, as 3279 these features of ICE are not used by RELOAD. 3281 Since the Attach request contains the candidate information and short 3282 term credentials, it is considered as an offer for a single media 3283 stream that happens to be encoded in a format different than SDP, but 3284 is otherwise considered a valid offer for the purposes of following 3285 the ICE specification. Similarly, the Attach response is considered 3286 a valid answer for the purposes of following the ICE specification. 3288 6.5.1.8. Verifying ICE Support 3290 An agent MUST skip the verification procedures in Section 5.1 and 6.1 3291 of ICE. Since RELOAD requires full ICE from all agents, this check 3292 is not required. 3294 6.5.1.9. Role Determination 3296 The roles of controlling and controlled as described in Section 5.2 3297 of ICE are still utilized with RELOAD. However, the offerer (the 3298 entity sending the Attach request) will always be controlling, and 3299 the answerer (the entity sending the Attach response) will always be 3300 controlled. The connectivity checks MUST still contain the ICE- 3301 CONTROLLED and ICE-CONTROLLING attributes, however, even though the 3302 role reversal capability for which they are defined will never be 3303 needed with RELOAD. This is to allow for a common codebase between 3304 ICE for RELOAD and ICE for SDP. 3306 6.5.1.10. Full ICE 3308 When the overlay uses ICE, connectivity checks and nominations are 3309 used as in regular ICE. 3311 6.5.1.10.1. Connectivity Checks 3313 The processes of forming check lists in Section 5.7 of ICE, 3314 scheduling checks in Section 5.8, and checking connectivity checks in 3315 Section 7 are used with RELOAD without change. 3317 6.5.1.10.2. Concluding ICE 3319 The procedures in Section 8 of ICE are followed to conclude ICE, with 3320 the following exceptions: 3322 o The controlling agent MUST NOT attempt to send an updated offer 3323 once the state of its single media stream reaches Completed. 3324 o Once the state of ICE reaches Completed, the agent can immediately 3325 free all unused candidates. This is because RELOAD does not have 3326 the concept of forking, and thus the three second delay in Section 3327 8.3 of ICE does not apply. 3329 6.5.1.10.3. Media Keepalives 3331 STUN MUST be utilized for the keepalives described in Section 10 of 3332 ICE. 3334 6.5.1.11. No-ICE 3336 No-ICE is selected when either side has provided "no ICE" Overlay 3337 Link candidates. STUN is not used for connectivity checks when doing 3338 No-ICE; instead the DTLS or TLS handshake (or similar security layer 3339 of future overlay link protocols) forms the connectivity check. The 3340 certificate exchanged during the (D)TLS handshake MUST match the node 3341 that sent the AttachReqAns and if it does not, the connection MUST be 3342 closed. 3344 6.5.1.12. Subsequent Offers and Answers 3346 An agent MUST NOT send a subsequent offer or answer. Thus, the 3347 procedures in Section 9 of ICE MUST be ignored. 3349 6.5.1.13. Sending Media 3351 The procedures of Section 11 of ICE apply to RELOAD as well. 3352 However, in this case, the "media" takes the form of application 3353 layer protocols (e.g. RELOAD) over TLS or DTLS. Consequently, once 3354 ICE processing completes, the agent will begin TLS or DTLS procedures 3355 to establish a secure connection. The node which sent the Attach 3356 request MUST be the TLS server. The other node MUST be the TLS 3357 client. The server MUST request TLS client authentication. The 3358 nodes MUST verify that the certificate presented in the handshake 3359 matches the identity of the other peer as found in the Attach 3360 message. Once the TLS or DTLS signaling is complete, the application 3361 protocol is free to use the connection. 3363 The concept of a previous selected pair for a component does not 3364 apply to RELOAD, since ICE restarts are not possible with RELOAD. 3366 6.5.1.14. Receiving Media 3368 An agent MUST be prepared to receive packets for the application 3369 protocol (TLS or DTLS carrying RELOAD) at any time. The jitter and 3370 RTP considerations in Section 11 of ICE do not apply to RELOAD. 3372 6.5.2. AppAttach 3374 A node sends an AppAttach request when it wishes to establish a 3375 direct connection to another node for the purposes of sending 3376 application layer messages. AppAttach is nearly identical to Attach, 3377 except for the purpose of the connection: it is used to transport 3378 non-RELOAD "media". A separate request is used to avoid implementor 3379 confusion between the two methods (this was found to be a real 3380 problem with initial implementations). The AppAttach request and its 3381 response contain an application attribute, which indicates what 3382 protocol is to be run over the connection. 3384 6.5.2.1. Request Definition 3386 An AppAttachReq message contains the requesting node's ICE connection 3387 parameters formatted into a binary structure. 3389 struct { 3390 opaque ufrag<0..2^8-1>; 3391 opaque password<0..2^8-1>; 3392 uint16 application; 3393 opaque role<0..2^8-1>; 3394 IceCandidate candidates<0..2^16-1>; 3395 } AppAttachReq; 3397 The values contained in AppAttachReq and AppAttachAns are: 3399 ufrag 3400 The username fragment (from ICE) 3402 password 3403 The ICE password. 3405 application 3406 A 16-bit application-id as defined in the Section 14.5. This 3407 number represents the IANA registered application that is going to 3408 send data on this connection. 3410 role 3411 An active/passive/actpass attribute from RFC 4145 [RFC4145]. 3413 candidates 3414 One or more ICE candidate values 3416 The application using connection set up with this request is 3417 responsible for providing sufficiently frequent keep traffic for NAT 3418 and Firewall keep alive and for deciding when to close the 3419 connection. 3421 6.5.2.2. Response Definition 3423 If a peer receives an AppAttach request, it SHOULD process the 3424 request and generate its own response with a AppAttachAns. It should 3425 then begin ICE checks. When a peer receives an AppAttach response, 3426 it SHOULD parse the response and begin its own ICE checks. If the 3427 application ID is not supported, the peer MUST reply with an 3428 Error_Not_Found error. 3430 struct { 3431 opaque ufrag<0..2^8-1>; 3432 opaque password<0..2^8-1>; 3433 uint16 application; 3434 opaque role<0..2^8-1>; 3435 IceCandidate candidates<0..2^16-1>; 3437 } AppAttachAns; 3439 The meaning of the fields is the same as in the AppAttachReq. 3441 6.5.3. Ping 3443 Ping is used to test connectivity along a path. A ping can be 3444 addressed to a specific Node-ID, to the peer controlling a given 3445 location (by using a Resource-ID) or to the wildcard Node-ID. 3447 6.5.3.1. Request Definition 3449 struct { 3450 opaque<0..2^16-1> padding; 3451 } PingReq; 3453 The Ping request is empty of meaningful contents. However, it may 3454 contain up to 65535 bytes of padding to facilitate the discovery of 3455 overlay maximum packet sizes. 3457 6.5.3.2. Response Definition 3459 A successful PingAns response contains the information elements 3460 requested by the peer. 3462 struct { 3463 uint64 response_id; 3464 uint64 time; 3465 } PingAns; 3467 A PingAns message contains the following elements: 3469 response_id 3470 A randomly generated 64-bit response ID. This is used to 3471 distinguish Ping responses. 3473 time 3474 The time when the Ping response was created represented in the 3475 same way as storage_time defined in Section 7. 3477 6.5.4. ConfigUpdate 3479 The ConfigUpdate method is used to push updated configuration data 3480 across the overlay. Whenever a node detects that another node has 3481 old configuration data, it MUST generate a ConfigUpdate request. The 3482 ConfigUpdate request allows updating of two kinds of data: the 3483 configuration data (Section 6.3.2.1) and the Kind information 3484 (Section 7.4.1.1). 3486 6.5.4.1. Request Definition 3488 enum { invalidConfigUpdateType(0), config(1), kind(2), (255) } 3489 ConfigUpdateType; 3491 typedef uint32 KindId; 3492 typedef opaque KindDescription<0..2^16-1>; 3494 struct { 3495 ConfigUpdateType type; 3496 uint32 length; 3498 select (type) { 3499 case config: 3500 opaque config_data<0..2^24-1>; 3502 case kind: 3503 KindDescription kinds<0..2^24-1>; 3505 /* This structure may be extended with new types*/ 3506 }; 3507 } ConfigUpdateReq; 3509 The ConfigUpdateReq message contains the following elements: 3511 type 3512 The type of the contents of the message. This structure allows 3513 for unknown content types. 3514 length 3515 The length of the remainder of the message. This is included to 3516 preserve backward compatibility and is 32 bits instead of 24 to 3517 facilitate easy conversion between network and host byte order. 3518 config_data (type==config) 3519 The contents of the configuration document. 3521 kinds (type==kind) 3522 One or more XML kind-block productions (see Section 11.1). These 3523 MUST be encoded with UTF-8 and assume a default namespace of 3524 "urn:ietf:params:xml:ns:p2p:config-base". 3526 6.5.4.2. Response Definition 3528 struct { 3529 } ConfigUpdateAns; 3531 If the ConfigUpdateReq is of type "config" it MUST only be processed 3532 if all the following are true: 3533 o The sequence number in the document is greater than the current 3534 configuration sequence number. 3535 o The configuration document is correctly digitally signed (see 3536 Section 11 for details on signatures. 3537 Otherwise appropriate errors MUST be generated. 3539 If the ConfigUpdateReq is of type "kind" it MUST only be processed if 3540 it is correctly digitally signed by an acceptable Kind signer (i.e., 3541 one listed in the current configuration file). Details on kind- 3542 signer field in the configuration file is described in Section 11.1. 3543 In addition, if the Kind update conflicts with an existing known Kind 3544 (i.e., it is signed by a different signer), then it should be 3545 rejected with "Error_Forbidden". This should not happen in correctly 3546 functioning overlays. 3548 If the update is acceptable, then the node MUST reconfigure itself to 3549 match the new information. This may include adding permissions for 3550 new Kinds, deleting old Kinds, or even, in extreme circumstances, 3551 exiting and reentering the overlay, if, for instance, the DHT 3552 algorithm has changed. 3554 If an implementation misses enough ConfigUpdates which include key 3555 changes, it is possible that it will no longer be able to verify new 3556 valid ConfigUpdates. In that case, the only available recovery 3557 mechanism is to attempt to retrieve a new configuration document, 3558 typically by the mechanisms it would use for initial bootstrapping. 3559 It is up to implementors whether or how to decide to employ this sort 3560 of recovery mechanism. 3562 The response for ConfigUpdate is empty. 3564 6.6. Overlay Link Layer 3566 RELOAD can use multiple Overlay Link protocols to send its messages. 3567 Because ICE is used to establish connections (see Section 6.5.1.3), 3568 RELOAD nodes are able to detect which Overlay Link protocols are 3569 offered by other nodes and establish connections between them. Any 3570 link protocol needs to be able to establish a secure, authenticated 3571 connection and to provide data origin authentication and message 3572 integrity for individual data elements. RELOAD currently supports 3573 three Overlay Link protocols: 3575 o DTLS [RFC6347] over UDP with Simple Reliability (SR) 3576 (OverlayLinkType=DTLS-UDP-SR) 3577 o TLS [RFC5246] over TCP with Framing Header, No-ICE 3578 (OverlayLinkType=TLS-TCP-FH-NO-ICE) 3579 o DTLS [RFC6347] over UDP with SR, No-ICE (OverlayLinkType=DTLS-UDP- 3580 SR-NO-ICE) 3582 Note that although UDP does not properly have "connections", both TLS 3583 and DTLS have a handshake which establishes a similar, stateful 3584 association, and we simply refer to these as "connections" for the 3585 purposes of this document. 3587 If a peer receives a message that is larger than value of max- 3588 message-size defined in the overlay configuration, the peer SHOULD 3589 send an Error_Message_Too_Large error and then close the TLS or DTLS 3590 session from which the message was received. Note that this error 3591 can be sent and the session closed before receiving the complete 3592 message. If the forwarding header is larger than the max-message- 3593 size, the receiver SHOULD close the TLS or DTLS session without 3594 sending an error. 3596 The Framing Header (FH) is used to frame messages and provide timing 3597 when used on a reliable stream-based transport protocol. Simple 3598 Reliability (SR) makes use of the FH to provide congestion control 3599 and semi-reliability when using unreliable message-oriented transport 3600 protocols. We will first define each of these algorithms in 3601 Section 6.6.2 and Section 6.6.3, then define overlay link protocols 3602 that use them in Section 6.6.4, Section 6.6.5 and Section 6.6.6. 3604 Note: We expect future Overlay Link protocols to define replacements 3605 for all components of these protocols, including the framing header. 3606 These three protocols have been chosen for simplicity of 3607 implementation and reasonable performance. 3609 Note to implementers: There are inherent tradeoffs in utilizing 3610 short timeouts to determine when a link has failed. To balance the 3611 tradeoffs, an implementation SHOULD quickly act to remove entries 3612 from the routing table when there is reason to suspect the link has 3613 failed. For example, in a Chord derived overlay algorithm, a closer 3614 finger table entry could be substituted for an entry in the finger 3615 table that has experienced a timeout. That entry can be restored if 3616 it proves to resume functioning, or replaced at some point in the 3617 future if necessary. End-to-end retransmissions will handle any lost 3618 messages, but only if the failing entries do not remain in the finger 3619 table for subsequent retransmissions. 3621 6.6.1. Future Overlay Link Protocols 3623 It is possible to define new link-layer protocols and apply them to a 3624 new overlay using the "overlay-link-protocol" configuration directive 3625 (see Section 11.1.). However, any new protocols MUST meet the 3626 following requirements. 3628 Endpoint authentication When a node forms an association with 3629 another endpoint, it MUST be possible to cryptographically verify 3630 that the endpoint has a given Node-ID. 3632 Traffic origin authentication and integrity When a node receives 3633 traffic from another endpoint, it MUST be possible to 3634 cryptographically verify that the traffic came from a given 3635 association and that it has not been modified in transit from the 3636 other endpoint in the association. The overlay link protocol MUST 3637 also provide replay prevention/detection. 3639 Traffic confidentiality When a node sends traffic to another 3640 endpoint, it MUST NOT be possible for a third party not involved 3641 in the association to determine the contents of that traffic. 3643 Any new overlay protocol MUST be defined via RFC 5226 Standards 3644 Action; see Section 14.11. 3646 6.6.1.1. HIP 3648 In a Host Identity Protocol Based Overlay Networking Environment (HIP 3649 BONE) [RFC6079] HIP [RFC5201] provides connection management (e.g., 3650 NAT traversal and mobility) and security for the overlay network. 3651 The P2PSIP Working Group has expressed interest in supporting a HIP- 3652 based link protocol. Such support would require specifying such 3653 details as: 3655 o How to issue certificates which provided identities meaningful to 3656 the HIP base exchange. We anticipate that this would require a 3657 mapping between ORCHIDs and NodeIds. 3658 o How to carry the HIP I1 and I2 messages. 3659 o How to carry RELOAD messages over HIP. 3661 [I-D.ietf-hip-reload-instance] documents work in progress on using 3662 RELOAD with the HIP BONE. 3664 6.6.1.2. ICE-TCP 3666 The ICE-TCP RFC [RFC6544] allows TCP to be supported as an Overlay 3667 Link protocol that can be added using ICE. 3669 6.6.1.3. Message-oriented Transports 3671 Modern message-oriented transports offer high performance, good 3672 congestion control, and avoid head of line blocking in case of lost 3673 data. These characteristics make them preferable as underlying 3674 transport protocols for RELOAD links. SCTP without message ordering 3675 and DCCP are two examples of such protocols. However, currently they 3676 are not well-supported by commonly available NATs, and specifications 3677 for ICE session establishment are not available. 3679 6.6.1.4. Tunneled Transports 3681 As of the time of this writing, there is significant interest in the 3682 IETF community in tunneling other transports over UDP, motivated by 3683 the situation that UDP is well-supported by modern NAT hardware, and 3684 similar performance can be achieved to native implementation. 3685 Currently SCTP, DCCP, and a generic tunneling extension are being 3686 proposed for message-oriented protocols. Once ICE traversal has been 3687 specified for these tunneled protocols, they should be 3688 straightforward to support as overlay link protocols. 3690 6.6.2. Framing Header 3692 In order to support unreliable links and to allow for quick detection 3693 of link failures when using reliable end-to-end transports, each 3694 message is wrapped in a very simple framing layer (FramedMessage) 3695 which is only used for each hop. This layer contains a sequence 3696 number which can then be used for ACKs. The same header is used for 3697 both reliable and unreliable transports for simplicity of 3698 implementation. 3700 The definition of FramedMessage is: 3702 enum { data(128), ack(129), (255) } FramedMessageType; 3704 struct { 3705 FramedMessageType type; 3707 select (type) { 3708 case data: 3709 uint32 sequence; 3710 opaque message<0..2^24-1>; 3712 case ack: 3713 uint32 ack_sequence; 3714 uint32 received; 3715 }; 3716 } FramedMessage; 3718 The type field of the PDU is set to indicate whether the message is 3719 data or an acknowledgement. 3721 If the message is of type "data", then the remainder of the PDU is as 3722 follows: 3724 sequence 3725 the sequence number. This increments by 1 for each framed message 3726 sent over this transport session. 3728 message 3729 the message that is being transmitted. 3731 Each connection has it own sequence number space. Initially the 3732 value is zero and it increments by exactly one for each message sent 3733 over that connection. 3735 When the receiver receives a message, it SHOULD immediately send an 3736 ACK message. The receiver MUST keep track of the 32 most recent 3737 sequence numbers received on this association in order to generate 3738 the appropriate ack. 3740 If the PDU is of type "ack", the contents are as follows: 3742 ack_sequence 3743 The sequence number of the message being acknowledged. 3745 received 3746 A bitmask indicating if each of the previous 32 sequence numbers 3747 before this packet has been among the 32 packets most recently 3748 received on this connection. When a packet is received with a 3749 sequence number N, the receiver looks at the sequence number of 3750 the previously 32 packets received on this connection. Call the 3751 previously received packet number M. For each of the previous 32 3752 packets, if the sequence number M is less than N but greater than 3753 N-32, the N-M bit of the received bitmask is set to one; otherwise 3754 it is zero. Note that a bit being set to one indicates positively 3755 that a particular packet was received, but a bit being set to zero 3756 means only that it is unknown whether or not the packet has been 3757 received, because it might have been received before the 32 most 3758 recently received packets. 3760 The received field bits in the ACK provide a high degree of 3761 redundancy so that the sender can figure out which packets the 3762 receiver has received and can then estimate packet loss rates. If 3763 the sender also keeps track of the time at which recent sequence 3764 numbers have been sent, the RTT can be estimated. 3766 Note that because retransmissions receive new sequence numbers, 3767 multiple ACKs may be received for the same message. This approach 3768 provides more information than traditional TCP sequence numbers, but 3769 care must be taken when applying algorithms designed based on TCP's 3770 stream-oriented sequence number. 3772 6.6.3. Simple Reliability 3774 When RELOAD is carried over DTLS or another unreliable link protocol, 3775 it needs to be used with a reliability and congestion control 3776 mechanism, which is provided on a hop-by-hop basis. The basic 3777 principle is that each message, regardless of whether or not it 3778 carries a request or response, will get an ACK and be reliably 3779 retransmitted. The receiver's job is very simple, limited to just 3780 sending ACKs. All the complexity is at the sender side. This allows 3781 the sending implementation to trade off performance versus 3782 implementation complexity without affecting the wire protocol. 3784 Because the receiver's role is limited to providing packet 3785 acknowledgements, a wide variety of congestion control algorithms can 3786 be implemented on the sender side while using the same basic wire 3787 protocol. The sender algorithm used MUST meet the requirements of 3788 [RFC5405]. 3790 6.6.3.1. Stop and Wait Sender Algorithm 3792 This section describes one possible implementation of a sender 3793 algorithm for Simple Reliability. It is adequate for overlays 3794 running on underlying networks with low latency and loss (LANs) or 3795 low-traffic overlays on the Internet. 3797 A node MUST NOT have more than one unacknowledged message on the DTLS 3798 connection at a time. Note that because retransmissions of the same 3799 message are given new sequence numbers, there may be multiple 3800 unacknowledged sequence numbers in use. 3802 The RTO ("Retransmission TimeOut") is based on an estimate of the 3803 round-trip time (RTT). The value for RTO is calculated separately 3804 for each DTLS session. Implementations can use a static value for 3805 RTO or a dynamic estimate which will result in better performance. 3806 For implementations that use a static value, the default value for 3807 RTO is 500 ms. Nodes MAY use smaller values of RTO if it is known 3808 that all nodes are within the local network. The default RTO MAY be 3809 chosen larger, and this is RECOMMENDED if it is known in advance 3810 (such as on high latency access links) that the round-trip time is 3811 larger. 3813 Implementations that use a dynamic estimate to compute the RTO MUST 3814 use the algorithm described in RFC 6298[RFC6298], with the exception 3815 that the value of RTO SHOULD NOT be rounded up to the nearest second 3816 but instead rounded up to the nearest millisecond. The RTT of a 3817 successful STUN transaction from the ICE stage is used as the initial 3818 measurement for formula 2.2 of RFC 6298. The sender keeps track of 3819 the time each message was sent for all recently sent messages. Any 3820 time an ACK is received, the sender can compute the RTT for that 3821 message by looking at the time the ACK was received and the time when 3822 the message was sent. This is used as a subsequent RTT measurement 3823 for formula 2.3 of RFC 6298 to update the RTO estimate. (Note that 3824 because retransmissions receive new sequence numbers, all received 3825 ACKs are used.) 3827 An initiating node SHOULD retransmit a message if it has not received 3828 an ACK after an interval of RTO (transit nodes do not retransmit at 3829 this layer). The node MUST double the time to wait after each 3830 retransmission. For each retransmission, the sequence number MUST be 3831 incremented. 3833 Retransmissions continue until a response is received, or until a 3834 total of 5 requests have been sent or there has been a hard ICMP 3835 error [RFC1122] or a TLS alert. The sender knows a response was 3836 received when it receives an ACK with a sequence number that 3837 indicates it is a response to one of the transmissions of this 3838 messages. For example, assuming an RTO of 500 ms, requests would be 3839 sent at times 0 ms, 500 ms, 1500 ms, 3500 ms, and 7500 ms. If all 3840 retransmissions for a message fail, then the sending node SHOULD 3841 close the connection routing the message. 3843 To determine when a link might be failing without waiting for the 3844 final timeout, observe when no ACKs have been received for an entire 3845 RTO interval, and then wait for three retransmissions to occur beyond 3846 that point. If no ACKs have been received by the time the third 3847 retransmission occurs, it is RECOMMENDED that the link be removed 3848 from the routing table. The link MAY be restored to the routing 3849 table if ACKs resume before the connection is closed, as described 3850 above. 3852 A sender MUST wait 10ms between receipt of an ACK and transmission of 3853 the next message. 3855 6.6.4. DTLS/UDP with SR 3857 This overlay link protocol consists of DTLS over UDP while 3858 implementing the Simple Reliability protocol. STUN Connectivity 3859 checks and keepalives are used. Any compliant sender algorithm may 3860 be used. 3862 6.6.5. TLS/TCP with FH, No-ICE 3864 This overlay link protocol consists of TLS over TCP with the framing 3865 header. Because ICE is not used, STUN connectivity checks are not 3866 used upon establishing the TCP connection, nor are they used for 3867 keepalives. 3869 Because the TCP layer's application-level timeout is too slow to be 3870 useful for overlay routing, the Overlay Link implementation MUST use 3871 the framing header to measure the RTT of the connection and calculate 3872 an RTO as specified in Section 2 of [RFC6298]. The resulting RTO is 3873 not used for retransmissions, but as a timeout to indicate when the 3874 link SHOULD be removed from the routing table. It is RECOMMENDED 3875 that such a connection be retained for 30s to determine if the 3876 failure was transient before concluding the link has failed 3877 permanently. 3879 When sending candidates for TLS/TCP with FH, No-ICE, a passive 3880 candidate MUST be provided. 3882 6.6.6. DTLS/UDP with SR, No-ICE 3884 This overlay link protocol consists of DTLS over UDP while 3885 implementing the Simple Reliability protocol. Because ICE is not 3886 used, no STUN connectivity checks or keepalives are used. 3888 6.7. Fragmentation and Reassembly 3890 In order to allow transmission over datagram protocols such as DTLS, 3891 RELOAD messages may be fragmented. 3893 Any node along the path can fragment the message but only the final 3894 destination reassembles the fragments. When a node takes a packet 3895 and fragments it, each fragment has a full copy of the Forwarding 3896 Header but the data after the Forwarding Header is broken up in 3897 appropriate sized chunks. The size of the payload chunks needs to 3898 take into account space to allow the via and destination lists to 3899 grow. Each fragment MUST contain a full copy of the via list, 3900 destination list, and ForwardingOptions and MUST contain at least 256 3901 bytes of the message body. If these elements cannot fit within the 3902 MTU of the underlying datagram protocol, RELOAD fragmentation is not 3903 performed and IP-layer fragmentation is allowed to occur. When a 3904 message must be fragmented, it SHOULD be split into equal-sized 3905 fragments that are no larger than the PMTU of the next overlay link 3906 minus 32 bytes. This is to allow the via list to grow before further 3907 fragmentation is required. 3909 Note that this fragmentation is not optimal for the end-to-end path - 3910 a message may be refragmented multiple times as it traverses the 3911 overlay but is only assembled at the final destination. This option 3912 has been chosen as it is far easier to implement than e2e PMTU 3913 discovery across an ever-changing overlay, and it effectively 3914 addresses the reliability issues of relying on IP-layer 3915 fragmentation. However, Ping can be used to allow e2e PMTU discovery 3916 to be implemented if desired. 3918 Upon receipt of a fragmented message by the intended peer, the peer 3919 holds the fragments in a holding buffer until the entire message has 3920 been received. The message is then reassembled into a single message 3921 and processed. In order to mitigate denial of service attacks, 3922 receivers SHOULD time out incomplete fragments after maximum request 3923 lifetime (15 seconds). Note this time was derived from looking at 3924 the end-to-end retransmission time and saving fragments long enough 3925 for the full end-to-end retransmissions to take place. Ideally the 3926 receiver would have enough buffer space to deal with as many 3927 fragments as can arrive in the maximum request lifetime. However, if 3928 the receiver runs out of buffer space to reassemble the messages it 3929 MUST drop the message. 3931 The fragment field of the forwarding header is used to encode 3932 fragmentation information. The offset is the number of bytes between 3933 the end of the forwarding header and the start of the data. The 3934 first fragment therefore has an offset of 0. The last fragment 3935 indicator MUST be appropriately set. If the message is not 3936 fragmented, it is simply treated as if it is the only fragment: the 3937 last fragment bit is set and the offset is 0 resulting in a fragment 3938 value of 0xC0000000. 3940 Note: the reason for this definition of the fragment field is that 3941 originally the high bit was defined in part of the specification as 3942 "is fragmented" and so there was some specification ambiguity about 3943 how to encode messages with only one fragment. This ambiguity was 3944 resolved in favor of always encoding as the "last" fragment with 3945 offset 0, thus simplifying the receiver code path, but resulting in 3946 the high bit being redundant. Because messages MUST be set with the 3947 high bit set to 1, implementations SHOULD discard any message with it 3948 set to 0. Implementations (presumably legacy ones) which choose to 3949 accept such messages MUST either ignore the remaining bits or ensure 3950 that they are 0. They MUST NOT try to interpret as fragmented 3951 messages with the high bit set low. 3953 7. Data Storage Protocol 3955 RELOAD provides a set of generic mechanisms for storing and 3956 retrieving data in the Overlay Instance. These mechanisms can be 3957 used for new applications simply by defining new code points and a 3958 small set of rules. No new protocol mechanisms are required. 3960 The basic unit of stored data is a single StoredData structure: 3962 struct { 3963 uint32 length; 3964 uint64 storage_time; 3965 uint32 lifetime; 3966 StoredDataValue value; 3967 Signature signature; 3968 } StoredData; 3970 The contents of this structure are as follows: 3972 length 3973 The size of the StoredData structure in bytes excluding the size 3974 of length itself. 3976 storage_time 3977 The time when the data was stored represented as the number of 3978 milliseconds elapsed since midnight Jan 1, 1970 UTC not counting 3979 leap seconds. This will have the same values for seconds as 3980 standard UNIX time or POSIX time. More information can be found 3981 at [UnixTime]. Any attempt to store a data value with a storage 3982 time before that of a value already stored at this location MUST 3983 generate a Error_Data_Too_Old error. This prevents rollback 3984 attacks. The node SHOULD make a best-effort attempt to use a 3985 correct clock to determine this number, however, the protocol does 3986 not require synchronized clocks: the receiving peer uses the 3987 storage time in the previous store, not its own clock. Clock 3988 values are used so that when clocks are generally synchronized, 3989 data may be stored in a single transaction, rather than querying 3990 for the value of a counter before the actual store. 3991 If a node attempting to store new data in response to a user 3992 request (rather than as an overlay maintenance operation such as 3993 occurs when healing the overlay from a partition) is rejected with 3994 an Error_Data_Too_Old error, the node MAY elect to perform its 3995 store using a storage_time that increments the value used with the 3996 previous store. This situation may occur when the clocks of nodes 3997 storing to this location are not properly synchronized. 3999 lifetime 4000 The validity period for the data, in seconds, starting from the 4001 time the peer receives the StoreReq. 4003 value 4004 The data value itself, as described in Section 7.2. 4006 signature 4007 A signature as defined in Section 7.1. 4009 Each Resource-ID specifies a single location in the Overlay Instance. 4010 However, each location may contain multiple StoredData values 4011 distinguished by Kind-ID. The definition of a Kind describes both 4012 the data values which may be stored and the data model of the data. 4013 Some data models allow multiple values to be stored under the same 4014 Kind-ID. Section 7.2 describes the available data models. Thus, for 4015 instance, a given Resource-ID might contain a single-value element 4016 stored under Kind-ID X and an array containing multiple values stored 4017 under Kind-ID Y. 4019 7.1. Data Signature Computation 4021 Each StoredData element is individually signed. However, the 4022 signature also must be self-contained and cover the Kind-ID and 4023 Resource-ID even though they are not present in the StoredData 4024 structure. The input to the signature algorithm is: 4026 resource_id || kind || storage_time || StoredDataValue || 4027 SignerIdentity 4029 Where || indicates concatenation. 4031 Where these values are: 4033 resource_id 4034 The Resource-ID where this data is stored. 4036 kind 4037 The Kind-ID for this data. 4039 storage_time 4040 The contents of the storage_time data value. 4042 StoredDataValue 4043 The contents of the stored data value, as described in the 4044 previous sections. 4046 SignerIdentity 4047 The signer identity as defined in Section 6.3.4. 4049 Once the signature has been computed, the signature is represented 4050 using a signature element, as described in Section 6.3.4. 4052 Note that there is no necessary relationship between the validity 4053 window of a certificate and the expiry of the data it is 4054 authenticating. When signatures are verified, the current time MUST 4055 be compared to the certificate validity period. Stored data MAY be 4056 set to expire after the signing certificate's validity period. Such 4057 signatures are not considered valid after the signing certificate 4058 expires. Implementations may garbage collect such data at their 4059 convenience, either purging it automatically (perhaps by setting the 4060 upper bound on data storage to the lifetime of the signing 4061 certificate) or by simply leaving it in-place until it expires 4062 naturally and relying on users of that data to notice the expired 4063 signing certificate. 4065 7.2. Data Models 4067 The protocol currently defines the following data models: 4069 o single value 4070 o array 4071 o dictionary 4073 These are represented with the StoredDataValue structure. The actual 4074 data model is known from the Kind being stored. 4076 struct { 4077 Boolean exists; 4078 opaque value<0..2^32-1>; 4079 } DataValue; 4081 struct { 4082 select (DataModel) { 4083 case single_value: 4084 DataValue single_value_entry; 4086 case array: 4087 ArrayEntry array_entry; 4089 case dictionary: 4090 DictionaryEntry dictionary_entry; 4092 /* This structure may be extended */ 4093 }; 4094 } StoredDataValue; 4096 We now discuss the properties of each data model in turn: 4098 7.2.1. Single Value 4100 A single-value element is a simple sequence of bytes. There may be 4101 only one single-value element for each Resource-ID, Kind-ID pair. 4103 A single value element is represented as a DataValue, which contains 4104 the following two elements: 4106 exists 4107 This value indicates whether the value exists at all. If it is 4108 set to False, it means that no value is present. If it is True, 4109 that means that a value is present. This gives the protocol a 4110 mechanism for indicating nonexistence as opposed to emptiness. 4112 value 4113 The stored data. 4115 7.2.2. Array 4117 An array is a set of opaque values addressed by an integer index. 4118 Arrays are zero based. Note that arrays can be sparse. For 4119 instance, a Store of "X" at index 2 in an empty array produces an 4120 array with the values [ NA, NA, "X"]. Future attempts to fetch 4121 elements at index 0 or 1 will return values with "exists" set to 4122 False. 4124 A array element is represented as an ArrayEntry: 4126 struct { 4127 uint32 index; 4128 DataValue value; 4129 } ArrayEntry; 4131 The contents of this structure are: 4133 index 4134 The index of the data element in the array. 4136 value 4137 The stored data. 4139 7.2.3. Dictionary 4141 A dictionary is a set of opaque values indexed by an opaque key with 4142 one value for each key. A single dictionary entry is represented as 4143 follows: 4145 A dictionary element is represented as a DictionaryEntry: 4147 typedef opaque DictionaryKey<0..2^16-1>; 4149 struct { 4150 DictionaryKey key; 4151 DataValue value; 4152 } DictionaryEntry; 4154 The contents of this structure are: 4156 key 4157 The dictionary key for this value. 4159 value 4160 The stored data. 4162 7.3. Access Control Policies 4164 Every Kind which is storable in an overlay MUST be associated with an 4165 access control policy. This policy defines whether a request from a 4166 given node to operate on a given value should succeed or fail. It is 4167 anticipated that only a small number of generic access control 4168 policies are required. To that end, this section describes a small 4169 set of such policies and Section 14.4 establishes a registry for new 4170 policies if required. Each policy has a short string identifier 4171 which is used to reference it in the configuration document. 4173 In the following policies, the term "signer" refers to the signer of 4174 the StoredValue object and, in the case of non-replica stores, to the 4175 signer of the StoreReq message. I.e., in a non-replica store, both 4176 the signer of the StoredValue and the signer of the StoreReq MUST 4177 conform to the policy. In the case of a replica store, the signer of 4178 the StoredValue MUST conform to the policy and the StoreReq itself 4179 MUST be checked as described in Section 7.4.1.1. 4181 7.3.1. USER-MATCH 4183 In the USER-MATCH policy, a given value MUST be written (or 4184 overwritten) if and only if the signer's certificate has a user name 4185 which hashes (using the hash function for the overlay) to the 4186 Resource-ID for the resource. Recall that the certificate may, 4187 depending on the overlay configuration, be self-signed. 4189 7.3.2. NODE-MATCH 4191 In the NODE-MATCH policy, a given value MUST be written (or 4192 overwritten) if and only if the signer's certificate has a specified 4193 Node-ID which hashes (using the hash function for the overlay) to the 4194 Resource-ID for the resource and that Node-ID is the one indicated in 4195 the SignerIdentity value cert_hash. 4197 7.3.3. USER-NODE-MATCH 4199 The USER-NODE-MATCH policy may only be used with dictionary types. 4200 In the USER-NODE-MATCH policy, a given value MUST be written (or 4201 overwritten) if and only if the signer's certificate has a user name 4202 which hashes (using the hash function for the overlay) to the 4203 Resource-ID for the resource. In addition, the dictionary key MUST 4204 be equal to the Node-ID in the certificate and that Node-ID MUST be 4205 the one indicated in the SignerIdentity value cert_hash. 4207 7.3.4. NODE-MULTIPLE 4209 In the NODE-MULTIPLE policy, a given value MUST be written (or 4210 overwritten) if and only if signer's certificate contains a Node-ID 4211 such that H(Node-ID || i) is equal to the Resource-ID for some small 4212 integer value of i and that Node-ID is the one indicated in the 4213 SignerIdentity value cert_hash. When this policy is in use, the 4214 maximum value of i MUST be specified in the Kind definition. 4216 Note that as i is not carried on the wire, the verifier MUST iterate 4217 through potential i values up to the maximum value in order to 4218 determine whether a store is acceptable. 4220 7.4. Data Storage Methods 4222 RELOAD provides several methods for storing and retrieving data: 4224 o Store values in the overlay 4225 o Fetch values from the overlay 4226 o Stat: get metadata about values in the overlay 4227 o Find the values stored at an individual peer 4229 These methods are each described in the following sections. 4231 7.4.1. Store 4233 The Store method is used to store data in the overlay. The format of 4234 the Store request depends on the data model which is determined by 4235 the Kind. 4237 7.4.1.1. Request Definition 4239 A StoreReq message is a sequence of StoreKindData values, each of 4240 which represents a sequence of stored values for a given Kind. The 4241 same Kind-ID MUST NOT be used twice in a given store request. Each 4242 value is then processed in turn. These operations MUST be atomic. 4243 If any operation fails, the state MUST be rolled back to before the 4244 request was received. 4246 The store request is defined by the StoreReq structure: 4248 struct { 4249 KindId kind; 4250 uint64 generation_counter; 4251 StoredData values<0..2^32-1>; 4252 } StoreKindData; 4254 struct { 4255 ResourceId resource; 4256 uint8 replica_number; 4257 StoreKindData kind_data<0..2^32-1>; 4258 } StoreReq; 4260 A single Store request stores data of a number of Kinds to a single 4261 resource location. The contents of the structure are: 4263 resource 4264 The resource to store at. 4266 replica_number 4267 The number of this replica. When a storing peer saves replicas to 4268 other peers each peer is assigned a replica number starting from 1 4269 and sent in the Store message. This field is set to 0 when a node 4270 is storing its own data. This allows peers to distinguish replica 4271 writes from original writes. 4273 kind_data 4274 A series of elements, one for each Kind of data to be stored. 4276 If the replica number is zero, then the peer MUST check that it is 4277 responsible for the resource and, if not, reject the request. If the 4278 replica number is nonzero, then the peer MUST check that it expects 4279 to be a replica for the resource and that the request sender is 4280 consistent with being the responsible node (i.e., that the receiving 4281 peer does not know of a better node) and, if not, reject the request. 4283 Each StoreKindData element represents the data to be stored for a 4284 single Kind-ID. The contents of the element are: 4286 kind 4287 The Kind-ID. Implementations MUST reject requests corresponding 4288 to unknown Kinds. 4290 generation_counter 4291 The expected current state of the generation counter 4292 (approximately the number of times this object has been written; 4293 see below for details). 4295 values 4296 The value or values to be stored. This may contain one or more 4297 stored_data values depending on the data model associated with 4298 each Kind. 4300 The peer MUST perform the following checks: 4302 o The Kind-ID is known and supported. 4303 o The signatures over each individual data element (if any) are 4304 valid. If this check fails, the request MUST be rejected with an 4305 Error_Forbidden error. 4306 o Each element is signed by a credential which is authorized to 4307 write this Kind at this Resource-ID. If this check fails, the 4308 request MUST be rejected with an Error_Forbidden error. 4309 o For original (non-replica) stores, the StoreReq is signed by a 4310 credential which is authorized to write this Kind at this 4311 Resource-ID. If this check fails, the request MUST be rejected 4312 with an Error_Forbidden error. 4313 o For replica stores, the StoreReq is signed by a Node-ID which is a 4314 plausible node to either have originally stored the value or in 4315 the replica set. What this means is overlay specific, but in the 4316 case of the Chord based DHT defined in this specification, replica 4317 StoreReqs MUST come from nodes which are either in the known 4318 replica set for a given resource or which are closer than some 4319 node in the replica set. If this check fails, the request MUST be 4320 rejected with an Error_Forbidden error. 4321 o For original (non-replica) stores, the peer MUST check that if the 4322 generation counter is non-zero, it equals the current value of the 4323 generation counter for this Kind. This feature allows the 4324 generation counter to be used in a way similar to the HTTP Etag 4325 feature. 4326 o For replica Stores, the peer MUST set the generation counter to 4327 match the generation counter in the message, and MUST NOT check 4328 the generation counter against the current value. Replica Stores 4329 MUST NOT use a generation counter of 0. 4330 o The storage time values are greater than that of any value which 4331 would be replaced by this Store. 4332 o The size and number of the stored values is consistent with the 4333 limits specified in the overlay configuration. 4334 o If the data is signed with identity_type set to "none" and/or 4335 SignatureAndHashAlgorithm values set to {0, 0} ("anonymous" and 4336 "none"), the StoreReq MUST be rejected with an Error_forbidden 4337 error. Only synthesized data returned by the storage can use 4338 these values (see Section 7.4.2.2) 4340 If all these checks succeed, the peer MUST attempt to store the data 4341 values. For non-replica stores, if the store succeeds and the data 4342 is changed, then the peer MUST increase the generation counter by at 4343 least one. If there are multiple stored values in a single 4344 StoreKindData, it is permissible for the peer to increase the 4345 generation counter by only 1 for the entire Kind-ID, or by 1 or more 4346 than one for each value. Accordingly, all stored data values MUST 4347 have a generation counter of 1 or greater. 0 is used in the Store 4348 request to indicate that the generation counter should be ignored for 4349 processing this request; however the responsible peer should increase 4350 the stored generation counter and should return the correct 4351 generation counter in the response. 4353 When a peer stores data previously stored by another node (e.g., for 4354 replicas or topology shifts) it MUST adjust the lifetime value 4355 downward to reflect the amount of time the value was stored at the 4356 peer. The adjustment SHOULD be implemented by an algorithm 4357 equivalent to the following: at the time the peer initially receives 4358 the StoreReq it notes the local time T. When it then attempts to do a 4359 StoreReq to another node it should decrement the lifetime value by 4360 the difference between the current local time and T. 4362 Unless otherwise specified by the usage, if a peer attempts to store 4363 data previously stored by another node (e.g., for replicas or 4364 topology shifts) and that store fails with either an 4365 Error_Generation_Counter_Too_Low or an Error_Data_Too_Old error, the 4366 peer MUST fetch the newer data from the peer generating the error and 4367 use that to replace its own copy. This rule allows resynchronization 4368 after partitions heal. 4370 When a network partition is being healed and unless otherwise 4371 specified, the default merging rule is to act as if all the values 4372 that need to be merged were stored and as if the order they were 4373 stored in corresponds to the stored time values associated with (and 4374 carried in) their values. Because the stored time values are those 4375 associated with the peer which did the writing, clock skew is 4376 generally not an issue. If two nodes are on different partitions, 4377 write to the same location, and have clock skew, this can create 4378 merge conflicts. However because RELOAD deliberately segregates 4379 storage so that data from different users and peers is stored in 4380 different locations, and a single peer will typically only be in a 4381 single network partition, this case will generally not arise. 4383 The properties of stores for each data model are as follows: 4385 Single-value: 4386 A store of a new single-value element creates the element if it 4387 does not exist and overwrites any existing value with the new 4388 value. 4390 Array: 4391 A store of an array entry replaces (or inserts) the given value at 4392 the location specified by the index. Because arrays are sparse, a 4393 store past the end of the array extends it with nonexistent values 4394 (exists = False) as required. A store at index 0xffffffff places 4395 the new value at the end of the array regardless of the length of 4396 the array. The resulting StoredData has the correct index value 4397 when it is subsequently fetched. 4399 Dictionary: 4400 A store of a dictionary entry replaces (or inserts) the given 4401 value at the location specified by the dictionary key. 4403 The following figure shows the relationship between these structures 4404 for an example store which stores the following values at resource 4405 "1234" 4407 o The value "abc" in the single value location for Kind X 4408 o The value "foo" at index 0 in the array for Kind Y 4409 o The value "bar" at index 1 in the array for Kind Y 4410 Store 4411 resource=1234 4412 replica_number = 0 4413 / \ 4414 / \ 4415 StoreKindData StoreKindData 4416 kind=X (Single-Value) kind=Y (Array) 4417 generation_counter = 99 generation_counter = 107 4418 | /\ 4419 | / \ 4420 StoredData / \ 4421 storage_time = xxxxxxx / \ 4422 lifetime = 86400 / \ 4423 signature = XXXX / \ 4424 | | | 4425 | StoredData StoredData 4426 | storage_time = storage_time = 4427 | yyyyyyyy zzzzzzz 4428 | lifetime = 86400 lifetime = 33200 4429 | signature = YYYY signature = ZZZZ 4430 | | | 4431 StoredDataValue | | 4432 value="abc" | | 4433 | | 4434 StoredDataValue StoredDataValue 4435 index=0 index=1 4436 value="foo" value="bar" 4438 7.4.1.2. Response Definition 4440 In response to a successful Store request the peer MUST return a 4441 StoreAns message containing a series of StoreKindResponse elements 4442 containing the current value of the generation counter for each 4443 Kind-ID, as well as a list of the peers where the data will be 4444 replicated by the node processing the request. 4446 struct { 4447 KindId kind; 4448 uint64 generation_counter; 4449 NodeId replicas<0..2^16-1>; 4450 } StoreKindResponse; 4452 struct { 4453 StoreKindResponse kind_responses<0..2^16-1>; 4454 } StoreAns; 4456 The contents of each StoreKindResponse are: 4458 kind 4459 The Kind-ID being represented. 4461 generation_counter 4462 The current value of the generation counter for that Kind-ID. 4464 replicas 4465 The list of other peers at which the data was/will be replicated. 4466 In overlays and applications where the responsible peer is 4467 intended to store redundant copies, this allows the storing node 4468 to independently verify that the replicas have in fact been 4469 stored. It does this verification by using the Stat method (see 4470 Section 7.4.3). Note that the storing node is not required to 4471 perform this verification. 4473 The response itself is just StoreKindResponse values packed end-to- 4474 end. 4476 If any of the generation counters in the request precede the 4477 corresponding stored generation counter, then the peer MUST fail the 4478 entire request and respond with an Error_Generation_Counter_Too_Low 4479 error. The error_info in the ErrorResponse MUST be a StoreAns 4480 response containing the correct generation counter for each Kind and 4481 the replica list, which will be empty. For original (non-replica) 4482 stores, a node which receives such an error SHOULD attempt to fetch 4483 the data and, if the storage_time value is newer, replace its own 4484 data with that newer data. This rule improves data consistency in 4485 the case of partitions and merges. 4487 If the data being stored is too large for the allowed limit by the 4488 given usage, then the peer MUST fail the request and generate an 4489 Error_Data_Too_Large error. 4491 If any type of request tries to access a data Kind that the peer does 4492 not know about, an Error_Unknown_Kind MUST be generated. The 4493 error_info in the Error_Response is: 4495 KindId unknown_kinds<0..2^8-1>; 4497 which lists all the Kinds that were unrecognized. A node which 4498 receives this error MUST generate a ConfigUpdate message which 4499 contains the appropriate Kind definition (assuming that in fact a 4500 Kind was used which was defined in the configuration document). 4502 7.4.1.3. Removing Values 4504 RELOAD does not have an explicit Remove operation. Rather, values 4505 are Removed by storing "nonexistent" values in their place. Each 4506 DataValue contains a boolean value called "exists" which indicates 4507 whether a value is present at that location. In order to effectively 4508 remove a value, the owner stores a new DataValue with "exists" set to 4509 False: 4511 exists = False 4512 value = {} (0 length) 4514 The owner SHOULD use a lifetime for the nonexistent value at least as 4515 long as the remainder of the lifetime of the value it is replacing; 4516 otherwise it is possible for the original value to be accidentally or 4517 maliciously re-stored after the storing node has expired it. Note 4518 that there is still a window of vulnerability for replay attack after 4519 the original lifetime has expired (as with any store). This attack 4520 can be mitigated by doing a nonexistent store with a very long 4521 lifetime. 4523 Storing nodes MUST treat these nonexistent values the same way they 4524 treat any other stored value, including overwriting the existing 4525 value, replicating them, and aging them out as necessary when 4526 lifetime expires. When a stored nonexistent value's lifetime 4527 expires, it is simply removed from the storing node like any other 4528 stored value expiration. 4530 Note that in the case of arrays and dictionaries, expiration may 4531 create an implicit, unsigned "nonexistent" value to represent a gap 4532 in the data structure, as might happen when any value is aged out. 4533 However, this value isn't persistent nor is it replicated. It is 4534 simply synthesized by the storing node. 4536 7.4.2. Fetch 4538 The Fetch request retrieves one or more data elements stored at a 4539 given Resource-ID. A single Fetch request can retrieve multiple 4540 different Kinds. 4542 7.4.2.1. Request Definition 4544 struct { 4545 int32 first; 4546 int32 last; 4547 } ArrayRange; 4549 struct { 4550 KindId kind; 4551 uint64 generation; 4552 uint16 length; 4554 select (DataModel) { 4555 case single_value: ; /* Empty */ 4557 case array: 4558 ArrayRange indices<0..2^16-1>; 4560 case dictionary: 4561 DictionaryKey keys<0..2^16-1>; 4563 /* This structure may be extended */ 4565 } model_specifer; 4566 } StoredDataSpecifier; 4568 struct { 4569 ResourceId resource; 4570 StoredDataSpecifier specifiers<0..2^16-1>; 4571 } FetchReq; 4573 The contents of the Fetch requests are as follows: 4575 resource 4576 The Resource-ID to fetch from. 4578 specifiers 4579 A sequence of StoredDataSpecifier values, each specifying some of 4580 the data values to retrieve. 4582 Each StoredDataSpecifier specifies a single Kind of data to retrieve 4583 and (if appropriate) the subset of values that are to be retrieved. 4584 The contents of the StoredDataSpecifier structure are as follows: 4586 kind 4587 The Kind-ID of the data being fetched. Implementations SHOULD 4588 reject requests corresponding to unknown Kinds unless specifically 4589 configured otherwise. 4591 DataModel 4592 The data model of the data. This is not transmitted on the wire 4593 but comes from the definition of the Kind. 4595 generation 4596 The last generation counter that the requesting node saw. This 4597 may be used to avoid unnecessary fetches or it may be set to zero. 4599 length 4600 The length of the rest of the structure, thus allowing 4601 extensibility. 4603 model_specifier 4604 A reference to the data value being requested within the data 4605 model specified for the Kind. For instance, if the data model is 4606 "array", it might specify some subset of the values. 4608 The model_specifier is as follows: 4610 o If the data model is single value, the specifier is empty. 4611 o If the data model is array, the specifier contains a list of 4612 ArrayRange elements, each of which contains two integers. The 4613 first integer is the beginning of the range and the second is the 4614 end of the range. 0 is used to indicate the first element and 4615 0xffffffff is used to indicate the final element. The first 4616 integer MUST be less than the second. While multiple ranges MAY 4617 be specified, they MUST NOT overlap. 4618 o If the data model is dictionary then the specifier contains a list 4619 of the dictionary keys being requested. If no keys are specified, 4620 than this is a wildcard fetch and all key-value pairs are 4621 returned. 4623 The generation counter is used to indicate the requester's expected 4624 state of the storing peer. If the generation counter in the request 4625 matches the stored counter, then the storing peer returns a response 4626 with no StoredData values. 4628 7.4.2.2. Response Definition 4630 The response to a successful Fetch request is a FetchAns message 4631 containing the data requested by the requester. 4633 struct { 4634 KindId kind; 4635 uint64 generation; 4636 StoredData values<0..2^32-1>; 4637 } FetchKindResponse; 4639 struct { 4640 FetchKindResponse kind_responses<0..2^32-1>; 4641 } FetchAns; 4643 The FetchAns structure contains a series of FetchKindResponse 4644 structures. There MUST be one FetchKindResponse element for each 4645 Kind-ID in the request. 4647 The contents of the FetchKindResponse structure are as follows: 4649 kind 4650 the Kind that this structure is for. 4652 generation 4653 the generation counter for this Kind. 4655 values 4656 the relevant values. If the generation counter in the request 4657 matches the generation counter in the stored data, then no 4658 StoredData values are returned. Otherwise, all relevant data 4659 values MUST be returned. A nonexistent value (i.e., one which the 4660 node has no knowledge of) is represented by a synthetic value with 4661 "exists" set to False and has an empty signature. Specifically, 4662 the identity_type is set to "none", the SignatureAndHashAlgorithm 4663 values are set to {0, 0} ("anonymous" and "none" respectively), 4664 and the signature value is of zero length. This removes the need 4665 for the responding node to do signatures for values which do not 4666 exist. These signatures are unnecessary as the entire response is 4667 signed by that node. Note that entries which have been removed by 4668 the procedure of Section 7.4.1.3 and have not yet expired also 4669 have exists = False but have valid signatures from the node which 4670 did the store. 4672 Upon receipt of a FetchAns message, nodes MUST verify the signatures 4673 on all the received values. Any values with invalid signatures 4674 (including expired certificates) MUST be discarded. Note that this 4675 implies that implementations which wish to store data for long 4676 periods of time must have certificates with appropriate expiry dates 4677 or re-store periodically. Implementations MAY return the subset of 4678 values with valid signatures, but in that case SHOULD somehow signal 4679 to the application that a partial response was received. 4681 There is one subtle point about signature computation on arrays. If 4682 the storing node uses the append feature (where the 4683 index=0xffffffff), then the index in the StoredData that is returned 4684 will not match that used by the storing node, which would break the 4685 signature. In order to avoid this issue, the index value in the 4686 array is set to zero before the signature is computed. This implies 4687 that malicious storing nodes can reorder array entries without being 4688 detected. 4690 7.4.3. Stat 4692 The Stat request is used to get metadata (length, generation counter, 4693 digest, etc.) for a stored element without retrieving the element 4694 itself. The name is from the UNIX stat(2) system call which performs 4695 a similar function for files in a file system. It also allows the 4696 requesting node to get a list of matching elements without requesting 4697 the entire element. 4699 7.4.3.1. Request Definition 4701 The Stat request is identical to the Fetch request. It simply 4702 specifies the elements to get metadata about. 4704 struct { 4705 ResourceId resource; 4706 StoredDataSpecifier specifiers<0..2^16-1>; 4707 } StatReq; 4709 7.4.3.2. Response Definition 4711 The Stat response contains the same sort of entries that a Fetch 4712 response would contain; however, instead of containing the element 4713 data it contains metadata. 4715 struct { 4716 Boolean exists; 4717 uint32 value_length; 4718 HashAlgorithm hash_algorithm; 4719 opaque hash_value<0..255>; 4720 } MetaData; 4722 struct { 4723 uint32 index; 4724 MetaData value; 4725 } ArrayEntryMeta; 4727 struct { 4728 DictionaryKey key; 4729 MetaData value; 4730 } DictionaryEntryMeta; 4732 struct { 4733 select (DataModel) { 4734 case single_value: 4735 MetaData single_value_entry; 4737 case array: 4738 ArrayEntryMeta array_entry; 4740 case dictionary: 4741 DictionaryEntryMeta dictionary_entry; 4743 /* This structure may be extended */ 4744 }; 4745 } MetaDataValue; 4747 struct { 4748 uint32 value_length; 4749 uint64 storage_time; 4750 uint32 lifetime; 4751 MetaDataValue metadata; 4752 } StoredMetaData; 4754 struct { 4755 KindId kind; 4756 uint64 generation; 4757 StoredMetaData values<0..2^32-1>; 4758 } StatKindResponse; 4760 struct { 4761 StatKindResponse kind_responses<0..2^32-1>; 4762 } StatAns; 4764 The structures used in StatAns parallel those used in FetchAns: a 4765 response consists of multiple StatKindResponse values, one for each 4766 Kind that was in the request. The contents of the StatKindResponse 4767 are the same as those in the FetchKindResponse, except that the 4768 values list contains StoredMetaData entries instead of StoredData 4769 entries. 4771 The contents of the StoredMetaData structure are the same as the 4772 corresponding fields in StoredData except that there is no signature 4773 field and the value is a MetaDataValue rather than a StoredDataValue. 4775 A MetaDataValue is a variant structure, like a StoredDataValue, 4776 except for the types of each arm, which replace DataValue with 4777 MetaData. 4779 The only really new structure is MetaData, which has the following 4780 contents: 4782 exists 4783 Same as in DataValue 4785 value_length 4786 The length of the stored value. 4788 hash_algorithm 4789 The hash algorithm used to perform the digest of the value. 4791 hash_value 4792 A digest using hash_algorithm on the value field of the DataValue 4793 including its 4 leading length bytes. 4795 7.4.4. Find 4797 The Find request can be used to explore the Overlay Instance. A Find 4798 request for a Resource-ID R and a Kind-ID T retrieves the Resource-ID 4799 (if any) of the resource of Kind T known to the target peer which is 4800 closest to R. This method can be used to walk the Overlay Instance by 4801 iteratively fetching R_n+1=nearest(1 + R_n). 4803 7.4.4.1. Request Definition 4805 The FindReq message contains a Resource-ID and a series of Kind-IDs 4806 identifying the resource the peer is interested in. 4808 struct { 4809 ResourceId resource; 4810 KindId kinds<0..2^8-1>; 4811 } FindReq; 4813 The request contains a list of Kind-IDs which the Find is for, as 4814 indicated below: 4816 resource 4817 The desired Resource-ID 4819 kinds 4820 The desired Kind-IDs. Each value MUST only appear once, and if 4821 not the request MUST be rejected with an error. 4823 7.4.4.2. Response Definition 4825 A response to a successful Find request is a FindAns message 4826 containing the closest Resource-ID on the peer for each Kind 4827 specified in the request. 4829 struct { 4830 KindId kind; 4831 ResourceId closest; 4832 } FindKindData; 4834 struct { 4835 FindKindData results<0..2^16-1>; 4836 } FindAns; 4838 If the processing peer is not responsible for the specified 4839 Resource-ID, it SHOULD return an Error_Not_Found error code. 4841 For each Kind-ID in the request the response MUST contain a 4842 FindKindData indicating the closest Resource-ID for that Kind-ID, 4843 unless the Kind is not allowed to be used with Find in which case a 4844 FindKindData for that Kind-ID MUST NOT be included in the response. 4845 If a Kind-ID is not known, then the corresponding Resource-ID MUST be 4846 0. Note that different Kind-IDs may have different closest Resource- 4847 IDs. 4849 The response is simply a series of FindKindData elements, one per 4850 Kind, concatenated end-to-end. The contents of each element are: 4852 kind 4853 The Kind-ID. 4855 closest 4856 The closest Resource-ID to the specified Resource-ID. This is 0 4857 if no Resource-ID is known. 4859 Note that the response does not contain the contents of the data 4860 stored at these Resource-IDs. If the requester wants this, it must 4861 retrieve it using Fetch. 4863 7.4.5. Defining New Kinds 4865 There are two ways to define a new Kind. The first is by writing a 4866 document and registering the Kind-ID with IANA. This is the 4867 preferred method for Kinds which may be widely used and reused. The 4868 second method is to simply define the Kind and its parameters in the 4869 configuration document using the section of Kind-ID space set aside 4870 for private use. This method MAY be used to define ad hoc Kinds in 4871 new overlays. 4873 However a Kind is defined, the definition MUST include: 4875 o The meaning of the data to be stored (in some textual form). 4876 o The Kind-ID. 4877 o The data model (single value, array, dictionary, etc). 4878 o The access control model. 4880 In addition, when Kinds are registered with IANA, each Kind is 4881 assigned a short string name which is used to refer to it in 4882 configuration documents. 4884 While each Kind needs to define what data model is used for its data, 4885 that does not mean that it must define new data models. Where 4886 practical, Kinds should use the existing data models. The intention 4887 is that the basic data model set be sufficient for most applications/ 4888 usages. 4890 8. Certificate Store Usage 4892 The Certificate Store usage allows a node to store its certificate in 4893 the overlay. 4895 A user/node MUST store its certificate at Resource-IDs derived from 4896 two Resource Names: 4898 o The user name in the certificate. 4899 o The Node-ID in the certificate. 4901 Note that in the second case the certificate for a peer is not stored 4902 at the its Node-ID but rather at a hash of its Node-ID. The 4903 intention here (as is common throughout RELOAD) is to avoid making a 4904 peer responsible for its own data. 4906 New certificates are stored at the end of the list. This structure 4907 allows users to store an old and a new certificate that both have the 4908 same Node-ID, which allows for migration of certificates when they 4909 are renewed. 4911 This usage defines the following Kinds: 4913 Name: CERTIFICATE_BY_NODE 4915 Data Model: The data model for CERTIFICATE_BY_NODE data is array. 4917 Access Control: NODE-MATCH. 4919 Name: CERTIFICATE_BY_USER 4921 Data Model: The data model for CERTIFICATE_BY_USER data is array. 4923 Access Control: USER-MATCH. 4925 9. TURN Server Usage 4927 The TURN server usage allows a RELOAD peer to advertise that it is 4928 prepared to be a TURN server as defined in [RFC5766]. When a node 4929 starts up, it joins the overlay network and forms several connections 4930 in the process. If the ICE stage in any of these connections returns 4931 a reflexive address that is not the same as the peer's perceived 4932 address, then the peer is behind a NAT and SHOULD NOT be a candidate 4933 for a TURN server. Additionally, if the peer's IP address is in the 4934 private address space range as defined by [RFC1918], then it is also 4935 SHOULD NOT be a candidate for a TURN server. Otherwise, the peer 4936 SHOULD assume it is a potential TURN server and follow the procedures 4937 below. 4939 If the node is a candidate for a TURN server it will insert some 4940 pointers in the overlay so that other peers can find it. The overlay 4941 configuration file specifies a turn-density parameter that indicates 4942 how many times each TURN server SHOULD record itself in the overlay. 4943 Typically this should be set to the reciprocal of the estimate of 4944 what percentage of peers will act as TURN servers. If the turn- 4945 density is not set to zero, for each value, called d, between 1 and 4946 turn-density, the peer forms a Resource Name by concatenating its 4947 Node-ID and the value d. This Resource Name is hashed to form a 4948 Resource-ID. The address of the peer is stored at that Resource-ID 4949 using type TURN-SERVICE and the TurnServer object: 4951 struct { 4952 uint8 iteration; 4953 IpAddressPort server_address; 4954 } TurnServer; 4956 The contents of this structure are as follows: 4958 iteration 4959 the d value 4961 server_address 4962 the address at which the TURN server can be contacted. 4964 Note: Correct functioning of this algorithm depends on having turn- 4965 density be an reasonable estimate of the reciprocal of the 4966 proportion of nodes in the overlay that can act as TURN servers. 4967 If the turn-density value in the configuration file is too low, 4968 then the process of finding TURN servers becomes more expensive as 4969 multiple candidate Resource-IDs must be probed to find a TURN 4970 server. 4972 Peers that provide this service need to support the TURN extensions 4973 to STUN for media relay as defined in [RFC5766]. 4975 This usage defines the following Kind to indicate that a peer is 4976 willing to act as a TURN server: 4978 Name TURN-SERVICE 4979 Data Model The TURN-SERVICE Kind stores a single value for each 4980 Resource-ID. 4981 Access Control NODE-MULTIPLE, with maximum iteration counter 20. 4983 Peers MAY find other servers by selecting a random Resource-ID and 4984 then doing a Find request for the appropriate Kind-ID with that 4985 Resource-ID. The Find request gets routed to a random peer based on 4986 the Resource-ID. If that peer knows of any servers, they will be 4987 returned. The returned response may be empty if the peer does not 4988 know of any servers, in which case the process gets repeated with 4989 some other random Resource-ID. As long as the ratio of servers 4990 relative to peers is not too low, this approach will result in 4991 finding a server relatively quickly. 4993 Note to implementers: The certificates used by TurnServer entries 4994 need to be retained as described in Section 6.3.4. 4996 10. Chord Algorithm 4998 This algorithm is assigned the name CHORD-RELOAD to indicate it is an 4999 adaptation of the basic Chord based DHT algorithm. 5001 This algorithm differs from the originally presented Chord algorithm 5002 [Chord]. It has been updated based on more recent research results 5003 and implementation experiences, and to adapt it to the RELOAD 5004 protocol. A short list of differences: 5006 o The original Chord algorithm specified that a single predecessor 5007 and a successor list be stored. The CHORD-RELOAD algorithm 5008 attempts to have more than one predecessor and successor. The 5009 predecessor sets help other neighbors learn their successor list. 5010 o The original Chord specification and analysis called for iterative 5011 routing. RELOAD specifies recursive routing. In addition to the 5012 performance implications, the cost of NAT traversal dictates 5013 recursive routing. 5014 o Finger table entries are indexed in opposite order. Original 5015 Chord specifies finger[0] as the immediate successor of the peer. 5016 CHORD-RELOAD specifies finger[0] as the peer 180 degrees around 5017 the ring from the peer. This change was made to simplify 5018 discussion and implementation of variable sized finger tables. 5019 However, with either approach no more than O(log N) entries should 5020 typically be stored in a finger table. 5021 o The stabilize() and fix_fingers() algorithms in the original Chord 5022 algorithm are merged into a single periodic process. 5023 Stabilization is implemented slightly differently because of the 5024 larger neighborhood, and fix_fingers is not as aggressive to 5025 reduce load, nor does it search for optimal matches of the finger 5026 table entries. 5027 o RELOAD allows for a 128 bit hash instead of a 160 bit hash, as 5028 RELOAD is not designed to be used in networks with close to or 5029 more than 2^128 nodes or objects (and it is hard to see how one 5030 would assemble such a network). 5031 o RELOAD uses randomized finger entries as described in 5032 Section 10.7.4.2. 5033 o This algorithm allows the use of either reactive or periodic 5034 recovery. The original Chord paper used periodic recovery. 5035 Reactive recovery provides better performance in small overlays, 5036 but is believed to be unstable in large (>1000) overlays with high 5037 levels of churn [handling-churn-usenix04]. The overlay 5038 configuration file specifies a "chord-reactive" element that 5039 indicates whether reactive recovery should be used. 5041 10.1. Overview 5043 The algorithm described here, CHORD-RELOAD, is a modified version of 5044 the Chord algorithm. In Chord (and in the algorithm described here), 5045 nodes are arranged in a ring with node n being adjacent to nodes n-1 5046 and n+1, with all arithmetic being done modulo 2^{k}, where k is the 5047 length of the Node-ID in bits, so that node 2^{k} - 1 is directly 5048 before node 0. 5050 Each peer keeps track of a finger table and a neighbor table. The 5051 neighbor table contains at least the three peers before and after 5052 this peer in the DHT ring. There may not be three entries in all 5053 cases such as small rings or while the ring topology is changing. 5054 The first entry in the finger table contains the peer half-way around 5055 the ring from this peer; the second entry contains the peer that is 5056 1/4 of the way around; the third entry contains the peer that is 5057 1/8th of the way around, and so on. Fundamentally, the Chord DHT can 5058 be thought of a doubly-linked list formed by knowing the successors 5059 and predecessor peers in the neighbor table, sorted by the Node-ID. 5060 As long as the successor peers are correct, the DHT will return the 5061 correct result. The pointers to the prior peers are kept to enable 5062 the insertion of new peers into the list structure. Keeping multiple 5063 predecessor and successor pointers makes it possible to maintain the 5064 integrity of the data structure even when consecutive peers 5065 simultaneously fail. The finger table forms a skip 5066 list[wikiSkiplist], so that entries in the linked list can be found 5067 in O(log(N)) time instead of the typical O(N) time that a linked list 5068 would provide where N represents the number of nodes in the DHT. 5070 The neighbor and finger table entries contain logical Node-IDs as 5071 values but the actual mapping of an IP level addressing information 5072 to reach that Node-ID is kept in the connection table. 5074 A peer, x, is responsible for a particular Resource-ID k if k is less 5075 than or equal to x and k is greater than p, where p is the Node-ID of 5076 the previous peer in the neighbor table. Care must be taken when 5077 computing to note that all math is modulo 2^128. 5079 10.2. Hash Function 5081 For this Chord based topology plugin, the size of the Resource-ID is 5082 128 bits. The hash of a Resource-ID MUST be computed using SHA-1 5083 [RFC3174] then the SHA-1 result MUST be truncated to the most 5084 significant 128 bits. 5086 10.3. Routing 5088 The routing table is conceptually the union of the neighbor table and 5089 the finger table. 5091 If a peer is not responsible for a Resource-ID k, but is directly 5092 connected to a node with Node-ID k, then it MUST route the message to 5093 that node. Otherwise, it MUST route the request to the peer in the 5094 routing table that has the largest Node-ID that is in the interval 5095 between the peer and k. If no such node is found, it finds the 5096 smallest Node-ID that is greater than k and MUST route the message to 5097 that node. 5099 10.4. Redundancy 5101 When a peer receives a Store request for Resource-ID k, and it is 5102 responsible for Resource-ID k, it MUST store the data and returns a 5103 success response. It MUST then send a Store request to its successor 5104 in the neighbor table and to that peer's successor. Note that these 5105 Store requests are addressed to those specific peers, even though the 5106 Resource-ID they are being asked to store is outside the range that 5107 they are responsible for. The peers receiving these SHOULD check 5108 they came from an appropriate predecessor in their neighbor table and 5109 that they are in a range that this predecessor is responsible for, 5110 and then they MUST store the data. They do not themselves perform 5111 further Stores because they can determine that they are not 5112 responsible for the Resource-ID. 5114 Managing replicas as the overlay changes is described in 5115 Section 10.7.3. 5117 The sequential replicas used in this overlay algorithm protect 5118 against peer failure but not against malicious peers. Additional 5119 replication from the Usage is required to protect resources from such 5120 attacks, as discussed in Section 13.5.4. 5122 10.5. Joining 5124 The join process for a Joining Node (JN) with Node-ID n is as 5125 follows. 5127 1. JN MUST connect to its chosen bootstrap node. 5128 2. JN SHOULD send an Attach request to the admitting peer (AP) for 5129 Node-ID n. The "send_update" flag can be used to acquire the 5130 routing table for AP. 5131 3. JN SHOULD send Attach requests to initiate connections to each of 5132 the peers in the neighbor table as well as to the desired finger 5133 table entries. Note that this does not populate their routing 5134 tables, but only their connection tables, so JN will not get 5135 messages that it is expected to route to other nodes. 5136 4. JN MUST enter all the peers it has successfully contacted into 5137 its routing table. 5138 5. JN MUST send a Join to AP. The AP MUST send the response to the 5139 Join. 5140 6. AP MUST do a series of Store requests to JN to store the data 5141 that JN will be responsible for. 5142 7. AP MUST send JN an Update explicitly labeling JN as its 5143 predecessor. At this point, JN is part of the ring and 5144 responsible for a section of the overlay. AP MAY now forget any 5145 data which is assigned to JN and not AP. AP SHOULD NOT forget 5146 any data where AP is the replica set for the data. 5147 8. The AP MUST send an Update to all of its neighbors with the new 5148 values of its neighbor set (including JN). 5149 9. The JN MUST send Updates to all the peers in its neighbor table. 5151 If JN sends an Attach to AP with send_update, it immediately knows 5152 most of its expected neighbors from AP's routing table update and MAY 5153 directly connect to them. This is the RECOMMENDED procedure. 5155 If for some reason JN does not get AP's routing table, it MAY still 5156 populate its neighbor table incrementally. It SHOULD send a Ping 5157 directed at Resource-ID n+1 (directly after its own Resource-ID). 5158 This allows it to discover its own successor. Call that node p0. It 5159 then SHOULD send a ping to p0+1 to discover its successor (p1). This 5160 process MAY be repeated to discover as many successors as desired. 5161 The values for the two peers before p will be found at a later stage 5162 when n receives an Update. An alternate procedure is to send 5163 Attaches to those nodes rather than pings, which forms the 5164 connections immediately but may be slower if the nodes need to 5165 collect ICE candidates, thus reducing parallelism. 5167 In order to set up its i'th finger table entry, JN MUST send an 5168 Attach to peer n+2^(128-i). This will be routed to a peer in 5169 approximately the right location around the ring. (Note the first 5170 entry in the finger table has i=1 and not i=0 in this formulation). 5172 The joining node MUST NOT send any Update message placing itself in 5173 the overlay until it has successfully completed an Attach with each 5174 peer that should be in its neighbor table. 5176 10.6. Routing Attaches 5178 When a peer needs to Attach to a new peer in its neighbor table, it 5179 MUST source-route the Attach request through the peer from which it 5180 learned the new peer's Node-ID. Source-routing these requests allows 5181 the overlay to recover from instability. 5183 All other Attach requests, such as those for new finger table 5184 entries, are routed conventionally through the overlay. 5186 10.7. Updates 5188 An Update for this DHT is defined as 5190 enum { invalidChordUpdateType(0), 5191 peer_ready(1), neighbors(2), full(3), (255) } 5192 ChordUpdateType; 5194 struct { 5195 uint32 uptime; 5196 ChordUpdateType type; 5197 select (type){ 5198 case peer_ready: /* Empty */ 5199 ; 5201 case neighbors: 5202 NodeId predecessors<0..2^16-1>; 5203 NodeId successors<0..2^16-1>; 5205 case full: 5206 NodeId predecessors<0..2^16-1>; 5207 NodeId successors<0..2^16-1>; 5208 NodeId fingers<0..2^16-1>; 5209 }; 5210 } ChordUpdate; 5212 The "uptime" field contains the time this peer has been up in 5213 seconds. 5215 The "type" field contains the type of the update, which depends on 5216 the reason the update was sent. 5218 peer_ready: this peer is ready to receive messages. This message 5219 is used to indicate that a node which has Attached is a peer and 5220 can be routed through. It is also used as a connectivity check to 5221 non-neighbor peers. 5223 neighbors: this version is sent to members of the Chord neighbor 5224 table. 5226 full: this version is sent to peers which request an Update with a 5227 RouteQueryReq. 5229 If the message is of type "neighbors", then the contents of the 5230 message will be: 5232 predecessors 5233 The predecessor set of the Updating peer. 5235 successors 5236 The successor set of the Updating peer. 5238 If the message is of type "full", then the contents of the message 5239 will be: 5241 predecessors 5242 The predecessor set of the Updating peer. 5244 successors 5245 The successor set of the Updating peer. 5247 fingers 5248 The finger table of the Updating peer, in numerically ascending 5249 order. 5251 A peer MUST maintain an association (via Attach) to every member of 5252 its neighbor set. A peer MUST attempt to maintain at least three 5253 predecessors and three successors, even though this will not be 5254 possible if the ring is very small. It is RECOMMENDED that O(log(N)) 5255 predecessors and successors be maintained in the neighbor set. There 5256 are many ways to estimate N, some of which are discussed in 5257 [I-D.ietf-p2psip-self-tuning]. 5259 10.7.1. Handling Neighbor Failures 5261 Every time a connection to a peer in the neighbor table is lost (as 5262 determined by connectivity pings or the failure of some request), the 5263 peer MUST remove the entry from its neighbor table and replace it 5264 with the best match it has from the other peers in its routing table. 5265 If using reactive recovery, it MUST send an immediate Update to all 5266 nodes in its Neighbor Table. The update will contain all the Node- 5267 IDs of the current entries of the table (after the failed one has 5268 been removed). Note that when replacing a successor the peer SHOULD 5269 delay the creation of new replicas for successor replacement hold- 5270 down time (30 seconds) after removing the failed entry from its 5271 neighbor table in order to allow a triggered update to inform it of a 5272 better match for its neighbor table. 5274 If the neighbor failure affects the peer's range of responsible IDs, 5275 then the Update MUST be sent to all nodes in its Connection Table. 5277 A peer MAY attempt to reestablish connectivity with a lost neighbor 5278 either by waiting additional time to see if connectivity returns or 5279 by actively routing a new Attach to the lost peer. Details for these 5280 procedures are beyond the scope of this document. In the case of an 5281 attempt to reestablish connectivity with a lost neighbor, the peer 5282 MUST be removed from the neighbor table. Such a peer is returned to 5283 the neighbor table once connectivity is reestablished. 5285 If connectivity is lost to all successor peers in the neighbor table, 5286 then this peer SHOULD behave as if it is joining the network and MUST 5287 use Pings to find a peer and send it a Join. If connectivity is lost 5288 to all the peers in the finger table, this peer SHOULD assume that it 5289 has been disconnected from the rest of the network, and it SHOULD 5290 periodically try to join the DHT. 5292 10.7.2. Handling Finger Table Entry Failure 5294 If a finger table entry is found to have failed, all references to 5295 the failed peer MUST be removed from the finger table and replaced 5296 with the closest preceding peer from the finger table or neighbor 5297 table. 5299 If using reactive recovery, the peer MUST initiate a search for a new 5300 finger table entry as described below. 5302 10.7.3. Receiving Updates 5304 When a peer, x, receives an Update request, it examines the Node-IDs 5305 in the UpdateReq and at its neighbor table and decides if this 5306 UpdateReq would change its neighbor table. This is done by taking 5307 the set of peers currently in the neighbor table and comparing them 5308 to the peers in the update request. There are two major cases: 5310 o The UpdateReq contains peers that match x's neighbor table, so no 5311 change is needed to the neighbor set. 5312 o The UpdateReq contains peers x does not know about that should be 5313 in x's neighbor table, i.e. they are closer than entries in the 5314 neighbor table. 5316 In the first case, no change is needed. 5318 In the second case, x MUST attempt to Attach to the new peers and if 5319 it is successful it MUST adjust its neighbor set accordingly. Note 5320 that it can maintain the now inferior peers as neighbors, but it MUST 5321 remember the closer ones. 5323 After any Pings and Attaches are done, if the neighbor table changes 5324 and the peer is using reactive recovery, the peer MUST send an Update 5325 request to each member of its Connection Table. These Update 5326 requests are what end up filling in the predecessor/successor tables 5327 of peers that this peer is a neighbor to. A peer MUST NOT enter 5328 itself in its successor or predecessor table and instead should leave 5329 the entries empty. 5331 If peer x is responsible for a Resource-ID R, and x discovers that 5332 the replica set for R (the next two nodes in its successor set) has 5333 changed, it MUST send a Store for any data associated with R to any 5334 new node in the replica set. It SHOULD NOT delete data from peers 5335 which have left the replica set. 5337 When a peer x detects that it is no longer in the replica set for a 5338 resource R (i.e., there are three predecessors between x and R), it 5339 SHOULD delete all data associated with R from its local store. 5341 When a peer discovers that its range of responsible IDs have changed, 5342 it MUST send an Update to all entries in its connection table. 5344 10.7.4. Stabilization 5346 There are four components to stabilization: 5347 1. exchange Updates with all peers in its neighbor table to exchange 5348 state. 5349 2. search for better peers to place in its finger table. 5350 3. search to determine if the current finger table size is 5351 sufficiently large. 5352 4. search to determine if the overlay has partitioned and needs to 5353 recover. 5355 10.7.4.1. Updating neighbor table 5357 A peer MUST periodically send an Update request to every peer in its 5358 Neighbor Table. The purpose of this is to keep the predecessor and 5359 successor lists up to date and to detect failed peers. The default 5360 time is about every ten minutes, but the configuration server SHOULD 5361 set this in the configuration document using the "chord-update- 5362 interval" element (denominated in seconds.) A peer SHOULD randomly 5363 offset these Update requests so they do not occur all at once. 5365 10.7.4.2. Refreshing finger table 5367 A peer MUST periodically search for new peers to replace invalid 5368 entries in the finger table. For peer x, the i'th finger table entry 5369 is valid if it is in the range [ x+2^( 128-i ), x+2^( 128-(i-1) )-1 5370 ]. Invalid entries occur in the finger table when a previous finger 5371 table entry has failed or when no peer has been found in that range. 5373 A peer SHOULD NOT send Ping requests looking for new finger table 5374 entries more often than the configuration element "chord-ping- 5375 interval", which defaults to 3600 seconds (one per hour). 5377 Two possible methods for searching for new peers for the finger table 5378 entries are presented: 5380 Alternative 1: A peer selects one entry in the finger table from 5381 among the invalid entries. It pings for a new peer for that finger 5382 table entry. The selection SHOULD be exponentially weighted to 5383 attempt to replace earlier (lower i) entries in the finger table. A 5384 simple way to implement this selection is to search through the 5385 finger table entries from i=1 and each time an invalid entry is 5386 encountered, send a Ping to replace that entry with probability 0.5. 5388 Alternative 2: A peer monitors the Update messages received from its 5389 connections to observe when an Update indicates a peer that would be 5390 used to replace in invalid finger table entry, i, and flags that 5391 entry in the finger table. Every "chord-ping-interval" seconds, the 5392 peer selects from among those flagged candidates using an 5393 exponentially weighted probability as above. 5395 When searching for a better entry, the peer SHOULD send the Ping to a 5396 Node-ID selected randomly from that range. Random selection is 5397 preferred over a search for strictly spaced entries to minimize the 5398 effect of churn on overlay routing [minimizing-churn-sigcomm06]. An 5399 implementation or subsequent specification MAY choose a method for 5400 selecting finger table entries other than choosing randomly within 5401 the range. Any such alternate methods SHOULD be employed only on 5402 finger table stabilization and not for the selection of initial 5403 finger table entries unless the alternative method is faster and 5404 imposes less overhead on the overlay. 5406 A peer MAY choose to keep connections to multiple peers that can act 5407 for a given finger table entry. 5409 10.7.4.3. Adjusting finger table size 5411 If the finger table has less than 16 entries, the node SHOULD attempt 5412 to discover more fingers to grow the size of the table to 16. The 5413 value 16 was chosen to ensure high odds of a node maintaining 5414 connectivity to the overlay even with strange network partitions. 5416 For many overlays, 16 finger table entries will be enough, but as an 5417 overlay grows very large, more than 16 entries may be required in the 5418 finger table for efficient routing. An implementation SHOULD be 5419 capable of increasing the number of entries in the finger table to 5420 128 entries. 5422 Although log(N) entries are all that are required for optimal 5423 performance, careful implementation of stabilization will result in 5424 no additional traffic being generated when maintaining a finger table 5425 larger than log(N) entries. Implementers are encouraged to make use 5426 of RouteQuery and algorithms for determining where new finger table 5427 entries may be found. Complete details of possible implementations 5428 are outside the scope of this specification. 5430 A simple approach to sizing the finger table is to ensure the finger 5431 table is large enough to contain at least the final successor in the 5432 peer's neighbor table. 5434 10.7.4.4. Detecting partitioning 5436 To detect that a partitioning has occurred and to heal the overlay, a 5437 peer P MUST periodically repeat the discovery process used in the 5438 initial join for the overlay to locate an appropriate bootstrap node, 5439 B. P SHOULD then send a Ping for its own Node-ID routed through B. If 5440 a response is received from a peer S', which is not P's successor, 5441 then the overlay is partitioned and P SHOULD send an Attach to S' 5442 routed through B, followed by an Update sent to S'. (Note that S' 5443 may not be in P's neighbor table once the overlay is healed, but the 5444 connection will allow S' to discover appropriate neighbor entries for 5445 itself via its own stabilization.) 5447 Future specifications may describe alternative mechanisms for 5448 determining when to repeat the discovery process. 5450 10.8. Route query 5452 For CHORD-RELOAD, the RouteQueryReq contains no additional 5453 information. The RouteQueryAns contains the single Node-ID of the 5454 next peer to which the responding peer would have routed the request 5455 message in recursive routing: 5457 struct { 5458 NodeId next_peer; 5459 } ChordRouteQueryAns; 5461 The contents of this structure are as follows: 5463 next_peer 5464 The peer to which the responding peer would route the message in 5465 order to deliver it to the destination listed in the request. 5467 If the requester has set the send_update flag, the responder SHOULD 5468 initiate an Update immediately after sending the RouteQueryAns. 5470 10.9. Leaving 5472 To support extensions, such as [I-D.ietf-p2psip-self-tuning], Peers 5473 SHOULD send a Leave request to all members of their neighbor table 5474 prior to exiting the Overlay Instance. The overlay_specific_data 5475 field MUST contain the ChordLeaveData structure defined below: 5477 enum { invalidChordLeaveType(0), 5478 from_succ(1), from_pred(2), (255) } 5479 ChordLeaveType; 5481 struct { 5482 ChordLeaveType type; 5484 select (type) { 5485 case from_succ: 5486 NodeId successors<0..2^16-1>; 5488 case from_pred: 5489 NodeId predecessors<0..2^16-1>; 5490 }; 5491 } ChordLeaveData; 5493 The 'type' field indicates whether the Leave request was sent by a 5494 predecessor or a successor of the recipient: 5496 from_succ 5497 The Leave request was sent by a successor. 5499 from_pred 5500 The Leave request was sent by a predecessor. 5502 If the type of the request is 'from_succ', the contents will be: 5504 successors 5505 The sender's successor list. 5507 If the type of the request is 'from_pred', the contents will be: 5509 predecessors 5510 The sender's predecessor list. 5512 Any peer which receives a Leave for a peer n in its neighbor set MUST 5513 follow procedures as if it had detected a peer failure as described 5514 in Section 10.7.1. 5516 11. Enrollment and Bootstrap 5518 The section defines the format of the configuration data as well the 5519 process to join a new overlay. 5521 11.1. Overlay Configuration 5523 This specification defines a new content type "application/ 5524 p2p-overlay+xml" for an MIME entity that contains overlay 5525 information. An example document is shown below. 5527 5528 5531 5533 CHORD-RELOAD 5534 16 5535 5536 MIIDJDCCAo2gAwIBAgIBADANBgkqhkiG9w0BAQUFADBwMQswCQYDVQQGEwJVUzET 5537 MBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxDjAMBgNVBAoT 5538 BXNpcGl0MSkwJwYDVQQLEyBTaXBpdCBUZXN0IENlcnRpZmljYXRlIEF1dGhvcml0 5539 eTAeFw0wMzA3MTgxMjIxNTJaFw0xMzA3MTUxMjIxNTJaMHAxCzAJBgNVBAYTAlVT 5540 MRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEOMAwGA1UE 5541 ChMFc2lwaXQxKTAnBgNVBAsTIFNpcGl0IFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9y 5542 aXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDIh6DkcUDLDyK9BEUxkud 5543 +nJ4xrCVGKfgjHm6XaSuHiEtnfELHM+9WymzkBNzZpJu30yzsxwfKoIKugdNUrD4 5544 N3viCicwcN35LgP/KnbN34cavXHr4ZlqxH+OdKB3hQTpQa38A7YXdaoz6goW2ft5 5545 Mi74z03GNKP/G9BoKOGd5QIDAQABo4HNMIHKMB0GA1UdDgQWBBRrRhcU6pR2JYBU 5546 bhNU2qHjVBShtjCBmgYDVR0jBIGSMIGPgBRrRhcU6pR2JYBUbhNU2qHjVBShtqF0 5547 pHIwcDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcT 5548 CFNhbiBKb3NlMQ4wDAYDVQQKEwVzaXBpdDEpMCcGA1UECxMgU2lwaXQgVGVzdCBD 5549 ZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B 5550 AQUFAAOBgQCWbRvv1ZGTRXxbH8/EqkdSCzSoUPrs+rQqR0xdQac9wNY/nlZbkR3O 5551 qAezG6Sfmklvf+DOg5RxQq/+Y6I03LRepc7KeVDpaplMFGnpfKsibETMipwzayNQ 5552 QgUf4cKBiF+65Ue7hZuDJa2EMv8qW4twEhGDYclpFU9YozyS1OhvUg== 5553 5554 YmFkIGNlcnQK 5555 https://example.org 5556 https://example.net 5557 false 5559 5560 5561 5562 20 5563 false 5564 false 5565 5566 400 5567 30 5568 true 5569 password 5570 4000 5571 30 5572 3000 5573 TLS 5574 47112162e84c69ba 5575 47112162e84c69ba 5576 6eba45d31a900c06 5577 6ebc45d31a900c06 5578 6ebc45d31a900ca6 5580 foo 5582 5583 urn:ietf:params:xml:ns:p2p:config-ext1 5584 5585 5586 5587 5588 SINGLE 5589 USER-MATCH 5590 1 5591 100 5592 5593 5594 VGhpcyBpcyBub3QgcmlnaHQhCg== 5595 5596 5597 5598 5599 ARRAY 5600 NODE-MULTIPLE 5601 3 5602 22 5603 4 5604 1 5605 5606 5607 5608 VGhpcyBpcyBub3QgcmlnaHQhCg== 5609 5610 5611 5612 5613 VGhpcyBpcyBub3QgcmlnaHQhCg== 5615 5616 5617 VGhpcyBpcyBub3QgcmlnaHQhCg== 5619 5621 The file MUST be a well formed XML document and it SHOULD contain an 5622 encoding declaration in the XML declaration. The file MUST use the 5623 UTF-8 character encoding. The namespace for the elements defined in 5624 this specification is urn:ietf:params:xml:ns:p2p:config-base and 5625 urn:ietf:params:xml:ns:p2p:config-chord". 5627 Note that elements or attributes that are defined as type xsd:boolean 5628 in the RELAX NG schema (Section 11.1.1) have two lexical 5629 representations, "1" or "true" for the concept true and "0" or 5630 "false" for the concept false. Whitespace and case processing 5631 follows the rules of [OASIS.relax_ng] and XML Schema Datatypes 5633 [W3C.REC-xmlschema-2-20041028] . 5635 The file MAY contain multiple "configuration" elements where each one 5636 contains the configuration information for a different overlay. Each 5637 configuration element MAY be followed by signature elements that 5638 provides a signature over the preceding configuration element. Each 5639 configuration element has the following attributes: 5641 instance-name: the name of the overlay (referred to as "overlay 5642 name" in this specification) 5644 expiration: time in the future at which this overlay configuration 5645 is no longer valid. The node SHOULD retrieve a new copy of the 5646 configuration at a randomly selected time that is before the 5647 expiration time. Note that if the certificates expire before a 5648 new configuration is retried, the node will not be able to 5649 validate the configuration file. All times MUST be in UTC. 5651 sequence: a monotonically increasing sequence number between 0 and 5652 2^16-2 5654 Inside each overlay element, the following elements can occur: 5656 topology-plugin This element defines the overlay algorithm being 5657 used. If missing the default is "CHORD-RELOAD". 5659 node-id-length This element contains the length of a NodeId 5660 (NodeIdLength) in bytes. This value MUST be between 16 (128 bits) 5661 and 20 (160 bits). If this element is not present, the default of 5662 16 is used. 5664 root-cert This element contains a base-64 encoded X.509v3 5665 certificate that is a root trust anchor used to sign all 5666 certificates in this overlay. There can be more than one root- 5667 cert element. 5669 enrollment-server This element contains the URL at which the 5670 enrollment server can be reached in a "url" element. This URL 5671 MUST be of type "https:". More than one enrollment-server element 5672 MAY be present. Note that there is no necessary relationship 5673 between the overlay name/configuration server name and the 5674 enrollment server name. 5676 self-signed-permitted This element indicates whether self-signed 5677 certificates are permitted. If it is set to "true", then self- 5678 signed certificates are allowed, in which case the enrollment- 5679 server and root-cert elements MAY be absent. Otherwise, it SHOULD 5680 be absent, but MAY be set to "false". This element also contains 5681 an attribute "digest" which indicates the digest to be used to 5682 compute the Node-ID. Valid values for this parameter are "sha1" 5683 and "sha256" representing SHA-1 [RFC3174] and SHA-256 [RFC6234] 5684 respectively. Implementations MUST support both of these 5685 algorithms. 5687 bootstrap-node This element represents the address of one of the 5688 bootstrap nodes. It has an attribute called "address" that 5689 represents the IP address (either IPv4 or IPv6, since they can be 5690 distinguished) and an optional attribute called "port" that 5691 represents the port and defaults to 6084. The IPv6 address is in 5692 typical hexadecimal form using standard period and colon 5693 separators as specified in [RFC5952]. More than one bootstrap- 5694 node element MAY be present. 5696 turn-density This element is a positive integer that represents the 5697 approximate reciprocal of density of nodes that can act as TURN 5698 servers. For example, if 5% of the nodes can act as TURN servers, 5699 this would be set to 20. If it is not present, the default value 5700 is 1. If there are no TURN servers in the overlay, it is set to 5701 zero. 5703 clients-permitted This element represents whether clients are 5704 permitted or whether all nodes must be peers. If clients are 5705 permitted, the element MUST be set to "true" or absent. If the 5706 nodes are not allowed to remain clients after the initial join, 5707 the element MUST be set to "false". There is currently no way for 5708 the overlay to enforce this. 5710 no-ice This element represents whether nodes are REQUIRED to use 5711 the "No-ICE" Overlay Link protocols in this overlay. If it is 5712 absent, it is treated as if it were set to "false". 5714 chord-update-interval The update frequency for the CHORD-RELOAD 5715 topology plugin (see Section 10). 5717 chord-ping-interval The ping frequency for the CHORD-RELOAD 5718 topology plugin (see Section 10). 5720 chord-reactive Whether reactive recovery SHOULD be used for this 5721 overlay. Set to "true" or "false". Default if missing is "true". 5722 (see Section 10). 5724 shared-secret If shared secret mode is used, this contains the 5725 shared secret. The security guarantee here is that any agent 5726 which is able to access the configuration document (presumably 5727 protected by some sort of HTTP access control or network topology) 5728 is able to recover the shared secret and hence join the overlay. 5730 max-message-size Maximum size in bytes of any message in the 5731 overlay. If this value is not present, the default is 5000. 5733 initial-ttl Initial default TTL (time to live, see Section 6.3.2) 5734 for messages. If this value is not present, the default is 100. 5736 overlay-reliability-timer Default value for the end-to-end 5737 retransmission timer for messages, in milliseconds. If not 5738 present, the default value is 3000. 5740 overlay-link-protocol Indicates a permissible overlay link protocol 5741 (see Section 6.6.1 for requirements for such protocols). An 5742 arbitrary number of these elements may appear. If none appear, 5743 then this implies the default value, "TLS", which refers to the 5744 use of TLS and DTLS. If one or more elements appear, then no 5745 default value applies. 5747 kind-signer This contains a single Node-ID in hexadecimal and 5748 indicates that the certificate with this Node-ID is allowed to 5749 sign Kinds. Identifying kind-signer by Node-ID instead of 5750 certificate allows the use of short lived certificates without 5751 constantly having to provide an updated configuration file. 5753 configuration-signer This contains a single Node-ID in hexadecimal 5754 and indicates that the certificate with this Node-ID is allowed to 5755 sign configurations for this instance-name. Identifying the 5756 signer by Node-ID instead of certificate allows the use of short 5757 lived certificates without constantly having to provide an updated 5758 configuration file. 5760 bad-node This contains a single Node-ID in hexadecimal and 5761 indicates that the certificate with this Node-ID MUST NOT be 5762 considered valid. This allows certificate revocation. An 5763 arbitrary number of these elements can be provided. Note that 5764 because certificates may expire, bad-node entries need only be 5765 present for the lifetime of the certificate. Technically 5766 speaking, bad Node-IDs may be reused once their certificates have 5767 expired, the requirement for Node-IDs to be pseudo randomly 5768 generated gives this event a vanishing probability. 5770 mandatory-extension This element contains the name of an XML 5771 namespace that a node joining the overlay MUST support. The 5772 presence of a mandatory-extension element does not require the 5773 extension to be used in the current configuration file, but can 5774 indicate that it may be used in the future. Note that the 5775 namespace is case-sensitive, as specified in [w3c-xml-namespaces] 5776 Section 2.3. More than one mandatory-extension element MAY be 5777 present. 5779 Inside each configuration element, the required-kinds element MAY 5780 also occur. This element indicates the Kinds that members MUST 5781 support and contains multiple kind-block elements that each define a 5782 single Kind that MUST be supported by nodes in the overlay. Each 5783 kind-block consists of a single kind element and a kind-signature. 5784 The kind element defines the Kind. The kind-signature is the 5785 signature computed over the kind element. 5787 Each kind element has either an id attribute or a name attribute. 5788 The name attribute is a string representing the Kind (the name 5789 registered to IANA) while the id is an integer Kind-ID allocated out 5790 of private space. 5792 In addition, the kind element MUST contain the following elements: 5793 max-count: the maximum number of values which members of the overlay 5794 must support. 5796 data-model: the data model to be used. 5798 max-size: the maximum size of individual values. 5800 access-control: the access control model to be used. 5802 The kind element MAY also contain the following element: 5803 max-node-multiple: if the access control is NODE-MULTIPLE, this 5804 element MUST be included. This indicates the maximum value for 5805 the i counter. It MUST be an integer greater than 0. 5807 All of the non optional values MUST be provided. If the Kind is 5808 registered with IANA, the data-model and access-control elements MUST 5809 match those in the Kind registration, and clients MUST ignore them in 5810 favor of the IANA versions. Multiple kind-block elements MAY be 5811 present. 5813 The kind-block element also MUST contain a "kind-signature" element. 5814 This signature is computed across the kind element from the beginning 5815 of the first < of the kind element to the end of the last > of the 5816 kind element in the same way as the signature element described later 5817 in this section. kind-block elements MUST be signed by a node listed 5818 in the kind-signers block of the current configuration. Receivers 5819 MUST verify the signature prior to accepting a kind-block. 5821 The configuration element MUST be treated as a binary blob that 5822 cannot be changed - including any whitespace changes - or the 5823 signature will break. The signature MUST be computed by taking each 5824 configuration element and starting from, and including, the first < 5825 at the start of up to and including the > in 5826 and treating this as a binary blob that MUST be 5827 signed using the standard SecurityBlock defined in Section 6.3.4. 5828 The SecurityBlock MUST be base 64 encoded using the base64 alphabet 5829 from [RFC4648] and MUST be put in the signature element following the 5830 configuration object in the configuration file. Any configuration 5831 file MUST be signed by one of the configuration-signer elements from 5832 the previous extant configuration. Recipients MUST verify the 5833 signature prior to accepting the configuration file. 5835 When a node receives a new configuration file, it MUST change its 5836 configuration to meet the new requirements. This may require the 5837 node to exit the DHT and re-join. If a node is not capable of 5838 supporting the new requirements, it MUST exit the overlay. If some 5839 information about a particular Kind changes from what the node 5840 previously knew about the Kind (for example the max size), the new 5841 information in the configuration files overrides any previously 5842 learned information. If any Kind data was signed by a node that is 5843 no longer allowed to sign Kinds, that Kind MUST be discarded along 5844 with any stored information of that Kind. Note that forcing an 5845 avalanche restart of the overlay with a configuration change that 5846 requires re-joining the overlay may result in serious performance 5847 problems, including total collapse of the network if configuration 5848 parameters are not properly considered. Such an event may be 5849 necessary in case of a compromised CA or similar problem, but for 5850 large overlays should be avoided in almost all circumstances. 5852 11.1.1. RELAX NG Grammar 5854 The grammar for the configuration data is: 5856 namespace chord = "urn:ietf:params:xml:ns:p2p:config-chord" 5857 namespace local = "" 5858 default namespace p2pcf = "urn:ietf:params:xml:ns:p2p:config-base" 5859 namespace rng = "http://relaxng.org/ns/structure/1.0" 5861 anything = 5862 (element * { anything } 5863 | attribute * { text } 5864 | text)* 5866 foreign-elements = element * - (p2pcf:* | local:* | chord:*) 5867 { anything }* 5868 foreign-attributes = attribute * - (p2pcf:*|local:*|chord:*) 5869 { text }* 5870 foreign-nodes = (foreign-attributes | foreign-elements)* 5872 start = element p2pcf:overlay { 5873 overlay-element 5874 } 5876 overlay-element &= element configuration { 5877 attribute instance-name { xsd:string }, 5878 attribute expiration { xsd:dateTime }?, 5879 attribute sequence { xsd:long }?, 5880 foreign-attributes*, 5881 parameter 5882 }+ 5883 overlay-element &= element signature { 5884 attribute algorithm { signature-algorithm-type }?, 5885 xsd:base64Binary 5886 }* 5888 signature-algorithm-type |= "rsa-sha1" 5889 signature-algorithm-type |= xsd:string # signature alg extensions 5891 parameter &= element topology-plugin { topology-plugin-type }? 5892 topology-plugin-type |= xsd:string # topo plugin extensions 5893 parameter &= element max-message-size { xsd:unsignedInt }? 5894 parameter &= element initial-ttl { xsd:int }? 5895 parameter &= element root-cert { xsd:base64Binary }* 5896 parameter &= element required-kinds { kind-block* }? 5897 parameter &= element enrollment-server { xsd:anyURI }* 5898 parameter &= element kind-signer { xsd:string }* 5899 parameter &= element configuration-signer { xsd:string }* 5900 parameter &= element bad-node { xsd:string }* 5901 parameter &= element no-ice { xsd:boolean }? 5902 parameter &= element shared-secret { xsd:string }? 5903 parameter &= element overlay-link-protocol { xsd:string }* 5904 parameter &= element clients-permitted { xsd:boolean }? 5905 parameter &= element turn-density { xsd:unsignedByte }? 5906 parameter &= element node-id-length { xsd:int }? 5907 parameter &= element mandatory-extension { xsd:string }* 5908 parameter &= foreign-elements* 5910 parameter &= 5911 element self-signed-permitted { 5912 attribute digest { self-signed-digest-type }, 5913 xsd:boolean 5914 }? 5915 self-signed-digest-type |= "sha1" 5916 self-signed-digest-type |= xsd:string # signature digest extensions 5918 parameter &= element bootstrap-node { 5919 attribute address { xsd:string }, 5920 attribute port { xsd:int }? 5922 }* 5924 kind-block = element kind-block { 5925 element kind { 5926 ( attribute name { kind-names } 5927 | attribute id { xsd:unsignedInt } ), 5928 kind-parameter 5929 } & 5930 element kind-signature { 5931 attribute algorithm { signature-algorithm-type }?, 5932 xsd:base64Binary 5933 }? 5934 } 5936 kind-parameter &= element max-count { xsd:int } 5937 kind-parameter &= element max-size { xsd:int } 5938 kind-parameter &= element max-node-multiple { xsd:int }? 5940 kind-parameter &= element data-model { data-model-type } 5941 data-model-type |= "SINGLE" 5942 data-model-type |= "ARRAY" 5943 data-model-type |= "DICTIONARY" 5944 data-model-type |= xsd:string # data model extensions 5946 kind-parameter &= element access-control { access-control-type } 5947 access-control-type |= "USER-MATCH" 5948 access-control-type |= "NODE-MATCH" 5949 access-control-type |= "USER-NODE-MATCH" 5950 access-control-type |= "NODE-MULTIPLE" 5951 access-control-type |= xsd:string # access control extensions 5953 kind-parameter &= foreign-elements* 5955 kind-names |= "TURN-SERVICE" 5956 kind-names |= "CERTIFICATE_BY_NODE" 5957 kind-names |= "CERTIFICATE_BY_USER" 5958 kind-names |= xsd:string # kind extensions 5960 # Chord specific parameters 5961 topology-plugin-type |= "CHORD-RELOAD" 5962 parameter &= element chord:chord-ping-interval { xsd:int }? 5963 parameter &= element chord:chord-update-interval { xsd:int }? 5964 parameter &= element chord:chord-reactive { xsd:boolean }? 5966 11.2. Discovery Through Configuration Server 5968 When a node first enrolls in a new overlay, it starts with a 5969 discovery process to find a configuration server. 5971 The node MAY start by determining the overlay name. This value MUST 5972 be provided by the user or some other out of band provisioning 5973 mechanism. The out of band mechanisms MAY also provide an optional 5974 URL for the configuration server. If a URL for the configuration 5975 server is not provided, the node MUST do a DNS SRV query using a 5976 Service name of "reload-config" and a protocol of TCP to find a 5977 configuration server and form the URL by appending a path of "/.well- 5978 known/reload-config" to the overlay name. This uses the "well known 5979 URI" framework defined in [RFC5785]. For example, if the overlay 5980 name was example.com, the URL would be 5981 "https://example.com/.well-known/reload-config". 5983 Once an address and URL for the configuration server is determined, 5984 the peer MUST form an HTTPS connection to that IP address. If an 5985 optional URL for the configuration server was provided, the 5986 certificate MUST match the domain name from the URL as described in 5987 [RFC2818]; otherwise the certificate MUST match the overlay name as 5988 described in [RFC2818]. If the HTTPS certificates passes the name 5989 matching, the node MUST fetch a new copy of the configuration file. 5990 To do this, the peer performs a GET to the URL. The result of the 5991 HTTP GET is an XML configuration file described above. If the XML is 5992 not valid, or the instance-name attribute of the overlay-element in 5993 the XML does not match the overlay name, this configurations file 5994 SHOULD be discarded. Otherwise, the new configuration MUST replace 5995 any previously learned configuration file for this overlay. 5997 For overlays that do not use a configuration server, nodes MUST 5998 obtain the configuration information needed to join the overlay 5999 through some out of band approach such as an XML configuration file 6000 sent over email. 6002 11.3. Credentials 6004 If the configuration document contains a enrollment-server element, 6005 credentials are REQUIRED to join the Overlay Instance. A peer which 6006 does not yet have credentials MUST contact the enrollment server to 6007 acquire them. 6009 RELOAD defines its own trivial certificate request protocol. We 6010 would have liked to have used an existing protocol but were concerned 6011 about the implementation burden of even the simplest of those 6012 protocols, such as [RFC5272] and [RFC5273]. The objective was to 6013 have a protocol which could be easily implemented in a Web server 6014 which the operator did not control (e.g., in a hosted service) and 6015 was compatible with the existing certificate handling tooling as used 6016 with the Web certificate infrastructure. This means accepting bare 6017 PKCS#10 requests and returning a single bare X.509 certificate. 6018 Although the MIME types for these objects are defined, none of the 6019 existing protocols support exactly this model. 6021 The certificate request protocol MUST be performed over HTTPS. The 6022 server certificate MUST match the overlay name as described in 6023 [RFC2818]. The request MUST be an HTTP POST with the parameters 6024 encoded as described in [RFC2388] and the following properties: 6026 o If authentication is required, there MUST be form parameters of 6027 "password" and "username" containing the user's account name and 6028 password in the clear (hence the need for HTTPS). The username 6029 and password strings MUST be UTF-8 strings compared as binary 6030 objects. Applications using RELOAD SHOULD define any needed 6031 string preparation as per [RFC4013] or its successor documents. 6032 o If more than one Node-ID is required, there MUST be a form 6033 parameter of "nodeids" containing the number of Node-IDs required. 6034 o There MUST be a form parameter of "csr" with a content type of 6035 "application/pkcs10", as defined in [RFC2311] that contains the 6036 certificate signing request (CSR). 6037 o The Accept header MUST contain the type "application/pkix-cert", 6038 indicating the type that is expected in the response. 6040 The enrollment server MUST authenticate the request using the 6041 provided account name and password. The reason for using the RFC 6042 2388 "multipart/form-data" encoding is so that the password parameter 6043 will not be encoded in the URL to reduce the chance of accidental 6044 leakage of the password. If the authentication succeeds and the 6045 requested user name in the CSR is acceptable, the server MUST 6046 generate and return a certificate for the CSR in the "csr" parameter 6047 of the request. The SubjectAltName field in the certificate MUST 6048 contain the following values: 6050 o One or more Node-IDs which MUST be cryptographically random 6051 [RFC4086]. Each MUST be chosen by the enrollment server in such a 6052 way that they are unpredictable to the requesting user. E.g., the 6053 user MUST NOT be informed of potential (random) Node-IDs prior to 6054 authenticating. Each is placed in the subjectAltName using the 6055 uniformResourceIdentifier type and MUST contain RELOAD URIs as 6056 described in Section 14.15 and MUST contain a Destination list 6057 with a single entry of type "node_id". The enrollment server 6058 SHOULD maintain a mapping of users to Node-IDs and if the same 6059 user returns (e.g., to have their certificate re-issued) return 6060 the same Node-IDs, thus avoiding the need for implementations to 6061 re-store all their data when their certificates expire. 6063 o A single name (the "user name") that this user is allowed to use 6064 in the overlay, using type rfc822Name. Enrollment servers SHOULD 6065 take care to only allow legal characters in the name (e.g., no 6066 embedded NULs), rather than simply accepting any name provided by 6067 the user. In some usages, the right-hand-side of the user name 6068 will match the overlay name, but there is no requirement for this 6069 match in this specification. Applications using this 6070 specification MAY define such a requirement, or MAY otherwise 6071 limit the allowed range of allowed user names. 6073 The certificate MUST be returned as type "application/pkix-cert" as 6074 defined in [RFC2585], with an HTTP status code of 200 OK. 6076 Certificate processing errors SHOULD result in a HTTP return code of 6077 403 "Forbidden" along with a body of type "text/plain" and body that 6078 consists of one of the tokens defined in the following list: 6080 failed_authentication The account name and password combination used 6081 in the HTTPS request was not valid. 6083 username_not_available The requested user name in the CSR was not 6084 acceptable. 6086 Node-IDs_not_available The number of Node-IDs requested was not 6087 acceptable. 6089 bad_CSR There was some other problem with the CSR. 6091 If the client receives an unknown token in the body, it SHOULD treat 6092 it as a failure for an unknown reason. 6094 The client MUST check that the certificate returned chains back to 6095 one of the certificates received in the "root-cert" list of the 6096 overlay configuration data (including PKIX BasicConstraints checks.) 6097 The node then reads the certificate to find the Node-ID it can use. 6099 11.3.1. Self-Generated Credentials 6101 If the "self-signed-permitted" element is present in the 6102 configuration and set to "true", then a node MUST generate its own 6103 self-signed certificate to join the overlay. The self-signed 6104 certificate MAY contain any user name of the users choice. 6106 For self-signed certificate containing only one Node-ID, the Node-ID 6107 MUST be computed by applying the digest specified in the self-signed- 6108 permitted element to the DER representation of the user's public key 6109 (more specifically the subjectPublicKeyInfo) and taking the high 6110 order bits. For self-signed certificates containing multiple Node- 6111 IDs, the index of the Node-ID (from 1 to the number of Node-IDs 6112 needed) must be prepended as a 4 bytes big endian integer to the DER 6113 representation of the user's public key and taking the high order 6114 bits. When accepting a self-signed certificate, nodes MUST check 6115 that the Node-ID and public keys match. This prevents Node-ID theft. 6117 Once the node has constructed a self-signed certificate, it MAY join 6118 the overlay. It MUST store its certificate in the overlay 6119 (Section 8) but SHOULD look to see if the user name is already taken 6120 before and if so choose another user name. Note that this only 6121 provides protection against accidental name collisions. Name theft 6122 is still possible. If protection against name theft is desired, then 6123 the enrollment service MUST be used. 6125 11.4. Contacting a Bootstrap Node 6127 In order to join the overlay, the joining node MUST contact a node in 6128 the overlay. Typically this means contacting the bootstrap nodes, 6129 since they are reachable by the local peer or have public IP 6130 addresses. If the joining node has cached a list of peers it has 6131 previously been connected with in this overlay, as an optimization it 6132 MAY attempt to use one or more of them as bootstrap nodes before 6133 falling back to the bootstrap nodes listed in the configuration file. 6135 When contacting a bootstrap node, the joining node MUST first form 6136 the DTLS or TLS connection to the bootstrap node and then sends an 6137 Attach request over this connection with the destination Node-ID set 6138 to the joining node's Node-ID. 6140 When the requester node finally does receive a response from some 6141 responding node, it can note the Node-ID in the response and use this 6142 Node-ID to start sending requests to join the Overlay Instance as 6143 described in Section 6.4. 6145 After a node has successfully joined the overlay network, it will 6146 have direct connections to several peers. Some MAY be added to the 6147 cached bootstrap nodes list and used in future boots. Peers that are 6148 not directly connected MUST NOT be cached. The suggested number of 6149 peers to cache is 10. Algorithms for determining which peers to 6150 cache are beyond the scope of this specification. 6152 12. Message Flow Example 6154 The following abbreviations are used in the message flow diagrams: 6155 JN = joining node, AP = admitting peer, NP = next peer after the AP, 6156 NNP = next next peer which is the peer after NP, PP = previous peer 6157 before the AP, PPP = previous previous peer which is the peer before 6158 the PP, BP = bootstrap peer. 6160 In the following example, we assume that JN has formed a connection 6161 to one of the bootstrap nodes. JN then sends an Attach through that 6162 peer to a resource ID of itself (JN). It gets routed to the 6163 admitting peer (AP) because JN is not yet part of the overlay. When 6164 AP responds, JN and AP use ICE to set up a connection and then set up 6165 DTLS. Once AP has connected to JN, AP sends to JN an Update to 6166 populate its Routing Table. The following example shows the Update 6167 happening after the DTLS connection is formed but it could also 6168 happen before in which case the Update would often be routed through 6169 other nodes. 6171 JN PPP PP AP NP NNP BP 6172 | | | | | | | 6173 | | | | | | | 6174 | | | | | | | 6175 |Attach Dest=JN | | | | | 6176 |---------------------------------------------------------->| 6177 | | | | | | | 6178 | | | | | | | 6179 | | |Attach Dest=JN | | | 6180 | | |<--------------------------------------| 6181 | | | | | | | 6182 | | | | | | | 6183 | | |Attach Dest=JN | | | 6184 | | |-------->| | | | 6185 | | | | | | | 6186 | | | | | | | 6187 | | |AttachAns | | | 6188 | | |<--------| | | | 6189 | | | | | | | 6190 | | | | | | | 6191 | | |AttachAns | | | 6192 | | |-------------------------------------->| 6193 | | | | | | | 6194 | | | | | | | 6195 |AttachAns | | | | | 6196 |<----------------------------------------------------------| 6197 | | | | | | | 6198 |ICE | | | | | | 6199 |<===========================>| | | | 6200 | | | | | | | 6201 |TLS | | | | | | 6202 |<...........................>| | | | 6203 | | | | | | | 6204 | | | | | | | 6205 | | | | | | | 6206 |Update | | | | | | 6207 |<----------------------------| | | | 6208 | | | | | | | 6209 | | | | | | | 6210 |UpdateAns| | | | | | 6211 |---------------------------->| | | | 6212 | | | | | | | 6213 | | | | | | | 6214 | | | | | | | 6216 Figure 1 6218 The JN then forms connections to the appropriate neighbors, such as 6219 NP, by sending an Attach which gets routed via other nodes. When NP 6220 responds, JN and NP use ICE and DTLS to set up a connection. 6222 JN PPP PP AP NP NNP BP 6223 | | | | | | | 6224 | | | | | | | 6225 | | | | | | | 6226 |Attach NP | | | | | 6227 |---------------------------->| | | | 6228 | | | | | | | 6229 | | | | | | | 6230 | | | |Attach NP| | | 6231 | | | |-------->| | | 6232 | | | | | | | 6233 | | | | | | | 6234 | | | |AttachAns| | | 6235 | | | |<--------| | | 6236 | | | | | | | 6237 | | | | | | | 6238 |AttachAns | | | | | 6239 |<----------------------------| | | | 6240 | | | | | | | 6241 | | | | | | | 6242 |ICE | | | | | | 6243 |<=====================================>| | | 6244 | | | | | | | 6245 | | | | | | | 6246 |TLS | | | | | | 6247 |<.....................................>| | | 6248 | | | | | | | 6249 | | | | | | | 6250 | | | | | | | 6251 | | | | | | | 6253 Figure 2 6255 JN also needs to populate its finger table (for the Chord based DHT). 6256 It issues an Attach to a variety of locations around the overlay. 6257 The diagram below shows it sending an Attach halfway around the Chord 6258 ring to the JN + 2^127. 6260 JN NP XX TP 6261 | | | | 6262 | | | | 6263 | | | | 6264 |Attach JN+2<<126 | | 6265 |-------->| | | 6266 | | | | 6267 | | | | 6268 | |Attach JN+2<<126 | 6269 | |-------->| | 6270 | | | | 6271 | | | | 6272 | | |Attach JN+2<<126 6273 | | |-------->| 6274 | | | | 6275 | | | | 6276 | | |AttachAns| 6277 | | |<--------| 6278 | | | | 6279 | | | | 6280 | |AttachAns| | 6281 | |<--------| | 6282 | | | | 6283 | | | | 6284 |AttachAns| | | 6285 |<--------| | | 6286 | | | | 6287 |ICE | | | 6288 |<===========================>| 6289 | | | | 6290 |TLS | | | 6291 |<...........................>| 6292 | | | | 6293 | | | | 6295 Figure 3 6297 Once JN has a reasonable set of connections, it is ready to take its 6298 place in the DHT. It does this by sending a Join to AP. AP does a 6299 series of Store requests to JN to store the data that JN will be 6300 responsible for. AP then sends JN an Update explicitly labeling JN 6301 as its predecessor. At this point, JN is part of the ring and 6302 responsible for a section of the overlay. AP can now forget any data 6303 which is assigned to JN and not AP. 6305 JN PPP PP AP NP NNP BP 6306 | | | | | | | 6307 | | | | | | | 6308 | | | | | | | 6309 |JoinReq | | | | | | 6310 |---------------------------->| | | | 6311 | | | | | | | 6312 | | | | | | | 6313 |JoinAns | | | | | | 6314 |<----------------------------| | | | 6315 | | | | | | | 6316 | | | | | | | 6317 |StoreReq Data A | | | | | 6318 |<----------------------------| | | | 6319 | | | | | | | 6320 | | | | | | | 6321 |StoreAns | | | | | | 6322 |---------------------------->| | | | 6323 | | | | | | | 6324 | | | | | | | 6325 |StoreReq Data B | | | | | 6326 |<----------------------------| | | | 6327 | | | | | | | 6328 | | | | | | | 6329 |StoreAns | | | | | | 6330 |---------------------------->| | | | 6331 | | | | | | | 6332 | | | | | | | 6333 |UpdateReq| | | | | | 6334 |<----------------------------| | | | 6335 | | | | | | | 6336 | | | | | | | 6337 |UpdateAns| | | | | | 6338 |---------------------------->| | | | 6339 | | | | | | | 6340 | | | | | | | 6341 | | | | | | | 6342 | | | | | | | 6344 Figure 4 6346 In Chord, JN's neighbor table needs to contain its own predecessors. 6347 It couldn't connect to them previously because it did not yet know 6348 their addresses. However, now that it has received an Update from 6349 AP, as in the previous diagram, it has AP's predecessors, which are 6350 also its own, so it sends Attaches to them. Below it is shown 6351 connecting only to AP's closest predecessor, PP. 6353 JN PPP PP AP NP NNP BP 6354 | | | | | | | 6355 | | | | | | | 6356 | | | | | | | 6357 |Attach Dest=PP | | | | | 6358 |---------------------------->| | | | 6359 | | | | | | | 6360 | | | | | | | 6361 | | |Attach Dest=PP | | | 6362 | | |<--------| | | | 6363 | | | | | | | 6364 | | | | | | | 6365 | | |AttachAns| | | | 6366 | | |-------->| | | | 6367 | | | | | | | 6368 | | | | | | | 6369 |AttachAns| | | | | | 6370 |<----------------------------| | | | 6371 | | | | | | | 6372 | | | | | | | 6373 |TLS | | | | | | 6374 |...................| | | | | 6375 | | | | | | | 6376 | | | | | | | 6377 |UpdateReq| | | | | | 6378 |------------------>| | | | | 6379 | | | | | | | 6380 | | | | | | | 6381 |UpdateAns| | | | | | 6382 |<------------------| | | | | 6383 | | | | | | | 6384 | | | | | | | 6385 |UpdateReq| | | | | | 6386 |---------------------------->| | | | 6387 | | | | | | | 6388 | | | | | | | 6389 |UpdateAns| | | | | | 6390 |<----------------------------| | | | 6391 | | | | | | | 6392 | | | | | | | 6393 |UpdateReq| | | | | | 6394 |-------------------------------------->| | | 6395 | | | | | | | 6396 | | | | | | | 6397 |UpdateAns| | | | | | 6398 |<--------------------------------------| | | 6399 | | | | | | | 6400 | | | | | | | 6401 Figure 5 6403 Finally, now that JN has a copy of all the data and is ready to route 6404 messages and receive requests, it sends Updates to everyone in its 6405 Routing Table to tell them it is ready to go. Below, it is shown 6406 sending such an update to TP. 6408 JN NP XX TP 6409 | | | | 6410 | | | | 6411 | | | | 6412 |Update | | | 6413 |---------------------------->| 6414 | | | | 6415 | | | | 6416 |UpdateAns| | | 6417 |<----------------------------| 6418 | | | | 6419 | | | | 6420 | | | | 6421 | | | | 6423 Figure 6 6425 13. Security Considerations 6427 13.1. Overview 6429 RELOAD provides a generic storage service, albeit one designed to be 6430 useful for P2PSIP. In this section we discuss security issues that 6431 are likely to be relevant to any usage of RELOAD. More background 6432 information can be found in [RFC5765]. 6434 In any Overlay Instance, any given user depends on a number of peers 6435 with which they have no well-defined relationship except that they 6436 are fellow members of the Overlay Instance. In practice, these other 6437 nodes may be friendly, lazy, curious, or outright malicious. No 6438 security system can provide complete protection in an environment 6439 where most nodes are malicious. The goal of security in RELOAD is to 6440 provide strong security guarantees of some properties even in the 6441 face of a large number of malicious nodes and to allow the overlay to 6442 function correctly in the face of a modest number of malicious nodes. 6444 P2PSIP deployments require the ability to authenticate both peers and 6445 resources (users) without the active presence of a trusted entity in 6446 the system. We describe two mechanisms. The first mechanism is 6447 based on public key certificates and is suitable for general 6448 deployments. The second is an admission control mechanism based on 6449 an overlay-wide shared symmetric key. 6451 13.2. Attacks on P2P Overlays 6453 The two basic functions provided by overlay nodes are storage and 6454 routing: some peer is responsible for storing a node's data and for 6455 allowing a third node to fetch this stored data. Other peers are 6456 responsible for routing messages to and from the storing nodes. Each 6457 of these issues is covered in the following sections. 6459 P2P overlays are subject to attacks by subversive nodes that may 6460 attempt to disrupt routing, corrupt or remove user registrations, or 6461 eavesdrop on signaling. The certificate-based security algorithms we 6462 describe in this specification are intended to protect overlay 6463 routing and user registration information in RELOAD messages. 6465 To protect the signaling from attackers pretending to be valid nodes 6466 (or nodes other than themselves), the first requirement is to ensure 6467 that all messages are received from authorized members of the 6468 overlay. For this reason, RELOAD MUST transport all messages over a 6469 secure channel (TLS and DTLS are defined in this document) which 6470 provides message integrity and authentication of the directly 6471 communicating peer. In addition, messages and data MUST be digitally 6472 signed with the sender's private key, providing end-to-end security 6473 for communications. 6475 13.3. Certificate-based Security 6477 This specification stores users' registrations and possibly other 6478 data in an overlay network. This requires a solution to securing 6479 this data as well as securing, as well as possible, the routing in 6480 the overlay. Both types of security are based on requiring that 6481 every entity in the system (whether user or peer) authenticate 6482 cryptographically using an asymmetric key pair tied to a certificate. 6484 When a user enrolls in the Overlay Instance, they request or are 6485 assigned a unique name, such as "alice@dht.example.net". These names 6486 MUST be unique and are meant to be chosen and used by humans much 6487 like a SIP Address of Record (AOR) or an email address. The user 6488 MUST also be assigned one or more Node-IDs by the central enrollment 6489 authority. Both the name and the Node-IDs are placed in the 6490 certificate, along with the user's public key. 6492 Each certificate enables an entity to act in two sorts of roles: 6494 o As a user, storing data at specific Resource-IDs in the Overlay 6495 Instance corresponding to the user name. 6496 o As a overlay peer with the Node-ID(s) listed in the certificate. 6498 Note that since only users of this Overlay Instance need to validate 6499 a certificate, this usage does not require a global PKI. Instead, 6500 certificates MUST be signed by a central enrollment authority which 6501 acts as the certificate authority for the Overlay Instance. This 6502 authority signs each node's certificate. Because each node possesses 6503 the CA's certificate (which they receive on enrollment) they can 6504 verify the certificates of the other entities in the overlay without 6505 further communication. Because the certificates contain the user/ 6506 node's public key, communications from the user/node can be verified 6507 in turn. 6509 If self-signed certificates are used, then the security provided is 6510 significantly decreased, since attackers can mount Sybil attacks. In 6511 addition, attackers cannot trust the user names in certificates 6512 (though they can trust the Node-IDs because they are 6513 cryptographically verifiable). This scheme may be appropriate for 6514 some small deployments, such as a small office or an ad hoc overlay 6515 set up among participants in a meeting where all hosts on the network 6516 are trusted. Some additional security can be provided by using the 6517 shared secret admission control scheme as well. 6519 Because all stored data is signed by the owner of the data the 6520 storing node can verify that the storer is authorized to perform a 6521 store at that Resource-ID and also allow any consumer of the data to 6522 verify the provenance and integrity of the data when it retrieves it. 6524 Note that RELOAD does not itself provide a revocation/status 6525 mechanism (though certificates may of course include OCSP responder 6526 information). Thus, certificate lifetimes SHOULD be chosen to 6527 balance the compromise window versus the cost of certificate renewal. 6528 Because RELOAD is already designed to operate in the face of some 6529 fraction of malicious nodes, this form of compromise is not fatal. 6531 All implementations MUST implement certificate-based security. 6533 13.4. Shared-Secret Security 6535 RELOAD also supports a shared secret admission control scheme that 6536 relies on a single key that is shared among all members of the 6537 overlay. It is appropriate for small groups that wish to form a 6538 private network without complexity. In shared secret mode, all the 6539 peers MUST share a single symmetric key which is used to key TLS-PSK 6540 or TLS-SRP mode. A peer which does not know the key cannot form TLS 6541 connections with any other peer and therefore cannot join the 6542 overlay. 6544 One natural approach to a shared-secret scheme is to use a user- 6545 entered password as the key. The difficulty with this is that in 6546 TLS-PSK mode, such keys are very susceptible to dictionary attacks. 6547 If passwords are used as the source of shared-keys, then TLS-SRP is a 6548 superior choice because it is not subject to dictionary attacks. 6550 13.5. Storage Security 6552 When certificate-based security is used in RELOAD, any given 6553 Resource-ID/Kind-ID pair is bound to some small set of certificates. 6554 In order to write data, the writer must prove possession of the 6555 private key for one of those certificates. Moreover, all data is 6556 stored, signed with the same private key that was used to authorize 6557 the storage. This set of rules makes questions of authorization and 6558 data integrity - which have historically been thorny for overlays - 6559 relatively simple. 6561 13.5.1. Authorization 6563 When a node wants to store some value, it MUST first digitally sign 6564 the value with its own private key. It then sends a Store request 6565 that contains both the value and the signature towards the storing 6566 peer (which is defined by the Resource Name construction algorithm 6567 for that particular Kind of value). 6569 When the storing peer receives the request, it MUST determine whether 6570 the storing node is authorized to store at this Resource-ID/Kind-ID 6571 pair. Determining this requires comparing the user's identity to the 6572 requirements of the access control model (see Section 7.3). If it 6573 satisfies those requirements the user is authorized to write, pending 6574 quota checks as described in the next section. 6576 For example, consider the certificate with the following properties: 6578 User name: alice@dht.example.com 6579 Node-ID: 013456789abcdef 6580 Serial: 1234 6582 If Alice wishes to Store a value of the "SIP Location" Kind, the 6583 Resource Name will be the SIP AOR "sip:alice@dht.example.com". The 6584 Resource-ID will be determined by hashing the Resource Name. Because 6585 SIP Location uses the USER-NODE-MATCH policy, it first verifies that 6586 the user name in the certificate hashes to the requested Resource-ID. 6587 It then verifies that the Node-ID in the certificate matches the 6588 dictionary key being used for the store. If both of these checks 6589 succeed, the Store is authorized. Note that because the access 6590 control model is different for different Kinds, the exact set of 6591 checks will vary. 6593 13.5.2. Distributed Quota 6595 Being a peer in an Overlay Instance carries with it the 6596 responsibility to store data for a given region of the Overlay 6597 Instance. However, allowing nodes to store unlimited amounts of data 6598 would create unacceptable burdens on peers and would also enable 6599 trivial denial of service attacks. RELOAD addresses this issue by 6600 requiring configurations to define maximum sizes for each Kind of 6601 stored data. Attempts to store values exceeding this size MUST be 6602 rejected (if peers are inconsistent about this, then strange 6603 artifacts will happen when the zone of responsibility shifts and a 6604 different peer becomes responsible for overlarge data). Because each 6605 Resource-ID/Kind-ID pair is bound to a small set of certificates, 6606 these size restrictions also create a distributed quota mechanism, 6607 with the quotas administered by the central configuration server. 6609 Allowing different Kinds of data to have different size restrictions 6610 allows new usages the flexibility to define limits that fit their 6611 needs without requiring all usages to have expansive limits. 6613 13.5.3. Correctness 6615 Because each stored value is signed, it is trivial for any retrieving 6616 node to verify the integrity of the stored value. Some more care 6617 needs to be taken to prevent version rollback attacks. Rollback 6618 attacks on storage are prevented by the use of store times and 6619 lifetime values in each store. A lifetime represents the latest time 6620 at which the data is valid and thus limits (though does not 6621 completely prevent) the ability of the storing node to perform a 6622 rollback attack on retrievers. In order to prevent a rollback attack 6623 at the time of the Store request, it is REQUIRED that storage times 6624 be monotonically increasing. Storing peers MUST reject Store 6625 requests with storage times smaller than or equal to those they are 6626 currently storing. In addition, a fetching node which receives a 6627 data value with a storage time older than the result of the previous 6628 fetch knows a rollback has occurred. 6630 13.5.4. Residual Attacks 6632 The mechanisms described here provides a high degree of security, but 6633 some attacks remain possible. Most simply, it is possible for 6634 storing peers to refuse to store a value (i.e., reject any request). 6635 In addition, a storing peer can deny knowledge of values which it has 6636 previously accepted. To some extent these attacks can be ameliorated 6637 by attempting to store to/retrieve from replicas, but a retrieving 6638 node does not know whether it should try this or not, since there is 6639 a cost to doing so. 6641 The certificate-based authentication scheme prevents a single peer 6642 from being able to forge data owned by other peers. Furthermore, 6643 although a subversive peer can refuse to return data resources for 6644 which it is responsible, it cannot return forged data because it 6645 cannot provide authentication for such registrations. Therefore 6646 parallel searches for redundant registrations can mitigate most of 6647 the effects of a compromised peer. The ultimate reliability of such 6648 an overlay is a statistical question based on the replication factor 6649 and the percentage of compromised peers. 6651 In addition, when a Kind is multivalued (e.g., an array data model), 6652 the storing peer can return only some subset of the values, thus 6653 biasing its responses. This can be countered by using single values 6654 rather than sets, but that makes coordination between multiple 6655 storing agents much more difficult. This is a trade off that must be 6656 made when designing any usage. 6658 13.6. Routing Security 6660 Because the storage security system guarantees (within limits) the 6661 integrity of the stored data, routing security focuses on stopping 6662 the attacker from performing a DOS attack that misroutes requests in 6663 the overlay. There are a few obvious observations to make about 6664 this. First, it is easy to ensure that an attacker is at least a 6665 valid node in the Overlay Instance. Second, this is a DOS attack 6666 only. Third, if a large percentage of the nodes on the Overlay 6667 Instance are controlled by the attacker, it is probably impossible to 6668 perfectly secure against this. 6670 13.6.1. Background 6672 In general, attacks on DHT routing are mounted by the attacker 6673 arranging to route traffic through one or two nodes it controls. In 6674 the Eclipse attack [Eclipse] the attacker tampers with messages to 6675 and from nodes for which it is on-path with respect to a given victim 6676 node. This allows it to pretend to be all the nodes that are 6677 reachable through it. In the Sybil attack [Sybil], the attacker 6678 registers a large number of nodes and is therefore able to capture a 6679 large amount of the traffic through the DHT. 6681 Both the Eclipse and Sybil attacks require the attacker to be able to 6682 exercise control over her Node-IDs. The Sybil attack requires the 6683 creation of a large number of peers. The Eclipse attack requires 6684 that the attacker be able to impersonate specific peers. In both 6685 cases, these attacks are limited by the use of centralized, 6686 certificate-based admission control. 6688 13.6.2. Admissions Control 6690 Admission to a RELOAD Overlay Instance is controlled by requiring 6691 that each peer have a certificate containing its Node-ID. The 6692 requirement to have a certificate is enforced by using certificate- 6693 based mutual authentication on each connection. (Note: the 6694 following only applies when self-signed certificates are not used.) 6695 Whenever a peer connects to another peer, each side automatically 6696 checks that the other has a suitable certificate. These Node-IDs 6697 MUST be randomly assigned by the central enrollment server. This has 6698 two benefits: 6700 o It allows the enrollment server to limit the number of Node-IDs 6701 issued to any individual user. 6702 o It prevents the attacker from choosing specific Node-IDs. 6704 The first property allows protection against Sybil attacks (provided 6705 the enrollment server uses strict rate limiting policies). The 6706 second property deters but does not completely prevent Eclipse 6707 attacks. Because an Eclipse attacker must impersonate peers on the 6708 other side of the attacker, the attacker must have a certificate for 6709 suitable Node-IDs, which requires him to repeatedly query the 6710 enrollment server for new certificates, which will match only by 6711 chance. From the attacker's perspective, the difficulty is that if 6712 the attacker only has a small number of certificates, the region of 6713 the Overlay Instance he is impersonating appears to be very sparsely 6714 populated by comparison to the victim's local region. 6716 13.6.3. Peer Identification and Authentication 6718 In general, whenever a peer engages in overlay activity that might 6719 affect the routing table it must establish its identity. This 6720 happens in two ways. First, whenever a peer establishes a direct 6721 connection to another peer it authenticates via certificate-based 6722 mutual authentication. All messages between peers are sent over this 6723 protected channel and therefore the peers can verify the data origin 6724 of the last hop peer for requests and responses without further 6725 cryptography. 6727 In some situations, however, it is desirable to be able to establish 6728 the identity of a peer with whom one is not directly connected. The 6729 most natural case is when a peer Updates its state. At this point, 6730 other peers may need to update their view of the overlay structure, 6731 but they need to verify that the Update message came from the actual 6732 peer rather than from an attacker. To prevent this, all overlay 6733 routing messages are signed by the peer that generated them. 6735 Replay is typically prevented for messages that impact the topology 6736 of the overlay by having the information come directly, or be 6737 verified by, the nodes that claimed to have generated the update. 6738 Data storage replay detection is done by signing time of the node 6739 that generated the signature on the store request thus providing a 6740 time based replay protection but the time synchronization is only 6741 needed between peers that can write to the same location. 6743 13.6.4. Protecting the Signaling 6745 The goal here is to stop an attacker from knowing who is signaling 6746 what to whom. An attacker is unlikely to be able to observe the 6747 activities of a specific individual given the randomization of IDs 6748 and routing based on the present peers discussed above. Furthermore, 6749 because messages can be routed using only the header information, the 6750 actual body of the RELOAD message can be encrypted during 6751 transmission. 6753 There are two lines of defense here. The first is the use of TLS or 6754 DTLS for each communications link between peers. This provides 6755 protection against attackers who are not members of the overlay. The 6756 second line of defense is to digitally sign each message. This 6757 prevents adversarial peers from modifying messages in flight, even if 6758 they are on the routing path. 6760 13.6.5. Routing Loops and Dos Attacks 6762 Source routing mechanisms are known to create the possibility for DoS 6763 amplification, especially by the induction of routing loops 6764 [RFC5095]. In order to limit amplification, the initial-ttl value in 6765 the configuration file SHOULD be set to a value slightly larger than 6766 the longest expected path through the network. For Chord, experience 6767 has shown that log(2) of the number of nodes in the network + 5 is a 6768 safe bound. Because nodes are required to enforce the initial-ttl as 6769 the maximum value, an attacker cannot achieve an amplification factor 6770 greater than initial-ttl, thus limiting the additional capabilities 6771 provided by source routing. 6773 In order to prevent the use of loops for targeted implementation 6774 attacks, implementations SHOULD check the destination list for 6775 duplicate entries and discard such records with an 6776 "Error_Invalid_Message" error. This does not completely prevent 6777 loops but does require that at least one attacker node be part of the 6778 loop. 6780 13.6.6. Residual Attacks 6782 The routing security mechanisms in RELOAD are designed to contain 6783 rather than eliminate attacks on routing. It is still possible for 6784 an attacker to mount a variety of attacks. In particular, if an 6785 attacker is able to take up a position on the overlay routing between 6786 A and B it can make it appear as if B does not exist or is 6787 disconnected. It can also advertise false network metrics in an 6788 attempt to reroute traffic. However, these are primarily DOS 6789 attacks. 6791 The certificate-based security scheme secures the namespace, but if 6792 an individual peer is compromised or if an attacker obtains a 6793 certificate from the CA, then a number of subversive peers can still 6794 appear in the overlay. While these peers cannot falsify responses to 6795 resource queries, they can respond with error messages, effecting a 6796 DoS attack on the resource registration. They can also subvert 6797 routing to other compromised peers. To defend against such attacks, 6798 a resource search must still consist of parallel searches for 6799 replicated registrations. 6801 14. IANA Considerations 6803 This section contains the new code points registered by this 6804 document. [NOTE TO IANA/RFC-EDITOR: Please replace RFC-AAAA with 6805 the RFC number for this specification in the following list.] 6807 14.1. Well-Known URI Registration 6809 IANA SHALL make the following "Well Known URI" registration as 6810 described in [RFC5785]: 6812 [[Note to RFC Editor - this paragraph can be removed before 6813 publication. ]] A review request was sent to 6814 wellknown-uri-review@ietf.org on October 12, 2010. 6816 +----------------------------+----------------------+ 6817 | URI suffix: | reload-config | 6818 | Change controller: | IETF | 6819 | Specification document(s): | [RFC-AAAA] | 6820 | Related information: | None | 6821 +----------------------------+----------------------+ 6823 14.2. Port Registrations 6825 [[Note to RFC Editor - this paragraph can be removed before 6826 publication. ]] IANA has already allocated a TCP port for the main 6827 peer to peer protocol. This port has the name p2psip-enroll and the 6828 port number of 6084. IANA needs to update this registration to 6829 change the service name to reload-config and to define it for UDP as 6830 well as TCP. 6832 IANA SHALL make the following port registration: 6834 +-----------------------------+-------------------------------------+ 6835 | Registration Technical | Cullen Jennings | 6836 | Contact | | 6837 | Registration Owner | IETF | 6838 | Transport Protocol | TCP & UDP | 6839 | Port Number | 6084 | 6840 | Service Name | reload-config | 6841 | Description | Peer to Peer Infrastructure | 6842 | | Configuration | 6843 +-----------------------------+-------------------------------------+ 6845 14.3. Overlay Algorithm Types 6847 IANA SHALL create a "RELOAD Overlay Algorithm Type" Registry. 6848 Entries in this registry are strings denoting the names of overlay 6849 algorithms as described in Section 11.1. The registration policy for 6850 this registry is RFC 5226 IETF Review. The initial contents of this 6851 registry are: 6853 +----------------+----------+ 6854 | Algorithm Name | RFC | 6855 +----------------+----------+ 6856 | CHORD-RELOAD | RFC-AAAA | 6857 | EXP-OVERLAY | RFC-AAAA | 6858 +----------------+----------+ 6860 The value EXP-OVERLAY has been made available for the purposes of 6861 experimentation. This value is not meant for vendor specific use of 6862 any sort and it MUST NOT be used for operational deployments. 6864 14.4. Access Control Policies 6866 IANA SHALL create a "RELOAD Access Control Policy" Registry. Entries 6867 in this registry are strings denoting access control policies, as 6868 described in Section 7.3. New entries in this registry SHALL be 6869 registered via RFC 5226 Standards Action. The initial contents of 6870 this registry are: 6872 +-----------------+----------+ 6873 | Access Policy | RFC | 6874 +-----------------+----------+ 6875 | USER-MATCH | RFC-AAAA | 6876 | NODE-MATCH | RFC-AAAA | 6877 | USER-NODE-MATCH | RFC-AAAA | 6878 | NODE-MULTIPLE | RFC-AAAA | 6879 | EXP-MATCH | RFC-AAAA | 6880 +-----------------+----------+ 6882 The value EXP-MATCH has been made available for the purposes of 6883 experimentation. This value is not meant for vendor specific use of 6884 any sort and it MUST NOT be used for operational deployments. 6886 14.5. Application-ID 6888 IANA SHALL create a "RELOAD Application-ID" Registry. Entries in 6889 this registry are 16-bit integers denoting application-ids as 6890 described in Section 6.5.2. Code points in the range 0x0001 to 6891 0x7fff SHALL be registered via RFC 5226 Standards Action. Code 6892 points in the range 0x8000 to 0xf000 SHALL be registered via RFC 5226 6893 Expert Review. Code points in the range 0xf001 to 0xfffe are 6894 reserved for private use. The initial contents of this registry are: 6896 +-------------+----------------+-------------------------------+ 6897 | Application | Application-ID | Specification | 6898 +-------------+----------------+-------------------------------+ 6899 | INVALID | 0 | RFC-AAAA | 6900 | SIP | 5060 | Reserved for use by SIP Usage | 6901 | SIP | 5061 | Reserved for use by SIP Usage | 6902 | Reserved | 0xffff | RFC-AAAA | 6903 +-------------+----------------+-------------------------------+ 6905 14.6. Data Kind-ID 6907 IANA SHALL create a "RELOAD Data Kind-ID" Registry. Entries in this 6908 registry are 32-bit integers denoting data Kinds, as described in 6909 Section 4.2. Code points in the range 0x00000001 to 0x7fffffff SHALL 6910 be registered via RFC 5226 Standards Action. Code points in the 6911 range 0x8000000 to 0xf0000000 SHALL be registered via RFC 5226 Expert 6912 Review. Code points in the range 0xf0000001 to 0xfffffffe are 6913 reserved for private use via the Kind description mechanism described 6914 in Section 11. The initial contents of this registry are: 6916 +---------------------+------------+----------+ 6917 | Kind | Kind-ID | RFC | 6918 +---------------------+------------+----------+ 6919 | INVALID | 0 | RFC-AAAA | 6920 | TURN-SERVICE | 2 | RFC-AAAA | 6921 | CERTIFICATE_BY_NODE | 3 | RFC-AAAA | 6922 | CERTIFICATE_BY_USER | 16 | RFC-AAAA | 6923 | Reserved | 0x7fffffff | RFC-AAAA | 6924 | Reserved | 0xfffffffe | RFC-AAAA | 6925 +---------------------+------------+----------+ 6927 14.7. Data Model 6929 IANA SHALL create a "RELOAD Data Model" Registry. Entries in this 6930 registry are strings denoting data models, as described in 6931 Section 7.2. Code points in this registry SHALL be registered via 6932 RFC 5226 Standards Action. The initial contents of this registry 6933 are: 6935 +------------+----------+ 6936 | Data Model | RFC | 6937 +------------+----------+ 6938 | INVALID | RFC-AAAA | 6939 | SINGLE | RFC-AAAA | 6940 | ARRAY | RFC-AAAA | 6941 | DICTIONARY | RFC-AAAA | 6942 | EXP-DATA | RFC-AAAA | 6943 | RESERVED | RFC-AAAA | 6944 +------------+----------+ 6946 The value EXP-DATA has been made available for the purposes of 6947 experimentation. This value is not meant for vendor specific use of 6948 any sort and it MUST NOT be used for operational deployments. 6950 14.8. Message Codes 6952 IANA SHALL create a "RELOAD Message Code" Registry. Entries in this 6953 registry are 16-bit integers denoting method codes as described in 6954 Section 6.3.3. These codes SHALL be registered via RFC 5226 6955 Standards Action. The initial contents of this registry are: 6957 +---------------------------------+----------------+----------+ 6958 | Message Code Name | Code Value | RFC | 6959 +---------------------------------+----------------+----------+ 6960 | invalidMessageCode | 0 | RFC-AAAA | 6961 | probe_req | 1 | RFC-AAAA | 6962 | probe_ans | 2 | RFC-AAAA | 6963 | attach_req | 3 | RFC-AAAA | 6964 | attach_ans | 4 | RFC-AAAA | 6965 | unused | 5 | | 6966 | unused | 6 | | 6967 | store_req | 7 | RFC-AAAA | 6968 | store_ans | 8 | RFC-AAAA | 6969 | fetch_req | 9 | RFC-AAAA | 6970 | fetch_ans | 10 | RFC-AAAA | 6971 | unused (was remove_req) | 11 | RFC-AAAA | 6972 | unused (was remove_ans) | 12 | RFC-AAAA | 6973 | find_req | 13 | RFC-AAAA | 6974 | find_ans | 14 | RFC-AAAA | 6975 | join_req | 15 | RFC-AAAA | 6976 | join_ans | 16 | RFC-AAAA | 6977 | leave_req | 17 | RFC-AAAA | 6978 | leave_ans | 18 | RFC-AAAA | 6979 | update_req | 19 | RFC-AAAA | 6980 | update_ans | 20 | RFC-AAAA | 6981 | route_query_req | 21 | RFC-AAAA | 6982 | route_query_ans | 22 | RFC-AAAA | 6983 | ping_req | 23 | RFC-AAAA | 6984 | ping_ans | 24 | RFC-AAAA | 6985 | stat_req | 25 | RFC-AAAA | 6986 | stat_ans | 26 | RFC-AAAA | 6987 | unused (was attachlite_req) | 27 | RFC-AAAA | 6988 | unused (was attachlite_ans) | 28 | RFC-AAAA | 6989 | app_attach_req | 29 | RFC-AAAA | 6990 | app_attach_ans | 30 | RFC-AAAA | 6991 | unused (was app_attachlite_req) | 31 | RFC-AAAA | 6992 | unused (was app_attachlite_ans) | 32 | RFC-AAAA | 6993 | config_update_req | 33 | RFC-AAAA | 6994 | config_update_ans | 34 | RFC-AAAA | 6995 | exp_a_req | 35 | RFC-AAAA | 6996 | exp_a_ans | 36 | RFC-AAAA | 6997 | exp_b_req | 37 | RFC-AAAA | 6998 | exp_b_ans | 38 | RFC-AAAA | 6999 | reserved | 0x8000..0xfffe | RFC-AAAA | 7000 | error | 0xffff | RFC-AAAA | 7001 +---------------------------------+----------------+----------+ 7003 The values exp_a_req, exp_a_ans, exp_b_req, and exp_b_ans have been 7004 made available for the purposes of experimentation. These values are 7005 not meant for vendor specific use of any sort and MUST NOT be used 7006 for operational deployments. 7008 14.9. Error Codes 7010 IANA SHALL create a "RELOAD Error Code" Registry. Entries in this 7011 registry are 16-bit integers denoting error codes as described in 7012 Section 6.3.3.1. New entries SHALL be defined via RFC 5226 Standards 7013 Action. The initial contents of this registry are: 7015 +-------------------------------------+----------------+----------+ 7016 | Error Code Name | Code Value | RFC | 7017 +-------------------------------------+----------------+----------+ 7018 | invalidErrorCode | 0 | RFC-AAAA | 7019 | Unused | 1 | RFC-AAAA | 7020 | Error_Forbidden | 2 | RFC-AAAA | 7021 | Error_Not_Found | 3 | RFC-AAAA | 7022 | Error_Request_Timeout | 4 | RFC-AAAA | 7023 | Error_Generation_Counter_Too_Low | 5 | RFC-AAAA | 7024 | Error_Incompatible_with_Overlay | 6 | RFC-AAAA | 7025 | Error_Unsupported_Forwarding_Option | 7 | RFC-AAAA | 7026 | Error_Data_Too_Large | 8 | RFC-AAAA | 7027 | Error_Data_Too_Old | 9 | RFC-AAAA | 7028 | Error_TTL_Exceeded | 10 | RFC-AAAA | 7029 | Error_Message_Too_Large | 11 | RFC-AAAA | 7030 | Error_Unknown_Kind | 12 | RFC-AAAA | 7031 | Error_Unknown_Extension | 13 | RFC-AAAA | 7032 | Error_Response_Too_Large | 14 | RFC-AAAA | 7033 | Error_Config_Too_Old | 15 | RFC-AAAA | 7034 | Error_Config_Too_New | 16 | RFC-AAAA | 7035 | Error_In_Progress | 17 | RFC-AAAA | 7036 | Error_Exp_A | 18 | RFC-AAAA | 7037 | Error_Exp_B | 19 | RFC-AAAA | 7038 | Error_Invalid_Message | 20 | RFC-AAAA | 7039 | reserved | 0x8000..0xfffe | RFC-AAAA | 7040 +-------------------------------------+----------------+----------+ 7042 The values Error_Exp_A and Error_Exp_B have been made available for 7043 the purposes of experimentation. These values are not meant for 7044 vendor specific use of any sort and MUST NOT be used for operational 7045 deployments. 7047 14.10. Overlay Link Types 7049 IANA SHALL create a "RELOAD Overlay Link Registry". For more 7050 information on the link types defined here, see Section 6.6. New 7051 entries SHALL be defined via RFC 5226 Standards Action. This 7052 registry SHALL be initially populated with the following values: 7054 +--------------------+------+---------------+ 7055 | Protocol | Code | Specification | 7056 +--------------------+------+---------------+ 7057 | INVALID-PROTOCOL | 0 | RFC-AAAA | 7058 | DTLS-UDP-SR | 1 | RFC-AAAA | 7059 | DTLS-UDP-SR-NO-ICE | 3 | RFC-AAAA | 7060 | TLS-TCP-FH-NO-ICE | 4 | RFC-AAAA | 7061 | EXP-LINK | 5 | RFC-AAAA | 7062 | reserved | 255 | RFC-AAAA | 7063 +--------------------+------+---------------+ 7065 The value EXP-LINK has been made available for the purposes of 7066 experimentation. This value is not meant for vendor specific use of 7067 any sort and it MUST NOT be used for operational deployments. 7069 14.11. Overlay Link Protocols 7071 IANA SHALL create an "Overlay Link Protocol Registry". Entries in 7072 this registry are strings denoting protocols as described in 7073 Section 11.1 and SHALL be defined via RFC 5226 Standards Action. 7074 This registry SHALL be initially populated with the following values: 7076 +---------------+---------------+ 7077 | Link Protocol | Specification | 7078 +---------------+---------------+ 7079 | TLS | RFC-AAAA | 7080 | EXP-PROTOCOL | RFC-AAAA | 7081 +---------------+---------------+ 7083 The value EXP-PROTOCOL has been made available for the purposes of 7084 experimentation. This value is not meant for vendor specific use of 7085 any sort and it MUST NOT be used for operational deployments. 7087 14.12. Forwarding Options 7089 IANA SHALL create a "Forwarding Option Registry". Entries in this 7090 registry are 8-bit integer denoting options as described in 7091 Section 6.3.2.3. Values between 1 and 127 SHALL be defined via RFC 7092 5226 Standards Action. Entries in this registry between 128 and 254 7093 SHALL be defined via RFC 5226 Specification Required. This registry 7094 SHALL be initially populated with the following values: 7096 +-------------------------+------+---------------+ 7097 | Forwarding Option | Code | Specification | 7098 +-------------------------+------+---------------+ 7099 | invalidForwardingOption | 0 | RFC-AAAA | 7100 | exp-forward | 1 | RFC-AAAA | 7101 | reserved | 255 | RFC-AAAA | 7102 +-------------------------+------+---------------+ 7104 The value exp-forward has been made available for the purposes of 7105 experimentation. This value is not meant for vendor specific use of 7106 any sort and it MUST NOT be used for operational deployments. 7108 14.13. Probe Information Types 7110 IANA SHALL create a "RELOAD Probe Information Type Registry". 7111 Entries are 8-bit integers denoting types as described in 7112 Section 6.4.2.5.1 and SHALL be defined via RFC 5226 Standards Action. 7113 This registry SHALL be initially populated with the following values: 7115 +--------------------+------+---------------+ 7116 | Probe Option | Code | Specification | 7117 +--------------------+------+---------------+ 7118 | invalidProbeOption | 0 | RFC-AAAA | 7119 | responsible_set | 1 | RFC-AAAA | 7120 | num_resources | 2 | RFC-AAAA | 7121 | uptime | 3 | RFC-AAAA | 7122 | exp-probe | 4 | RFC-AAAA | 7123 | reserved | 255 | RFC-AAAA | 7124 +--------------------+------+---------------+ 7126 The value exp-probe has been made available for the purposes of 7127 experimentation. This value is not meant for vendor specific use of 7128 any sort and it MUST NOT be used for operational deployments. 7130 14.14. Message Extensions 7132 IANA SHALL create a "RELOAD Extensions Registry". Entries in this 7133 registry are 8-bit integers denoting extensions as described in 7134 Section 6.3.3 and SHALL be defined via RFC 5226 Specification 7135 Required. This registry SHALL be initially populated with the 7136 following values: 7138 +-----------------------------+--------+---------------+ 7139 | Extensions Name | Code | Specification | 7140 +-----------------------------+--------+---------------+ 7141 | invalidMessageExtensionType | 0 | RFC-AAAA | 7142 | exp-ext | 1 | RFC-AAAA | 7143 | reserved | 0xFFFF | RFC-AAAA | 7144 +-----------------------------+--------+---------------+ 7146 The value exp-ext has been made available for the purposes of 7147 experimentation. This value is not meant for vendor specific use of 7148 any sort and it MUST NOT be used for operational deployments. 7150 14.15. reload URI Scheme 7152 This section describes the scheme for a reload URI, which can be used 7153 to refer to either: 7155 o A peer, e.g. as used in a certificate (see Section 11.3). 7156 o A resource inside a peer. 7158 The reload URI is defined using a subset of the URI schema specified 7159 in Appendix A of RFC 3986 [RFC3986] and the associated URI Guidelines 7160 [RFC4395] per the following ABNF syntax: 7162 RELOAD-URI = "reload://" destination "@" overlay "/" 7163 [specifier] 7165 destination = 1 * HEXDIG 7166 overlay = reg-name 7167 specifier = 1*HEXDIG 7169 The definitions of these productions are as follows: 7171 destination: a hex-encoded Destination List object (i.e., multiple 7172 concatenated Destination objects with no length prefix prior to 7173 the object as a whole.) 7175 overlay: the name of the overlay. 7177 specifier : a hex-encoded StoredDataSpecifier indicating the data 7178 element. 7180 If no specifier is present then this URI addresses the peer which can 7181 be reached via the indicated destination list at the indicated 7182 overlay name. If a specifier is present, then the URI addresses the 7183 data value. 7185 14.15.1. URI Registration 7187 [[ Note to RFC Editor - please remove this paragraph before 7188 publication. ]] A review request was sent to uri-review@ietf.org on 7189 Oct 7, 2010. 7191 The following summarizes the information necessary to register the 7192 reload URI. 7194 URI Scheme Name: reload 7196 Status: permanent 7198 URI Scheme Syntax: see Section 14.15 of RFC-AAAA 7200 URI Scheme Semantics: The reload URI is intended to be used as a 7201 reference to a RELOAD peer or resource. 7203 Encoding Considerations: The reload URI is not intended to be human- 7204 readable text, so it is encoded entirely in US-ASCII. 7206 Applications/protocols that use this URI scheme: The RELOAD protocol 7207 described in RFC-AAAA. 7208 Interoperability considerations: See RFC-AAAA. 7210 Security considerations: See RFC-AAAA 7212 Contact: Cullen Jennings 7214 Author/Change controller: IESG 7216 References: RFC-AAAA 7218 14.16. Media Type Registration 7220 [[ Note to RFC Editor - please remove this paragraph before 7221 publication. ]] A review request was sent to ietf-types@iana.org on 7222 May 27, 2011. 7224 Type name: application 7226 Subtype name: p2p-overlay+xml 7228 Required parameters: none 7230 Optional parameters: none 7232 Encoding considerations: Must be binary encoded. 7234 Security considerations: This media type is typically not used to 7235 transport information that needs to be kept confidential, however 7236 there are cases where it is integrity of the information is 7237 important. For these cases using a digital signature is RECOMMENDED. 7238 One way of doing this is specified in RFC-AAAA. In the case when the 7239 media includes a "shared-secret" element, then the contents of the 7240 file MUST be kept confidential or else anyone that can see the 7241 shared-secret and effect the RELOAD overlay network. 7243 Interoperability considerations: No known interoperability 7244 consideration beyond those identified for application/xml in 7245 [RFC3023]. 7247 Published specification: RFC-AAAA 7249 Applications that use this media type: The type is used to configure 7250 the peer to peer overlay networks defined in RFC-AAAA. 7252 Additional information: The syntax for this media type is specified 7253 in Section 11.1 of RFC-AAAA. The contents MUST be valid XML 7254 compliant with the RELAX NG grammar specified in RFC-AAAA and use the 7255 UTF-8[RFC3629] character encoding. 7257 Magic number(s): none 7259 File extension(s): relo 7261 Macintosh file type code(s): none 7263 Person & email address to contact for further information: Cullen 7264 Jennings 7266 Intended usage: COMMON 7268 Restrictions on usage: None 7270 Author: Cullen Jennings 7272 Change controller: IESG 7274 14.17. XML Name Space Registration 7276 This document registers two URIs for the config and config-chord XML 7277 namespaces in the IETF XML registry defined in [RFC3688]. 7279 14.17.1. Config URL 7281 URI: urn:ietf:params:xml:ns:p2p:config-base 7283 Registrant Contact: The IESG. 7285 XML: N/A, the requested URIs are XML namespaces 7287 14.17.2. Config Chord URL 7289 URI: urn:ietf:params:xml:ns:p2p:config-chord 7291 Registrant Contact: The IESG. 7293 XML: N/A, the requested URIs are XML namespaces 7295 15. Acknowledgments 7297 This specification is a merge of the "REsource LOcation And Discovery 7298 (RELOAD)" draft by David A. Bryan, Marcia Zangrilli and Bruce B. 7299 Lowekamp, the "Address Settlement by Peer to Peer" draft by Cullen 7300 Jennings, Jonathan Rosenberg, and Eric Rescorla, the "Security 7301 Extensions for RELOAD" draft by Bruce B. Lowekamp and James Deverick, 7302 the "A Chord-based DHT for Resource Lookup in P2PSIP" by Marcia 7303 Zangrilli and David A. Bryan, and the Peer-to-Peer Protocol (P2PP) 7304 draft by Salman A. Baset, Henning Schulzrinne, and Marcin 7305 Matuszewski. Thanks to the authors of RFC 5389 for text included 7306 from that. Vidya Narayanan provided many comments and improvements. 7308 The ideas and text for the Chord specific extension data to the Leave 7309 mechanisms was provided by Jouni Maenpaa, Gonzalo Camarillo, and Jani 7310 Hautakorpi. 7312 Thanks to the many people who contributed including Ted Hardie, 7313 Michael Chen, Dan York, Das Saumitra, Lyndsay Campbell, Brian Rosen, 7314 David Bryan, Dave Craig, and Julian Cain. Extensive last call 7315 comments were provided by: Jouni Maenpaa, Roni Even, Gonzalo 7316 Camarillo, Ari Keranen, John Buford, Michael Chen, Frederic-Philippe 7317 Met, Mary Barnes, Roland Bless, and David Bryan. Special thanks to 7318 Marc Petit-Huguenin who provided an amazing amount of detailed 7319 review. 7321 Dean Willis and Marc Petit-Huguenin help resolve and provided text to 7322 fix many comments received during IESG review. 7324 16. References 7325 16.1. Normative References 7327 [OASIS.relax_ng] 7328 Bray, T. and M. Murata, "RELAX NG Specification". 7330 [RFC1918] Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G., and 7331 E. Lear, "Address Allocation for Private Internets", 7332 BCP 5, RFC 1918, February 1996. 7334 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 7335 Requirement Levels", BCP 14, RFC 2119, March 1997. 7337 [RFC2388] Masinter, L., "Returning Values from Forms: multipart/ 7338 form-data", RFC 2388, August 1998. 7340 [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key 7341 Infrastructure Operational Protocols: FTP and HTTP", 7342 RFC 2585, May 1999. 7344 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 7345 specifying the location of services (DNS SRV)", RFC 2782, 7346 February 2000. 7348 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 7350 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 7351 Types", RFC 3023, January 2001. 7353 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 7354 (SHA1)", RFC 3174, September 2001. 7356 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 7357 Standards (PKCS) #1: RSA Cryptography Specifications 7358 Version 2.1", RFC 3447, February 2003. 7360 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 7361 10646", STD 63, RFC 3629, November 2003. 7363 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 7364 Resource Identifier (URI): Generic Syntax", STD 66, 7365 RFC 3986, January 2005. 7367 [RFC4279] Eronen, P. and H. Tschofenig, "Pre-Shared Key Ciphersuites 7368 for Transport Layer Security (TLS)", RFC 4279, 7369 December 2005. 7371 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 7372 Registration Procedures for New URI Schemes", BCP 35, 7373 RFC 4395, February 2006. 7375 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 7376 Encodings", RFC 4648, October 2006. 7378 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 7379 (ICE): A Protocol for Network Address Translator (NAT) 7380 Traversal for Offer/Answer Protocols", RFC 5245, 7381 April 2010. 7383 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 7384 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 7386 [RFC5272] Schaad, J. and M. Myers, "Certificate Management over CMS 7387 (CMC)", RFC 5272, June 2008. 7389 [RFC5273] Schaad, J. and M. Myers, "Certificate Management over CMS 7390 (CMC): Transport Protocols", RFC 5273, June 2008. 7392 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 7393 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 7394 October 2008. 7396 [RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines 7397 for Application Designers", BCP 145, RFC 5405, 7398 November 2008. 7400 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 7401 Relays around NAT (TURN): Relay Extensions to Session 7402 Traversal Utilities for NAT (STUN)", RFC 5766, April 2010. 7404 [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 7405 Address Text Representation", RFC 5952, August 2010. 7407 [RFC6091] Mavrogiannopoulos, N. and D. Gillmor, "Using OpenPGP Keys 7408 for Transport Layer Security (TLS) Authentication", 7409 RFC 6091, February 2011. 7411 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 7412 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 7414 [RFC6298] Paxson, V., Allman, M., Chu, J., and M. Sargent, 7415 "Computing TCP's Retransmission Timer", RFC 6298, 7416 June 2011. 7418 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 7419 Security Version 1.2", RFC 6347, January 2012. 7421 [W3C.REC-xmlschema-2-20041028] 7422 Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes 7423 Second Edition", World Wide Web Consortium 7424 Recommendation REC-xmlschema-2-20041028, October 2004, 7425 . 7427 [w3c-xml-namespaces] 7428 Bray, T., Hollander, D., Layman, A., Tobin, R., and Henry 7429 S. , "Namespaces in XML 1.0 (Third Edition)". 7431 16.2. Informative References 7433 [Chord] Stoica, I., Morris, R., Liben-Nowell, D., Karger, D., 7434 Kaashoek, M., Dabek, F., and H. Balakrishnan, "Chord: A 7435 Scalable Peer-to-peer Lookup Protocol for Internet 7436 Applications", IEEE/ACM Transactions on Networking Volume 7437 11, Issue 1, 17-32, Feb 2003. 7439 [Eclipse] Singh, A., Ngan, T., Druschel, T., and D. Wallach, 7440 "Eclipse Attacks on Overlay Networks: Threats and 7441 Defenses", INFOCOM 2006, April 2006. 7443 [I-D.ietf-hip-reload-instance] 7444 Keranen, A., Camarillo, G., and J. Maenpaa, "Host Identity 7445 Protocol-Based Overlay Networking Environment (HIP BONE) 7446 Instance Specification for REsource LOcation And Discovery 7447 (RELOAD)", draft-ietf-hip-reload-instance-06 (work in 7448 progress), November 2012. 7450 [I-D.ietf-p2psip-diagnostics] 7451 Song, H., Jiang, X., Even, R., and D. Bryan, "P2PSIP 7452 Overlay Diagnostics", draft-ietf-p2psip-diagnostics-09 7453 (work in progress), August 2012. 7455 [I-D.ietf-p2psip-rpr] 7456 Zong, N., Jiang, X., Even, R., and Y. Zhang, "An extension 7457 to RELOAD to support Relay Peer Routing", 7458 draft-ietf-p2psip-rpr-03 (work in progress), October 2012. 7460 [I-D.ietf-p2psip-self-tuning] 7461 Maenpaa, J., Camarillo, G., and J. Hautakorpi, "A Self- 7462 tuning Distributed Hash Table (DHT) for REsource LOcation 7463 And Discovery (RELOAD)", draft-ietf-p2psip-self-tuning-06 7464 (work in progress), July 2012. 7466 [I-D.ietf-p2psip-service-discovery] 7467 Maenpaa, J. and G. Camarillo, "Service Discovery Usage for 7468 REsource LOcation And Discovery (RELOAD)", 7469 draft-ietf-p2psip-service-discovery-06 (work in progress), 7470 October 2012. 7472 [I-D.ietf-p2psip-sip] 7473 Jennings, C., Lowekamp, B., Rescorla, E., Baset, S., 7474 Schulzrinne, H., and T. Schmidt, "A SIP Usage for RELOAD", 7475 draft-ietf-p2psip-sip-08 (work in progress), 7476 December 2012. 7478 [RFC1035] Mockapetris, P., "Domain names - implementation and 7479 specification", STD 13, RFC 1035, November 1987. 7481 [RFC1122] Braden, R., "Requirements for Internet Hosts - 7482 Communication Layers", STD 3, RFC 1122, October 1989. 7484 [RFC2311] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., and 7485 L. Repka, "S/MIME Version 2 Message Specification", 7486 RFC 2311, March 1998. 7488 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 7489 January 2004. 7491 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 7492 and Passwords", RFC 4013, February 2005. 7494 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 7495 Requirements for Security", BCP 106, RFC 4086, June 2005. 7497 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 7498 the Session Description Protocol (SDP)", RFC 4145, 7499 September 2005. 7501 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 7502 Congestion Control Protocol (DCCP)", RFC 4340, March 2006. 7504 [RFC4787] Audet, F. and C. Jennings, "Network Address Translation 7505 (NAT) Behavioral Requirements for Unicast UDP", BCP 127, 7506 RFC 4787, January 2007. 7508 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", 7509 RFC 4960, September 2007. 7511 [RFC5054] Taylor, D., Wu, T., Mavrogiannopoulos, N., and T. Perrin, 7512 "Using the Secure Remote Password (SRP) Protocol for TLS 7513 Authentication", RFC 5054, November 2007. 7515 [RFC5095] Abley, J., Savola, P., and G. Neville-Neil, "Deprecation 7516 of Type 0 Routing Headers in IPv6", RFC 5095, 7517 December 2007. 7519 [RFC5201] Moskowitz, R., Nikander, P., Jokela, P., and T. Henderson, 7520 "Host Identity Protocol", RFC 5201, April 2008. 7522 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 7523 Housley, R., and W. Polk, "Internet X.509 Public Key 7524 Infrastructure Certificate and Certificate Revocation List 7525 (CRL) Profile", RFC 5280, May 2008. 7527 [RFC5694] Camarillo, G. and IAB, "Peer-to-Peer (P2P) Architecture: 7528 Definition, Taxonomies, Examples, and Applicability", 7529 RFC 5694, November 2009. 7531 [RFC5765] Schulzrinne, H., Marocco, E., and E. Ivov, "Security 7532 Issues and Solutions in Peer-to-Peer Systems for Realtime 7533 Communications", RFC 5765, February 2010. 7535 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 7536 Uniform Resource Identifiers (URIs)", RFC 5785, 7537 April 2010. 7539 [RFC6079] Camarillo, G., Nikander, P., Hautakorpi, J., Keranen, A., 7540 and A. Johnston, "HIP BONE: Host Identity Protocol (HIP) 7541 Based Overlay Networking Environment (BONE)", RFC 6079, 7542 January 2011. 7544 [RFC6544] Rosenberg, J., Keranen, A., Lowekamp, B., and A. Roach, 7545 "TCP Candidates with Interactive Connectivity 7546 Establishment (ICE)", RFC 6544, March 2012. 7548 [Sybil] Douceur, J., "The Sybil Attack", IPTPS 02, March 2002. 7550 [UnixTime] 7551 Wikipedia, "Unix Time", . 7554 [bryan-design-hotp2p08] 7555 Bryan, D., Lowekamp, B., and M. Zangrilli, "The Design of 7556 a Versatile, Secure P2PSIP Communications Architecture for 7557 the Public Internet", Hot-P2P'08. 7559 [handling-churn-usenix04] 7560 Rhea, S., Geels, D., Roscoe, T., and J. Kubiatowicz, 7561 "Handling Churn in a DHT", In Proc. of the USENIX Annual 7562 Technical Conference June 2004 USENIX 2004. 7564 [lookups-churn-p2p06] 7565 Wu, D., Tian, Y., and K. Ng, "Analytical Study on 7566 Improving DHT Lookup Performance under Churn", IEEE 7567 P2P'06. 7569 [minimizing-churn-sigcomm06] 7570 Godfrey, P., Shenker, S., and I. Stoica, "Minimizing Churn 7571 in Distributed Systems", SIGCOMM 2006. 7573 [non-transitive-dhts-worlds05] 7574 Freedman, M., Lakshminarayanan, K., Rhea, S., and I. 7575 Stoica, "Non-Transitive Connectivity and DHTs", 7576 WORLDS'05. 7578 [opendht-sigcomm05] 7579 Rhea, S., Godfrey, B., Karp, B., Kubiatowicz, J., 7580 Ratnasamy, S., Shenker, S., Stoica, I., and H. Yu, 7581 "OpenDHT: A Public DHT and its Uses", SIGCOMM'05. 7583 [vulnerabilities-acsac04] 7584 Srivatsa, M. and L. Liu, "Vulnerabilities and Security 7585 Threats in Structured Peer-to-Peer Systems: A Quantitative 7586 Analysis", ACSAC 2004. 7588 [wikiChord] 7589 Wikipedia, "Chord (peer-to-peer)", 7590 . 7592 [wikiKBR] Wikipedia, "Key-based routing", 7593 . 7595 [wikiSkiplist] 7596 Wikipedia, "Skip list", 7597 . 7599 Appendix A. Routing Alternatives 7601 Significant discussion has been focused on the selection of a routing 7602 algorithm for P2PSIP. This section discusses the motivations for 7603 selecting symmetric recursive routing for RELOAD and describes the 7604 extensions that would be required to support additional routing 7605 algorithms. 7607 A.1. Iterative vs Recursive 7609 Iterative routing has a number of advantages. It is easier to debug, 7610 consumes fewer resources on intermediate peers, and allows the 7611 querying peer to identify and route around misbehaving peers 7613 [non-transitive-dhts-worlds05]. However, in the presence of NATs, 7614 iterative routing is intolerably expensive because a new connection 7615 must be established for each hop (using ICE) [bryan-design-hotp2p08]. 7617 Iterative routing is supported through the RouteQuery mechanism and 7618 is primarily intended for debugging. It also allows the querying 7619 peer to evaluate the routing decisions made by the peers at each hop, 7620 consider alternatives, and perhaps detect at what point the 7621 forwarding path fails. 7623 A.2. Symmetric vs Forward response 7625 An alternative to the symmetric recursive routing method used by 7626 RELOAD is Forward-Only routing, where the response is routed to the 7627 requester as if it were a new message initiated by the responder (in 7628 the previous example, Z sends the response to A as if it were sending 7629 a request). Forward-only routing requires no state in either the 7630 message or intermediate peers. 7632 The drawback of forward-only routing is that it does not work when 7633 the overlay is unstable. For example, if A is in the process of 7634 joining the overlay and is sending a Join request to Z, it is not yet 7635 reachable via forward routing. Even if it is established in the 7636 overlay, if network failures produce temporary instability, A may not 7637 be reachable (and may be trying to stabilize its network connectivity 7638 via Attach messages). 7640 Furthermore, forward-only responses are less likely to reach the 7641 querying peer than symmetric recursive ones are, because the forward 7642 path is more likely to have a failed peer than is the request path 7643 (which was just tested to route the request) 7644 [non-transitive-dhts-worlds05]. 7646 An extension to RELOAD that supports forward-only routing but relies 7647 on symmetric responses as a fallback would be possible, but due to 7648 the complexities of determining when to use forward-only and when to 7649 fallback to symmetric, we have chosen not to include it as an option 7650 at this point. 7652 A.3. Direct Response 7654 Another routing option is Direct Response routing, in which the 7655 response is returned directly to the querying node. In the previous 7656 example, if A encodes its IP address in the request, then Z can 7657 simply deliver the response directly to A. In the absence of NATs or 7658 other connectivity issues, this is the optimal routing technique. 7660 The challenge of implementing direct response is the presence of 7661 NATs. There are a number of complexities that must be addressed. In 7662 this discussion, we will continue our assumption that A issued the 7663 request and Z is generating the response. 7665 o The IP address listed by A may be unreachable, either due to NAT 7666 or firewall rules. Therefore, a direct response technique must 7667 fallback to symmetric response [non-transitive-dhts-worlds05]. 7668 The hop-by-hop ACKs used by RELOAD allow Z to determine when A has 7669 received the message (and the TLS negotiation will provide earlier 7670 confirmation that A is reachable), but this fallback requires a 7671 timeout that will increase the response latency whenever A is not 7672 reachable from Z. 7673 o Whenever A is behind a NAT it will have multiple candidate IP 7674 addresses, each of which must be advertised to ensure 7675 connectivity; therefore Z will need to attempt multiple 7676 connections to deliver the response. 7677 o One (or all) of A's candidate addresses may route from Z to a 7678 different device on the Internet. In the worst case these nodes 7679 may actually be running RELOAD on the same port. Therefore, it is 7680 absolutely necessary to establish a secure connection to 7681 authenticate A before delivering the response. This step 7682 diminishes the efficiency of direct response because multiple 7683 roundtrips are required before the message can be delivered. 7684 o If A is behind a NAT and does not have a connection already 7685 established with Z, there are only two ways the direct response 7686 will work. The first is that A and Z both be behind the same NAT, 7687 in which case the NAT is not involved. In the more common case, 7688 when Z is outside A's NAT, the response will only be received if 7689 A's NAT implements endpoint-independent filtering. As the choice 7690 of filtering mode conflates application transparency with security 7691 [RFC4787], and no clear recommendation is available, the 7692 prevalence of this feature in future devices remains unclear. 7694 An extension to RELOAD that supports direct response routing but 7695 relies on symmetric responses as a fallback would be possible, but 7696 due to the complexities of determining when to use direct response 7697 and when to fallback to symmetric, and the reduced performance for 7698 responses to peers behind restrictive NATs, we have chosen not to 7699 include it as an option at this point. 7701 A.4. Relay Peers 7703 [I-D.ietf-p2psip-rpr] has proposed implementing a form of direct 7704 response by having A identify a peer, Q, that will be directly 7705 reachable by any other peer. A uses Attach to establish a connection 7706 with Q and advertises Q's IP address in the request sent to Z. Z 7707 sends the response to Q, which relays it to A. This then reduces the 7708 latency to two hops, plus Z negotiating a secure connection to Q. 7710 This technique relies on the relative population of nodes such as A 7711 that require relay peers and peers such as Q that are capable of 7712 serving as a relay peer. It also requires nodes to be able to 7713 identify which category they are in. This identification problem has 7714 turned out to be hard to solve and is still an open area of 7715 exploration. 7717 An extension to RELOAD that supports relay peers is possible, but due 7718 to the complexities of implementing such an alternative, we have not 7719 added such a feature to RELOAD at this point. 7721 A concept similar to relay peers, essentially choosing a relay peer 7722 at random, has previously been suggested to solve problems of 7723 pairwise non-transitivity [non-transitive-dhts-worlds05], but 7724 deterministic filtering provided by NATs makes random relay peers no 7725 more likely to work than the responding peer. 7727 A.5. Symmetric Route Stability 7729 A common concern about symmetric recursive routing has been that one 7730 or more peers along the request path may fail before the response is 7731 received. The significance of this problem essentially depends on 7732 the response latency of the overlay. An overlay that produces slow 7733 responses will be vulnerable to churn, whereas responses that are 7734 delivered very quickly are vulnerable only to failures that occur 7735 over that small interval. 7737 The other aspect of this issue is whether the request itself can be 7738 successfully delivered. Assuming typical connection maintenance 7739 intervals, the time period between the last maintenance and the 7740 request being sent will be orders of magnitude greater than the delay 7741 between the request being forwarded and the response being received. 7742 Therefore, if the path was stable enough to be available to route the 7743 request, it is almost certainly going to remain available to route 7744 the response. 7746 An overlay that is unstable enough to suffer this type of failure 7747 frequently is unlikely to be able to support reliable functionality 7748 regardless of the routing mechanism. However, regardless of the 7749 stability of the return path, studies show that in the event of high 7750 churn, iterative routing is a better solution to ensure request 7751 completion [lookups-churn-p2p06] [non-transitive-dhts-worlds05] 7753 Finally, because RELOAD retries the end-to-end request, that retry 7754 will address the issues of churn that remain. 7756 Appendix B. Why Clients? 7758 There are a wide variety of reasons a node may act as a client rather 7759 than as a peer. This section outlines some of those scenarios and 7760 how the client's behavior changes based on its capabilities. 7762 B.1. Why Not Only Peers? 7764 For a number of reasons, a particular node may be forced to act as a 7765 client even though it is willing to act as a peer. These include: 7767 o The node does not have appropriate network connectivity, typically 7768 because it has a low-bandwidth network connection. 7769 o The node may not have sufficient resources, such as computing 7770 power, storage space, or battery power. 7771 o The overlay algorithm may dictate specific requirements for peer 7772 selection. These may include participating in the overlay to 7773 determine trustworthiness; controlling the number of peers in the 7774 overlay to reduce overly-long routing paths; or ensuring minimum 7775 application uptime before a node can join as a peer. 7777 The ultimate criteria for a node to become a peer are determined by 7778 the overlay algorithm and specific deployment. A node acting as a 7779 client that has a full implementation of RELOAD and the appropriate 7780 overlay algorithm is capable of locating its responsible peer in the 7781 overlay and using Attach to establish a direct connection to that 7782 peer. In that way, it may elect to be reachable under either of the 7783 routing approaches listed above. Particularly for overlay algorithms 7784 that elect nodes to serve as peers based on trustworthiness or 7785 population, the overlay algorithm may require such a client to locate 7786 itself at a particular place in the overlay. 7788 B.2. Clients as Application-Level Agents 7790 SIP defines an extensive protocol for registration and security 7791 between a client and its registrar/proxy server(s). Any SIP device 7792 can act as a client of a RELOAD-based P2PSIP overlay if it contacts a 7793 peer that implements the server-side functionality required by the 7794 SIP protocol. In this case, the peer would be acting as if it were 7795 the user's peer, and would need the appropriate credentials for that 7796 user. 7798 Application-level support for clients is defined by a usage. A usage 7799 offering support for application-level clients should specify how the 7800 security of the system is maintained when the data is moved between 7801 the application and RELOAD layers. 7803 Authors' Addresses 7805 Cullen Jennings 7806 Cisco 7807 170 West Tasman Drive 7808 MS: SJC-30/2 7809 San Jose, CA 95134 7810 USA 7812 Email: fluffy@cisco.com 7814 Bruce B. Lowekamp (editor) 7815 Skype 7816 Palo Alto, CA 7817 USA 7819 Email: bbl@lowekamp.net 7821 Eric Rescorla 7822 RTFM, Inc. 7823 2064 Edgewood Drive 7824 Palo Alto, CA 94303 7825 USA 7827 Phone: +1 650 678 2350 7828 Email: ekr@rtfm.com 7830 Salman A. Baset 7831 Columbia University 7832 1214 Amsterdam Avenue 7833 New York, NY 7834 USA 7836 Email: salman@cs.columbia.edu 7838 Henning Schulzrinne 7839 Columbia University 7840 1214 Amsterdam Avenue 7841 New York, NY 7842 USA 7844 Email: hgs@cs.columbia.edu