--- 1/draft-ietf-p2psip-base-10.txt 2010-10-12 18:14:35.000000000 +0200 +++ 2/draft-ietf-p2psip-base-11.txt 2010-10-12 18:14:35.000000000 +0200 @@ -1,24 +1,23 @@ P2PSIP C. Jennings Internet-Draft Cisco -Intended status: Standards Track B. Lowekamp, Ed. -Expires: February 4, 2011 Skype - E. Rescorla - Network Resonance - S. Baset - H. Schulzrinne +Intended status: Standards Track B. B. Lowekamp, Ed. +Expires: April 15, 2011 E.K. Rescorla + Skype + S.A. Baset + H.G. Schulzrinne Columbia University - Aug 3, 2010 + Oct 12, 2010 REsource LOcation And Discovery (RELOAD) Base Protocol - draft-ietf-p2psip-base-10 + draft-ietf-p2psip-base-11 Abstract In this document the term BCP 78 and BCP 79 refer to RFC 3978 and RFC 3979 respectively. They refer only to those RFCs and not to any documents that update or supersede them. This specification defines REsource LOcation And Discovery (RELOAD), a peer-to-peer (P2P) signaling protocol for use on the Internet. A P2P signaling protocol provides its clients with an abstract storage @@ -51,21 +51,21 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on February 4, 2011. + This Internet-Draft will expire on April 15, 2011. Copyright Notice Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents @@ -119,32 +119,32 @@ 4.1.1. Storage Permissions . . . . . . . . . . . . . . . . 30 4.1.2. Usages . . . . . . . . . . . . . . . . . . . . . . . 31 4.1.3. Replication . . . . . . . . . . . . . . . . . . . . 31 4.2. Service Discovery . . . . . . . . . . . . . . . . . . . 32 4.3. Application Connectivity . . . . . . . . . . . . . . . . 32 5. Overlay Management Protocol . . . . . . . . . . . . . . . . . 33 5.1. Message Receipt and Forwarding . . . . . . . . . . . . . 33 5.1.1. Responsible ID . . . . . . . . . . . . . . . . . . . 33 5.1.2. Other ID . . . . . . . . . . . . . . . . . . . . . . 34 5.1.3. Private ID . . . . . . . . . . . . . . . . . . . . . 35 - 5.2. Symmetric Recursive Routing . . . . . . . . . . . . . . 35 + 5.2. Symmetric Recursive Routing . . . . . . . . . . . . . . 36 5.2.1. Request Origination . . . . . . . . . . . . . . . . 36 - 5.2.2. Response Origination . . . . . . . . . . . . . . . . 36 + 5.2.2. Response Origination . . . . . . . . . . . . . . . . 37 5.3. Message Structure . . . . . . . . . . . . . . . . . . . 37 5.3.1. Presentation Language . . . . . . . . . . . . . . . 38 5.3.1.1. Common Definitions . . . . . . . . . . . . . . . 38 5.3.2. Forwarding Header . . . . . . . . . . . . . . . . . 41 5.3.2.1. Processing Configuration Sequence Numbers . . . . 43 5.3.2.2. Destination and Via Lists . . . . . . . . . . . . 44 5.3.2.3. Forwarding Options . . . . . . . . . . . . . . . 46 5.3.2.4. Direct Return Response Forwarding Options . . . . 47 - 5.3.3. Message Contents Format . . . . . . . . . . . . . . 48 + 5.3.3. Message Contents Format . . . . . . . . . . . . . . 47 5.3.3.1. Response Codes and Response Errors . . . . . . . 49 5.3.4. Security Block . . . . . . . . . . . . . . . . . . . 51 5.4. Overlay Topology . . . . . . . . . . . . . . . . . . . . 54 5.4.1. Topology Plugin Requirements . . . . . . . . . . . . 54 5.4.2. Methods and types for use by topology plugins . . . 54 5.4.2.1. Join . . . . . . . . . . . . . . . . . . . . . . 54 5.4.2.2. Leave . . . . . . . . . . . . . . . . . . . . . . 55 5.4.2.3. Update . . . . . . . . . . . . . . . . . . . . . 56 5.4.2.4. Route_Query . . . . . . . . . . . . . . . . . . . 56 5.4.2.5. Probe . . . . . . . . . . . . . . . . . . . . . . 57 @@ -156,145 +156,144 @@ 5.5.1.4. Collecting STUN Servers . . . . . . . . . . . . . 63 5.5.1.5. Gathering Candidates . . . . . . . . . . . . . . 64 5.5.1.6. Prioritizing Candidates . . . . . . . . . . . . . 65 5.5.1.7. Encoding the Attach Message . . . . . . . . . . . 65 5.5.1.8. Verifying ICE Support . . . . . . . . . . . . . . 66 5.5.1.9. Role Determination . . . . . . . . . . . . . . . 66 5.5.1.10. Full ICE . . . . . . . . . . . . . . . . . . . . 66 5.5.1.11. No-ICE . . . . . . . . . . . . . . . . . . . . . 67 5.5.1.12. Subsequent Offers and Answers . . . . . . . . . . 67 5.5.1.13. Sending Media . . . . . . . . . . . . . . . . . . 67 - 5.5.1.14. Receiving Media . . . . . . . . . . . . . . . . . 68 - 5.5.2. AppAttach . . . . . . . . . . . . . . . . . . . . . 68 + 5.5.1.14. Receiving Media . . . . . . . . . . . . . . . . . 67 + 5.5.2. AppAttach . . . . . . . . . . . . . . . . . . . . . 67 5.5.2.1. Request Definition . . . . . . . . . . . . . . . 68 - 5.5.2.2. Response Definition . . . . . . . . . . . . . . . 69 + 5.5.2.2. Response Definition . . . . . . . . . . . . . . . 68 5.5.3. Ping . . . . . . . . . . . . . . . . . . . . . . . . 69 5.5.3.1. Request Definition . . . . . . . . . . . . . . . 69 - 5.5.3.2. Response Definition . . . . . . . . . . . . . . . 70 - 5.5.4. Config_Update . . . . . . . . . . . . . . . . . . . 70 - 5.5.4.1. Request Definition . . . . . . . . . . . . . . . 71 + 5.5.3.2. Response Definition . . . . . . . . . . . . . . . 69 + 5.5.4. ConfigUpdate . . . . . . . . . . . . . . . . . . . . 70 + 5.5.4.1. Request Definition . . . . . . . . . . . . . . . 70 5.5.4.2. Response Definition . . . . . . . . . . . . . . . 71 - 5.6. Overlay Link Layer . . . . . . . . . . . . . . . . . . . 72 - 5.6.1. Future Overlay Link Protocols . . . . . . . . . . . 73 - 5.6.1.1. HIP . . . . . . . . . . . . . . . . . . . . . . . 74 - 5.6.1.2. ICE-TCP . . . . . . . . . . . . . . . . . . . . . 74 - 5.6.1.3. Message-oriented Transports . . . . . . . . . . . 74 + 5.6. Overlay Link Layer . . . . . . . . . . . . . . . . . . . 71 + 5.6.1. Future Overlay Link Protocols . . . . . . . . . . . 72 + 5.6.1.1. HIP . . . . . . . . . . . . . . . . . . . . . . . 73 + 5.6.1.2. ICE-TCP . . . . . . . . . . . . . . . . . . . . . 73 + 5.6.1.3. Message-oriented Transports . . . . . . . . . . . 73 5.6.1.4. Tunneled Transports . . . . . . . . . . . . . . . 74 - 5.6.2. Framing Header . . . . . . . . . . . . . . . . . . . 75 + 5.6.2. Framing Header . . . . . . . . . . . . . . . . . . . 74 5.6.3. Simple Reliability . . . . . . . . . . . . . . . . . 76 - 5.6.3.1. Retransmission and Flow Control . . . . . . . . . 77 - 5.6.4. DTLS/UDP with SR . . . . . . . . . . . . . . . . . . 78 - 5.6.5. TLS/TCP with FH, No-ICE . . . . . . . . . . . . . . 78 - 5.6.6. DTLS/UDP with SR, No-ICE . . . . . . . . . . . . . . 79 - 5.7. Fragmentation and Reassembly . . . . . . . . . . . . . . 79 - 6. Data Storage Protocol . . . . . . . . . . . . . . . . . . . . 80 + 5.6.3.1. Retransmission and Flow Control . . . . . . . . . 76 + 5.6.4. DTLS/UDP with SR . . . . . . . . . . . . . . . . . . 77 + 5.6.5. TLS/TCP with FH, No-ICE . . . . . . . . . . . . . . 77 + 5.6.6. DTLS/UDP with SR, No-ICE . . . . . . . . . . 78 + 5.7. Fragmentation and Reassembly . . . . . . . . . . . . . . 78 + 6. Data Storage Protocol . . . . . . . . . . . . . . . . . . . . 79 6.1. Data Signature Computation . . . . . . . . . . . . . . . 81 - 6.2. Data Models . . . . . . . . . . . . . . . . . . . . . . 82 - 6.2.1. Single Value . . . . . . . . . . . . . . . . . . . . 83 - 6.2.2. Array . . . . . . . . . . . . . . . . . . . . . . . 84 - 6.2.3. Dictionary . . . . . . . . . . . . . . . . . . . . . 84 - 6.3. Access Control Policies . . . . . . . . . . . . . . . . 85 - 6.3.1. USER-MATCH . . . . . . . . . . . . . . . . . . . . . 85 - 6.3.2. NODE-MATCH . . . . . . . . . . . . . . . . . . . . . 85 - 6.3.3. USER-NODE-MATCH . . . . . . . . . . . . . . . . . . 85 - 6.3.4. NODE-MULTIPLE . . . . . . . . . . . . . . . . . . . 85 - 6.4. Data Storage Methods . . . . . . . . . . . . . . . . . . 86 - 6.4.1. Store . . . . . . . . . . . . . . . . . . . . . . . 86 - 6.4.1.1. Request Definition . . . . . . . . . . . . . . . 86 - 6.4.1.2. Response Definition . . . . . . . . . . . . . . . 90 - 6.4.1.3. Removing Values . . . . . . . . . . . . . . . . . 91 - 6.4.2. Fetch . . . . . . . . . . . . . . . . . . . . . . . 92 - 6.4.2.1. Request Definition . . . . . . . . . . . . . . . 93 - 6.4.2.2. Response Definition . . . . . . . . . . . . . . . 95 - 6.4.3. Stat . . . . . . . . . . . . . . . . . . . . . . . . 95 - 6.4.3.1. Request Definition . . . . . . . . . . . . . . . 96 - 6.4.3.2. Response Definition . . . . . . . . . . . . . . . 96 - 6.4.4. Find . . . . . . . . . . . . . . . . . . . . . . . . 98 - 6.4.4.1. Request Definition . . . . . . . . . . . . . . . 98 - 6.4.4.2. Response Definition . . . . . . . . . . . . . . . 98 - 6.4.5. Defining New Kinds . . . . . . . . . . . . . . . . . 99 - 7. Certificate Store Usage . . . . . . . . . . . . . . . . . . . 100 - 8. TURN Server Usage . . . . . . . . . . . . . . . . . . . . . . 101 - 9. Chord Algorithm . . . . . . . . . . . . . . . . . . . . . . . 102 - 9.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 103 - 9.2. Routing . . . . . . . . . . . . . . . . . . . . . . . . 104 - 9.3. Redundancy . . . . . . . . . . . . . . . . . . . . . . . 104 - 9.4. Joining . . . . . . . . . . . . . . . . . . . . . . . . 105 - 9.5. Routing Attaches . . . . . . . . . . . . . . . . . . . . 105 - 9.6. Updates . . . . . . . . . . . . . . . . . . . . . . . . 106 - 9.6.1. Handling Neighbor Failures . . . . . . . . . . . . . 107 - 9.6.2. Handling Finger Table Entry Failure . . . . . . . . 108 - 9.6.3. Receiving Updates . . . . . . . . . . . . . . . . . 108 - 9.6.4. Stabilization . . . . . . . . . . . . . . . . . . . 109 - 9.6.4.1. Updating neighbor table . . . . . . . . . . . . . 109 - 9.6.4.2. Refreshing finger table . . . . . . . . . . . . . 109 - 9.6.4.3. Adjusting finger table size . . . . . . . . . . . 110 - 9.6.4.4. Detecting partitioning . . . . . . . . . . . . . 111 - 9.7. Route Query . . . . . . . . . . . . . . . . . . . . . . 111 - 9.8. Leaving . . . . . . . . . . . . . . . . . . . . . . . . 112 + 6.2. Data Models . . . . . . . . . . . . . . . . . . . . . . 81 + 6.2.1. Single Value . . . . . . . . . . . . . . . . . . . . 82 + 6.2.2. Array . . . . . . . . . . . . . . . . . . . . . . . 83 + 6.2.3. Dictionary . . . . . . . . . . . . . . . . . . . . . 83 + 6.3. Access Control Policies . . . . . . . . . . . . . . . . 84 + 6.3.1. USER-MATCH . . . . . . . . . . . . . . . . . . . . . 84 + 6.3.2. NODE-MATCH . . . . . . . . . . . . . . . . . . . . . 84 + 6.3.3. USER-NODE-MATCH . . . . . . . . . . . . . . . . . . 84 + 6.3.4. NODE-MULTIPLE . . . . . . . . . . . . . . . . . . . 84 + 6.4. Data Storage Methods . . . . . . . . . . . . . . . . . . 85 + 6.4.1. Store . . . . . . . . . . . . . . . . . . . . . . . 85 + 6.4.1.1. Request Definition . . . . . . . . . . . . . . . 85 + 6.4.1.2. Response Definition . . . . . . . . . . . . . . . 89 + 6.4.1.3. Removing Values . . . . . . . . . . . . . . . . . 90 + 6.4.2. Fetch . . . . . . . . . . . . . . . . . . . . . . . 90 + 6.4.2.1. Request Definition . . . . . . . . . . . . . . . 91 + 6.4.2.2. Response Definition . . . . . . . . . . . . . . . 93 + 6.4.3. Stat . . . . . . . . . . . . . . . . . . . . . . . . 93 + 6.4.3.1. Request Definition . . . . . . . . . . . . . . . 94 + 6.4.3.2. Response Definition . . . . . . . . . . . . . . . 94 + 6.4.4. Find . . . . . . . . . . . . . . . . . . . . . . . . 96 + 6.4.4.1. Request Definition . . . . . . . . . . . . . . . 96 + 6.4.4.2. Response Definition . . . . . . . . . . . . . . . 96 + 6.4.5. Defining New Kinds . . . . . . . . . . . . . . . . . 97 + 7. Certificate Store Usage . . . . . . . . . . . . . . . . . . . 98 + 8. TURN Server Usage . . . . . . . . . . . . . . . . . . . . . . 99 + 9. Chord Algorithm . . . . . . . . . . . . . . . . . . . . . . . 100 + 9.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 101 + 9.2. Routing . . . . . . . . . . . . . . . . . . . . . . . . 102 + 9.3. Redundancy . . . . . . . . . . . . . . . . . . . . . . . 102 + 9.4. Joining . . . . . . . . . . . . . . . . . . . . . . . . 103 + 9.5. Routing Attaches . . . . . . . . . . . . . . . . . . . . 103 + 9.6. Updates . . . . . . . . . . . . . . . . . . . . . . . . 104 + 9.6.1. Handling Neighbor Failures . . . . . . . . . . . . . 105 + 9.6.2. Handling Finger Table Entry Failure . . . . . . . . 106 + 9.6.3. Receiving Updates . . . . . . . . . . . . . . . . . 106 + 9.6.4. Stabilization . . . . . . . . . . . . . . . . . . . 107 + 9.6.4.1. Updating neighbor table . . . . . . . . . . . . . 107 + 9.6.4.2. Refreshing finger table . . . . . . . . . . . . . 107 + 9.6.4.3. Adjusting finger table size . . . . . . . . . . . 108 + 9.6.4.4. Detecting partitioning . . . . . . . . . . . . . 109 + 9.7. Route Query . . . . . . . . . . . . . . . . . . . . . . 109 + 9.8. Leaving . . . . . . . . . . . . . . . . . . . . . . . . 110 - 10. Enrollment and Bootstrap . . . . . . . . . . . . . . . . . . 113 - 10.1. Overlay Configuration . . . . . . . . . . . . . . . . . 113 - 10.1.1. Relax NG Grammar . . . . . . . . . . . . . . . . . . 118 - 10.2. Discovery Through Enrollment Server . . . . . . . . . . 120 - 10.3. Credentials . . . . . . . . . . . . . . . . . . . . . . 121 - 10.3.1. Self-Generated Credentials . . . . . . . . . . . . . 122 - 10.4. Searching for a Bootstrap Node . . . . . . . . . . . . . 122 - 10.5. Contacting a Bootstrap Node . . . . . . . . . . . . . . 123 - 11. Message Flow Example . . . . . . . . . . . . . . . . . . . . 123 - 12. Security Considerations . . . . . . . . . . . . . . . . . . . 129 - 12.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 129 - 12.2. Attacks on P2P Overlays . . . . . . . . . . . . . . . . 130 - 12.3. Certificate-based Security . . . . . . . . . . . . . . . 130 - 12.4. Shared-Secret Security . . . . . . . . . . . . . . . . . 131 - 12.5. Storage Security . . . . . . . . . . . . . . . . . . . . 132 - 12.5.1. Authorization . . . . . . . . . . . . . . . . . . . 132 - 12.5.2. Distributed Quota . . . . . . . . . . . . . . . . . 133 - 12.5.3. Correctness . . . . . . . . . . . . . . . . . . . . 133 - 12.5.4. Residual Attacks . . . . . . . . . . . . . . . . . . 133 - 12.6. Routing Security . . . . . . . . . . . . . . . . . . . . 134 - 12.6.1. Background . . . . . . . . . . . . . . . . . . . . . 134 - 12.6.2. Admissions Control . . . . . . . . . . . . . . . . . 135 - 12.6.3. Peer Identification and Authentication . . . . . . . 135 - 12.6.4. Protecting the Signaling . . . . . . . . . . . . . . 136 - 12.6.5. Residual Attacks . . . . . . . . . . . . . . . . . . 136 - 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 137 - 13.1. Port Registrations . . . . . . . . . . . . . . . . . . . 137 - 13.2. Overlay Algorithm Types . . . . . . . . . . . . . . . . 137 - 13.3. Access Control Policies . . . . . . . . . . . . . . . . 137 - 13.4. Application-ID . . . . . . . . . . . . . . . . . . . . . 138 - 13.5. Data Kind-ID . . . . . . . . . . . . . . . . . . . . . . 138 - 13.6. Data Model . . . . . . . . . . . . . . . . . . . . . . . 139 - 13.7. Message Codes . . . . . . . . . . . . . . . . . . . . . 139 - 13.8. Error Codes . . . . . . . . . . . . . . . . . . . . . . 140 - 13.9. Overlay Link Types . . . . . . . . . . . . . . . . . . . 141 - 13.10. Overlay Link Protocols . . . . . . . . . . . . . . . . . 141 - 13.11. Forwarding Options . . . . . . . . . . . . . . . . . . . 141 - 13.12. Probe Information Types . . . . . . . . . . . . . . . . 142 - 13.13. Message Extensions . . . . . . . . . . . . . . . . . . . 142 - 13.14. reload URI Scheme . . . . . . . . . . . . . . . . . . . 142 - 13.14.1. URI Registration . . . . . . . . . . . . . . . . . . 143 + 10. Enrollment and Bootstrap . . . . . . . . . . . . . . . . . . 111 + 10.1. Overlay Configuration . . . . . . . . . . . . . . . . . 111 + 10.1.1. Relax NG Grammar . . . . . . . . . . . . . . . . . . 116 + 10.2. Discovery Through Enrollment Server . . . . . . . . . . 118 + 10.3. Credentials . . . . . . . . . . . . . . . . . . . . . . 119 + 10.3.1. Self-Generated Credentials . . . . . . . . . . . . . 120 + 10.4. Searching for a Bootstrap Node . . . . . . . . . . . . . 121 + 10.5. Contacting a Bootstrap Node . . . . . . . . . . . . . . 121 + 11. Message Flow Example . . . . . . . . . . . . . . . . . . . . 122 + 12. Security Considerations . . . . . . . . . . . . . . . . . . . 128 + 12.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 128 + 12.2. Attacks on P2P Overlays . . . . . . . . . . . . . . . . 129 + 12.3. Certificate-based Security . . . . . . . . . . . . . . . 129 + 12.4. Shared-Secret Security . . . . . . . . . . . . . . . . . 130 + 12.5. Storage Security . . . . . . . . . . . . . . . . . . . . 131 + 12.5.1. Authorization . . . . . . . . . . . . . . . . . . . 131 + 12.5.2. Distributed Quota . . . . . . . . . . . . . . . . . 132 + 12.5.3. Correctness . . . . . . . . . . . . . . . . . . . . 132 + 12.5.4. Residual Attacks . . . . . . . . . . . . . . . . . . 132 + 12.6. Routing Security . . . . . . . . . . . . . . . . . . . . 133 + 12.6.1. Background . . . . . . . . . . . . . . . . . . . . . 133 + 12.6.2. Admissions Control . . . . . . . . . . . . . . . . . 134 + 12.6.3. Peer Identification and Authentication . . . . . . . 134 + 12.6.4. Protecting the Signaling . . . . . . . . . . . . . . 135 + 12.6.5. Residual Attacks . . . . . . . . . . . . . . . . . . 135 + 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 136 + 13.1. Well-Known URI Registration . . . . . . . . . . . . . . 136 + 13.2. Port Registrations . . . . . . . . . . . . . . . . . . . 136 + 13.3. Overlay Algorithm Types . . . . . . . . . . . . . . . . 137 + 13.4. Access Control Policies . . . . . . . . . . . . . . . . 137 + 13.5. Application-ID . . . . . . . . . . . . . . . . . . . . . 137 + 13.6. Data Kind-ID . . . . . . . . . . . . . . . . . . . . . . 138 + 13.7. Data Model . . . . . . . . . . . . . . . . . . . . . . . 138 + 13.8. Message Codes . . . . . . . . . . . . . . . . . . . . . 139 + 13.9. Error Codes . . . . . . . . . . . . . . . . . . . . . . 140 + 13.10. Overlay Link Types . . . . . . . . . . . . . . . . . . . 141 + 13.11. Overlay Link Protocols . . . . . . . . . . . . . . . . . 141 + 13.12. Forwarding Options . . . . . . . . . . . . . . . . . . . 142 + 13.13. Probe Information Types . . . . . . . . . . . . . . . . 142 + 13.14. Message Extensions . . . . . . . . . . . . . . . . . . . 142 + 13.15. reload URI Scheme . . . . . . . . . . . . . . . . . . . 143 + 13.15.1. URI Registration . . . . . . . . . . . . . . . . . . 143 14. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 144 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 144 15.1. Normative References . . . . . . . . . . . . . . . . . . 144 - 15.2. Informative References . . . . . . . . . . . . . . . . . 145 - Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 149 - A.1. Changes since draft-ietf-p2psip-reload-09 . . . . . . . 149 - Appendix B. Routing Alternatives . . . . . . . . . . . . . . . . 149 - B.1. Iterative vs Recursive . . . . . . . . . . . . . . . . . 149 - B.2. Symmetric vs Forward response . . . . . . . . . . . . . 149 - B.3. Direct Response . . . . . . . . . . . . . . . . . . . . 150 - B.4. Relay Peers . . . . . . . . . . . . . . . . . . . . . . 151 - B.5. Symmetric Route Stability . . . . . . . . . . . . . . . 152 - Appendix C. Why Clients? . . . . . . . . . . . . . . . . . . . . 152 - C.1. Why Not Only Peers? . . . . . . . . . . . . . . . . . . 152 - C.2. Clients as Application-Level Agents . . . . . . . . . . 153 + 15.2. Informative References . . . . . . . . . . . . . . . . . 146 + Appendix A. Routing Alternatives . . . . . . . . . . . . . . . . 148 + A.1. Iterative vs Recursive . . . . . . . . . . . . . . . . . 149 + A.2. Symmetric vs Forward response . . . . . . . . . . . . . 149 + A.3. Direct Response . . . . . . . . . . . . . . . . . . . . 149 + A.4. Relay Peers . . . . . . . . . . . . . . . . . . . . . . 151 + A.5. Symmetric Route Stability . . . . . . . . . . . . . . . 151 + Appendix B. Why Clients? . . . . . . . . . . . . . . . . . . . . 152 + B.1. Why Not Only Peers? . . . . . . . . . . . . . . . . . . 152 + B.2. Clients as Application-Level Agents . . . . . . . . . . 152 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 153 1. Introduction This document defines REsource LOcation And Discovery (RELOAD), a peer-to-peer (P2P) signaling protocol for use on the Internet. It provides a generic, self-organizing overlay network service, allowing nodes to efficiently route messages to other nodes and to efficiently store and retrieve data in the overlay. RELOAD provides several features that are critical for a successful P2P protocol for the @@ -324,46 +323,48 @@ High Performance Routing: The very nature of overlay algorithms introduces a requirement that peers participating in the P2P network route requests on behalf of other peers in the network. This introduces a load on those other peers, in the form of bandwidth and processing power. RELOAD has been defined with a simple, lightweight forwarding header, thus minimizing the amount of effort required by intermediate peers. Pluggable Overlay Algorithms: RELOAD has been designed with an abstract interface to the overlay layer to simplify implementing a - variety of structured (DHT) and unstructured overlay algorithms. - This specification also defines how RELOAD is used with Chord, - which is mandatory to implement. Specifying a default "must - implement" overlay algorithm promotes interoperability, while - extensibility allows selection of overlay algorithms optimized for - a particular application. + variety of structured (e.g., distributed hash tables) and + unstructured overlay algorithms. This specification also defines + how RELOAD is used with the Chord DHT algorithm, which is + mandatory to implement. Specifying a default "must implement" + overlay algorithm promotes interoperability, while extensibility + allows selection of overlay algorithms optimized for a particular + application. These properties were designed specifically to meet the requirements for a P2P protocol to support SIP. This document defines the base protocol for the distributed storage and location service, as well as critical usages for NAT traversal and security. The SIP Usage itself is described separately in [I-D.ietf-p2psip-sip]. RELOAD is not limited to usage by SIP and could serve as a tool for supporting other P2P applications with similar needs. RELOAD is also based on the concepts introduced in [I-D.ietf-p2psip-concepts]. 1.1. Basic Setting In this section, we provide a brief overview of the operational - setting for RELOAD. See the concepts document for more details. A - RELOAD Overlay Instance consists of a set of nodes arranged in a - connected graph. Each node in the overlay is assigned a numeric - Node-ID which, together with the specific overlay algorithm in use, - determines its position in the graph and the set of nodes it connects - to. The figure below shows a trivial example which isn't drawn from - any particular overlay algorithm, but was chosen for convenience of + setting for RELOAD. See the concepts + document[I-D.ietf-p2psip-concepts] for more details. A RELOAD + Overlay Instance consists of a set of nodes arranged in a connected + graph. Each node in the overlay is assigned a numeric Node-ID which, + together with the specific overlay algorithm in use, determines its + position in the graph and the set of nodes it connects to. The + figure below shows a trivial example which isn't drawn from any + particular overlay algorithm, but was chosen for convenience of representation. +--------+ +--------+ +--------+ | Node 10|--------------| Node 20|--------------| Node 30| +--------+ +--------+ +--------+ | | | | | | +--------+ +--------+ +--------+ | Node 40|--------------| Node 50|--------------| Node 60| +--------+ +--------+ +--------+ @@ -405,58 +406,57 @@ RELOAD network via Node 80, but no other node will route through it and Node 90 is still responsible for all addresses between 81-90. We refer to non-client nodes as peers. Other applications (for instance, SIP) can be defined on top of RELOAD and use these two basic RELOAD services to provide their own services. 1.2. Architecture - RELOAD is fundamentally an overlay network. Therefore, it can be - divided into components that mimic the layering of the Internet - model[RFC1122]. + RELOAD is fundamentally an overlay network. The following figure + shows the layered RELOAD architecture. Application +-------+ +-------+ | SIP | | XMPP | ... | Usage | | Usage | +-------+ +-------+ - -------------------------------------- Messaging API + ------------------------------------ Messaging Service Boundary +------------------+ +---------+ | Message |<--->| Storage | | Transport | +---------+ +------------------+ ^ ^ ^ | | v v | +-------------------+ | | Topology | | | Plugin | | +-------------------+ | ^ v v +------------------+ | Forwarding & | | Link Management | +------------------+ - -------------------------------------- Overlay Link API + ------------------------------------ Overlay Link Service Boundary +-------+ +------+ |TLS | |DTLS | ... +-------+ +------+ The major components of RELOAD are: Usage Layer: Each application defines a RELOAD usage; a set of data kinds and behaviors which describe how to use the services provided by RELOAD. These usages all talk to RELOAD through a - common Message Transport API. + common Message Transport Service. Message Transport: Handles end-to-end reliability, manages request state for the usages, and forwards Store and Fetch operations to the Storage component. Delivers message responses to the component initiating the request. Storage: The Storage component is responsible for processing messages relating to the storage and retrieval of data. It talks directly to the Topology Plugin to manage data replication and migration, and it talks to the Message Transport component to send @@ -479,21 +479,21 @@ Overlay Link Layer: Responsible for actually transporting traffic directly between nodes. Each such protocol includes the appropriate provisions for per-hop framing or hop-by-hop ACKs required by unreliable transports. TLS [RFC5246] and DTLS [RFC4347] are the currently defined "link layer" protocols used by RELOAD for hop-by-hop communication. New protocols MAY be defined, as described in Section 5.6.1 and Section 10.1. As this document defines only TLS and DTLS, we use those terms throughout the remainder of the document with the understanding that some - future document may add new overlay link layers. + future specification may add new overlay link layers. To further clarify the roles of the various layers, this figure parallels the architecture with each layer's role from an overlay perspective and implementation layer in the internet: | Internet Model | Real | Equivalent | Reload Internet | in Overlay | Architecture -------------+-----------------+------------------------------------ | | +-------+ +-------+ @@ -522,67 +522,67 @@ | | |TLS | |DTLS | ... | | +-------+ +------+ -------------+-----------------+------------------------------------ Network | | Link | 1.2.1. Usage Layer The top layer, called the Usage Layer, has application usages, such - as the SIP Location Usage, that use the abstract Message Transport - API provided by RELOAD. The goal of this layer is to implement - application-specific usages of the generic overlay services provided - by RELOAD. The usage defines how a specific application maps its - data into something that can be stored in the overlay, where to store - the data, how to secure the data, and finally how applications can - retrieve and use the data. + as the SIP Location Usage [I-D.ietf-p2psip-sip], that use the + abstract Message Transport Service provided by RELOAD. The goal of + this layer is to implement application-specific usages of the generic + overlay services provided by RELOAD. The usage defines how a + specific application maps its data into something that can be stored + in the overlay, where to store the data, how to secure the data, and + finally how applications can retrieve and use the data. The architecture diagram shows both a SIP usage and an XMPP usage. A - single application may require multiple usages; for example a SIP - application may also require a voicemail usage. A usage may define - multiple kinds of data that are stored in the overlay and may also - rely on kinds originally defined by other usages. + single application may require multiple usages; for example a + softphone application may also require a voicemail usage. A usage + may define multiple kinds of data that are stored in the overlay and + may also rely on kinds originally defined by other usages. Because the security and storage policies for each kind are dictated by the usage defining the kind, the usages may be coupled with the Storage component to provide security policy enforcement and to implement appropriate storage strategies according to the needs of the usage. The exact implementation of such an interface is outside the scope of this specification. 1.2.2. Message Transport The Message Transport component provides a generic message routing service for the overlay. The Message Transport layer is responsible for end-to-end message transactions, including retransmissions. Each peer is identified by its location in the overlay as determined by its Node-ID. A component that is a client of the Message Transport can perform two basic functions: o Send a message to a given peer specified by Node-ID or to the peer responsible for a particular Resource-ID. - o Receive messages that other peers send to a Node-ID or Resource-ID + o Receive messages that other peers sent to a Node-ID or Resource-ID for which the receiving peer is responsible. All usages rely on the Message Transport component to send and receive messages from peers. For instance, when a usage wants to store data, it does so by sending Store requests. Note that the Storage component and the Topology Plugin are themselves clients of the Message Transport, because they need to send and receive messages from other peers. - The Message Transport API is similar to those described as providing - "Key based routing" (KBR), although as RELOAD supports different - overlay algorithms (including non-DHT overlay algorithms) that - calculate keys in different ways, the actual interface must accept - Resource Names rather than actual keys. + The Message Transport Service is similar to those described as + providing "Key based routing" (KBR), although as RELOAD supports + different overlay algorithms (including non-DHT overlay algorithms) + that calculate keys in different ways, the actual interface must + accept Resource Names rather than actual keys. 1.2.3. Storage One of the major functions of RELOAD is to allow nodes to store data in the overlay and to retrieve data stored by other nodes or by themselves. The Storage component is responsible for processing data storage and retrieval messages. For instance, the Storage component might receive a Store request for a given resource from the Message Transport. It would then query the appropriate usage before storing the data value(s) in its local data store and sending a response to @@ -643,63 +643,62 @@ plugin to control the overlay and resource operations and messages. Since each overlay algorithm is defined and functions differently, we generically refer to the table of other peers that the overlay algorithm maintains and uses to route requests (neighbors) as a Routing Table. The Topology Plugin actually owns the Routing Table, and forwarding decisions are made by querying the Topology Plugin for the next hop for a particular Node-ID or Resource-ID. If this node is the destination of the message, the message is delivered to the Message Transport. - This layer may also utilize a framing header to encapsulate messages - as they are forwarding along each hop. Such a header may be used to - aid reliability, congestion control, flow control, etc. Any such - header has meaning only in the context of that individual link. + This layer also utilizes a framing header to encapsulate messages as + they are forwarding along each hop. This header aids reliability + congestion control, flow control, etc. It has meaning only in the + context of that individual link. The Forwarding and Link Management Layer sits on top of the Overlay Link Layer protocols that carry the actual traffic. This specification defines how to use DTLS and TLS protocols to carry RELOAD messages. 1.3. Security RELOAD's security model is based on each node having one or more public key certificates. In general, these certificates will be assigned by a central server which also assigns Node-IDs, although self-signed certificates can be used in closed networks. These credentials can be leveraged to provide communications security for RELOAD messages. RELOAD provides communications security at three levels: Connection Level: Connections between peers are secured with TLS, - DTLS, or potentially some to-be-defined future protocol. + DTLS, or potentially some to be defined future protocol. Message Level: Each RELOAD message must be signed. Object Level: Stored objects must be signed by the storing peer. These three levels of security work together to allow peers to verify the origin and correctness of data they receive from other peers, even in the face of malicious activity by other peers in the overlay. RELOAD also provides access control built on top of these communications security features. Because the peer responsible for storing a piece of data can validate the signature on the data being stored, the responsible peer can determine whether a given operation is permitted or not. RELOAD also provides an optional shared secret based admission - control feature using shared secrets and TLS-PSK. This mode is - typically used when self-signed certificates are being used but would - generally not be used when the certificates were all signed by an - enrollment server. In order to form a TLS connection to any node in - the overlay, a new node needs to know the shared overlay key, thus - restricting access to authorized users only. This feature is used - together with certificate-based access control, not as a replacement - for it. + control feature using shared secrets and TLS-PSK. In order to form a + TLS connection to any node in the overlay, a new node needs to know + the shared overlay key, thus restricting access to authorized users + only. This feature is used together with certificate-based access + control, not as a replacement for it. It is typically used when + self-signed certificates are being used but would generally not be + used when the certificates were all signed by an enrollment server. 1.4. Structure of This Document The remainder of this document is structured as follows. o Section 2 provides definitions of terms used in this document. o Section 3 provides an overview of the mechanisms used to establish and maintain the overlay. o Section 4 provides an overview of the mechanism RELOAD provides to support other applications. @@ -743,37 +742,37 @@ Peer: A host that is participating in the overlay. Peers are responsible for holding some portion of the data that has been stored in the overlay and also route messages on behalf of other hosts as required by the Overlay Algorithm. Client: A host that is able to store data in and retrieve data from the overlay but which is not participating in routing or data storage for the overlay. - Kind: A kind defined a particular type of data that can be stored in + Kind: A kind defines a particular type of data that can be stored in the overlay. Applications define new Kinds to story the data they - use. Each Kind is identied iwht a unique IANA assinged intereger + use. Each Kind is identified with a unique IANA assigned integer called a Kind-ID . Node: We use the term "Node" to refer to a host that may be either a Peer or a Client. Because RELOAD uses the same protocol for both clients and peers, much of the text applies equally to both. Therefore we use "Node" when the text applies to both Clients and Peers and the more specific term (i.e. client or peer) when the text applies only to Clients or only to Peers. - Node-ID: A 128-bit value that uniquely identifies a node. Node-IDs - 0 and 2^128 - 1 are reserved and are invalid Node-IDs. A value of - zero is not used in the wire protocol but can be used to indicate - an invalid node in implementations and APIs. The Node-ID of - 2^128-1 is used on the wire protocol as a wildcard. + Node-ID: A fixed-length value that uniquely identifies a node. + Node-IDs of all 0s and all 1s are reserved and are invalid Node- + IDs. A value of zero is not used in the wire protocol but can be + used to indicate an invalid node in implementations and APIs. The + Node-ID of all 1s is used on the wire protocol as a wildcard. Resource: An object or group of objects associated with a string identifier. See "Resource Name" below. Resource Name: The potentially human readable name by which a resource is identified. In unstructured P2P networks, the resource name is sometimes used directly as a Resource-ID. In structured P2P networks the resource name is typically mapped into a Resource-ID by using the string as the input to hash function. A SIP resource, for example, is often identified by its AOR which @@ -830,21 +829,21 @@ Every node in the RELOAD overlay is identified by a Node-ID. The Node-ID is used for three major purposes: o To address the node itself. o To determine its position in the overlay topology when the overlay is structured. o To determine the set of resources for which the node is responsible. Each node has a certificate [RFC5280] containing a Node-ID, which is - globally unique. + unique within an overlay instance. The certificate serves multiple purposes: o It entitles the user to store data at specific locations in the Overlay Instance. Each data kind defines the specific rules for determining which certificates can access each Resource-ID/Kind-ID pair. For instance, some kinds might allow anyone to write at a given location, whereas others might restrict writes to the owner of a single certificate. o It entitles the user to operate a node that has a Node-ID found in @@ -864,21 +863,21 @@ RELOAD supports multiple certificate issuance models. The first is based on a central enrollment process which allocates a unique name and Node-ID and puts them in a certificate for the user. All peers in a particular Overlay Instance have the enrollment server as a trust anchor and so can verify any other peer's certificate. In some settings, a group of users want to set up an overlay network but are not concerned about attack by other users in the network. For instance, users on a LAN might want to set up a short term ad hoc network without going to the trouble of setting up an enrollment - server. RELOAD supports the use of self-generated and self-signed + server. RELOAD supports the use of self-generated, self-signed certificates. When self-signed certificates are used, the node also generates its own Node-ID and username. The Node-ID is computed as a digest of the public key, to prevent Node-ID theft; however this model is still subject to a number of known attacks (most notably Sybil attacks [Sybil]) and can only be safely used in closed networks where users are mutually trusting. The general principle here is that the security mechanisms (TLS and message signatures) are always used, even if the certificates are self-signed. This allows for a single set of code paths in the @@ -917,50 +916,49 @@ concept. From the perspective of a peer, a client is simply a node which has not yet sent any Updates or Joins. It might never do so (if it's a client) or it might eventually do so (if it's just a node that's taking a long time to join). The routing and storage rules for RELOAD provide for correct behavior by peers regardless of whether other nodes attached to them are clients or peers. Of course, a client implementation must know that it intends to be a client, but this localizes complexity only to that node. For more discussion of the motivation for RELOAD's client support, - see Appendix C. + see Appendix B. 3.2.1. Client Routing - There are two routing options by which a client may be located in an - overlay. + Clients may insert themselves in the overlay in two ways: o Establish a connection to the peer responsible for the client's Node-ID in the overlay. Then requests may be sent from/to the client using its Node-ID in the same manner as if it were a peer, because the responsible peer in the overlay will handle the final step of routing to the client. This may require a TURN relay in cases where NATs or firewalls prevent a client from forming a direct connections with its responsible peer. Note that clients that choose this option MUST process Update messages from the - peer. Those updates can indicate that the peer no longer owns the - Client's Node-ID. The client then forms a connection to the - appropriate peer. Failure to do so will result in the client no - longer receiving messages. + peer. Those updates can indicate that the peer no longer is + responsible for the Client's Node-ID. The client then MUST form a + connection to the appropriate peer. Failure to do so will result + in the client no longer receiving messages. o Establish a connection with an arbitrary peer in the overlay (perhaps based on network proximity or an inability to establish a direct connection with the responsible peer). In this case, the client will rely on RELOAD's Destination List feature to ensure reachability. The client can initiate requests, and any node in the overlay that knows the Destination List to its current location can reach it, but the client is not directly reachable - using only its Node-ID. The Destination List required to reach it - must be learnable via other mechanisms, such as being stored in - the overlay by a usage, if the client is to receive incoming - requests from other members of the overlay. + using only its Node-ID. If the client is to receive incoming + requests from other members of the overlay, the Destination List + required to reach it must be learnable via other mechanisms, such + as being stored in the overlay by a usage. 3.2.2. Minimum Functionality Requirements for Clients A node may act as a client simply because it does not have the resources or even an implementation of the topology plugin required to act as a peer in the overlay. In order to exchange RELOAD messages with a peer, a client must meet a minimum level of functionality. Such a client must: o Implement RELOAD's connection-management operations that are used @@ -976,58 +974,62 @@ peers. While a client does not necessarily require a full implementation of the overlay algorithm, calculating the Resource-ID requires an implementation of the appropriate algorithm for the overlay. 3.3. Routing This section will discuss the requirements RELOAD's routing capabilities must meet, then describe the routing features in the protocol, and then provide a brief overview of how they are used. - Appendix B discusses some alternative designs and the tradeoffs that + Appendix A discusses some alternative designs and the tradeoffs that would be necessary to support them. RELOAD's routing capabilities must meet the following requirements: NAT Traversal: RELOAD must support establishing and using connections between nodes separated by one or more NATs, including locating peers behind NATs for those overlays allowing/requiring it. Clients: RELOAD must support requests from and to clients that do not participate in overlay routing. Client promotion: RELOAD must support clients that become peers at a later point as determined by the overlay algorithm and deployment. Low state: RELOAD's routing algorithms must not require significant state to be stored on intermediate peers. Return routability in unstable topologies: At some points in times, different nodes may have inconsistent information about the connectivity of the routing graph. In all cases, the response to a request needs to delivered to the node that sent the request and not to some other node. - To meet these requirements, RELOAD's routing relies on two basic - mechanisms: + RELOAD's routing provides three mechanisms designed to assist in + meeting these needs: - Via Lists: The forwarding header used by all RELOAD messages - contains both a Via List (built hop-by-hop as the message is - routed through the overlay) and a Destination List (providing - source-routing capabilities for requests and return-path routing - for responses). - Route_Query: The Route_Query method allows a node to query a peer + Destination Lists: While in principle it is possible to just + inject a message into the overlay with a bare NodeID as the + destination, RELOAD provides a source routing capability in the + form of "Destination Lists". A "Destination List provides a list + of the nodes through which a message must flow. + Via Lists: In order to allow responses to follow the same path as + requests, each message also contains a "Via List", which is added + to by each node a message traverses. This via list can then be + inverted and used as a destination list for the response. + RouteQuery: The RouteQuery method allows a node to query a peer for the next hop it will use to route a message. This method is useful for diagnostics and for iterative routing. The basic routing mechanism used by RELOAD is Symmetric Recursive. - We will first describe symmetric routing and then discuss its - advantages in terms of the requirements discussed above. + We will first describe symmetric recursive routing and then discuss + its advantages in terms of the requirements discussed above. - Symmetric recursive routing requires that a message follow the path + Symmetric recursive routing requires that a message follow a path through the overlay to the destination without returning to the originating node: each peer forwards the message closer to its destination. The return path of the response is then the same path followed in reverse. For example, a message following a route from A to Z through B and X: A B X Z ------------------------------- ----------> @@ -1054,44 +1056,44 @@ This figure shows use of full via-lists by intermediate peers B and X. However, if B and/or X are willing to store state, then they may elect to truncate the lists, save that information internally (keyed by the transaction id), and return the response message along the path from which it was received when the response is received. This option requires greater state to be stored on intermediate peers but saves a small amount of bandwidth and reduces the need for modifying the message en route. Selection of this mode of operation is a choice for the individual peer; the techniques are interoperable even on a single message. The figure below shows B using full via lists - but X truncating them and saving the state internally. + but X truncating them to X1 and saving the state internally. A B X Z ------------------------------- ----------> Dest=Z ----------> Via=A Dest=Z ----------> - Dest=Z + Dest=Z, X1 <---------- - Dest=X + Dest=X,X1 <---------- Dest=B, A <---------- Dest=A RELOAD also supports a basic Iterative routing mode (where the intermediate peers merely return a response indicating the next hop, but do not actually forward the message to that next hop themselves). - Iterative routing is implemented using the Route_Query method, which + Iterative routing is implemented using the RouteQuery method, which requests this behavior. Note that iterative routing is selected only by the initiating node. 3.4. Connectivity Management In order to provide efficient routing, a peer needs to maintain a set of direct connections to other peers in the Overlay Instance. Due to the presence of NATs, these connections often cannot be formed directly. Instead, we use the Attach request to establish a connection. Attach uses ICE [RFC5245] to establish the connection. @@ -1137,25 +1139,26 @@ RELOAD defines three methods for overlay maintenance: Join, Update, and Leave. However, the contents of those messages, when they are sent, and their precise semantics are specified by the actual overlay algorithm; RELOAD merely provides a framework of commonly-needed methods that provides uniformity of notation (and ease of debugging) for a variety of overlay algorithms. 3.5.2. Joining, Leaving, and Maintenance Overview When a new peer wishes to join the Overlay Instance, it must have a - Node-ID that it is allowed to use. When an enrollment server is used - that Node-ID will be in the certificate the node received from the - enrollment server. The details of the joining procedure are defined - by the overlay algorithm, but the general steps for joining an - Overlay Instance are: + Node-ID that it is allowed to use and a set of credentials which + match that Node-ID. When an enrollment server is used that Node-ID + will be in the certificate the node received from the enrollment + server. The details of the joining procedure are defined by the + overlay algorithm, but the general steps for joining an Overlay + Instance are: o Forming connections to some other peers. o Acquiring the data values this peer is responsible for storing. o Informing the other peers which were previously responsible for that data that this peer has taken over responsibility. The first thing the peer needs to do is to form a connection to some "bootstrap node". Because this is the first connection the peer makes, these nodes must have public IP addresses so that they can be connected to directly. Once a peer has connected to one or more @@ -1191,27 +1194,27 @@ responsible for some section of the Overlay Instance. 5. JP makes its own connections to the appropriate peers in the Overlay Instance. After this process is completed, JP is a full member of the Overlay Instance and can process Store/Fetch requests. Note that the first node is a special case. When ordinary nodes cannot form connections to the bootstrap nodes, then they are not part of the overlay. However, the first node in the overlay can - obviously not connect to others nodes. In order to support this - case, potential first nodes (which must also serve as bootstrap nodes + obviously not connect to other nodes. In order to support this case, + potential first nodes (which must also serve as bootstrap nodes initially) must somehow be instructed (perhaps by configuration settings) that they are the entire overlay, rather than not part of it. - Note that clients do not perfom either of these operations. + Note that clients do not perform either of these operations. 3.6. First-Time Setup Previous sections addressed how RELOAD works once a node has connected. This section provides an overview of how users get connected to the overlay for the first time. RELOAD is designed so that users can start with the name of the overlay they wish to join and perhaps a username and password, and leverage that into having a working peer with minimal user intervention. This helps avoid the problems that have been experienced with conventional SIP clients @@ -1330,57 +1333,56 @@ The most natural rule is that a certificate authorizes a user to store data keyed with their user name X. This rule is used for all the kinds defined in this specification. Thus, only a user with a certificate for "alice@example.org" could write to that location in the overlay. However, other usages can define any rules they choose, including publicly writable values. The digital signature over the data serves two purposes. First, it allows the peer responsible for storing the data to verify that this Store is authorized. Second, it provides integrity for the data. + The signature is saved along with the data value (or values) so that any reader can verify the integrity of the data. Of course, the responsible peer can "lose" the value but it cannot undetectably modify it. The size requirements of the data being stored in the overlay are - variable. For instance, a SIP AoR and voicemail differ widely in the + variable. For instance, a SIP AOR and voicemail differ widely in the storage size. RELOAD leaves it to the Usage and overlay configuration to limit size imbalance of various kinds. 4.1.2. Usages By itself, the distributed storage layer just provides infrastructure on which applications are built. In order to do anything useful, a - usage must be defined. Each Usage specifies several things: + usage must be defined. Each Usage needs to specify several things: o Registers Kind-ID code points for any kinds that the Usage defines. o Defines the data structure for each of the kinds. o Defines access control rules for each of the kinds. o Defines how the Resource Name is formed that is hashed to form the Resource-ID where each kind is stored. o Describes how values will be merged after a network partition. Unless otherwise specified, the default merging rule is to act as if all the values that need to be merged were stored and as if the order they were stored in corresponds to the stored time values associated with (and carried in) their values. Because the stored time values are those associated with the peer which did the writing, clock skew is generally not an issue. If two nodes are on different partitions, write to the same location, and have clock skew, this can create merge conflicts. However because RELOAD deliberately segregates storage so that data from different users and peers is stored in different locations, and a single peer will typically only be in a single network partition, this case will generally not arise. - o Defines the types of connections that can be initiated using - AppAttach. The kinds defined by a usage may also be applied to other usages. However, a need for different parameters, such as different size limits, would imply the need to create a new kind. 4.1.3. Replication Replication in P2P overlays can be used to provide: persistence: if the responsible peer crashes and/or if the storing @@ -1463,28 +1464,31 @@ Once the peer has determined that the message is correctly formatted, it examines the first entry on the destination list. There are three possible cases here: o The first entry on the destination list is an ID for which the peer is responsible. o The first entry on the destination list is an ID for which another peer is responsible. o The first entry on the destination list is a private ID that is being used for destination list compression. This is described - later. + later (note that private IDs can be distinguished from NodeIDs and + Resource IDs on the wire; see Section 5.3.2.2). These cases are handled as discussed below. 5.1.1. Responsible ID If the first entry on the destination list is an ID for which the - node is responsible, there are several sub-cases. + node is responsible, there are several sub-cases to consider. + + o o If the entry is a Resource-ID, then it MUST be the only entry on the destination list. If there are other entries, the message MUST be silently dropped. Otherwise, the message is destined for this node and it passes it up to the upper layers. o If the entry is a Node-ID which equals this node's Node-ID, then the message is destined for this node. If this is the only entry on the destination list, the message is destined for this node and is passed up to the upper layers. Otherwise the entry is removed from the destination list and the message is passed to the Message Transport. If the message is a response and there is state for @@ -1543,30 +1547,31 @@ instance, in the above example, Node D might send E a via list containing only the private ID (I). E would then use the destination list (D, I) to send its return message. When D processes this destination list, it would detect that I is a private ID, recover the via list (A, B, C), and reverse that to produce the correct destination list (C, B, A) before sending it to C. This feature is called List Compression. It MAY either be a compressed version of the original via list or an index into a state database containing the original via list. - Note that if an intermediate peer exits the overlay, then on the - return trip the message cannot be forwarded and will be dropped. The - ordinary timeout and retransmission mechanisms provide stability over - this type of failure. + No matter what mechanism for storing via list state is used, if an + intermediate peer exits the overlay, then on the return trip the + message cannot be forwarded and will be dropped. The ordinary + timeout and retransmission mechanisms provide stability over this + type of failure. Note that if an intermediate peer retains per-transaction state instead of modifying the via list, it needs some mechanism for timing out that state, otherwise its state database will grow without bound. Whatever algorithm is used, state MUST be maintained for at least the - value of the overlay reliability timer (3 seconds) and MAY keep it + value of the overlay reliability timer (3 seconds) and MAY be kept longer. 5.1.3. Private ID If the first entry in the destination list is a private id (e.g., a compressed via list), the peer MUST replace that entry with the original via list that it replaced and then re-examine the destination list to determine which of the above cases now applies. 5.2. Symmetric Recursive Routing @@ -1656,35 +1661,34 @@ Forwarding Header: Each message has a generic header which is used to forward the message between peers and to its final destination. This header is the only information that an intermediate peer (i.e., one that is not the target of a message) needs to examine. Message Contents: The message being delivered between the peers. From the perspective of the forwarding layer, the contents are opaque, however, they are interpreted by the higher layers. Security Block: A security block containing certificates and a - digital signature over the message. Note that this signature can - be computed without parsing the message contents. All messages - MUST be signed by their originator. + digital signature over the ""Message Contents". Note that this + signature can be computed without parsing the message contents. + All messages MUST be signed by their originator. The following sections describe the format of each part of the message. 5.3.1. Presentation Language The structures defined in this document are defined using a C-like syntax based on the presentation language used to define TLS. - Advantages of this style include: + [RFC5246] Advantages of this style include: - o It is easy to write and familiar enough looking that most readers - can grasp it quickly. + o It familiar enough looking that most readers can grasp it quickly. o The ability to define nested structures allows a separation between high-level and low-level message structures. o It has a straightforward wire encoding that allows quick implementation, but the structures can be comprehended without knowing the encoding. o The ability to mechanically compile encoders and decoders. Several idiosyncrasies of this language are worth noting. o All lengths are denoted in bytes, not objects. @@ -1702,22 +1706,22 @@ read the presentation language. An enum represents an enumerated type. The values associated with each possibility are represented in parentheses and the maximum value is represented as a nameless value, for purposes of describing the width of the containing integral type. For instance, Boolean represents a true or false: enum { false (0), true(1), (255)} Boolean; - A boolean value is either a 1 or a 0 and is represented as a single - byte on the wire. + A boolean value is either a 1 or a 0. The max value of 255 indicates + this is represented as a single byte on the wire. The NodeId, shown below, represents a single Node-ID. typedef opaque NodeId[NodeIdLength]; A NodeId is a fixed-length structure represented as a series of bytes, with the most significant byte first. The length is set on a per-overlay basis within the range of 16-20 bytes (128 to 160 bits). (See Section 10.1 for how NodeIdLength is set.) Note: the use of "typedef" here is an extension to the TLS language, but its meaning @@ -1729,27 +1733,28 @@ typedef opaque ResourceId<0..2^8-1>; Like a NodeId, a ResourceId is an opaque string of bytes, but unlike NodeIds, ResourceIds are variable length, up to 255 bytes (2048 bits) in length. On the wire, each ResourceId is preceded by a single length byte (allowing lengths up to 255). Thus, the 3-byte value "FOO" would be encoded as: 03 46 4f 4f. Note the < range > syntax defines a variable length element that does include the length of the element in the on the wire encoding. The number of bytes to encode - the length on the wire is derived by range. + the length on the wire is derived by range; i.e., it is the minimum + number of bytes which can encode the largest range value. A more complicated example is IpAddressPort, which represents a network address and can be used to carry either an IPv6 or IPv4 address: - enum {reserved_addr(0), ipv4_address (1), ipv6_address (2), + enum {reservedAddr(0), ipv4_address (1), ipv6_address (2), (255)} AddressType; struct { uint32 addr; uint16 port; } IPv4AddrPort; struct { uint128 addr; uint16 port; @@ -1833,24 +1838,24 @@ variable length string representing the overlay name is hashed with SHA-1 and the low order 32 bits are used. The purpose of this field is to allow nodes to participate in multiple overlays and to detect accidental misconfiguration. This is not a security critical function. configuration_sequence: The sequence number of the configuration file. version: The version of the RELOAD protocol being used. This is a - fixed point interger between 0.1 and 25.4. This document - describes version 0.1, with a value of 0x01. [[ Note to RFC - Editor: Please update this to version 1.0 with value of 0x0a and - remove this note. ]] + fixed point integer between 0.1 and 25.4. This document describes + version 0.1, with a value of 0x01. [[ Note to RFC Editor: Please + update this to version 1.0 with value of 0x0a and remove this + note. ]] ttl: An 8 bit field indicating the number of iterations, or hops, a message can experience before it is discarded. The TTL value MUST be decremented by one at every hop along the route the message traverses. If the TTL is 0, the message MUST NOT be propagated further and MUST be discarded, and a "Error_TTL_Exceeded" error should be generated. The initial value of the TTL SHOULD be 100 unless defined otherwise by the overlay configuration. fragment: This field is used to handle fragmentation. The high @@ -1860,23 +1865,25 @@ that this is the last fragment. The next six bits (0x20000000 to 0x01000000) are reserved and SHOULD be set to zero. The remainder of the field is used to indicate the fragment offset; see Section 5.7 length: The count in bytes of the size of the message, including the header. transaction_id: A unique 64 bit number that identifies this transaction and also allows receivers to disambiguate transactions - which are otherwise identical. Responses use the same Transaction - ID as the request they correspond to. Transaction IDs are also - used for fragment reassembly. + which are otherwise identical. In order to provide a high + probability that transaction IDs are unique, they MUST be randomly + generated. Responses use the same Transaction ID as the request + they correspond to. Transaction IDs are also used for fragment + reassembly. max_response_length: The maximum size in bytes of a response. Used by requesting nodes to avoid receiving (unexpected) very large responses. If this value is non-zero, responding peers MUST check that any response would not exceed it and if so generate an Error_Response_Too_Large value. This value SHOULD be set to zero for responses. via_list_length: The length of the via list in bytes. Note that in this field and the following two length fields we depart from the @@ -1909,26 +1916,29 @@ document changes, each version of the configuration document has a sequence number which is monotonically increasing mod 65536. Because the sequence number may in principle wrap, greater than or less than are interpreted by modulo arithmetic as in TCP. When a destination node receives a request, it MUST check that the configuration_sequence field is equal to its own configuration sequence number. If they do not match, it MUST generate an error, either Error_Config_Too_Old or Error_Config_Too_New. In addition, if the configuration file in the request is too old, it MUST generate a - Config_Update message to update the requesting node. This allows new + ConfigUpdate message to update the requesting node. This allows new configuration documents to propagate quickly throughout the system. The one exception to this rule is that if the configuration_sequence - field is equal to 0xffff, and the message type is Config_Update, then + field is equal to 0xffff, and the message type is ConfigUpdate, then the message MUST be accepted regardless of the receiving node's - configuration sequence number. + configuration sequence number. Since 65535 is a special value, peers + sending a new configuration when the configuration sequence is + currently 65534 MUST set the configuration sequence number to 0 when + they send out a new configuration. 5.3.2.2. Destination and Via Lists The destination list and via lists are sequences of Destination values: enum {reserved(0), node(1), resource(2), compressed(3), /* 128-255 not allowed */ (255) } DestinationType; @@ -1949,22 +1958,22 @@ struct { DestinationType type; uint8 length; DestinationData destination_data; } Destination; struct { uint16 compressed_id; /* top bit MUST be 1 */ } Destination; - If destination structure has its first bit set to 1, then it is a 16 - bit integer. If the first bit is not set, then it is a structure + If a destination structure has its first bit set to 1, then it is a + 16 bit integer. If the first bit is not set, then it is a structure starting with DestinationType. If it is a 16 bit integer, it is treated as if it were a full structure with a DestinationType of compressed and a compressed_id that was 2 bytes long with the value of the 16 bit integer. When the destination structure is not a 16 bit integer, it is the TLV structure with the following contents: type The type of the DestinationData Payload Data Unit (PDU). This may be one of "node", "resource", or "compressed". @@ -1994,47 +2003,43 @@ resource The Resource-ID of the resource which is desired. This type MUST only appear in the final location of a destination list and MUST NOT appear in a via list. It is meaningless to try to route through a resource. One possible encoding of the 16 bit integer version as an opaque identifier is to encode an index into a connection table. To avoid misrouting responses in the event a response is delayed and the - connection table entry has changed, the identifier should be split + connection table entry has changed, the identifier SHOULD be split between an index and a generation counter for that index. At startup, the generation counters should be initialized to random values. An implementation could use 12 bits for the connection table index and 3 bits for the generation counter. (Note that this does not suggest a 4096 entry connection table for every node, only the ability to encode for a larger connection table.) When a connection table slot is used for a new connection, the generation counter is incremented (with wrapping). Connection table slots are used on a rotating basis to maximize the time interval between uses of the same slot for different connections. When routing a message to an entry in the destination list encoding a connection table entry, the node confirms that the generation counter matches the current generation counter of that index before forwarding the message. If it does not match, the message is silently dropped. - Regardless of how the 16 bit integer field or opaque DestinationType - is used, the encoding MUST include a generation counter designed to - prevent misrouting of responses due to the connection table entry - having changed since the request message was originally forwarded. - 5.3.2.3. Forwarding Options The Forwarding header can be extended with forwarding header options, which are a series of ForwardingOptions structures: - enum { directResponseForwarding(1), (255) } ForwardingOptionsType; + enum { reservedForwarding(0), + directResponseForwarding(1), (255) } ForwardingOptionsType; struct { ForwardingOptionsType type; uint8 flags; uint16 length; select (type) { case directResponseForwarding: DirectResponseForwardingOption directResponseForwardingOption; /* This type may be extended */ } option; @@ -2054,70 +2059,71 @@ DESTINATION_CRITICAL(0x02), and RESPONSE_COPY(0x04). These flags MUST NOT be set in a response. If the FORWARD_CRITICAL flag is set, any node that would forward the message but does not understand this options MUST reject the request with an Error_Unsupported_Forwarding_Option error response. If the DESTINATION_CRITICAL flag is set, any node that generates a response to the message but does not understand the forwarding option MUST reject the request with an Error_Unsupported_Forwarding_Option error response. If the RESPONSE_COPY flag is set, any node generating a response MUST - copy the option from the request to the response and clear the - RESPONSE_COPY, FORWARD_CRITICAL and DESTINATION_CRITICAL flags. + copy the option from the request to the response except that the + RESPONSE_COPY, FORWARD_CRITICAL and DESTINATION_CRITICAL flags + must be cleared. option The option value. 5.3.2.4. Direct Return Response Forwarding Options This section defines an OPTIONAL forwarding option that allows the - originator of a request to signal that the node responsindg to the + originator of a request to signal that the node responding to the request should try to route the response directly to the node that made the request instead of having the responses traverse the overlay. : struct { AttachReqAns connection_information; NodeID requesting_node; } DirectResponseForwardingOption; Each ForwardingOption consists of the following values: connection_information All of the information needed to initiate a new connection to the - requesting node. + requesting node. This type is defined in Section 5.5.1.1. requesting_node The NodeID of the node that originated the request. This is used to match the TLS certificate. This option can only be used if the direct-return-response-permitted flag in the configuration for the overlay is set to TRUE. The RESPONSE_COPY flag SHOULD be set to false while the FORWARD_CRITICAL - and DESTINATION_CRITICAL SHOULD be set to true. When a node that + and DESTINATION_CRITICAL MUST be set to true. When a node that supports this forwarding options receives a request with it, it acts - as if it had send an Attache request to the the requesting_node and - it had received the connection_information in the answer. This cases - it to form a new connection directly to that node. Once that is - complete the response to this request is sent over that connection. - If a connection already exists directly to that node, it is used - instead of a a new connection being formed. The connection MAY be - closed at any point but is typically kept open until until it has - noot been used for a signicant period of time or one of the nodes - needs to reclaim resources. + as if it had send an Attach request to the requesting_node and it had + received the connection_information in the answer. This causes it to + form a new connection directly to that node. Once that is complete + the response to this request is sent over that connection. If a + connection already exists directly to that node, it is used instead + of a new connection being formed. The connection MAY be closed at + any point but is typically kept open until it has not been used for a + significant period of time or one of the nodes needs to reclaim + resources. 5.3.3. Message Contents Format The second major part of a RELOAD message is the contents part, which is defined by MessageContents: - enum { (2^16-1) } MessageExtensionType; + enum { reservedMessagesExtension(0), (2^16-1) } MessageExtensionType; struct { MessageExtensionType type; Boolean critical; opaque extension_contents<0..2^32-1>; } MessageExtension; struct { uint16 message_code; opaque message_body<0..2^32-1>; @@ -2132,43 +2138,42 @@ 0 Reserved 1 .. 0x7fff Requests and responses. These code points are always paired, with requests being odd and the corresponding response being the request code plus 1. Thus, "probe_request" (the Probe request) has value 1 and "probe_answer" (the Probe response) has value 2 0xffff Error - + The message codes are defined in Section 13.8 message_body The message body itself, represented as a variable-length string of bytes. The bytes themselves are dependent on the code value. See the sections describing the various RELOAD methods (Join, Update, Attach, Store, Fetch, etc.) for the definitions of the payload contents. - extensions Extensions to the message. Currently no extensions are defined, but new extensions can be defined by the process described in - Section 13.13. + Section 13.14. All extensions have the following form: type The extension type. critical Whether this extension must be understood in order to process the message. If critical = True and the recipient does not understand the message, it MUST generate an Error_Unknown_Extension error. - If critical = False, the recipient SHOULD choose to process the + If critical = False, the recipient MAY choose to process the message even if it does not understand the extension. extension_contents The contents of the extension (extension-dependent). 5.3.3.1. Response Codes and Response Errors A peer processing a request returns its status in the message_code field. If the request was a success, then the message code is the response code that matches the request (i.e., the next code up). The @@ -2191,66 +2196,75 @@ error_code A numeric error code indicating the error that occurred. error_info An optional arbitrary byte string. Unless otherwise specified, this will be a UTF-8 text string providing further information about what went wrong. The following error code values are defined. The numeric values for - these are defined in Section 13.8. + these are defined in Section 13.9. Error_Forbidden: The requesting node does not have permission to make this request. Error_Not_Found: The resource or peer cannot be found or does not exist. Error_Request_Timeout: A response to the request has not been received in a suitable amount of time. The requesting node MAY resend the request at a later time. Error_Data_Too_Old: A store cannot be completed because the storage_time precedes the existing value. + Error_Data_Too_Old: A store cannot be completed because the + storage_time precedes the existing value. + + Error_Data_Too_Large: A store cannot be completed because the + requested object exceeds the size limits for that kind. + Error_Generation_Counter_Too_Low: A store cannot be completed because the generation counter precedes the existing value. Error_Incompatible_with_Overlay: A peer receiving the request is using a different overlay, overlayalgorithm, or hash algorithm. Error_Unsupported_Forwarding_Option: A peer receiving the request with a forwarding options flagged as critical but the peer does not support this option. See section Section 5.3.2.3. Error_TTL_Exceeded: A peer receiving the request where the TTL got decremented to zero. See section Section 5.3.2. Error_Message_Too_Large: A peer receiving the request that was too large. See section Section 5.6. Error_Response_Too_Large: A peer would have generated a response that is too large per the max_response_length field. Error_Config_Too_Old: A destination peer received a request with a - configuration sequence that's too old. + configuration sequence that's too old. A node which generates + this response MUST then generate a ConfigUpdate message containing + the correct configuration. Error_Config_Too_New: A destination node received a request with a configuration sequence that's too new. A node which receives this - error MUST generate a Config_Update message to send a new copy of + error MUST generate a ConfigUpdate message to send a new copy of the configuration document to the node which generated the error. Error_Unknown_Kind: A destination node received a request with an unknown kind-id. A node which receives this error MUST generate a - Config_Update message which contains the appropriate kind - definition. + ConfigUpdate message which contains the appropriate kind + definition (assuming that in fact a kind was used which was + defined in the configuration document). Error_Unknown_Extension: A destination node received a request with an unknown extension. 5.3.4. Security Block The third part of a RELOAD message is the security block. The security block is represented by a SecurityBlock structure: enum { x509(0), (255) } certificate_type; @@ -2295,38 +2308,39 @@ it is the DER form. The signature is computed over the payload and parts of the forwarding header. The payload, in case of a Store, may contain an additional signature computed over a StoreReq structure. All signatures are formatted using the Signature element. This element is also used in other contexts where signatures are needed. The input structure to the signature computation varies depending on the data element being signed. - enum {reserved(0), cert_hash(1), (255)} SignerIdentityType; + enum { reservedSignerIdentity(0), + cert_hash(1), (255)} SignerIdentityType; select (identity_type) { case cert_hash; - HashAlgorithm hash_alg; + HashAlgorithm hash_alg; // From TLS opaque certificate_hash<0..2^8-1>; /* This structure may be extended with new types if necessary*/ } SignerIdentityValue; struct { SignerIdentityType identity_type; uint16 length; SignerIdentityValue identity[SignerIdentity.length]; } SignerIdentity; struct { - SignatureAndHashAlgorithm algorithm; + SignatureAndHashAlgorithm algorithm; // From TLS SignerIdentity identity; opaque signature_value<0..2^16-1>; } Signature; The signature construct contains the following values: algorithm The signature algorithm in use. The algorithm definitions are found in the IANA TLS SignatureAlgorithm Registry. @@ -2474,21 +2488,21 @@ Update is the primary overlay-specific maintenance message. It is used by the sender to notify the recipient of the sender's view of the current state of the overlay (its routing state), and it is up to the recipient to take whatever actions are appropriate to deal with the state change. In general, peers send Update messages to all their adjacencies whenever they detect a topology shift. When a peer detects through an Update that it is no longer responsible for any data value it is storing, it MUST attempt to - Store a copy to the correct node unless it knows the the newly + Store a copy to the correct node unless it knows the newly responsible node already has a copy of the data. This prevents data loss during large-scale topology shifts such as the merging of partitioned overlays. The contents of the UpdateReq message are completely overlay- specific. The UpdateAns response is expected to be either success or an error. 5.4.2.4. Route_Query @@ -2552,21 +2566,22 @@ peer controlling a given location (by using a resource ID). In either case, the target Node-IDs respond with a simple response containing some status information. 5.4.2.5.1. Request Definition The ProbeReq message contains a list (potentially empty) of the pieces of status information that the requester would like the responder to provide. - enum { responsible_set(1), num_resources(2), uptime(3), (255)} + enum { reservedProbeInformation(0), responsible_set(1), + num_resources(2), uptime(3), (255)} ProbeInformationType; struct { ProbeInformationType requested_info<0..2^8-1>; } ProbeReq The currently defined values for ProbeInformation are: responsible_set indicates that the peer should Respond with the fraction of the @@ -2605,21 +2620,21 @@ uint8 length; ProbeInformationData value; } ProbeInformation; struct { ProbeInformation probe_info<0..2^16-1>; } ProbeAns; A ProbeAns message contains a sequence of ProbeInformation structures. Each has a "length" indicating the length of the - following value field. This structure allows for unknown options + following value field. This structure allows for unknown option types. Each of the current possible Probe information types is a 32-bit unsigned integer. For type "responsible_ppb", it is the fraction of the overlay for which the peer is responsible in parts per billion. For type "num_resources", it is the number of resources the peer is storing. For the type "uptime" it is the number of seconds the peer has been up. The responding peer SHOULD include any values that the requesting @@ -2667,25 +2682,25 @@ becoming a peer (using Join and Update), to prevent half-open states where a node has started to form connections but is not really ready to act as a peer. Thus, clients (unlike peers) can simply Attach without sending Join or Update. 5.5.1.1. Request Definition An Attach request message contains the requesting node ICE connection parameters formatted into a binary structure. - enum { reserved(0), DTLS-UDP-SR(1), + enum { reservedOverlayLink(0), DTLS-UDP-SR(1), DTLS-UDP-SR-NO-ICE(3), TLS-TCP-FH-NO-ICE(4), (255) } OverlayLinkType; - enum { reserved(0), host(1), srflx(2), prflx(3), relay(4), + enum { reservedCand(0), host(1), srflx(2), prflx(3), relay(4), (255) } CandType; struct { opaque name<2^16-1>; opaque value<2^16-1>; } IceExtension; struct { IpAddressPort addr_port; OverlayLinkType overlay_link; @@ -2736,21 +2751,21 @@ only one component, it is always 1, and thus left out of the PDU. The remaining values are specified as follows: addr_port corresponds to the connection-address and port productions. overlay_link corresponds to the OverlayLinkType production, Overlay Link protocols used with No-ICE MUST specify "No-ICE" in their description. Future overlay link values can be added be defining - new OverlayLinkType values in the IANA registry in Section 13.9. + new OverlayLinkType values in the IANA registry in Section 13.10. Future extensions to the encapsulation or framing that provide for backward compatibility with that specified by a previously defined OverlayLinkType values MUST use that previous value. OverlayLinkType protocols are defined in Section 5.6 A single AttachReqAns MUST NOT include both candidates whose OverlayLinkType protocols use ICE (the default) and candidates that specify "No-ICE". foundation corresponds to the foundation production. @@ -2767,24 +2782,26 @@ extensions ICE extensions. The name and value fields correspond to binary translations of the equivalent fields in the ICE extensions. These values should be generated using the procedures described in Section 5.5.1.3. 5.5.1.2. Response Definition - If a peer receives an Attach request, it SHOULD process the request - and generate its own response with a AttachReqAns. It should then - begin ICE checks. When a peer receives an Attach response, it SHOULD - parse the response and begin its own ICE checks. + If a peer receives an Attach request, it MUST process the request and + SHOULD generate its own response with a AttachReqAns. A peer which + is overloaded or detects some other kind of error may of course + generate an error instead of an AttachReqAns. It should then begin + ICE checks. When a peer receives an Attach response, it SHOULD parse + the response and begin its own ICE checks. 5.5.1.3. Using ICE With RELOAD This section describes the profile of ICE that is used with RELOAD. RELOAD implementations MUST implement full ICE. In ICE as defined by [RFC5245], SDP is used to carry the ICE parameters. In RELOAD, this function is performed by a binary encoding in the Attach method. This encoding is more restricted than the SDP encoding because the RELOAD environment is simpler: @@ -2799,21 +2816,21 @@ ones selected by ICE. An agent follows the ICE specification as described in [RFC5245] with the changes and additional procedures described in the subsections below. 5.5.1.4. Collecting STUN Servers ICE relies on the node having one or more STUN servers to use. In conventional ICE, it is assumed that nodes are configured with one or - more STUN servers through some out-of-band mechanism. This is still + more STUN servers through some out of band mechanism. This is still possible in RELOAD but RELOAD also learns STUN servers as it connects to other peers. Because all RELOAD peers implement ICE and use STUN keepalives, every peer is a STUN server [RFC5389]. Accordingly, any peer a node knows will be willing to be a STUN server -- though of course it may be behind a NAT. A peer on a well-provisioned wide-area overlay will be configured with one or more bootstrap nodes. These nodes make an initial list of STUN servers. However, as the peer forms connections with additional peers, it builds more peers it can use as STUN servers. @@ -2825,22 +2842,23 @@ outside its NAT. However, if there are more NATs involved, it may learn additional server reflexive addresses (which vary based on where in the topology the STUN server is). To maximize the chance of achieving a direct connection, a peer SHOULD group other peers by the peer-reflexive addresses it discovers through them. It SHOULD then select one peer from each group to use as a STUN server for future connections. Only peers to which the peer currently has connections may be used. If the connection to that host is lost, it MUST be removed from the - list of stun servers and a new server from the same group SHOULD be - selected. + list of stun servers and a new server from the same group MUST be + selected unless there are no others servers in the group in which + case some other peer MAY be used. 5.5.1.5. Gathering Candidates When a node wishes to establish a connection for the purposes of RELOAD signaling or application signaling, it follows the process of gathering candidates as described in Section 4 of ICE [RFC5245]. RELOAD utilizes a single component. Consequently, gathering for these "streams" requires a single component. In the case where a node has not yet found a TURN server, the agent would not include a relayed candidate. @@ -2849,49 +2867,50 @@ or somehow knows of, TURN and STUN servers. RELOAD provides a way for an agent to learn these by querying the overlay, as described in Section 5.5.1.4 and Section 8. The default candidate selection described in Section 4.1.4 of ICE is ignored; defaults are not signaled or utilized by RELOAD. An alternative to using the full ICE supported by the Attach request is to use No-ICE mechanism by providing candidates with "No-ICE" Overlay Link protocols. Configuration for the overlay indicates - whether or not these Overlay Link protocols can be used. A node MUST - only use ICE or No-ICE candidates within one overlay instance. No- - ICE will not work in all of the scenarios where ICE would work, but - in some cases, particularly those with no NATs or firewalls, it will - work. It is RECOMMENDED that full ICE be used even for a node that - has a public, unfiltered IP address, to take advantage of STUN - connectivity checks, etc. + whether or not these Overlay Link protocols can be used. An overlay + MUST be either all ICE or all No-ICE. + + No-ICE will not work in all of the scenarios where ICE would work, + but in some cases, particularly those with no NATs or firewalls, it + will work. Therefore it is RECOMMENDED that full ICE be used even + for a node that has a public, unfiltered IP address, to take + advantage of STUN connectivity checks, etc. 5.5.1.6. Prioritizing Candidates At the time of writing, UDP is the only transport protocol specified to work with ICE. However, standardization of additional protocols for use with ICE is expected, including TCP and datagram-oriented protocols such as SCTP and DCCP. In particular, UDP encapsulations for SCTP and DCCP are expected to be standardized in the near future, greatly expanding the available Overlay Link protocols available for RELOAD. When additional protocols are available, the following prioritization is RECOMMENDED: o Highest priority is assigned to message-oriented protocols that - offer well-understood congestion and flow control without head-of- + offer well-understood congestion and flow control without head of line blocking. For example, SCTP without message ordering, DCCP, or those protocols encapsulated using UDP. o Second highest priority is assigned to stream-oriented protocols, e.g. TCP. o Lowest priority is assigned to protocols encapsulated over UDP that do not implement well-established congestion control - algorithms. For example, the DTLS/UDP with SR overlay link - protocol. + algorithms. The DTLS/UDP with SR overlay link protocol is an + example of such a protocol. 5.5.1.7. Encoding the Attach Message Section 4.3 of ICE describes procedures for encoding the SDP for conveying RELOAD candidates. Instead of actually encoding an SDP, the candidate information (IP address and port and transport protocol, priority, foundation, type and related address) is carried within the attributes of the Attach request or its response. Similarly, the username fragment and password are carried in the Attach message or its response. Section 5.5.1 describes the detailed @@ -2930,25 +2949,20 @@ checks and nominations are used as in regular ICE. 5.5.1.10.1. Connectivity Checks The processes of forming check lists in Section 5.7 of ICE, scheduling checks in Section 5.8, and checking connectivity checks in Section 7 are used with RELOAD without change. 5.5.1.10.2. Concluding ICE - The controlling agent MUST utilize regular nomination. This is to - ensure consistent state on the final selected pairs without the need - for an updated offer, as RELOAD does not generate additional offer/ - answer exchanges. - The procedures in Section 8 of ICE are followed to conclude ICE, with the following exceptions: o The controlling agent MUST NOT attempt to send an updated offer once the state of its single media stream reaches Completed. o Once the state of ICE reaches Completed, the agent can immediately free all unused candidates. This is because RELOAD does not have the concept of forking, and thus the three second delay in Section 8.3 of ICE does not apply. @@ -2960,54 +2974,38 @@ 5.5.1.11. No-ICE No-ICE is selected when either side has provided "no ICE" Overlay Link candidates. STUN is not used for connectivity checks when doing No-ICE; instead the DTLS or TLS handshake (or similar security layer of future overlay link protocols) forms the connectivity check. The certificate exchanged during the (D)TLS handshake must match the node that sent the AttachReqAns and if it does not, the connection MUST be closed. -5.5.1.11.1. Implementation Notes for No-ICE - - This is a non-normative section to help implementors. - - At times ICE can seem a bit daunting to get one's head around. For a - simple IPv4 only peer, a simple implementation of No-ICE could be - done by doing the following: - o When sending an AttachReqAns, form one candidate with a priority - value of (2^24)*(126)+(2^8)*(65535)+(2^0)*(256-1) that specifies - the UDP port being listened to and another one with the TCP port. - o Check the certificate received in the TLS handshake has the same - Node-ID as the node that has sent the AttachReqAns. If multiple - connections succeed, close all but the one with highest priority. - o Do normal TLS and DTLS with no need for any special framing or - STUN processing. - 5.5.1.12. Subsequent Offers and Answers An agent MUST NOT send a subsequent offer or answer. Thus, the procedures in Section 9 of ICE MUST be ignored. 5.5.1.13. Sending Media - The procedures of Section 11 apply to RELOAD as well. However, in - this case, the "media" takes the form of application layer protocols - (RELOAD or SIP for example) over TLS or DTLS. Consequently, once ICE - processing completes, the agent will begin TLS or DTLS procedures to - establish a secure connection. The node which sent the Attach - request MUST be the TLS server. The other node MUST be the TLS - client. The server MUST request TLS client authentication. The - nodes MUST verify that the certificate presented in the handshake - matches the identity of the other peer as found in the Attach - message. Once the TLS or DTLS signaling is complete, the application - protocol is free to use the connection. + The procedures of Section 11 of ICE apply to RELOAD as well. + However, in this case, the "media" takes the form of application + layer protocols (RELOAD or SIP for example) over TLS or DTLS. + Consequently, once ICE processing completes, the agent will begin TLS + or DTLS procedures to establish a secure connection. The node which + sent the Attach request MUST be the TLS server. The other node MUST + be the TLS client. The server MUST request TLS client + authentication. The nodes MUST verify that the certificate presented + in the handshake matches the identity of the other peer as found in + the Attach message. Once the TLS or DTLS signaling is complete, the + application protocol is free to use the connection. The concept of a previous selected pair for a component does not apply to RELOAD, since ICE restarts are not possible with RELOAD. 5.5.1.14. Receiving Media An agent MUST be prepared to receive packets for the application protocol (TLS or DTLS carrying RELOAD, SIP or anything else) at any time. The jitter and RTP considerations in Section 11 of ICE do not apply to RELOAD. @@ -3038,24 +3036,23 @@ The values contained in AppAttachReq and AppAttachAns are: ufrag The username fragment (from ICE) password The ICE password. application - A 16-bit application-id as defined in the Section 13.4. This - number represents the IANA registered applications that is going - to be sent data on this connection. For SIP, this is 5060 or - 5061. + A 16-bit application-id as defined in the Section 13.5. This + number represents the IANA registered application that is going to + send data on this connection. For SIP, this is 5060 or 5061. role An active/passive/actpass attribute from RFC 4145 [RFC4145]. candidates One or more ICE candidate values 5.5.2.2. Response Definition If a peer receives an AppAttach request, it SHOULD process the @@ -3095,64 +3092,65 @@ uint64 time; } PingAns; A PingAns message contains the following elements: response_id A randomly generated 64-bit response ID. This is used to distinguish Ping responses. time - The time when the ping responses was created in absolute time, - represented in milliseconds since midnight Jan 1, 1970 which is - the UNIX epoch. + The time when the ping responses was created in absolute UNIX + style time, represented in milliseconds since midnight Jan 1, 1970 + and not counting leap seconds. -5.5.4. Config_Update +5.5.4. ConfigUpdate - The Config_Update method is used to push updated configuration data + The ConfigUpdate method is used to push updated configuration data across the overlay. Whenever a node detects that another node has - old configuration data, it MUST generate a Config_Update request. - The Config_Update request allows updating of two kinds of data: the + old configuration data, it MUST generate a ConfigUpdate request. The + ConfigUpdate request allows updating of two kinds of data: the configuration data (Section 5.3.2.1) and kind information (Section 6.4.1.1). 5.5.4.1. Request Definition - enum { reserved(0), config(1), kind(2), (255) } - Config_UpdateType; + enum { reservedConfigUpdate(0), config(1), kind(2), (255) } + ConfigUpdateType; typedef opaque KindDescription<2^16-1>; struct { - Config_UpdateType type; + ConfigUpdateType type; uint32 length; select (type) { case config: opaque config_data<2^24-1>; case kind: KindDescription kinds<2^24-1>; /* This structure may be extended with new types*/ }; - } Config_UpdateReq; + } ConfigUpdateReq; - The Config_UpdateReq message contains the following elements: + The ConfigUpdateReq message contains the following elements: type The type of the contents of the message. This structure allows for unknown content types. length The length of the remainder of the message. This is included to preserve backward compatibility and is 32 bits instead of 24 to facilitate easy conversion between network and host byte order. + config_data (type==config) The contents of the configuration document. kinds (type==kind) One or more XML kind-block productions (see Section 10.1). These MUST be encoded with UTF-8 and assume a default namespace of "urn:ietf:params:xml:ns:p2p:config-base". 5.5.4.2. Response Definition struct { @@ -3149,47 +3147,46 @@ config_data (type==config) The contents of the configuration document. kinds (type==kind) One or more XML kind-block productions (see Section 10.1). These MUST be encoded with UTF-8 and assume a default namespace of "urn:ietf:params:xml:ns:p2p:config-base". 5.5.4.2. Response Definition struct { - } Config_UpdateReq + } ConfigUpdateRsp - If the Config_UpdateReq is of type "config" it MUST only be processed + If the ConfigUpdateReq is of type "config" it MUST only be processed if all the following are true: - o The sequence number in the document is greater than the current configuration sequence number. o The configuration document is correctly digitally signed (see Section 10 for details on signatures. Otherwise appropriate errors MUST be generated. - If the Config_UpdateReq is of type "kind" it MUST only be processed - if it is correctly digitally signed by an acceptable kind signer as - specified in the configuraton file. Details on kind-signer field in + If the ConfigUpdateReq is of type "kind" it MUST only be processed if + it is correctly digitally signed by an acceptable kind signer as + specified in the configuration file. Details on kind-signer field in the configuration file is described in Section 10.1. In addition, if the kind update conflicts with an existing known kind (i.e., it is signed by a different signer), then it should be rejected with "Error_Forbidden". This should not happen in correctly functioning overlays. If the update is acceptable, then the node MUST reconfigure itself to match the new information. This may include adding permissions for new kinds, deleting old kinds, or even, in extreme circumstances, exiting and reentering the overlay, if, for instance, the DHT algorithm has changed. - The response for Config_Update is empty. + The response for ConfigUpdate is empty. 5.6. Overlay Link Layer RELOAD can use multiple Overlay Link protocols to send its messages. Because ICE is used to establish connections (see Section 5.5.1.3), RELOAD nodes are able to detect which Overlay Link protocols are offered by other nodes and establish connections between them. Any link protocol needs to be able to establish a secure, authenticated connection and to provide data origin authentication and message integrity for individual data elements. RELOAD currently supports @@ -3254,74 +3251,72 @@ cryptographically verify that the traffic came from a given association and that it has not been modified in transit from the other endpoint in the association. The overlay link protocol MUST also provide replay prevention/detection. Traffic confidentiality When a node sends traffic to another endpoint, it MUST NOT be possible for a third party not involved in the association to determine the contents of that traffic. Any new overlay protocol MUST be defined via RFC 5226 Standards - Action; see Section 13.10. + Action; see Section 13.11. 5.6.1.1. HIP The P2PSIP Working Group has expressed interest in supporting a HIP- based link protocol [RFC5201]. Such support would require specifying such details as: o How to issue certificates which provided identities meaningful to the HIP base exchange. We anticipate that this would require a mapping between ORCHIDs and NodeIds. o How to carry the HIP I1 and I2 messages. We anticipate that this would require defining a HIP Tunnel usage. o How to carry RELOAD messages over HIP. 5.6.1.2. ICE-TCP The ICE-TCP draft [I-D.ietf-mmusic-ice-tcp] should allow TCP to be supported as an Overlay Link protocol that can be added using ICE. - However, as of the time of this writing, the draft is not making - significant progress toward approval. 5.6.1.3. Message-oriented Transports Modern message-oriented transports offer high performance, good - congestion control, and avoid head-of-line blocking in case of lost + congestion control, and avoid head of line blocking in case of lost data. These characteristics make them preferable as underlying transport protocols for RELOAD links. SCTP without message ordering and DCCP are two examples of such protocols. However, currently they are not well-supported by commonly available NATs, and specifications for ICE session establishment are not available. 5.6.1.4. Tunneled Transports As of the time of this writing, there is significant interest in the IETF community in tunneling other transports over UDP, motivated by the situation that UDP is well-supported by modern NAT hardware, and similar performance can be achieved to native implementation. Currently SCTP, DCCP, and a generic tunneling extension are being proposed for message-oriented protocols. Baset et al. have proposed tunneling TCP over UDP for similar reasons [I-D.baset-tsvwg-tcp-over-udp]. Once ICE traversal has been - specified for these tunneled protocols, they should be easily - supported as an overlay link protocol. + specified for these tunneled protocols, they should be + straightforward to support as overlay link protocols. 5.6.2. Framing Header In order to support unreliable links and to allow for quick detection of link failures when using reliable end-to-end transports, each message is wrapped in a very simple framing layer (FramedMessage) which is only used for each hop. This layer contains a sequence number which can then be used for ACKs. The same header is used for both reliable and unreliable transports for simplicity of - implementation---not all aspects of the header apply to both types of + implementation - not all aspects of the header apply to both types of transports. The definition of FramedMessage is: enum {data (128), ack (129), (255)} FramedMessageType; struct { FramedMessageType type; select (type) { @@ -3370,21 +3365,21 @@ the previously 32 packets received on this connection. Call the previously received packet number M. For each of the previous 32 packets, if the sequence number M is less than N but greater than N-32, the N-M bit of the received bitmask is set to one; otherwise it is zero. Note that a bit being set to one indicates positively that a particular packet was received, but a bit being set to zero means only that it is unknown whether or not the packet has been received, because it might have been received before the 32 most recently received packets. - The received field bits in the ACK provide a very high degree of + The received field bits in the ACK provide a high degree of redundancy so that the sender can figure out which packets the receiver has received and can then estimate packet loss rates. If the sender also keeps track of the time at which recent sequence numbers have been sent, the RTT can be estimated. 5.6.3. Simple Reliability When RELOAD is carried over DTLS or another unreliable link protocol, it needs to be used with a reliability and congestion control mechanism, which is provided on a hop-by-hop basis. The basic @@ -3433,27 +3428,27 @@ message by looking at the time the ACK was received and the time when the message was sent. This is used as a subsequent RTT measurement for formula 2.3 of RFC 2988 to update the RTO estimate. (Note that because retransmissions receive new sequence numbers, all received ACKs are used.) The value for RTO is calculated separately for each DTLS session. Retransmissions continue until a response is received, or until a total of 5 requests have been sent or there has been a hard ICMP - error [RFC1122]. The sender knows a response was received when it - receives an ACK with a sequence number that indicates it is a - response to one of the transmissions of this messages. For example, - assuming an RTO of 500 ms, requests would be sent at times 0 ms, 500 - ms, 1500 ms, 3500 ms, and 7500 ms. If all retransmissions for a - message fail, then the sending node SHOULD close the connection - routing the message. + error [RFC1122] or a TLS alert. The sender knows a response was + received when it receives an ACK with a sequence number that + indicates it is a response to one of the transmissions of this + messages. For example, assuming an RTO of 500 ms, requests would be + sent at times 0 ms, 500 ms, 1500 ms, 3500 ms, and 7500 ms. If all + retransmissions for a message fail, then the sending node SHOULD + close the connection routing the message. To determine when a link may be failing without waiting for the final timeout, observe when no ACKs have been received for an entire RTO interval, and then wait for three retransmissions to occur beyond that point. If no ACKs have been received by the time the third retransmission occurs, it is RECOMMENDED that the link be removed from the routing table. The link MAY be restored to the routing table if ACKs resume before the connection is closed, as described above. @@ -3470,28 +3465,28 @@ checks and keepalives are used. 5.6.5. TLS/TCP with FH, No-ICE This overlay link protocol consists of TLS over TCP with the framing header. Because ICE is not used, STUN connectivity checks are not used upon establishing the TCP connection, nor are they used for keepalives. Because the TCP layer's application-level timeout is too slow to be - useful for overlay routing, the Overlay Link implementation MUST - using the framing header to measure the RTT of the connection and - calculate an RTO as specified in Section 2 of [RFC2988]. The - resulting RTO is not used for retransmissions, but as a timeout to - indicate when the link SHOULD be removed from the routing table. It - is RECOMMENDED that such a connection be retained for 30s to - determine if the failure was transient before concluding the link has - failed permanently. + useful for overlay routing, the Overlay Link implementation MUST use + the framing header to measure the RTT of the connection and calculate + an RTO as specified in Section 2 of [RFC2988]. The resulting RTO is + not used for retransmissions, but as a timeout to indicate when the + link SHOULD be removed from the routing table. It is RECOMMENDED + that such a connection be retained for 30s to determine if the + failure was transient before concluding the link has failed + permanently. When sending candidates for TLS/TCP with FH, No-ICE, a passive candidate MUST be provided. The following table shows which side of the exchange initiates the connection depending on whether they provided ICE or No-ICE candidates. Note that the active TCP role does not alter the TLS server/client determination. +----------------------+----------+-----------------+ | Offeror | Answerer | TCP Active Role | +----------------------+----------+-----------------+ @@ -3549,22 +3544,22 @@ fragments as can arrive in the maximum request lifetime. However, if the receiver runs out of buffer space to reassemble the messages it MUST drop the message. When a message is fragmented, the fragment offset value is stored in the lower 24 bits of the fragment field of the forwarding header. The offset is the number of bytes between the end of the forwarding header and the start of the data. The first fragment therefore has an offset of 0. The first and last bit indicators MUST be appropriately set. If the message is not fragmented, then both the - first and last fragment are set to 1 and the offset is 0 resulting in - a fragment value of 0xC0000000. + first and last fragment bits are set to 1 and the offset is 0 + resulting in a fragment value of 0xC0000000. 6. Data Storage Protocol RELOAD provides a set of generic mechanisms for storing and retrieving data in the Overlay Instance. These mechanisms can be used for new applications simply by defining new code points and a small set of rules. No new protocol mechanisms are required. The basic unit of stored data is a single StoredData structure: @@ -3577,27 +3572,27 @@ } StoredData; The contents of this structure are as follows: length The size of the StoredData structure in octets excluding the size of length itself. storage_time The time when the data was stored in absolute time, represented in - milliseconds since the Unix epoch of midnight Jan 1, 1970. Any - attempt to store a data value with a storage time before that of a - value already stored at this location MUST generate a - Error_Data_Too_Old error. This prevents rollback attacks. Note - that this does not require synchronized clocks: the receiving - peer uses the storage time in the previous store, not its own - clock. + milliseconds since the Unix epoch of midnight Jan 1, 1970 and not + counting leap seconds. Any attempt to store a data value with a + storage time before that of a value already stored at this + location MUST generate a Error_Data_Too_Old error. This prevents + rollback attacks. Note that this does not require synchronized + clocks: the receiving peer uses the storage time in the previous + store, not its own clock. A node that is attempting to store new data in response to a user request (rather than as an overlay maintenance operation such as occurs during unpartitioning) is rejected with an Error_Data_Too_Old error, the node MAY elect to perform its store using a storage_time that increments the value used with the previous store. This situation may occur when the clocks of nodes storing to this location are not properly synchronized. lifetime The validity period for the data, in seconds, starting from the @@ -3748,21 +3744,21 @@ value The stored data. 6.3. Access Control Policies Every kind which is storable in an overlay MUST be associated with an access control policy. This policy defines whether a request from a given node to operate on a given value should succeed or fail. It is anticipated that only a small number of generic access control policies are required. To that end, this section describes a small - set of such policies and Section 13.3 establishes a registry for new + set of such policies and Section 13.4 establishes a registry for new policies if required. Each policy has a short string identifier which is used to reference it in the configuration document. 6.3.1. USER-MATCH In the USER-MATCH policy, a given value MUST be written (or overwritten) if and only if the request is signed with a key associated with a certificate whose user name hashes (using the hash function for the overlay) to the Resource-ID for the resource. Recall that the certificate may, depending on the overlay @@ -3882,60 +3878,58 @@ Error_Forbidden error. o Each element is signed by a credential which is authorized to write this kind at this Resource-ID. If this check fails, the request MUST be rejected with an Error_Forbidden error. o For original (non-replica) stores, the peer MUST check that if the generation-counter is non-zero, it equals the current value of the generation-counter for this kind. This feature allows the generation counter to be used in a way similar to the HTTP Etag feature. + o For replica Stores, the peer MUST set the generation counter to + match the generation_counter in the message, and MUST NOT check + the generation counter against the current value. Replica Stores + MUST NOT use a generation counter of 0. o The storage time values are greater than that of any value which would be replaced by this Store. o The size and number of the stored values is consistent with the limits specified in the overlay configuration. If all these checks succeed, the peer MUST attempt to store the data values. For non-replica stores, if the store succeeds and the data is changed, then the peer must increase the generation counter by at least one. If there are multiple stored values in a single StoreKindData, it is permissible for the peer to increase the generation counter by only 1 for the entire Kind-ID, or by 1 or more than one for each value. Accordingly, all stored data values must have a generation counter of 1 or greater. 0 is used in the Store request to indicate that the generation counter should be ignored for processing this request; however the responsible peer should increase the stored generation counter and should return the correct generation counter in the response. - For replica Stores, the peer MUST set the generation counter to match - the generation_counter in the message, and MUST NOT check the - generation counter against the current value. Replica Stores MUST - NOT use a generation counter of 0. - When a peer stores data previously stored by another node (e.g., for replicas or topology shifts) it MUST adjust the lifetime value downward to reflect the amount of time the value was stored at the peer. Unless otherwise specified by the usage, if a peer attempts to store data previously stored by another node (e.g., for replicas or topology shifts) and that store fails with either an Error_Generation_Counter_Too_Low or an Error_Data_Too old error, the - peer MUST fetch the newer data from the the peer generating the error - and use that to replace its own copy. This rule allows - resynchronization after partitions heal. + peer MUST fetch the newer data from the peer generating the error and + use that to replace its own copy. This rule allows resynchronization + after partitions heal. The properties of stores for each data model are as follows: Single-value: - A store of a new single-value element creates the element if it does not exist and overwrites any existing value with the new value. Array: A store of an array entry replaces (or inserts) the given value at the location specified by the index. Because arrays are sparse, a store past the end of the array extends it with nonexistent values (exists=False) as required. A store at index 0xffffffff places the new value at the end of the array regardless of the length of @@ -3972,29 +3967,30 @@ | storage_time = storage_time = | yyyyyyyy zzzzzzz | lifetime = 86400 lifetime = 33200 | signature = YYYY signature = ZZZZ | | | StoredDataValue | | value="abc" | | | | StoredDataValue StoredDataValue index=0 index=1 + value="foo" value="bar" 6.4.1.2. Response Definition In response to a successful Store request the peer MUST return a StoreAns message containing a series of StoreKindResponse elements containing the current value of the generation counter for each Kind-ID, as well as a list of the peers where the data will be - replicated. + replicated by the node processing the request.. struct { KindId kind; uint64 generation_counter; NodeId replicas<0..2^16-1>; } StoreKindResponse; struct { StoreKindResponse kind_responses<0..2^16-1>; } StoreAns; @@ -4030,21 +4026,21 @@ the case of partitions and merges. If the data being stored is too large for the allowed limit by the given usage, then the peer MUST fail the request and generate an Error_Data_Too_Large error. If any type of request tries to access a data kind that the node does not know about, an Error_Unknown_Kind MUST be generated. The error_info in the Error_Response is: - KindId unknown_kinds<2^8-1>; + KindId unknown_kinds<0..2^8-1>; which lists all the kinds that were unrecognized. 6.4.1.3. Removing Values This version of RELOAD (unlike previous versions) does not have an explicit Remove operation. Rather, values are Removed by storing "nonexistent" values in their place. Each DataValue contains a boolean value called "exists" which indicates whether a value is present at that location. In order to effectively remove a value, @@ -4137,22 +4133,22 @@ "array", it might specify some subset of the values. The model_specifier is as follows: o If the data model is single value, the specifier is empty. o If the data model is array, the specifier contains a list of ArrayRange elements, each of which contains two integers. The first integer is the beginning of the range and the second is the end of the range. 0 is used to indicate the first element and 0xffffffff is used to indicate the final element. The first - integer must be less than the second. The ranges MUST NOT - overlap. + integer must be less than the second. While multiple ranges MAY + be specified, they MUST NOT overlap. o If the data model is dictionary then the specifier contains a list of the dictionary keys being requested. If no keys are specified, than this is a wildcard fetch and all key-value pairs are returned. The generation-counter is used to indicate the requester's expected state of the storing peer. If the generation-counter in the request matches the stored counter, then the storing peer returns a response with no StoredData values. @@ -4312,36 +4308,37 @@ 6.4.4. Find The Find request can be used to explore the Overlay Instance. A Find request for a Resource-ID R and a Kind-ID T retrieves the Resource-ID (if any) of the resource of kind T known to the target peer which is closest to R. This method can be used to walk the Overlay Instance by interactively fetching R_n+1=nearest(1 + R_n). 6.4.4.1. Request Definition - The FindReq message contains a series of Resource-IDs and Kind-IDs + The FindReq message contains a Resource-ID and a series of Kind-IDs identifying the resource the peer is interested in. struct { ResourceId resource; KindId kinds<0..2^8-1>; } FindReq; The request contains a list of Kind-IDs which the Find is for, as indicated below: resource The desired Resource-ID kinds - The desired Kind-IDs. Each value MUST only appear once. + The desired Kind-IDs. Each value MUST only appear once, and if + not the request MUST be rejected with an error. 6.4.4.2. Response Definition A response to a successful Find request is a FindAns message containing the closest Resource-ID on the peer for each kind specified in the request. struct { KindId kind; ResourceId closest; @@ -4447,51 +4444,51 @@ in the process. If the ICE stage in any of these connections returns a reflexive address that is not the same as the peer's perceived address, then the peer is behind a NAT and not a candidate for a TURN server. Additionally, if the peer's IP address is in the private address space range, then it is also not a candidate for a TURN server. Otherwise, the peer SHOULD assume it is a potential TURN server and follow the procedures below. If the node is a candidate for a TURN server it will insert some pointers in the overlay so that other peers can find it. The overlay - configuration file specifies a turnDensity parameter that indicates + configuration file specifies a turn-density parameter that indicates how many times each TURN server should record itself in the overlay. Typically this should be set to the reciprocal of the estimate of - what percentage of peers will act as TURN servers. For each value, - called d, between 1 and turnDensity, the peer forms a Resource Name - by concatenating its Peer-ID and the value d. This Resource Name is - hashed to form a Resource-ID. The address of the peer is stored at - that Resource-ID using type TURN-SERVICE and the TurnServer object: + what percentage of peers will act as TURN servers. If the turn- + density is not set to zero, for each value, called d, between 1 and + turn-density, the peer forms a Resource Name by concatenating its + Peer-ID and the value d. This Resource Name is hashed to form a + Resource-ID. The address of the peer is stored at that Resource-ID + using type TURN-SERVICE and the TurnServer object: struct { uint8 iteration; IpAddressAndPort server_address; } TurnServer; The contents of this structure are as follows: iteration the d value server_address the address at which the TURN server can be contacted. Note: Correct functioning of this algorithm depends critically on - having turnDensity be an accurate estimate of the true density of - TURN servers. If turnDensity is too high, then the process of + having turn-density be an accurate estimate of the true density of + TURN servers. If turn-density is too high, then the process of finding TURN servers becomes extremely expensive as multiple candidate Resource-IDs must be probed. Peers that provide this service need to support the TURN extensions - to STUN for media relay of both UDP and TCP traffic as defined in - [RFC5766] and [RFC5382]. + to STUN for media relay as defined in [RFC5766]. This usage defines the following kind to indicate that a peer is willing to act as a TURN server: Name TURN-SERVICE Data Model The TURN-SERVICE kind stores a single value for each Resource-ID. Access Control NODE-MULTIPLE, with maximum iteration counter 20. Peers can find other servers by selecting a random Resource-ID and @@ -4530,21 +4527,22 @@ However, with either approach no more than O(log N) entries should typically be stored in a finger table. o The stabilize() and fix_fingers() algorithms in the original Chord algorithm are merged into a single periodic process. Stabilization is implemented slightly differently because of the larger neighborhood, and fix_fingers is not as aggressive to reduce load, nor does it search for optimal matches of the finger table entries. o RELOAD uses a 128 bit hash instead of a 160 bit hash, as RELOAD is not designed to be used in networks with close to or more than - 2^128 nodes. + 2^128 nodes (and it is hard to see how one would assemble such a + network). o RELOAD uses randomized finger entries as described in Section 9.6.4.2. o This algorithm allows the use of either reactive or periodic recovery. The original Chord paper used periodic recovery. Reactive recovery provides better performance in small overlays, but is believed to be unstable in large (>1000) overlays with high levels of churn [handling-churn-usenix04]. The overlay configuration file specifies a "chord-reload-reactive" element that indicates whether reactive recovery should be used. @@ -4683,25 +4681,26 @@ NodeId predecessors<0..2^16-1>; NodeId successors<0..2^16-1>; case full: NodeId predecessors<0..2^16-1>; NodeId successors<0..2^16-1>; NodeId fingers<0..2^16-1>; }; } ChordUpdate; + The "uptime" field contains the time this peer has been up in + seconds. + The "type" field contains the type of the update, which depends on the reason the update was sent. - uptime: time this peer has been up in seconds. - peer_ready: this peer is ready to receive messages. This message is used to indicate that a node which has Attached is a peer and can be routed through. It is also used as a connectivity check to non-neighbor peers. neighbors: this version is sent to members of the Chord neighbor table. full: this version is sent to peers which request an Update with a RouteQueryReq. @@ -4987,39 +4986,42 @@ predecessors The sender's predecessor list. Any peer which receives a Leave for a peer n in its neighbor set follows procedures as if it had detected a peer failure as described in Section 9.6.1. 10. Enrollment and Bootstrap + The section defines the format of the configuration data as well the + process to join a new overlay. + 10.1. Overlay Configuration This specification defines a new content type "application/ p2p-overlay+xml" for an MIME entity that contains overlay information. An example document is shown below. false 30 - TLS + TLS false 10 4000 https://example.org foo 300 400 false asecret @@ -5097,39 +5098,40 @@ may be present. self-signed-permitted This element indicates whether self-signed certificates are permitted. If it is set to "true", then self- signed certificates are allowed, in which case the enrollment- server and root-cert elements may be absent. Otherwise, it SHOULD be absent, but MAY be set to "false". This element also contains an attribute "digest" which indicates the digest to be used to compute the Node-ID. Valid values for this parameter are "SHA-1" and "SHA-256". Implementations MUST support both of these algorithms. + direct-return-response-permitted This element indicates whether direct return routed responses as described in Section 5.3.2.4 are permitted. If it is set to "true", they MAY be used. Otherwise, it SHOULD be absent, but MAY be set to "false". Implementations - MAY support direct return routed respone. - + MAY support direct return routed response. bootstrap-node This element represents the address of one of the bootstrap nodes. It has an attribute called "address" that represents the IP address (either IPv4 or IPv6, since they can be distinguished) and an attribute called "port" that represents the - port. The IP address is in typical hexidecimal form using + port. The IP address is in typical hexadecimal form using standard period and colon separators as specified in [I-D.ietf-6man-text-addr-representation]. More than one bootstrap-peer element may be present. turn-density This element is a positive integer that represents the approximate reciprocal of density of nodes that can act as TURN - servers. For example, if 10% of the nodes can act as TURN - servers, this would be set to 10. If it is not present, the - default value is 1. + servers. For example, if 5% of the nodes can act as TURN servers, + this would be set to 20. If it is not present, the default value + is 1. If there are no TURN servers in the overlay, it is set to + zero. multicast-bootstrap This element represents the address of a multicast, broadcast, or anycast address and port that may be used for bootstrap. Nodes SHOULD listen on the address. It has an attributed called "address" that represents the IP address and an attribute called "port" that represents the port. More than one "multicast-bootstrap" element may be present. clients-permitted This element represents whether clients are permitted or whether all nodes must be peers. If it is set to "TRUE" or absent, this indicates that clients are permitted. If it is set to "FALSE" then nodes MUST join as peers. @@ -5141,45 +5143,51 @@ chord-ping-interval The ping frequency for the Chord-reload topology plugin (see Section 9). chord-reload-reactive Whether reactive recovery should be used for this overlay. (see Section 9). shared-secret If shared secret mode is used, this contains the shared secret. max-message-size Maximum size in bytes of any message in the overlay. If this value is not present, the default is 5000. initial-ttl Initial default TTL (time to live, see Section 5.3.2) for messages. If this value is not present, the default is 100. + overlay-link-protocol Indicates a permissible overlay link protocol (see Section 5.6.1 for requirements for such protocols). An arbitrary number of these elements may appear. If none appear, then this implies the default value, "TLS", which refers to the use of TLS and DTLS. If one or more elements appear, then no default value applies. - kind-signer This contains a single Node-ID in hexadecimal and indicates that the certificate with this Node-ID is allowed to sign kinds. Identifying kind-signer by Node-ID instead of certificate allows the use of short lived certificates without constantly having to provide an updated configuration file. bad-node This contains a single Node-ID in hexadecimal and indicates that the certificate with this Node-ID MUST NOT be - considered valid. This allows certificate revocation. + considered valid. This allows certificate revocation. An + arbitrary number of these elements can be provided. Note that + because certificates may expire, bad-node entries need only be + present for the lifetime of the certificate. Technically + speaking, bad node-ids may be reused once their certificates have + expired, the requirement for node-ids to be pseudo randomly + generated gives this event a vanishing probability. Inside each overlay element, the required-kinds elements can also occur. This element indicates the kinds that members must support and contains multiple kind-block elements that each define a single kind that MUST be supported by nodes in the overlay. Each kind-block consists of a single kind element and a kind-signature. The kind element defines the kind. The kind-signature is the signature computed over the kind element. - Each kind has either an ID attribute or a name atribute. The name + Each kind has either an ID attribute or a name attribute. The name attribute is a string representing the kind (the name registered to IANA) while the ID is an integer kind-id allocated out of private space. In addition, the kind element contains the following elements: max-count: the maximum number of values which members of the overlay must support. data-model: the data model to be used. max-size: the maximum size of individual values. access-control: the access control model to be used. @@ -5195,21 +5203,21 @@ kinds elements MAY be present. The kind-block element also MUST contain a "kind-signature" element. This signature is computed across the kind from the beginning of the first < of the kind to the end of the last > of the kind in the same way as the "signature element described later in this section. The configuration file is a binary file and cannot be changed - including whitespace changes - or the signature will break. The signature is computed by taking each configuration element and - starting form, and including, the first < at the start of + starting from, and including, the first < at the start of up to and including the > in and treating this as a binary blob that is signed using the standard SecurityBlock defined in Section 5.3.4. The SecurityBlock is base 64 encoded using the base64 alphabet from RFC[RFC4648] and put in the signature element following the configuration object in the config file. When a node receives a new configuration file, it MUST change its configuration to meet the new requirements. This may require the node to exit the DHT and re-join. If a node is not capable of @@ -5327,48 +5334,45 @@ # Chord specific paramters topology-plugin-type |= "chord" kind-names |= "sip-registration" kind-names |= "turn-service" parameter &= element chord:chord-ping-interval { xsd:int }? parameter &= element chord:chord-update-interval { xsd:int }? 10.2. Discovery Through Enrollment Server When a node first enrolls in a new overlay, it starts with a - discovery process to find an enrollment server. Related work to the - approach used here is described in - [I-D.garcia-p2psip-dns-sd-bootstrapping] and - [I-D.matthews-p2psip-bootstrap-mechanisms]. Another scheme for - referencing overlays is described in - [I-D.hardie-p2poverlay-pointers]. + discovery process to find an enrollment server. The node first determines the overlay name. This value is provided - by the user or some other out-of-band provisioning mechanism. The - out-of-band mechanisms may also provide an optional URL for the + by the user or some other out of band provisioning mechanism. The + out of band mechanisms may also provide an optional URL for the enrollment server. If a URL for the enrollment server is not provided, the node MUST do a DNS SRV query using a Service name of - "p2psip_enroll" and a protocol of tcp to find an enrollment server - and form the URL by appending a path of "/p2psip/enroll" to the - overlay name. For example, if the overlay name was example.com, the - URL would be "https://example.com/p2psip/enroll". + "p2psip-enroll" and a protocol of TCP to find an enrollment server + and form the URL by appending a path of "/.well-known/p2psip-enroll" + to the overlay name. This uses the "well known URI" framework + defined in [RFC5785]. For example, if the overlay name was + example.com, the URL would be + "https://example.com//.well-known/p2psip-enroll". Once an address and URL for the enrollment server is determined, the peer forms an HTTPS connection to that IP address. The certificate MUST match the overlay name as described in [RFC2818]. Then the node MUST fetch a new copy of the configuration file. To do this, the peer performs a GET to the URL. The result of the HTTP GET is an XML configuration file described above, which replaces any previously learned configuration file for this overlay. For overlays that do not use an enrollment server, nodes obtain the configuration information needed to join the overlay through some out - of band approach such an an XML configuration file sent over email. + of band approach such an XML configuration file sent over email. 10.3. Credentials If the configuration document contains a enrollment-server element, credentials are required to join the Overlay Instance. A peer which does not yet have credentials MUST contact the enrollment server to acquire them. RELOAD defines its own trivial certificate request protocol. We would have liked to have used an existing protocol but were concerned @@ -5394,43 +5398,44 @@ indicating the type that is expected in the response. The enrollment server MUST authenticate the request using the provided user name and password. If the authentication succeeds and the requested user name is acceptable, the server generates and returns a certificate. The SubjectAltName field in the certificate contains the following values: o One or more Node-IDs which MUST be cryptographically random [RFC4086]. Each MUST be chosen by the enrollment server in such a - way that they are unpredictable to the requesting user. Each is - placed in the subjectAltName using the uniformResourceIdentifier - type and MUST contain RELOAD URIs as described in Section 13.14 - and MUST contain a Destination list with a single entry of type - "node_id". + way that they are unpredictable to the requesting user. E.g., the + user MUST NOT be informed of potential (random) Node-IDs prior to + authenticating. Each is placed in the subjectAltName using the + uniformResourceIdentifier type and MUST contain RELOAD URIs as + described in Section 13.15 and MUST contain a Destination list + with a single entry of type "node_id". o A single name this user is allowed to use in the overlay, using type rfc822Name. The certificate is returned as type "application/pkix-cert", with an HTTP status code of 200 OK. Certificate processing errors should be treated as HTTP errors and have appropriate HTTP status codes. The client MUST check that the certificate returned was signed by one of the certificates received in the "root-cert" list of the overlay configuration data. The node then reads the certificate to find the Node-IDs it can use. 10.3.1. Self-Generated Credentials - If the "self-signed-permitted" element is present and set to "TRUE", - then a node MUST generate its own self-signed certificate to join the - overlay. The self-signed certificate MAY contain any user name of - the users choice. + If the "self-signed-permitted" element is present in the + configuration and set to "TRUE", then a node MUST generate its own + self-signed certificate to join the overlay. The self-signed + certificate MAY contain any user name of the users choice. The Node-ID MUST be computed by applying the digest specified in the self-signed-permitted element to the DER representation of the user's public key (more specifically the subjectPublicKeyInfo) and taking the high order bits. When accepting a self-signed certificate, nodes MUST check that the Node-ID and public keys match. This prevents Node-ID theft. Once the node has constructed a self-signed certificate, it MAY join the overlay. Before storing its certificate in the overlay @@ -5458,21 +5463,21 @@ In order to join the overlay, the joining node MUST contact a node in the overlay. Typically this means contacting the bootstrap nodes, since they are reachable by the local peer or have public IP addresses. If the joining node has cached a list of peers it has previously been connected with in this overlay, as an optimization it MAY attempt to use one or more of them as bootstrap nodes before falling back to the bootstrap nodes listed in the configuration file. When contacting a bootstrap node, the joining node first forms the - DTLS or TLS connection to the boostrap node and then sends an Attach + DTLS or TLS connection to the bootstrap node and then sends an Attach request over this connection with the destination Node-ID set to the joining node's Node-ID. When the requester node finally does receive a response from some responding node, it can note the Node-ID in the response and use this Node-ID to start sending requests to join the Overlay Instance as described in Section 5.4. After a node has successfully joined the overlay network, it will have direct connections to several peers. Some MAY be added to the @@ -5482,21 +5487,21 @@ cache are beyond the scope of this specification. 11. Message Flow Example The following abbreviation are used in the message flow diagrams: JP = joining peer, AP = admitting peer, NP = next peer after the AP, NNP = next next peer which is the peer after NP, PP = previous peer before the AP, PPP = previous previous peer which is the peer before the PP, BP = bootstrap peer. - The follwowing abbreviation are used in the message flow diagrams: + The following abbreviation are used in the message flow diagrams: In the following example, we assume that JP has formed a connection to one of the bootstrap nodes. JP then sends an Attach through that peer to the admitting peer (AP) to initiate a connection. When AP responds, JP and AP use ICE to set up a connection and then set up TLS. JP PPP PP AP NP NNP BP | | | | | | | | | | | | | | @@ -6089,129 +6094,149 @@ routing to other compromised peers. To defend against such attacks, a resource search must still consist of parallel searches for replicated registrations. 13. IANA Considerations This section contains the new code points registered by this document. [NOTE TO IANA/RFC-EDITOR: Please replace RFC-AAAA with the RFC number for this specification in the following list.] -13.1. Port Registrations +13.1. Well-Known URI Registration + + IANA will make the following "Well Known URI" registration as + described in [RFC5785]: [[Note to RFC Editor - this paragraph can be removed before - publication. ]] IANA has already allocated a port for the main peer - to peer protocol. This port has the name p2p-sip and the port number - of 6084. The names of this port may need to be changed as this draft - progresses and if it does careful instructions will be needed to IANA - to ensure the final RFC and IANA registrations are in sync. + publication. ]] A review request was sent to + wellknown-uri-review@ietf.org on October 12, 2010. + + +----------------------------+----------------------+ + | URI suffix: | p2psip-enroll | + | Change controller: | IETF | + | Specification document(s): | [RFC-AAAA] | + | Related information: | None | + +----------------------------+----------------------+ + +13.2. Port Registrations + + [[Note to RFC Editor - this paragraph can be removed before + publication. ]] IANA has already allocated a TCP port for the main + peer to peer protocol. This port has the name p2p-sip and the port + number of 6084. IANA will update this registration to be defined for + UDP as well as TCP. IANA will make the following port registration: - +-------------------------------+-----------------------------------+ - | Registration Technical | Cullen Jennings | - | Contact | | + +------------------------------+------------------------------------+ + | Registration Technical | Cullen Jennings | + | Contact | | | Registration Owner | IETF | - | Transport Protocol | TCP, UDP | - | Port Number | 6084 | - | Service Name | p2psip_enroll | - | Description | RELOAD P2P Protcol | + | Transport Protocol | TCP | + | Port Number | TBD | + | Service Name | p2psip-enroll | + | Description | Peer to Peer Infrastructure | + | | Enrollment | | Reference | [RFC-AAAA] | - +-------------------------------+-----------------------------------+ + +------------------------------+------------------------------------+ -13.2. Overlay Algorithm Types +13.3. Overlay Algorithm Types IANA SHALL create a "RELOAD Overlay Algorithm Type" Registry. Entries in this registry are strings denoting the names of overlay algorithms. The registration policy for this registry is RFC 5226 IETF Review. The initial contents of this registry are: +----------------+----------+ | Algorithm Name | RFC | +----------------+----------+ | chord-reload | RFC-AAAA | +----------------+----------+ -13.3. Access Control Policies +13.4. Access Control Policies IANA SHALL create a "RELOAD Access Control Policy" Registry. Entries in this registry are strings denoting access control policies, as described in Section 6.3. New entries in this registry SHALL be registered via RFC 5226 Standards Action. The initial contents of this registry are: - USER-MATCH - NODE-MATCH - USER-NODE-MATCH - NODE-MULTIPLE + +-----------------+----------+ + | Access Policy | RFC | + +-----------------+----------+ + | USER-MATCH | RFC-AAAA | + | NODE-MATCH | RFC-AAAA | + | USER-NODE-MATCH | RFC-AAAA | + | NODE-MULTIPLE | RFC-AAAA | + +-----------------+----------+ -13.4. Application-ID +13.5. Application-ID IANA SHALL create a "RELOAD Application-ID" Registry. Entries in - this registry are 16-bit integers denoting applictions kinds. Code + this registry are 16-bit integers denoting application kinds. Code points in the range 0x0001 to 0x7fff SHALL be registered via RFC 5226 Standards Action. Code points in the range 0x8000 to 0xf000 SHALL be registered via RFC 5226 Expert Review. Code points in the range - 0xf001 to 0xfffe are reserved for private us. The initial contents + 0xf001 to 0xfffe are reserved for private use. The initial contents of this registry are: +-------------+----------------+-------------------------------+ | Application | Application-ID | Specification | +-------------+----------------+-------------------------------+ | INVALID | 0 | RFC-AAAA | | RELOAD | 1 | RFC-AAAA | | SIP | 5060 | Reserved for use by SIP Usage | | SIP | 5061 | Reserved for use by SIP Usage | | Reserved | 0xffff | RFC-AAAA | +-------------+----------------+-------------------------------+ -13.5. Data Kind-ID +13.6. Data Kind-ID IANA SHALL create a "RELOAD Data Kind-ID" Registry. Entries in this registry are 32-bit integers denoting data kinds, as described in Section 4.1.2. Code points in the range 0x00000001 to 0x7fffffff SHALL be registered via RFC 5226 Standards Action. Code points in the range 0x8000000 to 0xf0000000 SHALL be registered via RFC 5226 - Expert Review. Code points in the range 0xf0000001 to 0xffffffff are + Expert Review. Code points in the range 0xf0000001 to 0xfffffffe are reserved for private use via the kind description mechanism described in Section 10. The initial contents of this registry are: +---------------------+------------+----------+ | Kind | Kind-ID | RFC | +---------------------+------------+----------+ | INVALID | 0 | RFC-AAAA | | TURN_SERVICE | 2 | RFC-AAAA | | CERTIFICATE_BY_NODE | 3 | RFC-AAAA | | CERTIFICATE_BY_USER | 16 | RFC-AAAA | | Reserved | 0x7fffffff | RFC-AAAA | - | Reserved | 0xffffffff | RFC-AAAA | + | Reserved | 0xfffffffe | RFC-AAAA | +---------------------+------------+----------+ -13.6. Data Model +13.7. Data Model IANA SHALL create a "RELOAD Data Model" Registry. Entries in this registry are 8-bit integers denoting data models, as described in Section 6.2. Code points in this registry SHALL be registered via RFC 5226 Standards Action. The initial contents of this registry are: +--------------+------+----------+ | Data Model | Code | RFC | +--------------+------+----------+ | INVALID | 0 | RFC-AAAA | | SINGLE_VALUE | 1 | RFC-AAAA | | ARRAY | 2 | RFC-AAAA | | DICTIONARY | 3 | RFC-AAAA | | RESERVED | 255 | RFC-AAAA | +--------------+------+----------+ -13.7. Message Codes +13.8. Message Codes IANA SHALL create a "RELOAD Message Code" Registry. Entries in this registry are 16-bit integers denoting method codes as described in Section 5.3.3. These codes SHALL be registered via RFC 5226 Standards Action. The initial contents of this registry are: +---------------------------------+----------------+----------+ | Message Code Name | Code Value | RFC | +---------------------------------+----------------+----------+ | invalid | 0 | RFC-AAAA | @@ -6244,21 +6269,21 @@ | unused (was attachlite_req) | 27 | RFC-AAAA | | unused (was attachlite_ans) | 28 | RFC-AAAA | | app_attach_req | 29 | RFC-AAAA | | app_attach_ans | 30 | RFC-AAAA | | unused (was app_attachlite_req) | 31 | RFC-AAAA | | unused (was app_attachlite_ans) | 32 | RFC-AAAA | | reserved | 0x8000..0xfffe | RFC-AAAA | | error | 0xffff | RFC-AAAA | +---------------------------------+----------------+----------+ -13.8. Error Codes +13.9. Error Codes IANA SHALL create a "RELOAD Error Code" Registry. Entries in this registry are 16-bit integers denoting error codes. New entries SHALL be defined via RFC 5226 Standards Action. The initial contents of this registry are: +-------------------------------------+----------------+----------+ | Error Code Name | Code Value | RFC | +-------------------------------------+----------------+----------+ | invalid | 0 | RFC-AAAA | @@ -6268,98 +6293,100 @@ | Error_Request_Timeout | 4 | RFC-AAAA | | Error_Generation_Counter_Too_Low | 5 | RFC-AAAA | | Error_Incompatible_with_Overlay | 6 | RFC-AAAA | | Error_Unsupported_Forwarding_Option | 7 | RFC-AAAA | | Error_Data_Too_Large | 8 | RFC-AAAA | | Error_Data_Too_Old | 9 | RFC-AAAA | | Error_TTL_Exceeded | 10 | RFC-AAAA | | Error_Message_Too_Large | 11 | RFC-AAAA | | Error_Unknown_Kind | 12 | RFC-AAAA | | Error_Unknown_Extension | 13 | RFC-AAAA | + | Error_Response_Too_Large | 14 | RFC-AAAA | + | Error_Config_Too_Old | 15 | RFC-AAAA | + | Error_Config_Too_New | 16 | RFC-AAAA | | reserved | 0x8000..0xfffe | RFC-AAAA | +-------------------------------------+----------------+----------+ -13.9. Overlay Link Types +13.10. Overlay Link Types IANA shall create a "RELOAD Overlay Link." New entries SHALL be defined via RFC 5226 Standards Action. This registry SHALL be initially populated with the following values: +--------------------+------+---------------+ | Protocol | Code | Specification | +--------------------+------+---------------+ | reserved | 0 | RFC-AAAA | | DTLS-UDP-SR | 1 | RFC-AAAA | | DTLS-UDP-SR-NO-ICE | 3 | RFC-AAAA | | TLS-TCP-FH-NO-ICE | 4 | RFC-AAAA | | reserved | 255 | RFC-AAAA | +--------------------+------+---------------+ -13.10. Overlay Link Protocols +13.11. Overlay Link Protocols IANA shall create an "Overlay Link Protocol Registry". Entries in this registry SHALL be defined via RFC 5226 Standards Action. This registry SHALL be initially populated with the following value: "TLS". -13.11. Forwarding Options +13.12. Forwarding Options IANA shall create a "Forwarding Option Registry". Entries in this registry between 1 and 127 SHALL be defined via RFC 5226 Standards Action. Entries in this registry between 128 and 254 SHALL be defined via RFC 5226 Specification Required. This registry SHALL be initially populated with the following values: +-------------------+------+---------------+ | Forwarding Option | Code | Specification | +-------------------+------+---------------+ | invalid | 0 | RFC-AAAA | | reserved | 255 | RFC-AAAA | +-------------------+------+---------------+ -13.12. Probe Information Types +13.13. Probe Information Types IANA shall create a "RELOAD Probe Information Type Registry". Entries in this registry SHALL be defined via RFC 5226 Standards Action. This registry SHALL be initially populated with the following values: +-----------------+------+---------------+ | Probe Option | Code | Specification | +-----------------+------+---------------+ | invalid | 0 | RFC-AAAA | | responsible_set | 1 | RFC-AAAA | | num_resources | 2 | RFC-AAAA | | uptime | 3 | RFC-AAAA | | reserved | 255 | RFC-AAAA | +-----------------+------+---------------+ -13.13. Message Extensions +13.14. Message Extensions IANA shall create a "RELOAD Extensions Registry". Entries in this registry SHALL be defined via RFC 5226 Specification Required. This registry SHALL be initially populated with the following values: +-----------------+--------+---------------+ | Extensions Name | Code | Specification | +-----------------+--------+---------------+ | invalid | 0 | RFC-AAAA | | reserved | 0xFFFF | RFC-AAAA | +-----------------+--------+---------------+ -13.14. reload URI Scheme +13.15. reload URI Scheme This section describes the scheme for a reload URI, which can be used to refer to either: o A peer. - o A resource inside a peer. The reload URI is defined using a subset of the URI schema specified in Appendix A of RFC 3986 [RFC3986] and the associated URI Guidelines [RFC4395] per the following ABNF syntax: RELOAD-URI = "reload://" destination "@" overlay "/" [specifier] destination = 1 * HEXDIG @@ -6373,60 +6400,64 @@ overlay: the name of the overlay. specifier : a hex-encoded StoredDataSpecifier indicating the data element. If no specifier is present then this URI addresses the peer which can be reached via the indicated destination list at the indicated overlay name. If a specifier is present, then the URI addresses the data value. -13.14.1. URI Registration +13.15.1. URI Registration + + [[ Note to RFC Editor - please remove this paragraph before + publication. ]] Review request was sent to uri-review@ietf.org on Oct + 7, 2010. The following summarizes the information necessary to register the reload URI. URI Scheme Name: reload Status: permanent - URI Scheme Syntax: see Section 13.14 of RFC-AAAA + URI Scheme Syntax: see Section 13.15 of RFC-AAAA URI Scheme Semantics: The reload URI is intended to be used as a reference to a RELOAD peer or resource. - Encoding Considerations: The reload URI is not intended to be - human-readable text, so it is encoded entirely in US-ASCII. - Applications/protocols that use this URI scheme: The RELOAD - protocol described in RFC-AAAA. - Interoperability considerations See RFC-AAAA. - Security considerations See RFC-AAAA - Contact Cullen Jennings - Author/Change controller IESG - References RFC-AAAA + Encoding Considerations: The reload URI is not intended to be human- + readable text, so it is encoded entirely in US-ASCII. + Applications/protocols that use this URI scheme: The RELOAD protocol + described in RFC-AAAA. + Interoperability considerations: See RFC-AAAA. + Security considerations: See RFC-AAAA + Contact: Cullen Jennings + Author/Change controller: IESG + References: RFC-AAAA 14. Acknowledgments This specification is a merge of the "REsource LOcation And Discovery (RELOAD)" draft by David A. Bryan, Marcia Zangrilli and Bruce B. Lowekamp, the "Address Settlement by Peer to Peer" draft by Cullen Jennings, Jonathan Rosenberg, and Eric Rescorla, the "Security Extensions for RELOAD" draft by Bruce B. Lowekamp and James Deverick, the "A Chord-based DHT for Resource Lookup in P2PSIP" by Marcia Zangrilli and David A. Bryan, and the Peer-to-Peer Protocol (P2PP) draft by Salman A. Baset, Henning Schulzrinne, and Marcin Matuszewski. Thanks to the authors of RFC 5389 for text included - from that. Vidya Narayanan provided many comments and imporvements. + from that. Vidya Narayanan provided many comments and improvements. The ideas and text for the Chord specific extension data to the Leave mechanisms was provided by J. Maenpaa, G. Camarillo, and J. Hautakorpi. Thanks to the many people who contributed including Ted Hardie, Michael Chen, Dan York, Das Saumitra, Lyndsay Campbell, Brian Rosen, - David Bryan, Dave Craig, and Julian Cain. Extensinve working last + David Bryan, Dave Craig, and Julian Cain. Extensive working last call comments were provided by: Jouni Maenpaa, Roni Even, Ari Keranen, John Buford, Michael Chen, Frederic-Philippe Met, and David Bryan. 15. References 15.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. @@ -6471,20 +6502,22 @@ Timer", RFC 2988, November 2000. [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005. [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and Registration Procedures for New URI Schemes", BCP 35, RFC 4395, February 2006. + [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. + [I-D.ietf-6man-text-addr-representation] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 Address Text Representation", draft-ietf-6man-text-addr-representation-07 (work in progress), February 2010. 15.2. Informative References [I-D.ietf-mmusic-ice-tcp] Rosenberg, J., "TCP Candidates with Interactive @@ -6513,76 +6546,58 @@ [I-D.ietf-p2psip-concepts] Bryan, D., Matthews, P., Shim, E., Willis, D., and S. Dawkins, "Concepts and Terminology for Peer to Peer SIP", draft-ietf-p2psip-concepts-02 (work in progress), July 2008. [RFC1122] Braden, R., "Requirements for Internet Hosts - Communication Layers", STD 3, RFC 1122, October 1989. - [RFC5382] Guha, S., Biswas, K., Ford, B., Sivakumar, S., and P. - Srisuresh, "NAT Behavioral Requirements for TCP", BCP 142, - RFC 5382, October 2008. - [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in the Session Description Protocol (SDP)", RFC 4145, September 2005. - [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. - [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005. [RFC5054] Taylor, D., Wu, T., Mavrogiannopoulos, N., and T. Perrin, "Using the Secure Remote Password (SRP) Protocol for TLS Authentication", RFC 5054, November 2007. [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. - [I-D.matthews-p2psip-bootstrap-mechanisms] - Cooper, E., "Bootstrap Mechanisms for P2PSIP", - draft-matthews-p2psip-bootstrap-mechanisms-00 (work in - progress), February 2007. - - [I-D.garcia-p2psip-dns-sd-bootstrapping] - Garcia, G., "P2PSIP bootstrapping using DNS-SD", - draft-garcia-p2psip-dns-sd-bootstrapping-00 (work in - progress), October 2007. - [I-D.pascual-p2psip-clients] Pascual, V., Matuszewski, M., Shim, E., Zhang, H., and S. Yongchao, "P2PSIP Clients", draft-pascual-p2psip-clients-01 (work in progress), February 2008. [RFC4787] Audet, F. and C. Jennings, "Network Address Translation (NAT) Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787, January 2007. [RFC2311] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., and L. Repka, "S/MIME Version 2 Message Specification", RFC 2311, March 1998. [I-D.jiang-p2psip-sep] Jiang, X. and H. Zhang, "Service Extensible P2P Peer Protocol", draft-jiang-p2psip-sep-01 (work in progress), February 2008. - [I-D.hardie-p2poverlay-pointers] - Hardie, T., "Mechanisms for use in pointing to overlay - networks, nodes, or resources", - draft-hardie-p2poverlay-pointers-00 (work in progress), - January 2008. + [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known + Uniform Resource Identifiers (URIs)", RFC 5785, + April 2010. [I-D.ietf-p2psip-sip] Jennings, C., Lowekamp, B., Rescorla, E., Baset, S., and H. Schulzrinne, "A SIP Usage for RELOAD", draft-ietf-p2psip-sip-01 (work in progress), March 2009. [Sybil] Douceur, J., "The Sybil Attack", IPTPS 02, March 2002. [Eclipse] Singh, A., Ngan, T., Druschel, T., and D. Wallach, "Eclipse Attacks on Overlay Networks: Threats and @@ -6625,57 +6640,44 @@ [handling-churn-usenix04] Rhea, S., Geels, D., Roscoe, T., and J. Kubiatowicz, "Handling Churn in a DHT", In Proc. of the USENIX Annual Technical Conference June 2004 USENIX 2004. [minimizing-churn-sigcomm06] Godfrey, P., Shenker, S., and I. Stoica, "Minimizing Churn in Distributed Systems", SIGCOMM 2006. -Appendix A. Change Log - -A.1. Changes since draft-ietf-p2psip-reload-09 - - o Made NodeId length configurable on a per-overlay basis. (Per - consensus call at IETF 78). - o Added support for replacing TLS if necessary. - o Added a "send_update" flag to the AttachReqAns structure. - o Added support for Direct Return Responses. - o Clarified support for overlays with No-ICE. - o Added a note that peers which do not modify the via list must - somehow garbage collect state. - -Appendix B. Routing Alternatives +Appendix A. Routing Alternatives Significant discussion has been focused on the selection of a routing algorithm for P2PSIP. This section discusses the motivations for selecting symmetric recursive routing for RELOAD and describes the extensions that would be required to support additional routing algorithms. -B.1. Iterative vs Recursive +A.1. Iterative vs Recursive Iterative routing has a number of advantages. It is easier to debug, consumes fewer resources on intermediate peers, and allows the querying peer to identify and route around misbehaving peers [non-transitive-dhts-worlds05]. However, in the presence of NATs, iterative routing is intolerably expensive because a new connection must be established for each hop (using ICE) [bryan-design-hotp2p08]. Iterative routing is supported through the Route_Query mechanism and is primarily intended for debugging. It also allows the querying peer to evaluate the routing decisions made by the peers at each hop, consider alternatives, and perhaps detect at what point the forwarding path fails. -B.2. Symmetric vs Forward response +A.2. Symmetric vs Forward response An alternative to the symmetric recursive routing method used by RELOAD is Forward-Only routing, where the response is routed to the requester as if it were a new message initiated by the responder (in the previous example, Z sends the response to A as if it were sending a request). Forward-only routing requires no state in either the message or intermediate peers. The drawback of forward-only routing is that it does not work when the overlay is unstable. For example, if A is in the process of @@ -6690,21 +6692,21 @@ path is more likely to have a failed peer than is the request path (which was just tested to route the request) [non-transitive-dhts-worlds05]. An extension to RELOAD that supports forward-only routing but relies on symmetric responses as a fallback would be possible, but due to the complexities of determining when to use forward-only and when to fallback to symmetric, we have chosen not to include it as an option at this point. -B.3. Direct Response +A.3. Direct Response Another routing option is Direct Response routing, in which the response is returned directly to the querying node. In the previous example, if A encodes its IP address in the request, then Z can simply deliver the response directly to A. In the absence of NATs or other connectivity issues, this is the optimal routing technique. The challenge of implementing direct response is the presence of NATs. There are a number of complexities that must be addressed. In this discussion, we will continue our assumption that A issued the @@ -6739,21 +6741,21 @@ [RFC4787], and no clear recommendation is available, the prevalence of this feature in future devices remains unclear. An extension to RELOAD that supports direct response routing but relies on symmetric responses as a fallback would be possible, but due to the complexities of determining when to use direct response and when to fallback to symmetric, and the reduced performance for responses to peers behind restrictive NATs, we have chosen not to include it as an option at this point. -B.4. Relay Peers +A.4. Relay Peers SEP [I-D.jiang-p2psip-sep] has proposed implementing a form of direct response by having A identify a peer, Q, that will be directly reachable by any other peer. A uses Attach to establish a connection with Q and advertises Q's IP address in the request sent to Z. Z sends the response to Q, which relays it to A. This then reduces the latency to two hops, plus Z negotiating a secure connection to Q. This technique relies on the relative population of nodes such as A that require relay peers and peers such as Q that are capable of @@ -6765,21 +6767,21 @@ An extension to RELOAD that supports relay peers is possible, but due to the complexities of implementing such an alternative, we have not added such a feature to RELOAD at this point. A concept similar to relay peers, essentially choosing a relay peer at random, has previously been suggested to solve problems of pairwise non-transitivity [non-transitive-dhts-worlds05], but deterministic filtering provided by NATs makes random relay peers no more likely to work than the responding peer. -B.5. Symmetric Route Stability +A.5. Symmetric Route Stability A common concern about symmetric recursive routing has been that one or more peers along the request path may fail before the response is received. The significance of this problem essentially depends on the response latency of the overlay. An overlay that produces slow responses will be vulnerable to churn, whereas responses that are delivered very quickly are vulnerable only to failures that occur over that small interval. The other aspect of this issue is whether the request itself can be @@ -6794,37 +6796,36 @@ An overlay that is unstable enough to suffer this type of failure frequently is unlikely to be able to support reliable functionality regardless of the routing mechanism. However, regardless of the stability of the return path, studies show that in the event of high churn, iterative routing is a better solution to ensure request completion [lookups-churn-p2p06] [non-transitive-dhts-worlds05] Finally, because RELOAD retries the end-to-end request, that retry will address the issues of churn that remain. -Appendix C. Why Clients? +Appendix B. Why Clients? There are a wide variety of reasons a node may act as a client rather than as a peer [I-D.pascual-p2psip-clients]. This section outlines some of those scenarios and how the client's behavior changes based on its capabilities. -C.1. Why Not Only Peers? +B.1. Why Not Only Peers? For a number of reasons, a particular node may be forced to act as a client even though it is willing to act as a peer. These include: o The node does not have appropriate network connectivity, typically because it has a low-bandwidth network connection. o The node may not have sufficient resources, such as computing power, storage space, or battery power. - o The overlay algorithm may dictate specific requirements for peer selection. These may include participating in the overlay to determine trustworthiness; controlling the number of peers in the overlay to reduce overly-long routing paths; or ensuring minimum application uptime before a node can join as a peer. The ultimate criteria for a node to become a peer are determined by the overlay algorithm and specific deployment. A node acting as a client that has a full implementation of RELOAD and the appropriate overlay algorithm is capable of locating its responsible peer in the @@ -6828,21 +6829,21 @@ the overlay algorithm and specific deployment. A node acting as a client that has a full implementation of RELOAD and the appropriate overlay algorithm is capable of locating its responsible peer in the overlay and using Attach to establish a direct connection to that peer. In that way, it may elect to be reachable under either of the routing approaches listed above. Particularly for overlay algorithms that elect nodes to serve as peers based on trustworthiness or population, the overlay algorithm may require such a client to locate itself at a particular place in the overlay. -C.2. Clients as Application-Level Agents +B.2. Clients as Application-Level Agents SIP defines an extensive protocol for registration and security between a client and its registrar/proxy server(s). Any SIP device can act as a client of a RELOAD-based P2PSIP overlay if it contacts a peer that implements the server-side functionality required by the SIP protocol. In this case, the peer would be acting as if it were the user's peer, and would need the appropriate credentials for that user. Application-level support for clients is defined by a usage. A usage @@ -6854,41 +6855,41 @@ Cullen Jennings Cisco 170 West Tasman Drive MS: SJC-21/2 San Jose, CA 95134 USA Phone: +1 408 421-9990 Email: fluffy@cisco.com + Bruce B. Lowekamp (editor) Skype Palo Alto, CA USA Email: bbl@lowekamp.net Eric Rescorla - Network Resonance - 2064 Edgewood Drive - Palo Alto, CA 94303 + Skype + 8000 Marina Blvd + Brisbane, CA 94005 USA - Phone: +1 650 320-8549 - Email: ekr@networkresonance.com + Phone: +1 650 678 2350 + Email: ekr@skype.net Salman A. Baset Columbia University 1214 Amsterdam Avenue New York, NY USA Email: salman@cs.columbia.edu - Henning Schulzrinne Columbia University 1214 Amsterdam Avenue New York, NY USA Email: hgs@cs.columbia.edu