draft-ietf-p2psip-base-26.txt   rfc6940.txt 
P2PSIP C. Jennings Internet Engineering Task Force (IETF) C. Jennings
Internet-Draft Cisco Request for Comments: 6940 Cisco
Intended status: Standards Track B. Lowekamp, Ed. Category: Standards Track B. Lowekamp, Ed.
Expires: August 28, 2013 Skype ISSN: 2070-1721 Skype
E. Rescorla E. Rescorla
RTFM, Inc. RTFM, Inc.
S. Baset S. Baset
H. Schulzrinne H. Schulzrinne
Columbia University Columbia University
February 24, 2013 January 2014
REsource LOcation And Discovery (RELOAD) Base Protocol REsource LOcation And Discovery (RELOAD) Base Protocol
draft-ietf-p2psip-base-26
Abstract Abstract
This specification defines REsource LOcation And Discovery (RELOAD), This specification defines REsource LOcation And Discovery (RELOAD),
a peer-to-peer (P2P) signaling protocol for use on the Internet. A a peer-to-peer (P2P) signaling protocol for use on the Internet. A
P2P signaling protocol provides its clients with an abstract storage P2P signaling protocol provides its clients with an abstract storage
and messaging service between a set of cooperating peers that form and messaging service between a set of cooperating peers that form
the overlay network. RELOAD is designed to support a P2P Session the overlay network. RELOAD is designed to support a P2P Session
Initiation Protocol (P2PSIP) network, but can be utilized by other Initiation Protocol (P2PSIP) network, but can be utilized by other
applications with similar requirements by defining new usages that applications with similar requirements by defining new usages that
specify the kinds of data that needs to be stored for a particular specify the Kinds of data that need to be stored for a particular
application. RELOAD defines a security model based on a certificate application. RELOAD defines a security model based on a certificate
enrollment service that provides unique identities. NAT traversal is enrollment service that provides unique identities. NAT traversal is
a fundamental service of the protocol. RELOAD also allows access a fundamental service of the protocol. RELOAD also allows access
from "client" nodes that do not need to route traffic or store data from "client" nodes that do not need to route traffic or store data
for others. for others.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This is an Internet Standards Track document.
provisions of BCP 78 and BCP 79.
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 This document is a product of the Internet Engineering Task Force
and may be updated, replaced, or obsoleted by other documents at any (IETF). It represents the consensus of the IETF community. It has
time. It is inappropriate to use Internet-Drafts as reference received public review and has been approved for publication by the
material or to cite them other than as "work in progress." Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
This Internet-Draft will expire on August 28, 2013. Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc6940.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 35 skipping to change at page 2, line 35
Without obtaining an adequate license from the person(s) controlling Without obtaining an adequate license from the person(s) controlling
the copyright in such materials, this document may not be modified the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other it for publication as an RFC or to translate it into languages other
than English. than English.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1. Basic Setting . . . . . . . . . . . . . . . . . . . . . 8 1.1. Basic Setting . . . . . . . . . . . . . . . . . . . . . . 8
1.2. Architecture . . . . . . . . . . . . . . . . . . . . . . 10 1.2. Architecture . . . . . . . . . . . . . . . . . . . . . . 10
1.2.1. Usage Layer . . . . . . . . . . . . . . . . . . . . 13 1.2.1. Usage Layer . . . . . . . . . . . . . . . . . . . . . 13
1.2.2. Message Transport . . . . . . . . . . . . . . . . . 13 1.2.2. Message Transport . . . . . . . . . . . . . . . . . . 13
1.2.3. Storage . . . . . . . . . . . . . . . . . . . . . . 14 1.2.3. Storage . . . . . . . . . . . . . . . . . . . . . . . 14
1.2.4. Topology Plugin . . . . . . . . . . . . . . . . . . 15 1.2.4. Topology Plug-in . . . . . . . . . . . . . . . . . . 15
1.2.5. Forwarding and Link Management Layer . . . . . . . . 15 1.2.5. Forwarding and Link Management Layer . . . . . . . . 16
1.3. Security . . . . . . . . . . . . . . . . . . . . . . . . 16 1.3. Security . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4. Structure of This Document . . . . . . . . . . . . . . . 17 1.4. Structure of This Document . . . . . . . . . . . . . . . 17
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 18 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 18
3. Overlay Management Overview . . . . . . . . . . . . . . . . . 22 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1. Security and Identification . . . . . . . . . . . . . . 22 4. Overlay Management Overview . . . . . . . . . . . . . . . . . 21
3.1.1. Shared-Key Security . . . . . . . . . . . . . . . . 24 4.1. Security and Identification . . . . . . . . . . . . . . . 21
3.2. Clients . . . . . . . . . . . . . . . . . . . . . . . . 24 4.1.1. Shared-Key Security . . . . . . . . . . . . . . . . . 23
3.2.1. Client Routing . . . . . . . . . . . . . . . . . . . 25 4.2. Clients . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.2. Minimum Functionality Requirements for Clients . . . 26 4.2.1. Client Routing . . . . . . . . . . . . . . . . . . . 24
3.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . 26 4.2.2. Minimum Functionality Requirements for Clients . . . 25
3.4. Connectivity Management . . . . . . . . . . . . . . . . 30 4.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5. Overlay Algorithm Support . . . . . . . . . . . . . . . 31 4.4. Connectivity Management . . . . . . . . . . . . . . . . . 29
3.5.1. Support for Pluggable Overlay Algorithms . . . . . . 31 4.5. Overlay Algorithm Support . . . . . . . . . . . . . . . . 30
3.5.2. Joining, Leaving, and Maintenance Overview . . . . . 31 4.5.1. Support for Pluggable Overlay Algorithms . . . . . . 30
3.6. First-Time Setup . . . . . . . . . . . . . . . . . . . . 33 4.5.2. Joining, Leaving, and Maintenance Overview . . . . . 30
3.6.1. Initial Configuration . . . . . . . . . . . . . . . 33 4.6. First-Time Setup . . . . . . . . . . . . . . . . . . . . 32
3.6.2. Enrollment . . . . . . . . . . . . . . . . . . . . . 33 4.6.1. Initial Configuration . . . . . . . . . . . . . . . . 32
3.6.3. Diagnostics . . . . . . . . . . . . . . . . . . . . 34 4.6.2. Enrollment . . . . . . . . . . . . . . . . . . . . . 32
4. Application Support Overview . . . . . . . . . . . . . . . . 34 4.6.3. Diagnostics . . . . . . . . . . . . . . . . . . . . . 33
4.1. Data Storage . . . . . . . . . . . . . . . . . . . . . . 34 5. Application Support Overview . . . . . . . . . . . . . . . . 33
4.1.1. Storage Permissions . . . . . . . . . . . . . . . . 35 5.1. Data Storage . . . . . . . . . . . . . . . . . . . . . . 33
4.1.2. Replication . . . . . . . . . . . . . . . . . . . . 36 5.1.1. Storage Permissions . . . . . . . . . . . . . . . . . 34
4.2. Usages . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.1.2. Replication . . . . . . . . . . . . . . . . . . . . . 35
4.3. Service Discovery . . . . . . . . . . . . . . . . . . . 37 5.2. Usages . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.4. Application Connectivity . . . . . . . . . . . . . . . . 38 5.3. Service Discovery . . . . . . . . . . . . . . . . . . . . 36
5. RFC 2119 Terminology . . . . . . . . . . . . . . . . . . . . 38 5.4. Application Connectivity . . . . . . . . . . . . . . . . 36
6. Overlay Management Protocol . . . . . . . . . . . . . . . . . 38 6. Overlay Management Protocol . . . . . . . . . . . . . . . . . 37
6.1. Message Receipt and Forwarding . . . . . . . . . . . . . 38 6.1. Message Receipt and Forwarding . . . . . . . . . . . . . 37
6.1.1. Responsible ID . . . . . . . . . . . . . . . . . . . 39 6.1.1. Responsible ID . . . . . . . . . . . . . . . . . . . 38
6.1.2. Other ID . . . . . . . . . . . . . . . . . . . . . . 40 6.1.2. Other ID . . . . . . . . . . . . . . . . . . . . . . 38
6.1.3. Opaque ID . . . . . . . . . . . . . . . . . . . . . 42 6.1.3. Opaque ID . . . . . . . . . . . . . . . . . . . . . . 40
6.2. Symmetric Recursive Routing . . . . . . . . . . . . . . 42 6.2. Symmetric Recursive Routing . . . . . . . . . . . . . . . 41
6.2.1. Request Origination . . . . . . . . . . . . . . . . 42 6.2.1. Request Origination . . . . . . . . . . . . . . . . . 41
6.2.2. Response Origination . . . . . . . . . . . . . . . . 43 6.2.2. Response Origination . . . . . . . . . . . . . . . . 42
6.3. Message Structure . . . . . . . . . . . . . . . . . . . 43 6.3. Message Structure . . . . . . . . . . . . . . . . . . . . 42
6.3.1. Presentation Language . . . . . . . . . . . . . . . 44 6.3.1. Presentation Language . . . . . . . . . . . . . . . . 43
6.3.1.1. Common Definitions . . . . . . . . . . . . . . . 45 6.3.1.1. Common Definitions . . . . . . . . . . . . . . . 44
6.3.2. Forwarding Header . . . . . . . . . . . . . . . . . 48 6.3.2. Forwarding Header . . . . . . . . . . . . . . . . . . 46
6.3.2.1. Processing Configuration Sequence Numbers . . . . 51 6.3.2.1. Processing Configuration Sequence Numbers . . . . 49
6.3.2.2. Destination and Via Lists . . . . . . . . . . . . 51 6.3.2.2. Destination and Via Lists . . . . . . . . . . . . 50
6.3.2.3. Forwarding Option . . . . . . . . . . . . . . . . 54 6.3.2.3. Forwarding Option . . . . . . . . . . . . . . . . 52
6.3.3. Message Contents Format . . . . . . . . . . . . . . 55 6.3.3. Message Contents Format . . . . . . . . . . . . . . . 53
6.3.3.1. Response Codes and Response Errors . . . . . . . 57 6.3.3.1. Response Codes and Response Errors . . . . . . . 54
6.3.4. Security Block . . . . . . . . . . . . . . . . . . . 60 6.3.4. Security Block . . . . . . . . . . . . . . . . . . . 57
6.4. Overlay Topology . . . . . . . . . . . . . . . . . . . . 64 6.4. Overlay Topology . . . . . . . . . . . . . . . . . . . . 60
6.4.1. Topology Plugin Requirements . . . . . . . . . . . . 64 6.4.1. Topology Plug-in Requirements . . . . . . . . . . . . 60
6.4.2. Methods and types for use by topology plugins . . . 65 6.4.2. Methods and Types for Use by Topology Plug-ins . . . 61
6.4.2.1. Join . . . . . . . . . . . . . . . . . . . . . . 65 6.4.2.1. Join . . . . . . . . . . . . . . . . . . . . . . 61
6.4.2.2. Leave . . . . . . . . . . . . . . . . . . . . . . 66 6.4.2.2. Leave . . . . . . . . . . . . . . . . . . . . . . 62
6.4.2.3. Update . . . . . . . . . . . . . . . . . . . . . 67 6.4.2.3. Update . . . . . . . . . . . . . . . . . . . . . 63
6.4.2.4. RouteQuery . . . . . . . . . . . . . . . . . . . 67 6.4.2.4. RouteQuery . . . . . . . . . . . . . . . . . . . 63
6.4.2.5. Probe . . . . . . . . . . . . . . . . . . . . . . 68 6.4.2.5. Probe . . . . . . . . . . . . . . . . . . . . . . 65
6.5. Forwarding and Link Management Layer . . . . . . . . . . 70 6.5. Forwarding and Link Management Layer . . . . . . . . . . 67
6.5.1. Attach . . . . . . . . . . . . . . . . . . . . . . . 71 6.5.1. Attach . . . . . . . . . . . . . . . . . . . . . . . 67
6.5.1.1. Request Definition . . . . . . . . . . . . . . . 72 6.5.1.1. Request Definition . . . . . . . . . . . . . . . 68
6.5.1.2. Response Definition . . . . . . . . . . . . . . . 74 6.5.1.2. Response Definition . . . . . . . . . . . . . . . 70
6.5.1.3. Using ICE With RELOAD . . . . . . . . . . . . . . 75 6.5.1.3. Using ICE with RELOAD . . . . . . . . . . . . . . 71
6.5.1.4. Collecting STUN Servers . . . . . . . . . . . . . 76 6.5.1.4. Collecting STUN Servers . . . . . . . . . . . . . 71
6.5.1.5. Gathering Candidates . . . . . . . . . . . . . . 76 6.5.1.5. Gathering Candidates . . . . . . . . . . . . . . 72
6.5.1.6. Prioritizing Candidates . . . . . . . . . . . . . 77 6.5.1.6. Prioritizing Candidates . . . . . . . . . . . . . 72
6.5.1.7. Encoding the Attach Message . . . . . . . . . . . 78 6.5.1.7. Encoding the Attach Message . . . . . . . . . . . 73
6.5.1.8. Verifying ICE Support . . . . . . . . . . . . . . 78 6.5.1.8. Verifying ICE Support . . . . . . . . . . . . . . 74
6.5.1.9. Role Determination . . . . . . . . . . . . . . . 78 6.5.1.9. Role Determination . . . . . . . . . . . . . . . 74
6.5.1.10. Full ICE . . . . . . . . . . . . . . . . . . . . 79 6.5.1.10. Full ICE . . . . . . . . . . . . . . . . . . . . 74
6.5.1.11. No-ICE . . . . . . . . . . . . . . . . . . . . . 79 6.5.1.11. No-ICE . . . . . . . . . . . . . . . . . . . . . 75
6.5.1.12. Subsequent Offers and Answers . . . . . . . . . . 79 6.5.1.12. Subsequent Offers and Answers . . . . . . . . . . 75
6.5.1.13. Sending Media . . . . . . . . . . . . . . . . . . 79 6.5.1.13. Sending Media . . . . . . . . . . . . . . . . . . 75
6.5.1.14. Receiving Media . . . . . . . . . . . . . . . . . 80 6.5.1.14. Receiving Media . . . . . . . . . . . . . . . . . 75
6.5.2. AppAttach . . . . . . . . . . . . . . . . . . . . . 80 6.5.2. AppAttach . . . . . . . . . . . . . . . . . . . . . . 75
6.5.2.1. Request Definition . . . . . . . . . . . . . . . 80 6.5.2.1. Request Definition . . . . . . . . . . . . . . . 76
6.5.2.2. Response Definition . . . . . . . . . . . . . . . 81 6.5.2.2. Response Definition . . . . . . . . . . . . . . . 77
6.5.3. Ping . . . . . . . . . . . . . . . . . . . . . . . . 82 6.5.3. Ping . . . . . . . . . . . . . . . . . . . . . . . . 77
6.5.3.1. Request Definition . . . . . . . . . . . . . . . 82 6.5.3.1. Request Definition . . . . . . . . . . . . . . . 77
6.5.3.2. Response Definition . . . . . . . . . . . . . . . 82 6.5.3.2. Response Definition . . . . . . . . . . . . . . . 77
6.5.4. ConfigUpdate . . . . . . . . . . . . . . . . . . . . 83 6.5.4. ConfigUpdate . . . . . . . . . . . . . . . . . . . . 78
6.5.4.1. Request Definition . . . . . . . . . . . . . . . 83 6.5.4.1. Request Definition . . . . . . . . . . . . . . . 78
6.5.4.2. Response Definition . . . . . . . . . . . . . . . 84 6.5.4.2. Response Definition . . . . . . . . . . . . . . . 79
6.6. Overlay Link Layer . . . . . . . . . . . . . . . . . . . 85 6.6. Overlay Link Layer . . . . . . . . . . . . . . . . . . . 80
6.6.1. Future Overlay Link Protocols . . . . . . . . . . . 86 6.6.1. Future Overlay Link Protocols . . . . . . . . . . . . 81
6.6.1.1. HIP . . . . . . . . . . . . . . . . . . . . . . . 86 6.6.1.1. HIP . . . . . . . . . . . . . . . . . . . . . . . 82
6.6.1.2. ICE-TCP . . . . . . . . . . . . . . . . . . . . . 87 6.6.1.2. ICE-TCP . . . . . . . . . . . . . . . . . . . . . 82
6.6.1.3. Message-oriented Transports . . . . . . . . . . . 87 6.6.1.3. Message-Oriented Transports . . . . . . . . . . . 82
6.6.1.4. Tunneled Transports . . . . . . . . . . . . . . . 87 6.6.1.4. Tunneled Transports . . . . . . . . . . . . . . . 82
6.6.2. Framing Header . . . . . . . . . . . . . . . . . . . 87 6.6.2. Framing Header . . . . . . . . . . . . . . . . . . . 83
6.6.3. Simple Reliability . . . . . . . . . . . . . . . . . 89 6.6.3. Simple Reliability . . . . . . . . . . . . . . . . . 84
6.6.3.1. Stop and Wait Sender Algorithm . . . . . . . . . 90 6.6.3.1. Stop and Wait Sender Algorithm . . . . . . . . . 85
6.6.4. DTLS/UDP with SR . . . . . . . . . . . . . . . . . . 91 6.6.4. DTLS/UDP with SR . . . . . . . . . . . . . . . . . . 86
6.6.5. TLS/TCP with FH, No-ICE . . . . . . . . . . . . . . 91 6.6.5. TLS/TCP with FH, No-ICE . . . . . . . . . . . . . . . 86
6.6.6. DTLS/UDP with SR, No-ICE . . . . . . . . . . . . . . 92 6.6.6. DTLS/UDP with SR, No-ICE . . . . . . . . . . . . . . 87
6.7. Fragmentation and Reassembly . . . . . . . . . . . . . . 92 6.7. Fragmentation and Reassembly . . . . . . . . . . . . . . 87
7. Data Storage Protocol . . . . . . . . . . . . . . . . . . . . 93 7. Data Storage Protocol . . . . . . . . . . . . . . . . . . . . 88
7.1. Data Signature Computation . . . . . . . . . . . . . . . 95 7.1. Data Signature Computation . . . . . . . . . . . . . . . 90
7.2. Data Models . . . . . . . . . . . . . . . . . . . . . . 96 7.2. Data Models . . . . . . . . . . . . . . . . . . . . . . . 91
7.2.1. Single Value . . . . . . . . . . . . . . . . . . . . 97 7.2.1. Single Value . . . . . . . . . . . . . . . . . . . . 91
7.2.2. Array . . . . . . . . . . . . . . . . . . . . . . . 97 7.2.2. Array . . . . . . . . . . . . . . . . . . . . . . . . 92
7.2.3. Dictionary . . . . . . . . . . . . . . . . . . . . . 98 7.2.3. Dictionary . . . . . . . . . . . . . . . . . . . . . 92
7.3. Access Control Policies . . . . . . . . . . . . . . . . 99 7.3. Access Control Policies . . . . . . . . . . . . . . . . . 93
7.3.1. USER-MATCH . . . . . . . . . . . . . . . . . . . . . 99 7.3.1. USER-MATCH . . . . . . . . . . . . . . . . . . . . . 93
7.3.2. NODE-MATCH . . . . . . . . . . . . . . . . . . . . . 99 7.3.2. NODE-MATCH . . . . . . . . . . . . . . . . . . . . . 93
7.3.3. USER-NODE-MATCH . . . . . . . . . . . . . . . . . . 100 7.3.3. USER-NODE-MATCH . . . . . . . . . . . . . . . . . . . 93
7.3.4. NODE-MULTIPLE . . . . . . . . . . . . . . . . . . . 100 7.3.4. NODE-MULTIPLE . . . . . . . . . . . . . . . . . . . . 94
7.4. Data Storage Methods . . . . . . . . . . . . . . . . . . 100 7.4. Data Storage Methods . . . . . . . . . . . . . . . . . . 94
7.4.1. Store . . . . . . . . . . . . . . . . . . . . . . . 100 7.4.1. Store . . . . . . . . . . . . . . . . . . . . . . . . 94
7.4.1.1. Request Definition . . . . . . . . . . . . . . . 100 7.4.1.1. Request Definition . . . . . . . . . . . . . . . 94
7.4.1.2. Response Definition . . . . . . . . . . . . . . . 105 7.4.1.2. Response Definition . . . . . . . . . . . . . . . 100
7.4.1.3. Removing Values . . . . . . . . . . . . . . . . . 107 7.4.1.3. Removing Values . . . . . . . . . . . . . . . . . 101
7.4.2. Fetch . . . . . . . . . . . . . . . . . . . . . . . 108
7.4.2.1. Request Definition . . . . . . . . . . . . . . . 108 7.4.2. Fetch . . . . . . . . . . . . . . . . . . . . . . . . 102
7.4.2.2. Response Definition . . . . . . . . . . . . . . . 110 7.4.2.1. Request Definition . . . . . . . . . . . . . . . 102
7.4.3. Stat . . . . . . . . . . . . . . . . . . . . . . . . 111 7.4.2.2. Response Definition . . . . . . . . . . . . . . . 104
7.4.3.1. Request Definition . . . . . . . . . . . . . . . 112 7.4.3. Stat . . . . . . . . . . . . . . . . . . . . . . . . 105
7.4.3.2. Response Definition . . . . . . . . . . . . . . . 112 7.4.3.1. Request Definition . . . . . . . . . . . . . . . 105
7.4.4. Find . . . . . . . . . . . . . . . . . . . . . . . . 114 7.4.3.2. Response Definition . . . . . . . . . . . . . . . 106
7.4.4.1. Request Definition . . . . . . . . . . . . . . . 115 7.4.4. Find . . . . . . . . . . . . . . . . . . . . . . . . 107
7.4.4.2. Response Definition . . . . . . . . . . . . . . . 115 7.4.4.1. Request Definition . . . . . . . . . . . . . . . 108
7.4.5. Defining New Kinds . . . . . . . . . . . . . . . . . 116 7.4.4.2. Response Definition . . . . . . . . . . . . . . . 108
8. Certificate Store Usage . . . . . . . . . . . . . . . . . . . 117 7.4.5. Defining New Kinds . . . . . . . . . . . . . . . . . 109
9. TURN Server Usage . . . . . . . . . . . . . . . . . . . . . . 118 8. Certificate Store Usage . . . . . . . . . . . . . . . . . . . 110
10. Chord Algorithm . . . . . . . . . . . . . . . . . . . . . . . 119 9. TURN Server Usage . . . . . . . . . . . . . . . . . . . . . . 110
10.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 120 10. Chord Algorithm . . . . . . . . . . . . . . . . . . . . . . . 112
10.2. Hash Function . . . . . . . . . . . . . . . . . . . . . 121 10.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 113
10.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . 121 10.2. Hash Function . . . . . . . . . . . . . . . . . . . . . 114
10.4. Redundancy . . . . . . . . . . . . . . . . . . . . . . . 122 10.3. Routing . . . . . . . . . . . . . . . . . . . . . . . . 114
10.5. Joining . . . . . . . . . . . . . . . . . . . . . . . . 122 10.4. Redundancy . . . . . . . . . . . . . . . . . . . . . . . 114
10.6. Routing Attaches . . . . . . . . . . . . . . . . . . . . 124 10.5. Joining . . . . . . . . . . . . . . . . . . . . . . . . 115
10.7. Updates . . . . . . . . . . . . . . . . . . . . . . . . 124 10.6. Routing Attaches . . . . . . . . . . . . . . . . . . . . 116
10.7.1. Handling Neighbor Failures . . . . . . . . . . . . . 126 10.7. Updates . . . . . . . . . . . . . . . . . . . . . . . . 117
10.7.2. Handling Finger Table Entry Failure . . . . . . . . 126 10.7.1. Handling Neighbor Failures . . . . . . . . . . . . . 118
10.7.3. Receiving Updates . . . . . . . . . . . . . . . . . 127 10.7.2. Handling Finger Table Entry Failure . . . . . . . . 119
10.7.4. Stabilization . . . . . . . . . . . . . . . . . . . 128 10.7.3. Receiving Updates . . . . . . . . . . . . . . . . . 119
10.7.4.1. Updating Neighbor Table . . . . . . . . . . . . . 128 10.7.4. Stabilization . . . . . . . . . . . . . . . . . . . 120
10.7.4.2. Refreshing Finger Table . . . . . . . . . . . . . 128 10.7.4.1. Updating the Neighbor Table . . . . . . . . . . 120
10.7.4.3. Adjusting Finger Table size . . . . . . . . . . . 129 10.7.4.2. Refreshing the Finger Table . . . . . . . . . . 121
10.7.4.4. Detecting partitioning . . . . . . . . . . . . . 130 10.7.4.3. Adjusting Finger Table Size . . . . . . . . . . 122
10.8. Route query . . . . . . . . . . . . . . . . . . . . . . 130 10.7.4.4. Detecting Partitioning . . . . . . . . . . . . . 122
10.9. Leaving . . . . . . . . . . . . . . . . . . . . . . . . 130 10.8. Route Query . . . . . . . . . . . . . . . . . . . . . . 123
11. Enrollment and Bootstrap . . . . . . . . . . . . . . . . . . 131 10.9. Leaving . . . . . . . . . . . . . . . . . . . . . . . . 123
11.1. Overlay Configuration . . . . . . . . . . . . . . . . . 132 11. Enrollment and Bootstrap . . . . . . . . . . . . . . . . . . 124
11.1.1. RELAX NG Grammar . . . . . . . . . . . . . . . . . . 140 11.1. Overlay Configuration . . . . . . . . . . . . . . . . . 124
11.2. Discovery Through Configuration Server . . . . . . . . . 142 11.1.1. RELAX NG Grammar . . . . . . . . . . . . . . . . . . 132
11.3. Credentials . . . . . . . . . . . . . . . . . . . . . . 143 11.2. Discovery through Configuration Server . . . . . . . . . 134
11.3.1. Self-Generated Credentials . . . . . . . . . . . . . 145 11.3. Credentials . . . . . . . . . . . . . . . . . . . . . . 135
11.4. Contacting a Bootstrap Node . . . . . . . . . . . . . . 146 11.3.1. Self-Generated Credentials . . . . . . . . . . . . . 137
12. Message Flow Example . . . . . . . . . . . . . . . . . . . . 146 11.4. Contacting a Bootstrap Node . . . . . . . . . . . . . . 138
13. Security Considerations . . . . . . . . . . . . . . . . . . . 152 12. Message Flow Example . . . . . . . . . . . . . . . . . . . . 138
13.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 152 13. Security Considerations . . . . . . . . . . . . . . . . . . . 144
13.2. Attacks on P2P Overlays . . . . . . . . . . . . . . . . 153 13.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 144
13.3. Certificate-based Security . . . . . . . . . . . . . . . 153 13.2. Attacks on P2P Overlays . . . . . . . . . . . . . . . . 145
13.4. Shared-Secret Security . . . . . . . . . . . . . . . . . 154 13.3. Certificate-Based Security . . . . . . . . . . . . . . . 145
13.5. Storage Security . . . . . . . . . . . . . . . . . . . . 155 13.4. Shared-Secret Security . . . . . . . . . . . . . . . . . 147
13.5.1. Authorization . . . . . . . . . . . . . . . . . . . 155 13.5. Storage Security . . . . . . . . . . . . . . . . . . . . 147
13.5.2. Distributed Quota . . . . . . . . . . . . . . . . . 156 13.5.1. Authorization . . . . . . . . . . . . . . . . . . . 147
13.5.3. Correctness . . . . . . . . . . . . . . . . . . . . 156 13.5.2. Distributed Quota . . . . . . . . . . . . . . . . . 148
13.5.4. Residual Attacks . . . . . . . . . . . . . . . . . . 156 13.5.3. Correctness . . . . . . . . . . . . . . . . . . . . 148
13.6. Routing Security . . . . . . . . . . . . . . . . . . . . 157 13.5.4. Residual Attacks . . . . . . . . . . . . . . . . . . 149
13.6.1. Background . . . . . . . . . . . . . . . . . . . . . 157
13.6.2. Admissions Control . . . . . . . . . . . . . . . . . 158 13.6. Routing Security . . . . . . . . . . . . . . . . . . . . 149
13.6.3. Peer Identification and Authentication . . . . . . . 158 13.6.1. Background . . . . . . . . . . . . . . . . . . . . . 150
13.6.4. Protecting the Signaling . . . . . . . . . . . . . . 159 13.6.2. Admissions Control . . . . . . . . . . . . . . . . . 150
13.6.5. Routing Loops and Dos Attacks . . . . . . . . . . . 159 13.6.3. Peer Identification and Authentication . . . . . . . 151
13.6.6. Residual Attacks . . . . . . . . . . . . . . . . . . 160 13.6.4. Protecting the Signaling . . . . . . . . . . . . . . 151
14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 160 13.6.5. Routing Loops and DoS Attacks . . . . . . . . . . . 152
14.1. Well-Known URI Registration . . . . . . . . . . . . . . 160 13.6.6. Residual Attacks . . . . . . . . . . . . . . . . . . 152
14.2. Port Registrations . . . . . . . . . . . . . . . . . . . 160 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 153
14.3. Overlay Algorithm Types . . . . . . . . . . . . . . . . 161 14.1. Well-Known URI Registration . . . . . . . . . . . . . . 153
14.4. Access Control Policies . . . . . . . . . . . . . . . . 161 14.2. Port Registrations . . . . . . . . . . . . . . . . . . . 153
14.5. Application-ID . . . . . . . . . . . . . . . . . . . . . 162 14.3. Overlay Algorithm Types . . . . . . . . . . . . . . . . 154
14.6. Data Kind-ID . . . . . . . . . . . . . . . . . . . . . . 162 14.4. Access Control Policies . . . . . . . . . . . . . . . . 154
14.7. Data Model . . . . . . . . . . . . . . . . . . . . . . . 163 14.5. Application-ID . . . . . . . . . . . . . . . . . . . . . 155
14.8. Message Codes . . . . . . . . . . . . . . . . . . . . . 163 14.6. Data Kind-ID . . . . . . . . . . . . . . . . . . . . . . 155
14.9. Error Codes . . . . . . . . . . . . . . . . . . . . . . 165 14.7. Data Model . . . . . . . . . . . . . . . . . . . . . . . 156
14.10. Overlay Link Types . . . . . . . . . . . . . . . . . . . 165 14.8. Message Codes . . . . . . . . . . . . . . . . . . . . . 156
14.11. Overlay Link Protocols . . . . . . . . . . . . . . . . . 166 14.9. Error Codes . . . . . . . . . . . . . . . . . . . . . . 158
14.12. Forwarding Options . . . . . . . . . . . . . . . . . . . 166 14.10. Overlay Link Types . . . . . . . . . . . . . . . . . . . 159
14.13. Probe Information Types . . . . . . . . . . . . . . . . 167 14.11. Overlay Link Protocols . . . . . . . . . . . . . . . . . 159
14.14. Message Extensions . . . . . . . . . . . . . . . . . . . 167 14.12. Forwarding Options . . . . . . . . . . . . . . . . . . . 160
14.15. reload URI Scheme . . . . . . . . . . . . . . . . . . . 168 14.13. Probe Information Types . . . . . . . . . . . . . . . . 160
14.15.1. URI Registration . . . . . . . . . . . . . . . . . . 169 14.14. Message Extensions . . . . . . . . . . . . . . . . . . . 161
14.16. Media Type Registration . . . . . . . . . . . . . . . . 170 14.15. Reload URI Scheme . . . . . . . . . . . . . . . . . . . 161
14.17. XML Name Space Registration . . . . . . . . . . . . . . 171 14.15.1. URI Registration . . . . . . . . . . . . . . . . . 162
14.17.1. Config URL . . . . . . . . . . . . . . . . . . . . . 171 14.16. Media Type Registration . . . . . . . . . . . . . . . . 162
14.17.2. Config Chord URL . . . . . . . . . . . . . . . . . . 171 14.17. XML Namespace Registration . . . . . . . . . . . . . . . 163
15. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 171 14.17.1. Config URL . . . . . . . . . . . . . . . . . . . . 164
16. References . . . . . . . . . . . . . . . . . . . . . . . . . 172 14.17.2. Config Chord URL . . . . . . . . . . . . . . . . . 164
16.1. Normative References . . . . . . . . . . . . . . . . . . 172 15. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 164
16.2. Informative References . . . . . . . . . . . . . . . . . 176 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 165
Appendix A. Routing Alternatives . . . . . . . . . . . . . . . . 180 16.1. Normative References . . . . . . . . . . . . . . . . . . 165
A.1. Iterative vs Recursive . . . . . . . . . . . . . . . . . 181 16.2. Informative References . . . . . . . . . . . . . . . . . 167
A.2. Symmetric vs Forward response . . . . . . . . . . . . . 181 Appendix A. Routing Alternatives . . . . . . . . . . . . . . . . 171
A.3. Direct Response . . . . . . . . . . . . . . . . . . . . 181 A.1. Iterative vs. Recursive . . . . . . . . . . . . . . . . . 171
A.4. Relay Peers . . . . . . . . . . . . . . . . . . . . . . 183 A.2. Symmetric vs. Forward Response . . . . . . . . . . . . . 171
A.5. Symmetric Route Stability . . . . . . . . . . . . . . . 183 A.3. Direct Response . . . . . . . . . . . . . . . . . . . . . 172
Appendix B. Why Clients? . . . . . . . . . . . . . . . . . . . . 184 A.4. Relay Peers . . . . . . . . . . . . . . . . . . . . . . . 173
B.1. Why Not Only Peers? . . . . . . . . . . . . . . . . . . 184 A.5. Symmetric Route Stability . . . . . . . . . . . . . . . . 173
B.2. Clients as Application-Level Agents . . . . . . . . . . 184 Appendix B. Why Clients? . . . . . . . . . . . . . . . . . . . . 174
B.1. Why Not Only Peers? . . . . . . . . . . . . . . . . . . . 174
B.2. Clients as Application-Level Agents . . . . . . . . . . . 175
1. Introduction 1. Introduction
This document defines REsource LOcation And Discovery (RELOAD), a This document defines REsource LOcation And Discovery (RELOAD), a
peer-to-peer (P2P) signaling protocol for use on the Internet. It peer-to-peer (P2P) signaling protocol for use on the Internet.
provides a generic, self-organizing overlay network service, allowing RELOAD provides a generic, self-organizing overlay network service,
nodes to route messages to other nodes and to store and retrieve data allowing nodes to route messages to other nodes and to store and
in the overlay. RELOAD provides several features that are critical retrieve data in the overlay. RELOAD provides several features that
for a successful P2P protocol for the Internet: are critical for a successful P2P protocol for the Internet:
Security Framework: A P2P network will often be established among a Security Framework: A P2P network will often be established among a
set of peers that do not trust each other. RELOAD leverages a set of peers that do not trust each other. RELOAD leverages a
central enrollment server to provide credentials for each peer central enrollment server to provide credentials for each peer,
which can then be used to authenticate each operation. This which can then be used to authenticate each operation. This
greatly reduces the possible attack surface. greatly reduces the possible attack surface.
Usage Model: RELOAD is designed to support a variety of Usage Model: RELOAD is designed to support a variety of
applications, including P2P multimedia communications with the applications, including P2P multimedia communications with the
Session Initiation Protocol [I-D.ietf-p2psip-sip]. RELOAD allows Session Initiation Protocol (SIP) [SIP-RELOAD]. RELOAD allows the
the definition of new application usages, each of which can define definition of new application usages, each of which can define its
its own data types, along with the rules for their use. This own data types, along with the rules for their use. This allows
allows RELOAD to be used with new applications through a simple RELOAD to be used with new applications through a simple
documentation process that supplies the details for each documentation process that supplies the details for each
application. application.
NAT Traversal: RELOAD is designed to function in environments where NAT Traversal: RELOAD is designed to function in environments where
many if not most of the nodes are behind NATs or firewalls. many, if not most, of the nodes are behind NATs or firewalls.
Operations for NAT traversal are part of the base design, Operations for NAT traversal are part of the base design,
including using Interactive Connectivity Establishment (ICE) including using Interactive Connectivity Establishment (ICE)
[RFC5245] to establish new RELOAD or application protocol [RFC5245] to establish new RELOAD or application protocol
connections. connections.
Optimized Routing: The very nature of overlay algorithms introduces Optimized Routing: The very nature of overlay algorithms introduces
a requirement that peers participating in the P2P network route a requirement that peers participating in the P2P network route
requests on behalf of other peers in the network. This introduces requests on behalf of other peers in the network. This introduces
a load on those other peers, in the form of bandwidth and a load on those other peers in the form of bandwidth and
processing power. RELOAD has been defined with a simple, processing power. RELOAD has been defined with a simple,
lightweight forwarding header, thus minimizing the amount of lightweight forwarding header, thus minimizing the amount of
effort for intermediate peers. effort for intermediate peers.
Pluggable Overlay Algorithms: RELOAD has been designed with an Pluggable Overlay Algorithms: RELOAD has been designed with an
abstract interface to the overlay layer to simplify implementing a abstract interface to the overlay layer to simplify implementing a
variety of structured (e.g., distributed hash tables) and variety of structured (e.g., distributed hash tables (DHTs)) and
unstructured overlay algorithms. The idea here is that RELOAD unstructured overlay algorithms. The idea here is that RELOAD
provides a generic structure that can fit most types of overlay provides a generic structure that can fit most types of overlay
topologies (ring, hyperspace, etc.). To instantiate an actual topologies (ring, hyperspace, etc.). To instantiate an actual
network, you combine RELOAD with a specific overlay algorithm, network, you combine RELOAD with a specific overlay algorithm,
which defines how to construct the overlay topology and route which defines how to construct the overlay topology and route
messages efficiently within it. This specification also defines messages efficiently within it. This specification also defines
how RELOAD is used with the Chord [Chord] based DHT algorithm, how RELOAD is used with the Chord-based [Chord] DHT algorithm,
which is mandatory to implement. Specifying a default "mandatory which is mandatory to implement. Specifying a default "mandatory-
to implement" overlay algorithm promotes interoperability, while to-implement" overlay algorithm promotes interoperability, while
extensibility allows selection of overlay algorithms optimized for extensibility allows selection of overlay algorithms optimized for
a particular application. a particular application.
Support for Clients: RELOAD clients differ from RELOAD peers Support for Clients: RELOAD clients differ from RELOAD peers
primarily in that they do not store information on behalf of other primarily in that they do not store information on behalf of other
nodes in the overlay, but only use the overlay to locate users and nodes in the overlay. Rather, they use the overlay only to locate
resources as well as store information. users and resources, as well as to store information and to
contact other nodes.
These properties were designed specifically to meet the requirements These properties were designed specifically to meet the requirements
for a P2P protocol to support SIP. This document defines the base for a P2P protocol to support SIP. This document defines the base
protocol for the distributed storage and location service, as well as protocol for the distributed storage and location service, as well as
critical usage for NAT traversal. The SIP Usage itself is described critical usage for NAT traversal. The SIP Usage itself is described
separately in [I-D.ietf-p2psip-sip]. RELOAD is not limited to usage separately in [SIP-RELOAD]. RELOAD is not limited to usage by SIP
by SIP and could serve as a tool for supporting other P2P and could serve as a tool for supporting other P2P applications with
applications with similar needs. similar needs.
1.1. Basic Setting 1.1. Basic Setting
In this section, we provide a brief overview of the operational In this section, we provide a brief overview of the operational
setting for RELOAD. A RELOAD Overlay Instance consists of a set of setting for RELOAD. A RELOAD Overlay Instance consists of a set of
nodes arranged in a partly connected graph. Each node in the overlay nodes arranged in a partly connected graph. Each node in the overlay
is assigned a numeric Node-ID for the lifetime of the node which, is assigned a numeric Node-ID for the lifetime of the node, which,
together with the specific overlay algorithm in use, determines its together with the specific overlay algorithm in use, determines its
position in the graph and the set of nodes it connects to. The position in the graph and the set of nodes it connects to. The
Node-ID is also tightly coupled to the certificate (see Node-ID is also tightly coupled to the certificate (see
Section 13.3). The figure below shows a trivial example which isn't Section 13.3). The figure below shows a trivial example which isn't
drawn from any particular overlay algorithm, but was chosen for drawn from any particular overlay algorithm, but was chosen for
convenience of representation. convenience of representation.
+--------+ +--------+ +--------+ +--------+ +--------+ +--------+
| Node 10|--------------| Node 20|--------------| Node 30| | Node 10|--------------| Node 20|--------------| Node 30|
+--------+ +--------+ +--------+ +--------+ +--------+ +--------+
| | | | | |
| | | | | |
+--------+ +--------+ +--------+ +--------+ +--------+ +--------+
| Node 40|--------------| Node 50|--------------| Node 60| | Node 40|--------------| Node 50|--------------| Node 60|
+--------+ +--------+ +--------+ +--------+ +--------+ +--------+
| | | | | |
| | | | | |
+--------+ +--------+ +--------+ +--------+ +--------+ +--------+
| Node 70|--------------| Node 80|--------------| Node 90| | Node 70|--------------| Node 80|--------------| Node 90|
+--------+ +--------+ +--------+ +--------+ +--------+ +--------+
| |
| |
+--------+ +--------+
| Node 85| | Node 85|
|(Client)| |(Client)|
+--------+ +--------+
Because the graph is not fully connected, when a node wants to send a Because the graph is not fully connected, when a node wants to send a
message to another node, it may need to route it through the network. message to another node, it may need to route it through the network.
For instance, Node 10 can talk directly to nodes 20 and 40, but not For instance, Node 10 can talk directly to nodes 20 and 40, but not
to Node 70. In order to send a message to Node 70, it would first to Node 70. In order to send a message to Node 70, it would first
send it to Node 40 with instructions to pass it along to Node 70. send it to Node 40, with instructions to pass it along to Node 70.
Different overlay algorithms will have different connectivity graphs, Different overlay algorithms will have different connectivity graphs,
but the general idea behind all of them is to allow any node in the but the general idea behind all of them is to allow any node in the
graph to efficiently reach every other node within a small number of graph to efficiently reach every other node within a small number of
hops. hops.
The RELOAD network is not only a messaging network. It is also a The RELOAD network is not only a messaging network. It is also a
storage network, albeit one designed for small-scale transient storage network, albeit one designed for small-scale transient
storage rather than for bulk storage of large objects. Records are storage rather than for bulk storage of large objects. Records are
stored under numeric addresses, called Resource-IDs, which occupy the stored under numeric addresses, called Resource-IDs, which occupy the
same space as node identifiers. Peers are responsible for storing same space as node identifiers. Peers are responsible for storing
the data associated with some set of addresses as determined by their the data associated with some set of addresses, as determined by
Node-ID. For instance, we might say that every peer is responsible their Node-ID. For instance, we might say that every peer is
for storing any data value which has an address less than or equal to responsible for storing any data value which has an address less than
its own Node-ID, but greater than the next lowest Node-ID. Thus, or equal to its own Node-ID, but greater than the next lowest
Node-20 would be responsible for storing values 11-20. Node-ID. Thus, Node 20 would be responsible for storing values
11-20.
RELOAD also supports clients. These are nodes which have Node-IDs RELOAD also supports clients. These are nodes which have Node-IDs
but do not participate in routing or storage. For instance, in the but do not participate in routing or storage. For instance, in the
figure above Node 85 is a client. It can route to the rest of the figure above, Node 85 is a client. It can route to the rest of the
RELOAD network via Node 80, but no other node will route through it 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 and Node 90 is still responsible for addresses in the range [81..90].
refer to non-client nodes as peers. We refer to non-client nodes as peers.
Other applications (for instance, SIP) can be defined on top of Other applications (for instance, SIP) can be defined on top of
RELOAD and use these two basic RELOAD services to provide their own RELOAD and can use these two basic RELOAD services to provide their
services. own services.
1.2. Architecture 1.2. Architecture
RELOAD is fundamentally an overlay network. The following figure RELOAD is fundamentally an overlay network. The following figure
shows the layered RELOAD architecture. shows the layered RELOAD architecture.
Application Application
+-------+ +-------+ +-------+ +-------+
| SIP | | XMPP | ... | SIP | | XMPP | ...
skipping to change at page 10, line 29 skipping to change at page 10, line 29
+-------+ +-------+ +-------+ +-------+
------------------------------------ Messaging Service Boundary ------------------------------------ Messaging Service Boundary
+------------------+ +---------+ +------------------+ +---------+
| Message |<--->| Storage | | Message |<--->| Storage |
| Transport | +---------+ | Transport | +---------+
+------------------+ ^ +------------------+ ^
^ ^ | ^ ^ |
| v v | v v
| +-------------------+ | +-------------------+
| | Topology | | | Topology |
| | Plugin | | | Plug-in |
| +-------------------+ | +-------------------+
| ^ | ^
v v v v
+------------------+ +------------------+
| Forwarding & | | Forwarding & |
| Link Management | | Link Management |
+------------------+ +------------------+
------------------------------------ Overlay Link Service Boundary ------------------------------------ Overlay Link Service Boundary
+-------+ +-------+ +-------+ +-------+
|TLS | |DTLS | ... |TLS | |DTLS | ...
|Overlay| |Overlay| |Overlay| |Overlay|
|Link | |Link | |Link | |Link |
+-------+ +-------+ +-------+ +-------+
The major components of RELOAD are: The major components of RELOAD are:
Usage Layer: Each application defines a RELOAD usage; a set of data Usage Layer: Each application defines a RELOAD Usage, which is a set
Kinds and behaviors which describe how to use the services of data Kinds and behaviors which describe how to use the services
provided by RELOAD. These usages all talk to RELOAD through a provided by RELOAD. These usages all talk to RELOAD through a
common Message Transport Service. common Message Transport Service.
Message Transport: Handles end-to-end reliability, manages request Message Transport: Handles end-to-end reliability, manages request
state for the usages, and forwards Store and Fetch operations to state for the usages, and forwards Store and Fetch operations to
the Storage component. Delivers message responses to the the Storage component. It delivers message responses to the
component initiating the request. component initiating the request.
Storage: The Storage component is responsible for processing Storage: The Storage component is responsible for processing
messages relating to the storage and retrieval of data. It talks messages relating to the storage and retrieval of data. It talks
directly to the Topology Plugin to manage data replication and directly to the Topology Plug-in to manage data replication and
migration, and it talks to the Message Transport component to send migration, and it talks to the Message Transport component to send
and receive messages. and receive messages.
Topology Plugin: The Topology Plugin is responsible for implementing Topology Plug-in: The Topology Plug-in is responsible for
the specific overlay algorithm being used. It uses the Message implementing the specific overlay algorithm being used. It uses
Transport component to send and receive overlay management the Message Transport component to send and receive overlay
messages, the Storage component to manage data replication, and management messages, the Storage component to manage data
the Forwarding Layer to control hop-by-hop message forwarding. replication, and the Forwarding Layer to control hop-by-hop
This component superficially parallels conventional routing message forwarding. This component superficially parallels
algorithms, but is more tightly coupled to the Forwarding Layer conventional routing algorithms, but is more tightly coupled to
because there is no single "routing table" equivalent used by all the Forwarding Layer, because there is no single "Routing Table"
overlay algorithms. The topology plugin has two functions, equivalent used by all overlay algorithms. The Topology Plug-in
constructing the local forwarding instructions, and selecting the has two functions: constructing the local forwarding instructions
operational topology (i.e., creating links by sending overlay and selecting the operational topology (i.e., creating links by
management messages). sending overlay management messages).
Forwarding and Link Management Layer: Stores and implements the Forwarding and Link Management Layer: Stores and implements the
Routing Table by providing packet forwarding services between Routing Table by providing packet forwarding services between
nodes. It also handles establishing new links between nodes, nodes. It also handles establishing new links between nodes,
including setting up connections for overlay links across NATs including setting up connections for overlay links across NATs
using ICE. using ICE.
Overlay Link Layer: Responsible for actually transporting traffic Overlay Link Layer: Responsible for actually transporting traffic
directly between nodes. TLS [RFC5246] and DTLS [RFC6347] are the directly between nodes. Transport Layer Security (TLS) [RFC5246]
and Datagram Transport Layer Security (DTLS) [RFC6347] are the
currently defined "overlay link layer" protocols used by RELOAD currently defined "overlay link layer" protocols used by RELOAD
for hop-by-hop communication. Each such protocol includes the for hop-by-hop communication. Each such protocol includes the
appropriate provisions for per-hop framing or hop-by-hop ACKs appropriate provisions for per-hop framing and hop-by-hop ACKs
needed by unreliable underlying transports. New protocols can be needed by unreliable underlying transports. New protocols can be
defined, as described in Section 6.6.1 and Section 11.1. As this defined, as described in Sections 6.6.1 and 11.1. As this
document defines only TLS and DTLS, we use those terms throughout document defines only TLS and DTLS, we use those terms throughout
the remainder of the document with the understanding that some the remainder of the document with the understanding that some
future specification 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 To further clarify the roles of the various layers, the following
parallels the architecture with each layer's role from an overlay figure parallels the architecture with each layer's role from an
perspective and implementation layer in the internet: overlay perspective and implementation layer in the Internet:
Internet | Internet Model | Internet | Internet Model |
Model | Equivalent | Reload Model | Equivalent | Reload
| in Overlay | Architecture | in Overlay | Architecture
-------------+-----------------+------------------------------------ -------------+-----------------+------------------------------------
| | +-------+ +-------+ | | +-------+ +-------+
| Application | | SIP | | XMPP | ... | Application | | SIP | | XMPP | ...
| | | Usage | | Usage | | | | Usage | | Usage |
| | +-------+ +-------+ | | +-------+ +-------+
| | ---------------------------------- | | ----------------------------------
| |+------------------+ +---------+ | |+------------------+ +---------+
| Transport || Message |<--->| Storage | | Transport || Message |<--->| Storage |
| || Transport | +---------+ | || Transport | +---------+
| |+------------------+ ^ | |+------------------+ ^
| | ^ ^ | | | ^ ^ |
| | | v v | | | v v
Application | | | +-------------------+ Application | | | +-------------------+
| (Routing) | | | Topology | | (Routing) | | | Topology |
| | | | Plugin | | | | | Plug-in |
| | | +-------------------+ | | | +-------------------+
| | | ^ | | | ^
| | v v | | v v
| Network | +------------------+ | Network | +------------------+
| | | Forwarding & | | | | Forwarding & |
| | | Link Management | | | | Link Management |
| | +------------------+ | | +------------------+
| | ---------------------------------- | | ----------------------------------
Transport | Link | +-------+ +------+ Transport | Link | +-------+ +------+
| | |TLS | |DTLS | ... | | |TLS | |DTLS | ...
skipping to change at page 13, line 8 skipping to change at page 13, line 8
Link | Link |
In addition to the above components, nodes may communicate with a In addition to the above components, nodes may communicate with a
central provisioning infrastructure (not shown) to get configuration central provisioning infrastructure (not shown) to get configuration
information, authentication credentials, and the initial set of nodes information, authentication credentials, and the initial set of nodes
to communicate with to join the overlay. to communicate with to join the overlay.
1.2.1. Usage Layer 1.2.1. Usage Layer
The top layer, called the Usage Layer, has application usages, such The top layer, called the Usage Layer, has application usages, such
as the SIP Registration Usage [I-D.ietf-p2psip-sip], that use the as the SIP Registration Usage [SIP-RELOAD], that use the abstract
abstract Message Transport Service provided by RELOAD. The goal of Message Transport Service provided by RELOAD. The goal of this layer
this layer is to implement application-specific usages of the generic is to implement application-specific usages of the generic overlay
overlay services provided by RELOAD. The usage defines how a services provided by RELOAD. The Usage defines how a specific
specific application maps its data into something that can be stored application maps its data into something that can be stored in the
in the overlay, where to store the data, how to secure the data, and overlay, where to store the data, how to secure the data, and finally
finally how applications can retrieve and use the data. how applications can retrieve and use the data.
The architecture diagram shows both a SIP usage and an XMPP usage. A The architecture diagram shows both a SIP Usage and an XMPP Usage. A
single application may require multiple usages; for example a single application may require multiple usages; for example, a
voicemail feature in a softphone application that stores links to the voicemail feature in a softphone application that stores links to the
messages in the overlay would require a different usage than the type messages in the overlay would require a different usage than the type
of rendezvous service of XMPP or SIP. A usage may define multiple of rendezvous service of XMPP or SIP. A usage may define multiple
Kinds of data that are stored in the overlay and may also rely on Kinds of data that are stored in the overlay and may also rely on
Kinds originally defined by other usages. Kinds originally defined by other usages.
Because the security and storage policies for each Kind are dictated Because the security and storage policies for each Kind are dictated
by the usage defining the Kind, the usages may be coupled with the by the usage defining the Kind, the usages may be coupled with the
Storage component to provide security policy enforcement and to Storage component to provide security policy enforcement and to
implement appropriate storage strategies according to the needs of implement appropriate storage strategies according to the needs of
the usage. The exact implementation of such an interface is outside the usage. The exact implementation of such an interface is outside
the scope of this specification. the scope of this specification.
1.2.2. Message Transport 1.2.2. Message Transport
The Message Transport component provides a generic message routing The Message Transport component provides a generic message routing
service for the overlay. The Message Transport layer is responsible service for the overlay. The Message Transport layer is responsible
for end-to-end message transactions. Each peer is identified by its for end-to-end message transactions. Each peer is identified by its
location in the overlay as determined by its Node-ID. A component location in the overlay, as determined by its Node-ID. A component
that is a client of the Message Transport can perform two basic that is a client of the Message Transport can perform two basic
functions: functions:
o Send a message to a given peer specified by Node-ID or to the peer o Send a message to a given peer specified by Node-ID or to the peer
responsible for a particular Resource-ID. responsible for a particular Resource-ID.
o Receive messages that other peers sent 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. for which the receiving peer is responsible.
All usages rely on the Message Transport component to send and All usages rely on the Message Transport component to send and
receive messages from peers. For instance, when a usage wants to receive messages from peers. For instance, when a usage wants to
store data, it does so by sending Store requests. Note that the store data, it does so by sending Store requests. Note that the
Storage component and the Topology Plugin are themselves clients of Storage component and the Topology Plug-in are themselves clients of
the Message Transport, because they need to send and receive messages the Message Transport, because they need to send and receive messages
from other peers. from other peers.
The Message Transport Service is responsible for end-to-end The Message Transport Service is responsible for end-to-end
reliability, accomplished by timer-based retransmissions. Unlike the reliability, which is accomplished by timer-based retransmissions.
Internet transport layer, however, this layer does not provide Unlike the Internet transport layer, however, this layer does not
congestion control. RELOAD is a request-response protocol, with no provide congestion control. RELOAD is a request-response protocol,
more than two pairs of request-response messages used in typical with no more than two pairs of request-response messages used in
transactions between pairs of nodes, therefore there are no typical transactions between pairs of nodes; therefore, there are no
opportunities to observe and react to end-to-end congestion. As with opportunities to observe and react to end-to-end congestion. As with
all Internet applications, implementers are strongly discouraged from all Internet applications, implementers are strongly discouraged from
writing applications that react to loss by immediately retrying the writing applications that react to loss by immediately retrying the
transaction. transaction.
The Message Transport Service is similar to those described as The Message Transport Service is similar to those described as
providing "Key based routing" (KBR)[wikiKBR], although as RELOAD providing "key-based routing" (KBR) [wikiKBR], although as RELOAD
supports different overlay algorithms (including non-DHT overlay supports different overlay algorithms (including non-DHT overlay
algorithms) that calculate keys (storage indices, not encryption algorithms) that calculate keys (storage indices, not encryption
keys) in different ways, the actual interface needs to accept keys) in different ways, the actual interface needs to accept
Resource Names rather than actual keys. Resource Names rather than actual keys.
Stability of the underlying network supporting the overlay (the The Forwarding and Link Management layers are responsible for
Internet) and congestion control between overlay neighbors, which maintaining the overlay in the face of changes in the available nodes
and underlying network supporting the overlay (the Internet). They
also handle congestion control between overlay neighbors, and
exchange routing updates and data replicas in addition to forwarding exchange routing updates and data replicas in addition to forwarding
end-to-end messages, is handled by the Forwarding and Link Management end-to-end messages.
layer described below.
Real-world experience has shown that a fixed timeout for the end-to- Real-world experience has shown that a fixed timeout for the end-to-
end retransmission timer is sufficient for practical overlay end retransmission timer is sufficient for practical overlay
networks. This timer is adjustable via the overlay configuration. networks. This timer is adjustable via the overlay configuration.
As the overlay configuration can be rapidly updated, this value could As the overlay configuration can be rapidly updated, this value could
be dynamically adjusted at coarse time scales, although algorithms be dynamically adjusted at coarse time scales, although algorithms
for determining how to accomplish this are beyond the scope of this for determining how to accomplish this are beyond the scope of this
specification. In many cases, however, more appropriate means of specification. In many cases, however, other means of improving
improving network performance, such as the Topology Plugin removing network performance, such as having the Topology Plug-in remove lossy
lossy links from use in overlay routing or reducing the overall hop- links from use in overlay routing or reducing the overall hop count
count of end-to-end paths will be more effective than simply of end-to-end paths, will be more effective than simply increasing
increasing the retransmission timer. the retransmission timer.
1.2.3. Storage 1.2.3. Storage
One of the major functions of RELOAD is to allow nodes to store data One of the major functions of RELOAD is storage of data, that is,
in the overlay and to retrieve data stored by other nodes or by allowing nodes to store data in the overlay and to retrieve data
themselves. The Storage component is responsible for processing data stored by other nodes or by themselves. The Storage component is
storage and retrieval messages. For instance, the Storage component responsible for processing data storage and retrieval messages. For
might receive a Store request for a given resource from the Message instance, the Storage component might receive a Store request for a
Transport. It would then query the appropriate usage before storing given resource from the Message Transport. It would then query the
the data value(s) in its local data store and sending a response to appropriate usage before storing the data value(s) in its local data
the Message Transport for delivery to the requesting node. store and sending a response to the Message Transport for delivery to
Typically, these messages will come from other nodes, but depending the requesting node. Typically, these messages will come from other
on the overlay topology, a node might be responsible for storing data nodes, but depending on the overlay topology, a node might be
for itself as well, especially if the overlay is small. responsible for storing data for itself as well, especially if the
overlay is small.
A peer's Node-ID determines the set of resources that it will be A peer's Node-ID determines the set of resources that it will be
responsible for storing. However, the exact mapping between these is responsible for storing. However, the exact mapping between these is
determined by the overlay algorithm in use. The Storage component determined by the overlay algorithm in use. The Storage component
will only receive a Store request from the Message Transport if this will only receive a Store request from the Message Transport if this
peer is responsible for that Resource-ID. The Storage component is peer is responsible for that Resource-ID. The Storage component is
notified by the Topology Plugin when the Resource-IDs for which it is notified by the Topology Plug-in when the Resource-IDs for which it
responsible change, and the Storage component is then responsible for is responsible change, and the Storage component is then responsible
migrating resources to other peers. for migrating resources to other peers.
1.2.4. Topology Plugin 1.2.4. Topology Plug-in
RELOAD is explicitly designed to work with a variety of overlay RELOAD is explicitly designed to work with a variety of overlay
algorithms. In order to facilitate this, the overlay algorithm algorithms. In order to facilitate this, the overlay algorithm
implementation is provided by a Topology Plugin so that each overlay implementation is provided by a Topology Plug-in so that each overlay
can select an appropriate overlay algorithm that relies on the common can select an appropriate overlay algorithm that relies on the common
RELOAD core protocols and code. RELOAD core protocols and code.
The Topology Plugin is responsible for maintaining the overlay The Topology Plug-in is responsible for maintaining the overlay
algorithm Routing Table, which is consulted by the Forwarding and algorithm Routing Table, which is consulted by the Forwarding and
Link Management Layer before routing a message. When connections are Link Management Layer before routing a message. When connections are
made or broken, the Forwarding and Link Management Layer notifies the made or broken, the Forwarding and Link Management Layer notifies the
Topology Plugin, which adjusts the Routing Table as appropriate. The Topology Plug-in, which adjusts the Routing Table as appropriate.
Topology Plugin will also instruct the Forwarding and Link Management The Topology Plug-in will also instruct the Forwarding and Link
Layer to form new connections as dictated by the requirements of the Management Layer to form new connections as dictated by the
overlay algorithm Topology. The Topology Plugin issues periodic requirements of the overlay algorithm Topology. The Topology Plug-in
update requests through Message Transport to maintain and update its issues periodic update requests through Message Transport to maintain
Routing Table. and update its Routing Table.
As peers enter and leave, resources may be stored on different peers, As peers enter and leave, resources may be stored on different peers,
so the Topology Plugin also keeps track of which peers are so the Topology Plug-in also keeps track of which peers are
responsible for which resources. As peers join and leave, the responsible for which resources. As peers join and leave, the
Topology Plugin instructs the Storage component to issue resource Topology Plug-in instructs the Storage component to issue resource
migration requests as appropriate, in order to ensure that other migration requests as appropriate, in order to ensure that other
peers have whatever resources they are now responsible for. The peers have whatever resources they are now responsible for. The
Topology Plugin is also responsible for providing for redundant data Topology Plug-in is also responsible for providing for redundant data
storage to protect against loss of information in the event of a peer storage to protect against loss of information in the event of a peer
failure and to protect against compromised or subversive peers. failure and to protect against compromised or subversive peers.
1.2.5. Forwarding and Link Management Layer 1.2.5. Forwarding and Link Management Layer
The Forwarding and Link Management Layer is responsible for getting a The Forwarding and Link Management Layer is responsible for getting a
message to the next peer, as determined by the Topology Plugin. This message to the next peer, as determined by the Topology Plug-in.
Layer establishes and maintains the network connections as needed by This layer establishes and maintains the network connections as
the Topology Plugin. This layer is also responsible for setting up needed by the Topology Plug-in. This layer is also responsible for
connections to other peers through NATs and firewalls using ICE, and setting up connections to other peers through NATs and firewalls
it can elect to forward traffic using relays for NAT and firewall using ICE, and it can elect to forward traffic using relays for NAT
traversal. and firewall traversal.
Congestion control is implemented at this layer to protect the Congestion control is implemented at this layer to protect the
Internet paths used to form the link in the overlay. Additionally, Internet paths used to form the link in the overlay. Additionally,
retransmission is performed to improve the reliability of end-to-end retransmission is performed to improve the reliability of end-to-end
transactions. The relation of this layer to the Message Transport transactions. The relation of this layer to the Message Transport
Layer can be likened to the relation of the link-level congestion Layer can be likened to the relation of the link-level congestion
control and retransmission in modern wireless networks to Internet control and retransmission in modern wireless networks ` to Internet
transport protocols. transport protocols.
This layer provides a generic interface that allows the topology This layer provides a generic interface that allows the Topology
plugin to control the overlay and resource operations and messages. Plug-in to control the overlay and resource operations and messages.
Since each overlay algorithm is defined and functions differently, we Because each overlay algorithm is defined and functions differently,
generically refer to the table of other peers that the overlay we generically refer to the table of other peers that the overlay
algorithm maintains and uses to route requests (neighbors) as a algorithm maintains and uses to route requests as a Routing Table.
Routing Table. The Topology Plugin actually owns the Routing Table, The Topology Plug-in actually owns the Routing Table, and forwarding
and forwarding decisions are made by querying the Topology Plugin for decisions are made by querying the Topology Plug-in for the next hop
the next hop for a particular Node-ID or Resource-ID. If this node for a particular Node-ID or Resource-ID. If this node is the
is the destination of the message, the message is delivered to the destination of the message, the message is delivered to the Message
Message Transport. Transport.
This layer also utilizes a framing header to encapsulate messages as This layer also utilizes a framing header to encapsulate messages as
they are forwarded along each hop. This header aids reliability they are forwarded along each hop. This header aids reliability
congestion control, flow control, etc. It has meaning only in the congestion control, flow control, etc. It has meaning only in the
context of that individual link. context of that individual link.
The Forwarding and Link Management Layer sits on top of the Overlay The Forwarding and Link Management Layer sits on top of the Overlay
Link Layer protocols that carry the actual traffic. This Link Layer protocols that carry the actual traffic. This
specification defines how to use DTLS and TLS protocols to carry specification defines how to use DTLS and TLS protocols to carry
RELOAD messages. RELOAD messages.
1.3. Security 1.3. Security
RELOAD's security model is based on each node having one or more RELOAD's security model is based on each node having one or more
public key certificates. In general, these certificates will be public key certificates. In general, these certificates will be
assigned by a central server which also assigns Node-IDs, although assigned by a central server, which also assigns Node-IDs, although
self-signed certificates can be used in closed networks. These self-signed certificates can be used in closed networks. These
credentials can be leveraged to provide communications security for credentials can be leveraged to provide communications security for
RELOAD messages. RELOAD provides communications security at three RELOAD messages. RELOAD provides communications security at three
levels: levels:
Connection Level: Connections between nodes are secured with TLS, Connection level: Connections between nodes 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 is signed. Message level: Each RELOAD message is signed.
Object Level: Stored objects are signed by the creating node. Object Level: Stored objects are signed by the creating node.
These three levels of security work together to allow nodes to verify These three levels of security work together to allow nodes to verify
the origin and correctness of data they receive from other nodes, the origin and correctness of data they receive from other nodes,
even in the face of malicious activity by other nodes in the overlay. even in the face of malicious activity by other nodes in the overlay.
RELOAD also provides access control built on top of these RELOAD also provides access control built on top of these
communications security features. Because the peer responsible for communications security features. Because the peer responsible for
storing a piece of data can validate the signature on the data being storing a piece of data can validate the signature on the data being
stored, the responsible peer can determine whether a given operation stored, it can determine whether or not a given operation is
is permitted or not. permitted.
RELOAD also provides an optional shared secret based admission RELOAD also provides an optional shared-secret-based admission
control feature using shared secrets and TLS-PSK/TLS-SRP. In order control feature using shared secrets and TLS pre-shared keys (PSK) or
to form a TLS connection to any node in the overlay, a new node needs TLS Secure Remote Password (SRP). In order to form a TLS connection
to know the shared overlay key, thus restricting access to authorized to any node in the overlay, a new node needs to know the shared
users only. This feature is used together with certificate-based overlay key, thus restricting access to authorized users only. This
access control, not as a replacement for it. It is typically used feature is used together with certificate-based access control, not
when self-signed certificates are being used but would generally not as a replacement for it. It is typically used when self-signed
be used when the certificates were all signed by an enrollment certificates are being used but would generally not be used when the
server. certificates were all signed by an enrollment server.
1.4. Structure of This Document 1.4. Structure of This Document
The remainder of this document is structured as follows. The remainder of this document is structured as follows.
o Section 2 provides definitions of terms used in this document. o Section 3 provides definitions of terms used in this document.
o Section 3 provides an overview of the mechanisms used to establish o Section 4 provides an overview of the mechanisms used to establish
and maintain the overlay. and maintain the overlay.
o Section 4 provides an overview of the mechanism RELOAD provides to o Section 5 provides an overview of the mechanism RELOAD provides to
support other applications. support other applications.
o Section 6 defines the protocol messages that RELOAD uses to o Section 6 defines the protocol messages that RELOAD uses to
establish and maintain the overlay. establish and maintain the overlay.
o Section 7 defines the protocol messages that are used to store and o Section 7 defines the protocol messages that are used to store and
retrieve data using RELOAD. retrieve data using RELOAD.
o Section 8 defines the Certificate Store Usages. o Section 8 defines the Certificate Store Usages.
o Section 9 defines the TURN Server Usage needed to locate TURN o Section 9 defines the TURN Server Usage needed to locate TURN
servers for NAT traversal. (Traversal Using Relays around NAT) servers for NAT traversal.
o Section 10 defines a specific Topology Plugin using Chord based o Section 10 defines a specific Topology Plug-in using a Chord-based
algorithm. algorithm.
o Section 11 defines the mechanisms that new RELOAD nodes use to o Section 11 defines the mechanisms that new RELOAD nodes use to
join the overlay for the first time. join the overlay for the first time.
o Section 12 provides an extended example. o Section 12 provides an extended example.
2. Terminology 2. Requirements Language
Terms in this document are defined inline when used and are also The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
3. Terminology
Terms in this document are defined in-line when used and are also
defined below for reference. The definitions in this section use defined below for reference. The definitions in this section use
terminology and concepts that are not explained until later in the terminology and concepts that are not explained until later in the
specification. specification.
Admitting Peer: A Peer in the Overlay which helps the Joining Node Admitting Peer (AP): A peer in the overlay which helps the Joining
join the Overlay. Node join the Overlay.
Bootstrap Node: A network node used by Joining Nodes to help locate Bootstrap Node: A network node used by Joining Nodes to help locate
the Admitting Peer. the Admitting Peer.
Client: A host that is able to store data in and retrieve data from 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 the overlay, but does not participate in routing or data storage
storage for the overlay. for the overlay.
Configuration Document: An XML document containing all the Overlay Configuration Document: An XML document containing all the Overlay
Parameters for one overlay instance. Parameters for one overlay instance.
Connection Table: Contains connection information for the set of Connection Table: Contains connection information for the set of
nodes to which a node is directly connected, which include nodes nodes to which a node is directly connected, which include nodes
that are not yet available for routing. that are not yet available for routing.
Destination List: A list of Node-IDs, Resource-ID and Opaque IDs Destination List: A list of Node-IDs, Resource-IDs, and Opaque IDs
through which a message is to be routed, in strict order. A through which a message is to be routed, in strict order. A
single Node-ID, Resource-ID or Opaque ID is a trivial form of single Node-ID, Resource-ID, or Opaque ID is a trivial form of
destination list. When multiple Node-IDs are specified, a Destination List. When multiple Node-IDs are specified, a
Destination List is a loose source route. The list is reduced Destination List is a loose source route. The list is reduced hop
hop-by-hop, does not include the source but includes the by hop, and does not include the source but does include the
destination. destination.
DHT: A distributed hash table. A DHT is an abstract hash table DHT: A distributed hash table. A DHT is an abstract storage service
service realized by storing the contents of the hash table across realized by storing the contents of the hash table across a set of
a set of peers. peers.
ID: A generic term for any kind of identifiers in an Overlay. This ID: A generic term for any kind of identifiers in an Overlay. This
document specifies an ID as being a Application-ID, Kind-ID , document specifies an ID as being an Application-ID, a Kind-ID, a
Node-ID, Transaction ID, component ID, response ID, Resource-ID, Node-ID, a transaction ID, a component ID, a response ID, a
or an Opaque ID. Resource-ID, or an Opaque ID.
Joining Node: A node that is attempting to become a Peer in a Joining Node (JN): A node that is attempting to become a peer in a
particular Overlay. particular Overlay.
Kind: A Kind defines 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 store the data they the overlay. Applications define new Kinds to store the data they
use. Each Kind is identified with a unique integer called a use. Each Kind is identified with a unique integer called a
Kind-ID. Kind-ID.
Kind-ID: A unique 32 bit value identifying a Kind. Kind-IDs are Kind-ID: A unique 32-bit value identifying a Kind. Kind-IDs are
either private or allocated by IANA (see Section 14.6). either private or allocated by IANA (see Section 14.6).
Maximum Request Lifetime: The maximum time a request will wait for a Maximum Request Lifetime: The maximum time a request will wait for a
response. This value is equal to the overlay-reliability-timer response. This value is equal to the value of the overlay
value defined in Section 11.1 multiplied by the number of reliability value (defined in Section 11.1) multiplied by the
transmissions, as defined in Section 6.2.1, and so defaults to 15 number of transmissions (defined in Section 6.2.1), and so
seconds. defaults to 15 seconds.
Node: The term "Node" is used to refer to a host that may be either Node: The term "node" refers to a host that may be either a peer or
a Peer or a Client. Because RELOAD uses the same protocol for a client. Because RELOAD uses the same protocol for both clients
both clients and peers, much of the text applies equally to both. and peers, much of the text applies equally to both. Therefore,
Therefore we use "Node" when the text applies to both Clients and we use "node" when the text applies to both clients and peers, and
Peers and the more specific term (i.e., client or peer) when the we use the more specific term (i.e., "client" or "peer") when the
text applies only to Clients or only to Peers. text applies only to clients or only to peers.
Node-ID: A value of fixed but configurable length that uniquely Node-ID: A value of fixed but configurable length that uniquely
identifies a node. Node-IDs of all 0s and all 1s are reserved; a identifies a node. Node-IDs of all 0s and all 1s are reserved. A
value of zero is not used in the wire protocol but can be used to value of 0 is not used in the wire protocol, but can be used to
indicate an invalid node in implementations and APIs; the Node-ID indicate an invalid node in implementations and APIs. The Node-ID
of all 1s is used on the wire protocol as a wildcard. of all 1s is used on the wire protocol as a wildcard.
Overlay Algorithm: An overlay algorithm defines the rules for Overlay Algorithm: An overlay algorithm defines the rules for
determining which peers in an overlay store a particular piece of determining which peers in an overlay store a particular piece of
data and for determining a topology of interconnections amongst data and for determining a topology of interconnections amongst
peers in order to find a piece of data. peers in order to find a piece of data.
Overlay Instance: A specific overlay algorithm and the collection of Overlay Instance: A specific overlay algorithm and the collection of
peers that are collaborating to provide read and write access to peers that are collaborating to provide read and write access to
it. There can be any number of overlay instances running in an IP it. Any number of overlay instances can be running in an IP
network at a time, and each operates in isolation of the others. network at a time, and each operates in isolation of the others.
Overlay Parameters: A set of values that are shared between all Overlay Parameters: A set of values that are shared among all nodes
nodes in an overlay. The overlay parameters are distributed in an in an overlay. The overlay parameters are distributed in an XML
XML document called the Configuration Document. document called the Configuration Document.
Peer: A host that is participating in the overlay. Peers are Peer: A host that is participating in the overlay. Peers are
responsible for holding some portion of the data that has been responsible for holding some portion of the data that has been
stored in the overlay and also route messages on behalf of other stored in the overlay, and they are responsible for routing
hosts as needed by the Overlay Algorithm. messages on behalf of other hosts as needed by the Overlay
Algorithm.
Peer Admission: The act of admitting a node (the "Joining Node") Peer Admission: The act of admitting a node (the Joining Node) into
into an Overlay. After the admission process is over, the joining an Overlay. After the admission process is over, the Joining Node
node is a fully-functional peer of the overlay. During the is a fully functional peer of the overlay. During the admission
admission process, the joining node may need to present process, the Joining Node may need to present credentials to prove
credentials to prove that it has sufficient authority to join the that it has sufficient authority to join the overlay.
overlay.
Resource: An object or group of objects stored in a P2P network. Resource: An object or group of objects stored in a P2P network.
Resource-ID: A value that identifies some resources and which is Resource-ID: A value that identifies some resources and which is
used as a key for storing and retrieving the resource. Often this used as a key for storing and retrieving the resource. Often this
is not human friendly/readable. One way to generate a Resource-ID is not human friendly/readable. One way to generate a Resource-ID
is by applying a mapping function to some other unique name (e.g., is by applying a mapping function to some other unique name (e.g.,
user name or service name) for the resource. The Resource-ID is user name or service name) for the resource. The Resource-ID is
used by the distributed database algorithm to determine the peer used by the distributed database algorithm to determine the peer
or peers that are responsible for storing the data for the or peers that are responsible for storing the data for the
overlay. In structured P2P networks, Resource-IDs are generally overlay. In structured P2P networks, Resource-IDs are generally
fixed length and are formed by hashing the resource name. In fixed length and are formed by hashing the Resource Name. In
unstructured networks, resource names may be used directly as unstructured networks, Resource Names may be used directly as
Resource-IDs and may be variable lengths. Resource-IDs and may be of variable length.
Resource Name: The name by which a resource is identified. In Resource Name: The name by which a resource is identified. In
unstructured P2P networks, the resource name is sometimes used unstructured P2P networks, the Resource Name is sometimes used
directly as a Resource-ID. In structured P2P networks the directly as a Resource-ID. In structured P2P networks, the
resource name is typically mapped into a Resource-ID by using the Resource Name is typically mapped into a Resource-ID by using the
string as the input to hash function. Structured and unstructured string as the input to hash function. Structured and unstructured
P2P networks are described in [RFC5694]. A SIP resource, for P2P networks are described in [RFC5694]. A SIP resource, for
example, is often identified by its AOR which is an example of a example, is often identified by its AOR (address-of-record), which
Resource Name. is an example of a Resource Name.
Responsible Peer: The peer that is responsible for a specific Responsible Peer: The peer that is responsible for a specific
resource, as defined by the topology plugin algorithm. resource, as defined by the Topology Plug-in algorithm.
Routing Table: The set of directly connected peers which a node can Routing Table: The set of directly connected peers which a node can
use to forward overlay messages. In normal operation, these peers use to forward overlay messages. In normal operation, these peers
will all be on the Connection Table but not vice versa, because will all be in the Connection Table, but not vice versa, because
some peers may not yet be available for routing. Peers may send some peers may not yet be available for routing. Peers may send
messages directly to peers that are in their Connection Tables but messages directly to peers that are in their Connection Tables,
may only forward messages to peers that are not in their but may forward messages to peers that are not in their Connection
Connection Table through peers that are in the Routing Table. Table only through peers that are in the Routing Table.
Successor Replacement Hold-Down Time: The amount of time to wait Successor Replacement Hold-Down Time: The amount of time to wait
before starting replication when a new successor is found; it before starting replication when a new successor is found; it
defaults to 30 seconds. defaults to 30 seconds.
Transaction ID: A randomly chosen identifier selected by the Transaction ID: A randomly chosen identifier selected by the
originator of a request and used to correlate requests and originator of a request that is used to correlate requests and
responses. responses.
Usage: A usage is the definition of a set of data structures (data Usage: The definition of a set of data structures (data Kinds) that
Kinds) that an application wants to store in the overlay. A usage an application wants to store in the overlay. A usage may also
may also define a set of network protocols (application IDs) that define a set of network protocols (Application IDs) that can be
can be tunneled over TLS or DTLS direct connections between nodes. tunneled over TLS or DTLS direct connections between nodes. For
E.g., the SIP usage defines a SIP registration data Kind that example, the SIP Usage defines a SIP registration data Kind, which
contains information on how to reach a SIP endpoint and two contains information on how to reach a SIP endpoint, and two
application IDs corresponding to the SIP and SIPS protocols. Application IDs corresponding to the SIP and SIPS protocols.
User: A user is a physical person identified by the certificates User: A physical person identified by the certificates assigned to
assigned to them. them.
User Name: A name identifying a user of the overlay, typically used User Name: A name identifying a user of the overlay, typically used
as a Resource Name, or as a label on a Resource that identifies as a Resource Name or as a label on a resource that identifies the
the user owning the resource. user owning the resource.
3. Overlay Management Overview 4. Overlay Management Overview
The most basic function of RELOAD is as a generic overlay network. The most basic function of RELOAD is as a generic overlay network.
Nodes need to be able to join the overlay, form connections to other Nodes need to be able to join the overlay, form connections to other
nodes, and route messages through the overlay to nodes to which they nodes, and route messages through the overlay to nodes to which they
are not directly connected. This section provides an overview of the are not directly connected. This section provides an overview of the
mechanisms that perform these functions. mechanisms that perform these functions.
3.1. Security and Identification 4.1. Security and Identification
The overlay parameters are specified in a configuration document. The overlay parameters are specified in a Configuration Document.
Because the parameters include security critical information such as Because the parameters include security-critical information, such as
the certificate signing trust anchors, the configuration document the certificate signing trust anchors, the Configuration Document
needs to be retrieved securely. The initial configuration document needs to be retrieved securely. The initial Configuration Document
is either initially fetched over HTTPS or manually provisioned; is either initially fetched over HTTPS or manually provisioned.
subsequent configuration document updates are received either by Subsequent Configuration Document updates are received either as a
periodically refreshing from the configuration server, or, more result of being refreshed periodically by the configuration server,
commonly, by being flood filled through the overlay, which allows for or, more commonly, by being flood-filled through the overlay, which
fast propagation once an update is pushed. In the latter case, allows for fast propagation once an update is pushed. In the latter
updates are via digital signatures tracing back to the initial case, updates are via digital signatures that trace back to the
configuration document. initial Configuration Document.
Every node in the RELOAD overlay is identified by a Node-ID. The Every node in the RELOAD overlay is identified by a Node-ID. The
Node-ID is used for three major purposes: Node-ID is used for three major purposes:
o To address the node itself. o To address the node itself.
o To determine its position in the overlay topology (if the overlay o To determine the node's position in the overlay topology (if the
is structured; overlays do not need to be structured). overlay is structured; overlays do not need to be structured).
o To determine the set of resources for which the node is o To determine the set of resources for which the node is
responsible. responsible.
Each node has a certificate [RFC5280] containing this Node-ID in a Each node has a certificate [RFC5280] containing its Node-ID in a
subjectAltName extension, which is unique within an overlay instance. subjectAltName extension, which is unique within an overlay instance.
The certificate serves multiple purposes: The certificate serves multiple purposes:
o It entitles the user to store data at specific locations in the o It entitles the user to store data at specific locations in the
Overlay Instance. Each data Kind defines the specific rules for Overlay Instance. Each data Kind defines the specific rules for
determining which certificates can access each Resource-ID/Kind-ID determining which certificates can access each Resource-ID/Kind-ID
pair. For instance, some Kinds might allow anyone to write at a pair. For instance, some Kinds might allow anyone to write at a
given location, whereas others might restrict writes to the owner given location, whereas others might restrict writes to the owner
of a single certificate. of a single certificate.
o It entitles the user to operate a node that has a Node-ID found in o It entitles the user to operate a node that has a Node-ID found in
the certificate. When the node forms a connection to another the certificate. When the node forms a connection to another
peer, it uses this certificate so that a node connecting to it peer, it uses this certificate so that a node connecting to it
knows it is connected to the correct node (technically: a (D)TLS knows it is connected to the correct node. (Technically, a TLS or
association with client authentication is formed.) In addition, DTLS association with client authentication is formed.) In
the node can sign messages, thus providing integrity and addition, the node can sign messages, thus providing integrity and
authentication for messages which are sent from the node. authentication for messages which are sent from the node.
o It entitles the user to use the user name found in the o It entitles the user to use the user name found in the
certificate. certificate.
If a user has more than one device, typically they would get one If a user has more than one device, typically they would get one
certificate for each device. This allows each device to act as a certificate for each device. This allows each device to act as a
separate peer. separate peer.
RELOAD supports multiple certificate issuance models. The first is RELOAD supports multiple certificate issuance models. The first is
based on a central enrollment process which allocates a unique name 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 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 in a particular Overlay Instance have the enrollment server as a
trust anchor and so can verify any other peer's certificate. 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 The second model is useful in settings, when a group of users want to
but are not concerned about attack by other users in the network. set up an overlay network but are not concerned about attack by other
For instance, users on a LAN might want to set up a short term ad hoc users in the network. For instance, users on a LAN might want to set
network without going to the trouble of setting up an enrollment up a short-term ad hoc network without going to the trouble of
server. RELOAD supports the use of self-generated, self-signed setting up an enrollment server. RELOAD supports the use of self-
certificates. When self-signed certificates are used, the node also generated, self-signed certificates. When self-signed certificates
generates its own Node-ID and user name. The Node-ID is computed as are used, the node also generates its own Node-ID and user name. The
a digest of the public key, to prevent Node-ID theft. Note that the Node-ID is computed as a digest of the public key, to prevent Node-ID
relevant cryptographic property for the digest is preimage theft. Note that the relevant cryptographic property for the digest
resistance. Collision-resistance is not needed since an attacker who is partial preimage resistance. Collision resistance is not needed,
can create two nodes with the same Node-ID but different public key because an attacker who can create two nodes with the same Node-ID
obtains no advantage. This model is still subject to a number of but a different public key obtains no advantage. This model is still
known attacks (most notably Sybil attacks [Sybil]) and can only be subject to a number of known attacks (most notably, Sybil attacks
safely used in closed networks where users are mutually trusting. [Sybil]) and can be safely used only in closed networks where users
Another drawback of this approach is that user's data is then tied to are mutually trusting. Another drawback of this approach is that the
their keys, so if a key is changed any data stored under their user's data is then tied to their key, so if a key is changed, any
Node-ID needs to be re-stored. This is not an issue for centrally- data stored under their Node-ID needs to be re-stored. This is not
issued Node-IDs provided that the CA re-issues the same Node-ID when an issue for centrally issued Node-IDs provided that the
a new certificate is generated. Certification Authority (CA) reissues the same Node-ID when a new
certificate is generated.
The general principle here is that the security mechanisms (TLS or The general principle here is that the security mechanisms (TLS or
DTLS at the data link layer and message signatures at the message DTLS at the data link layer and message signatures at the message
transport layer) are always used, even if the certificates are self- transport layer) are always used, even if the certificates are self-
signed. This allows for a single set of code paths in the systems signed. This allows for a single set of code paths in the systems,
with the only difference being whether certificate verification is with the only difference being whether certificate verification is
used to chain to a single root of trust. used to chain to a single root of trust.
3.1.1. Shared-Key Security 4.1.1. Shared-Key Security
RELOAD also provides an admission control system based on shared RELOAD also provides an admission control system based on shared
keys. In this model, the peers all share a single key which is used keys. In this model, the peers all share a single key which is used
to authenticate the peer-to-peer connections via TLS-PSK [RFC4279] or to authenticate the peer-to-peer connections via TLS-PSK [RFC4279] or
TLS-SRP [RFC5054]. TLS-SRP [RFC5054].
3.2. Clients 4.2. Clients
RELOAD defines a single protocol that is used both as the peer RELOAD defines a single protocol that is used both as the peer
protocol and as the client protocol for the overlay. This simplifies protocol and as the client protocol for the overlay. Having a single
implementation, particularly for devices that may act in either role, protocol simplifies implementation, particularly for devices that may
and allows clients to inject messages directly into the overlay. act in either role, and allows clients to inject messages directly
into the overlay.
We use the term "peer" to identify a node in the overlay that routes We use the term "peer" to identify a node in the overlay that routes
messages for nodes other than those to which it is directly messages for nodes other than those to which it is directly
connected. Peers also have storage responsibilities. We use the connected. Peers also have storage responsibilities. We use the
term "client" to refer to nodes that do not have routing or storage term "client" to refer to nodes that do not have routing or storage
responsibilities. When text applies to both peers and clients, we responsibilities. When text applies to both peers and clients, we
will simply refer to such devices as "nodes." will simply refer to such devices as "nodes".
RELOAD's client support allows nodes that are not participating in RELOAD's client support allows nodes that are not participating in
the overlay as peers to utilize the same implementation and to the overlay as peers to utilize the same implementation and to
benefit from the same security mechanisms as the peers. Clients benefit from the same security mechanisms as the peers. Clients
possess and use certificates that authorize the user to store data at possess and use certificates that authorize the user to store data at
certain locations in the overlay. The Node-ID in the certificate is certain locations in the overlay. The Node-ID in the certificate is
used to identify the particular client as a member of the overlay and used to identify the particular client as a member of the overlay and
to authenticate its messages. to authenticate its messages.
In RELOAD, unlike some other designs, clients are not a first-class In RELOAD, unlike some other designs, clients are not first-class
entity. From the perspective of a peer, a client is a node that has entities. From the perspective of a peer, a client is a node that
connected to the overlay, but has not yet taken steps to insert has connected to the overlay, but that has not yet taken steps to
itself into the overlay topology. It might never do so (if it's a insert itself into the overlay topology. It might never do so (if
client) or it might eventually do so (if it's just a node that's it's a client), or it might eventually do so (if it's just a node
taking a long time to join). The routing and storage rules for that is taking a long time to join). The routing and storage rules
RELOAD provide for correct behavior by peers regardless of whether for RELOAD provide for correct behavior by peers regardless of
other nodes attached to them are clients or peers. Of course, a whether other nodes attached to them are clients or peers. Of
client implementation needs to know that it intends to be a client, course, a client implementation needs to know that it intends to be a
but this localizes complexity only to that node. client, but this localizes complexity only to that node.
For more discussion of the motivation for RELOAD's client support, For more discussion about the motivation for RELOAD's client support,
see Appendix B. see Appendix B.
3.2.1. Client Routing 4.2.1. Client Routing
Clients may insert themselves in the overlay in two ways: Clients may insert themselves in the overlay in two ways:
o Establish a connection to the peer responsible for the client's 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 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, 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 because the responsible peer in the overlay will handle the final
step of routing to the client. This may require a TURN [RFC5766] step of routing to the client. This may require a TURN [RFC5766]
relay in cases where NATs or firewalls prevent a client from relay in cases where NATs or firewalls prevent a client from
forming a direct connection with its responsible peer. Note that forming a direct connection with its responsible peer. Note that
clients that choose this option need to process Update clients that choose this option need to process Update messages
(Section 6.4.2.3) messages from the peer. Those updates can from the peer (Section 6.4.2.3). These updates can indicate that
indicate that the peer no longer is responsible for the Client's the peer is no longer responsible for the client's Node-ID. The
Node-ID. The client would then need to form a connection to the client would then need to form a connection to the appropriate
appropriate peer. Failure to do so will result in the client no peer. Failure to do so will result in the client no longer
longer receiving messages. receiving messages.
o Establish a connection with an arbitrary peer in the overlay o Establish a connection with an arbitrary peer in the overlay
(perhaps based on network proximity or an inability to establish a (perhaps based on network proximity or an inability to establish a
direct connection with the responsible peer). In this case, the direct connection with the responsible peer). In this case, the
client will rely on RELOAD's Destination List (Section 6.3.2.2) client will rely on RELOAD's Destination List feature
feature to ensure reachability. The client can initiate requests, (Section 6.3.2.2) to ensure reachability. The client can initiate
and any node in the overlay that knows the Destination List to its requests, and any node in the overlay that knows the Destination
current location can reach it, but the client is not directly List to its current location can reach it, but the client is not
reachable using only its Node-ID. If the client is to receive directly reachable using only its Node-ID. If the client is to
incoming requests from other members of the overlay, the receive incoming requests from other members of the overlay, the
Destination List needed to reach the client needs to be learnable Destination List needed to reach the client needs to be learnable
via other mechanisms, such as being stored in the overlay by a via other mechanisms, such as being stored in the overlay by a
usage. A client connected this way using a certificate with only usage. A client connected this way using a certificate with only
a single Node-ID can proceed to use the connection without a single Node-ID can proceed to use the connection without
performing an Attach (Section 6.5.1). A client wishing to connect performing an Attach (Section 6.5.1). A client wishing to connect
using this mechanism with a certificate with multiple Node-IDs can using this mechanism with a certificate with multiple Node-IDs can
use a Ping (Section 6.5.3) to probe the Node-ID of the node to use a Ping (Section 6.5.3) to probe the Node-ID of the node to
which it is connected before doing the Attach. which it is connected before performing the Attach.
3.2.2. Minimum Functionality Requirements for Clients 4.2.2. Minimum Functionality Requirements for Clients
A node may act as a client simply because it does not have the A node may act as a client simply because it does not have the
capacity, or even an implementation of the topology plugin defined in capacity or need to act as a peer in the overlay, or because it does
not even have an implementation of the Topology Plug-in defined in
Section 6.4.1, needed to act as a peer in the overlay. In order to Section 6.4.1, needed to act as a peer in the overlay. In order to
exchange RELOAD messages with a peer, a client needs to meet a exchange RELOAD messages with a peer, a client needs to meet a
minimum level of functionality. Such a client will: minimum level of functionality. Such a client will:
o Implement RELOAD's connection-management operations that are used o Implement RELOAD's connection-management operations that are used
to establish the connection with the peer. to establish the connection with the peer.
o Implement RELOAD's data retrieval methods (with client o Implement RELOAD's data retrieval methods (with client
functionality). functionality).
o Be able to calculate Resource-IDs used by the overlay. o Be able to calculate Resource-IDs used by the overlay.
o Possess security credentials needed by the overlay it is o Possess security credentials needed by the overlay that it is
implementing. implementing.
A client speaks the same protocol as the peers, knows how to A client speaks the same protocol as the peers, knows how to
calculate Resource-IDs, and signs its requests in the same manner as calculate Resource-IDs, and signs its requests in the same manner as
peers. While a client does not necessarily require a full peers. While a client does not necessarily require a full
implementation of the overlay algorithm, calculating the Resource-ID implementation of the overlay algorithm, calculating the Resource-ID
requires an implementation of an appropriate algorithm for the requires an implementation of an appropriate algorithm for the
overlay. overlay.
3.3. Routing 4.3. Routing
This section discusses the capabilities of RELOAD's routing layer, This section discusses the capabilities of RELOAD's routing layer and
the protocol features used to implement them, and a brief overview of the protocol features used to implement the capabilities, and
how they are used. Appendix A discusses some alternative designs and provides a brief overview of how they are used. Appendix A discusses
the tradeoffs that would be necessary to support them. some alternative designs and the trade-offs that would be necessary
to support them.
RELOAD's routing provides the following capabilities: RELOAD's routing provides the following capabilities:
Resource-based routing: RELOAD supports routing messages based Resource-based Routing: RELOAD supports routing messages based
solely on the name of the resource. Such messages are delivered solely on the name of the resource. Such messages are delivered
to a node that is responsible for that resource. Both structured to a node that is responsible for that resource. Both structured
and unstructured overlays are supported, so the route may not be and unstructured overlays are supported, so the route may not be
deterministic for all Topology Plugins. deterministic for all Topology Plug-ins.
Node-based routing: RELOAD supports routing messages to a specific Node-based Routing: RELOAD supports routing messages to a specific
node in the overlay. node in the overlay.
Clients: RELOAD supports requests from and to clients that do not Clients: RELOAD supports requests from and to clients that do not
participate in overlay routing, located via either of the participate in overlay routing. The clients are located via
mechanisms described above. either of the mechanisms described above.
NAT Traversal: RELOAD supports establishing and using connections NAT Traversal: RELOAD supports establishing and using connections
between nodes separated by one or more NATs, including locating between nodes separated by one or more NATs, including locating
peers behind NATs for those overlays allowing/requiring it. peers behind NATs for those overlays allowing/requiring it.
Low state: RELOAD's routing algorithms do not require significant Low State: RELOAD's routing algorithms do not require significant
state (i.e., state linear or greater in the number of outstanding state (i.e., state linear or greater in the number of outstanding
messages that have passed through it) to be stored on intermediate messages that have passed through it) to be stored on intermediate
peers. peers.
Routability in unstable topologies: Overlay topology changes Routability in Unstable Topologies: Overlay topology changes
constantly in an overlay of moderate size due to the failure of constantly in an overlay of moderate size due to the failure of
individual nodes and links in the system. RELOAD's routing allows individual nodes and links in the system. RELOAD's routing allows
peers to re-route messages when a failure is detected, and replies peers to reroute messages when a failure is detected, and replies
can be returned to the requesting node as long as the peers that can be returned to the requesting node as long as the peers that
originally forwarded the successful request do not fail before the originally forwarded the successful request do not fail before the
response is returned. response is returned.
RELOAD's routing utilizes three basic mechanisms: RELOAD's routing utilizes three basic mechanisms:
Destination Lists: While in principle it is possible to just Destination Lists: While, in principle, it is possible to just
inject a message into the overlay with a single Node-ID as the inject a message into the overlay with a single Node-ID as the
destination, RELOAD provides a source routing capability in the destination, RELOAD provides a source-routing capability in the
form of "Destination Lists". A Destination List provides a list form of "Destination Lists". A Destination List provides a list
of the nodes through which a message flows in order (i.e., it is of the nodes through which a message flows in order (i.e., it is
loose source routed). The minimal destination list contains just loose source routed). The minimal Destination List contains just
a single value. a single value.
Via Lists: In order to allow responses to follow the same path as Via Lists: In order to allow responses to follow the same path as
requests, each message also contains a "Via List", which is requests, each message also contains a "Via List", which is
appended to by each node a message traverses. This via list can appended to by each node a message traverses. This Via List can
then be inverted and used as a destination list for the response. then be inverted and used as a Destination List for the response.
RouteQuery: The RouteQuery method allows a node to query a peer RouteQuery: The RouteQuery method allows a node to query a peer for
for the next hop it will use to route a message. This method is the next hop it will use to route a message. This method is
useful for diagnostics and for iterative routing (see useful for diagnostics and for iterative routing (see
Section 6.4.2.4). Section 6.4.2.4).
The basic routing mechanism used by RELOAD is Symmetric Recursive. The basic routing mechanism that RELOAD uses is symmetric recursive.
We will first describe symmetric recursive routing and then discuss We will first describe symmetric recursive routing and then discuss
its advantages in terms of the requirements discussed above. its advantages in terms of the requirements discussed above.
Symmetric recursive routing requires that a request message follow a Symmetric recursive routing requires that a request message follow a
path through the overlay to the destination: each peer forwards the path through the overlay to the destination: each peer forwards the
message closer to its destination. The return path of the response message closer to its destination. The return path of the response
is then the same path followed in reverse. Note that a failure on goes through the same nodes as the request (though it may also go
the reverse path caused by a topology change after the request was through some new intermediate nodes due to topology changes). Note
sent will be handled by the end-to-end retransmission of the response that a failure on the reverse path caused by a topology change after
as described in Section 6.2.1. For example, a message following a the request was sent will be handled by the end-to-end retransmission
route from A to Z through B and X: of the response as described in Section 6.2.1. For example, the
following figure shows a message following a route from A to Z
through B and X:
A B X Z A B X Z
------------------------------- -------------------------------
----------> ---------->
Dest=Z Dest=Z
----------> ---------->
Via=A Via=A
Dest=Z Dest=Z
----------> ---------->
Via=A,B Via=A,B
Dest=Z Dest=Z
<---------- <----------
Dest=X,B,A Dest=X,B,A
<---------- <----------
Dest=B,A Dest=B,A
<---------- <----------
Dest=A Dest=A
Note that the preceding Figure does not indicate whether A is a Note that this figure does not indicate whether A is a client or
client or peer: A forwards its request to B and the response is peer. A forwards its request to B, and the response is returned to A
returned to A in the same manner regardless of A's role in the in the same manner regardless of A's role in the overlay.
overlay.
This figure shows use of full via lists by intermediate peers B and 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 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 elect to truncate the lists and save the truncated information
by the transaction ID), and return the response message along the internally using the transaction ID as a key to allow it to be
path from which it was received when the response is received. This retrieved later. Later, when the response message arrives, the
option requires greater state to be stored on intermediate peers but transaction ID would be used to recover the truncated information and
saves a small amount of bandwidth and reduces the need for modifying return the response message along the path from which the request
the message en route. Selection of this mode of operation is a arrived. This option requires a greater amount of state to be stored
choice for the individual peer; the techniques are interoperable even on intermediate peers, but saves a small amount of bandwidth and
on a single message. The figure below shows B using full via lists reduces the need for modifying the message en route. Selection of
but X truncating them to X1 and saving the state internally. 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 to X1 and
saving the state internally.
A B X Z A B X Z
------------------------------- -------------------------------
----------> ---------->
Dest=Z Dest=Z
----------> ---------->
Via=A Via=A
Dest=Z Dest=Z
----------> ---------->
Via=X1 Via=X1
Dest=Z Dest=Z
<---------- <----------
Dest=X,X1 Dest=X,X1
<---------- <----------
Dest=B,A Dest=B,A
<---------- <----------
Dest=A Dest=A
As before, when B receives the message, B creates a via list As before, when B receives the message, B creates a Via List
consisting of [A]. However, instead of sending [A, B], X creates an consisting of [A]. However, instead of sending [A, B], X creates an
opaque ID X1 which maps internally to [A, B] (perhaps by being an opaque ID X1 which maps internally to [A, B] (perhaps by being an
encryption of [A, B]) and forwards to Z with only X1 as the via list. encryption of [A, B]) and then forwards to Z with only X1 as the Via
When the response arrives at X, it maps X1 back to [A, B] and then List. When the response arrives at X, it maps X1 back to [A, B],
inverts it to produce the new destination list [B, A] and routes it then inverts it to produce the new Destination List [B, A], and
to B. finally routes it to B.
RELOAD also supports a basic Iterative "routing" mode (where the RELOAD also supports a basic iterative "routing" mode, in which the
intermediate peers merely return a response indicating the next hop, intermediate peers merely return a response indicating the next hop,
but do not actually forward the message to that next hop themselves). but do not actually forward the message to that next hop themselves.
Iterative "routing" is implemented using the RouteQuery method (see Iterative routing is implemented using the RouteQuery method (see
Section 6.4.2.4), which requests this behavior. Note that iterative Section 6.4.2.4), which requests this behavior. Note that iterative
"routing" is selected only by the initiating node. routing is selected only by the initiating node.
3.4. Connectivity Management 4.4. Connectivity Management
In order to provide efficient routing, a peer needs to maintain a set 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 of direct connections to other peers in the Overlay Instance. Due to
the presence of NATs, these connections often cannot be formed the presence of NATs, these connections often cannot be formed
directly. Instead, we use the Attach request to establish a directly. Instead, we use the Attach request to establish a
connection. Attach uses Interactive Connectivity Establishment (ICE) connection. Attach uses Interactive Connectivity Establishment (ICE)
[RFC5245] to establish the connection. It is assumed that the reader [RFC5245] to establish the connection. It is assumed that the reader
is familiar with ICE. is familiar with ICE.
Say that peer A wishes to form a direct connection to peer B, either Say that peer A wishes to form a direct connection to peer B, either
to join the overlay or to add more connections in its Routing Table. to join the overlay or to add more connections in its Routing Table.
It gathers ICE candidates and packages them up in an Attach request It gathers ICE candidates and packages them up in an Attach request,
which it sends to B through usual overlay routing procedures. B does which it sends to B through usual overlay routing procedures. B does
its own candidate gathering and sends back a response with its its own candidate gathering and sends back a response with its
candidates. A and B then do ICE connectivity checks on the candidate candidates. A and B then do ICE connectivity checks on the candidate
pairs. The result is a connection between A and B. At this point, A pairs. The result is a connection between A and B. At this point, A
and B MAY send messages directly between themselves without going and B MAY send messages directly between themselves without going
through other overlay peers. In other words, A and B are on each through other overlay peers. In other words, A and B are in each
other's Connection Tables. They MAY then execute an Update process, other's Connection Tables. They MAY then execute an Update process,
resulting in additions to each other's Routing Tables, and become resulting in additions to each other's Routing Tables, and may then
able to route messages through each other to other overlay nodes become able to route messages through each other to other overlay
nodes.
There are two cases where Attach is not used. The first is when a There are two cases where Attach is not used. The first is when a
peer is joining the overlay and is not connected to any peers. In peer is joining the overlay and is not connected to any peers. In
order to support this case, some small number of "bootstrap nodes" order to support this case, a small number of bootstrap nodes
typically need to be publicly accessible so that new peers can typically need to be publicly accessible so that new peers can
directly connect to them. Section 11 contains more detail on this. directly connect to them. Section 11 contains more detail on this.
The second case is when a client connects to a peer at an arbitrary The second case is when a client connects to a peer at an arbitrary
IP address, rather than to its responsible peer, as described in the IP address, rather than to its responsible peer, as described in the
second bullet point of Section 3.2.1. second bullet point of Section 4.2.1.
In general, a peer needs to maintain connections to all of the peers In general, a peer needs to maintain connections to all of the peers
near it in the Overlay Instance and to enough other peers to have near it in the Overlay Instance and to enough other peers to have
efficient routing (the details, e.g., on what "enough" or "near" efficient routing (the details on what "enough" and "near" mean
means, depend on the specific overlay). If a peer cannot form a depend on the specific overlay). If a peer cannot form a connection
connection to some other peer, this is not necessarily a disaster; to some other peer, this is not necessarily a disaster; overlays can
overlays can route correctly even without fully connected links. route correctly even without fully connected links. However, a peer
However, a peer needs to try to maintain the specified Routing Table needs to try to maintain the specified Routing Table defined by the
defined by the topology plugin algorithm and needs to form new Topology Plug-in algorithm and needs to form new connections if it
connections if it detects that it has fewer direct connections than detects that it has fewer direct connections than specified by the
specified by the algorithm. This also implies that peers, in algorithm. This also implies that peers, in accordance with the
accordance with the topology plugin algorithm, need to periodically Topology Plug-in algorithm, need to periodically verify that the
verify that the connected peers are still alive and if not try to connected peers are still alive and, if not, need to try to re-form
reform the connection or form an alternate one. See Section 10.7.4.3 the connections or form alternate ones. See Section 10.7.4.3 for an
for an example on how a specific overlay algorithm implements these example on how a specific overlay algorithm implements these
constraints. constraints.
3.5. Overlay Algorithm Support 4.5. Overlay Algorithm Support
The Topology Plugin allows RELOAD to support a variety of overlay The Topology Plug-in allows RELOAD to support a variety of overlay
algorithms. This specification defines a DHT based on Chord, which algorithms. This specification defines a DHT based on Chord, which
is mandatory to implement, but the base RELOAD protocol is designed is mandatory to implement, but the base RELOAD protocol is designed
to support a variety of overlay algorithms. The information needed to support a variety of overlay algorithms. The information needed
to implement this DHT is fully contained in this specification but it to implement this DHT is fully contained in this specification, but
is easier to understand if you are familiar with Chord [Chord] based it is easier to understand if you are familiar with Chord-based
DHTs. A nice tutorial can be found at [wikiChord]. [Chord] DHTs. A nice tutorial can be found at [wikiChord].
3.5.1. Support for Pluggable Overlay Algorithms 4.5.1. Support for Pluggable Overlay Algorithms
RELOAD defines three methods for overlay maintenance: Join, Update, RELOAD defines three methods for overlay maintenance: Join, Update,
and Leave. However, the contents of those messages, when they are and Leave. However, the contents of these messages, when they are
sent, and their precise semantics are specified by the actual overlay sent, and their precise semantics are specified by the actual overlay
algorithm, which is specified by configuration for all nodes in the algorithm, which is specified by configuration for all nodes in the
overlay, and thus known to nodes prior to their attempting to join overlay and thus is known to nodes before they attempt to join the
the overlay. RELOAD merely provides a framework of commonly-needed overlay. RELOAD merely provides a framework of commonly needed
methods that provides uniformity of notation (and ease of debugging) methods that provide uniformity of notation (and ease of debugging)
for a variety of overlay algorithms. for a variety of overlay algorithms.
3.5.2. Joining, Leaving, and Maintenance Overview 4.5.2. Joining, Leaving, and Maintenance Overview
When a new peer wishes to join the Overlay Instance, it will need a When a new peer wishes to join the Overlay Instance, it will need a
Node-ID that it is allowed to use and a set of credentials which Node-ID that it is allowed to use and a set of credentials which
match that Node-ID. When an enrollment server is used, the Node-ID match that Node-ID. When an enrollment server is used, the Node-ID
used is the Node-ID found in the certificate received from the used is the one found in the certificate received from the enrollment
enrollment server. The details of the joining procedure are defined server. The details of the joining procedure are defined by the
by the overlay algorithm, but the general steps for joining an overlay algorithm, but the general steps for joining an Overlay
Overlay Instance are: Instance are:
o Forming connections to some other peers. o Form connections to some other peers.
o Acquiring the data values this peer is responsible for storing. o Acquire the data values this peer is responsible for storing.
o Informing the other peers which were previously responsible for o Inform the other peers which were previously responsible for that
that data that this peer has taken over responsibility. data that this peer has taken over responsibility.
The first thing the peer needs to do is to form a connection to some 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 bootstrap node. Because this is the first connection the peer makes,
makes, these nodes will need public IP addresses so that they can be these nodes will need public IP addresses so that they can be
connected to directly. Once a peer has connected to one or more connected to directly. Once a peer has connected to one or more
bootstrap nodes, it can form connections in the usual way by routing bootstrap nodes, it can form connections in the usual way, by routing
Attach messages through the overlay to other nodes. Once a peer has Attach messages through the overlay to other nodes. After a peer has
connected to the overlay for the first time, it can cache the set of connected to the overlay for the first time, it can cache the set of
past adjacencies which have public IP address and attempt to use them past adjacencies which have public IP addresses and can attempt to
as future bootstrap nodes. Note that this requires some notion of use them as future bootstrap nodes. Note that this requires some
which addresses are likely to be public as discussed in Section 9. notion of which addresses are likely to be public as discussed in
Section 9.
Once a peer has connected to a bootstrap node, it then needs to take After a peer has connected to a bootstrap node, it then needs to take
up its appropriate place in the overlay. This requires two major up its appropriate place in the overlay. This requires two major
operations: operations:
o Forming connections to other peers in the overlay to populate its o Form connections to other peers in the overlay to populate its
Routing Table. Routing Table.
o Getting a copy of the data it is now responsible for storing and o Get a copy of the data it is now responsible for storing, and
assuming responsibility for that data. assume responsibility for that data.
The second operation is performed by contacting the Admitting Peer The second operation is performed by contacting the Admitting Peer
(AP), the node which is currently responsible for that section of the (AP), the node which is currently responsible for the relevant
overlay. section of the overlay.
The details of this operation depend mostly on the overlay algorithm The details of this operation depend mostly on the overlay algorithm
involved, but a typical case would be: involved, but a typical case would be:
1. JN (Joining Node) sends a Join request to AP (Admitting Peer) 1. JN sends a Join request to AP announcing its intention to join.
announcing its intention to join.
2. AP sends a Join response. 2. AP sends a Join response.
3. AP does a sequence of Stores to JN to give it the data it will 3. AP does a sequence of Stores to JN to give it the data it will
need. need.
4. AP does Updates to JN and to other peers to tell it about its own 4. AP does Updates to JN and to other peers to tell them about its
Routing Table. At this point, both JN and AP consider JN own Routing Table. At this point, both JN and AP consider JN
responsible for some section of the Overlay Instance. responsible for some section of the Overlay Instance.
5. JN makes its own connections to the appropriate peers in the 5. JN makes its own connections to the appropriate peers in the
Overlay Instance. Overlay Instance.
After this process is completed, JN is a full member of the Overlay After this process completes, JN is a full member of the Overlay
Instance and can process Store/Fetch requests. Instance and can process Store/Fetch requests.
Note that the first node is a special case. When ordinary nodes Note that the first node is a special case. When ordinary nodes
cannot form connections to the bootstrap nodes, then they are not cannot form connections to the bootstrap nodes, then they are not
part of the overlay. However, the first node in the overlay can part of the overlay. However, the first node in the overlay can
obviously not connect to other nodes. In order to support this case, obviously not connect to other nodes. In order to support this case,
potential first nodes (which can also serve as bootstrap nodes potential first nodes (which can also initially serve as bootstrap
initially) need to somehow be instructed that they are the entire nodes) need to somehow be instructed that they are the entire
overlay, rather than not part of it. (e.g., by comparing their IP overlay, rather than part of an existing overlay (e.g., by comparing
address to the bootstrap IP addresses in the configuration file) their IP address to the bootstrap IP addresses in the configuration
file).
Note that clients do not perform either of these operations. Note that clients do not perform either of these operations.
3.6. First-Time Setup 4.6. First-Time Setup
Previous sections addressed how RELOAD works once a node has Previous sections addressed how RELOAD works after a node has
connected. This section provides an overview of how users get connected. This section provides an overview of how users get
connected to the overlay for the first time. RELOAD is designed so 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 that users can start with the name of the overlay they wish to join
and perhaps an account name and password, and leverage that into and perhaps an account name and password, and can leverage these into
having a working peer with minimal user intervention. This helps having a working peer with minimal user intervention. This helps
avoid the problems that have been experienced with conventional SIP avoid the problems that have been experienced with conventional SIP
clients where users need to manually configure a large number of clients in which users need to manually configure a large number of
settings. settings.
3.6.1. Initial Configuration 4.6.1. Initial Configuration
In the first phase of the process, the user starts out with the name In the first phase of the setup process, the user starts with the
of the overlay and uses this to download an initial set of overlay name of the overlay and uses it to download an initial set of overlay
configuration parameters. The node does a DNS SRV [RFC2782] lookup configuration parameters. The node does a DNS SRV [RFC2782] lookup
on the overlay name to get the address of a configuration server. It on the overlay name to get the address of a configuration server. It
can then connect to this server with HTTPS [RFC2818] to download a can then connect to this server with HTTPS [RFC2818] to download a
configuration document which contains the basic overlay configuration Configuration Document which contains the basic overlay configuration
parameters as well as a set of bootstrap nodes which can be used to parameters as well as a set of bootstrap nodes which can be used to
join the overlay. The details of the relations between names in the join the overlay. The details of the relationships between names in
HTTPS certificates, and the overlay names are described in the HTTPS certificates and the overlay names are described in
Section 11.2. Section 11.2.
If a node already has the valid configuration document that it If a node already has the valid Configuration Document that it
received by some out of band method, this step can be skipped. Note received by an out-of-band method, this step can be skipped. Note
that that out of band method needs to provide authentication and that this out-of-band method needs to provide authentication and
integrity, because the configuration document contains the trust integrity, because the Configuration Document contains the trust
anchors used by the overlay. anchors used by the overlay.
3.6.2. Enrollment 4.6.2. Enrollment
If the overlay is using centralized enrollment, then a user needs to If the overlay is using centralized enrollment, then a user needs to
acquire a certificate before joining the overlay. The certificate acquire a certificate before joining the overlay. The certificate
attests both to the user's name within the overlay and to the Node- attests both to the user's name within the overlay and to the
IDs which they are permitted to operate. In that case, the Node-IDs which they are permitted to operate. In this case, the
configuration document will contain the address of an enrollment Configuration Document will contain the address of an enrollment
server which can be used to obtain such a certificate, and will also server which can be used to obtain such a certificate and will also
contain the trust anchor, so this document must be retrieved securely contain the trust anchor, so this document must be retrieved securely
(see Section 11.2). The enrollment server may (and probably will) (see Section 11.2). The enrollment server may (and probably will)
require some sort of account name for the user and password before require some sort of account name for the user and a password before
issuing the certificate. The enrollment server's ability to ensure issuing the certificate. The enrollment server's ability to ensure
attackers can not get a large number of certificates for the overlay attackers cannot get a large number of certificates for the overlay
is one of the cornerstones of RELOAD's security. is one of the cornerstones of RELOAD's security.
3.6.3. Diagnostics 4.6.3. Diagnostics
Significant advice around managing a RELOAD overlay and extensions Significant advice around managing a RELOAD overlay and extensions
for diagnostics are described in [I-D.ietf-p2psip-diagnostics]. for diagnostics are described in [P2P-DIAGNOSTICS].
4. Application Support Overview 5. Application Support Overview
RELOAD is not intended to be used alone, but rather as a substrate RELOAD is not intended to be used alone, but rather as a substrate
for other applications. These applications can use RELOAD for a for other applications. These applications can use RELOAD for a
variety of purposes: variety of purposes:
o To store data in the overlay and retrieve data stored by other o To store data in the overlay and to retrieve data stored by other
nodes. nodes.
o As a discovery mechanism for services such as TURN. o As a discovery mechanism for services such as TURN.
o To form direct connections which can be used to transmit o To form direct connections which can be used to transmit
application-level messages without using the overlay. application-level messages without using the overlay.
This section provides an overview of these services. This section provides an overview of these services.
4.1. Data Storage 5.1. Data Storage
RELOAD provides operations to Store and Fetch data. Each location in RELOAD provides operations to Store and Fetch data. Each location in
the Overlay Instance is referenced by a Resource-ID. However, each the Overlay Instance is referenced by a Resource-ID. However, each
location may contain data elements corresponding to multiple Kinds location may contain data elements corresponding to multiple Kinds
(e.g., certificate, SIP registration). Similarly, there may be (e.g., certificate and SIP registration). Similarly, there may be
multiple elements of a given Kind, as shown below: multiple elements of a given Kind, as shown below:
+--------------------------------+ +--------------------------------+
| Resource-ID | | Resource-ID |
| | | |
| +------------+ +------------+ | | +------------+ +------------+ |
| | Kind 1 | | Kind 2 | | | | Kind 1 | | Kind 2 | |
| | | | | | | | | | | |
| | +--------+ | | +--------+ | | | | +--------+ | | +--------+ | |
| | | Value | | | | Value | | | | | | Value | | | | Value | | |
skipping to change at page 35, line 7 skipping to change at page 34, line 7
| | +--------+ | | +--------+ | | | | +--------+ | | +--------+ | |
| | | +------------+ | | | | +------------+ |
| | +--------+ | | | | +--------+ | |
| | | Value | | | | | | Value | | |
| | +--------+ | | | | +--------+ | |
| +------------+ | | +------------+ |
+--------------------------------+ +--------------------------------+
Each Kind is identified by a Kind-ID, which is a code point either Each Kind is identified by a Kind-ID, which is a code point either
assigned by IANA or allocated out of a private range. As part of the assigned by IANA or allocated out of a private range. As part of the
Kind definition, protocol designers may define constraints, such as Kind definition, protocol designers may define constraints (such as
limits on size, on the values which may be stored. For many Kinds, limits on size) on the values which may be stored. For many Kinds,
the set may be restricted to a single value; some sets may be allowed the set may be restricted to a single value, while some sets may be
to contain multiple identical items while others may only have unique allowed to contain multiple identical items, and others may have only
items. Note that a Kind may be employed by multiple usages and new unique items. Note that a Kind may be employed by multiple usages,
usages are encouraged to use previously defined Kinds where possible. and new usages are encouraged to use previously defined Kinds where
We define the following data models in this document, though other possible. We define the following data models in this document,
usages can define their own structures: although other usages can define their own structures:
single value: There can be at most one item in the set and any value single value: There can be at most one item in the set, and any
overwrites the previous item. value overwrites the previous item.
array: Many values can be stored and addressed by a numeric index. array: Many values can be stored and addressed by a numeric index.
dictionary: The values stored are indexed by a key. Often this key dictionary: The values stored are indexed by a key. Often, this key
is one of the values from the certificate of the peer sending the is one of the values from the certificate of the peer sending the
Store request. Store request.
In order to protect stored data from tampering by other nodes, each In order to protect stored data from tampering by other nodes, each
stored value is individually digitally signed by the node which stored value is individually digitally signed by the node which
created it. When a value is retrieved, the digital signature can be created it. When a value is retrieved, the digital signature can be
verified to detect tampering. If the certificate used to verify the verified to detect tampering. If the certificate used to verify the
stored value signature expires, the value can no longer be retrieved stored value signature expires, the value can no longer be retrieved
(though may not be immediately garbage collected by the storing node) (although it may not be immediately garbage collected by the storing
and the creating node will need to store the value again if it node), and the creating node will need to store the value again if it
desires that stored value to continue to be available. desires that the stored value continue to be available.
4.1.1. Storage Permissions 5.1.1. Storage Permissions
A major issue in peer-to-peer storage networks is minimizing the A major issue in peer-to-peer storage networks is minimizing the
burden of becoming a peer, and in particular minimizing the amount of burden of becoming a peer and, in particular, minimizing the amount
data which any peer needs to to store for other nodes. RELOAD of data which any peer needs to store for other nodes. RELOAD
addresses this issue by only allowing any given node to store data at addresses this issue by allowing any given node to store data only at
a small number of locations in the overlay, with those locations a small number of locations in the overlay, with those locations
being determined by the node's certificate. When a peer uses a Store being determined by the node's certificate. When a peer uses a Store
request to place data at a location authorized by its certificate, it request to place data at a location authorized by its certificate, it
signs that data with the private key that corresponds to its signs that data with the private key that corresponds to its
certificate. Then the peer responsible for storing the data is able certificate. Then the peer responsible for storing the data is able
to verify that the peer issuing the request is authorized to make to verify that the peer issuing the request is authorized to make
that request. Each data Kind defines the exact rules for determining that request. Each data Kind defines the exact rules for determining
what certificate is appropriate. what certificate is appropriate.
The most natural rule is that a certificate authorizes a user to The most natural rule is that a certificate authorizes a user to
store data keyed with their user name X. Thus, only a user with a store data keyed with their user name X. Thus, only a user with a
certificate for "alice@example.org" could write to that location in certificate for "alice@example.org" could write to that location in
the overlay (see Section 11.3). However, other usages can define any the overlay (see Section 11.3). However, other usages can define any
rules they choose, including publicly writable values. rules they choose, including publicly writable values.
The digital signature over the data serves two purposes. First, it The digital signature over the data serves two purposes. First, it
allows the peer responsible for storing the data to verify that this allows the peer responsible for storing the data to verify that this
Store is authorized. Second, it provides integrity for the data. Store is authorized. Second, it provides integrity for the data.
The signature is saved along with the data value (or values) so that 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 any reader can verify the integrity of the data. Of course, the
responsible peer can "lose" the value but it cannot undetectably responsible peer can "lose" the value, but it cannot undetectably
modify it. modify it.
The size requirements of the data being stored in the overlay are 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 storage size. RELOAD leaves it to the usage and overlay
configuration to limit size imbalance of various Kinds. configuration to limit size imbalances of various Kinds.
4.1.2. Replication 5.1.2. Replication
Replication in P2P overlays can be used to provide: Replication in P2P overlays can be used to provide:
persistence: if the responsible peer crashes and/or if the storing persistence: if the responsible peer crashes and/or if the storing
peer leaves the overlay peer leaves the overlay
security: to guard against DoS attacks by the responsible peer or security: to guard against DoS attacks by the responsible peer or
routing attacks to that responsible peer routing attacks to that responsible peer
load balancing: to balance the load of queries for popular load balancing: to balance the load of queries for popular resources
resources.
A variety of schemes are used in P2P overlays to achieve some of A variety of schemes are used in P2P overlays to achieve some of
these goals. Common techniques include replicating on neighbors of these goals. Common techniques include replicating on neighbors of
the responsible peer, randomly locating replicas around the overlay, the responsible peer, randomly locating replicas around the overlay,
or replicating along the path to the responsible peer. and replicating along the path to the responsible peer.
The core RELOAD specification does not specify a particular The core RELOAD specification does not specify a particular
replication strategy. Instead, the first level of replication replication strategy. Instead, the first level of replication
strategies are determined by the overlay algorithm, which can base strategies is determined by the overlay algorithm, which can base the
the replication strategy on its particular topology. For example, replication strategy on its particular topology. For example, Chord
Chord places replicas on successor peers, which will take over places replicas on successor peers, which will take over
responsibility if the responsible peer fails [Chord]. responsibility if the responsible peer fails [Chord].
If additional replication is needed, for example if data persistence If additional replication is needed, for example, if data persistence
is particularly important for a particular usage, then that usage may is particularly important for a particular usage, then that usage may
specify additional replication, such as implementing random specify additional replication, such as implementing random
replications by inserting a different well known constant into the replications by inserting a different well-known constant into the
Resource Name used to store each replicated copy of the resource. Resource Name used to store each replicated copy of the resource.
Such replication strategies can be added independent of the Such replication strategies can be added independently of the
underlying algorithm, and their usage can be determined based on the underlying algorithm, and their usage can be determined based on the
needs of the particular usage. needs of the particular usage.
4.2. Usages 5.2. Usages
By itself, the distributed storage layer just provides infrastructure By itself, the distributed storage layer provides only the
on which applications are built. In order to do anything useful, a infrastructure on which applications are built. In order to do
usage needs to be defined. Each Usage needs to specify several anything useful, a usage needs to be defined. Each usage needs to
things: specify several things:
o Register Kind-ID code points for any Kinds that the Usage defines o Register Kind-ID code points for any Kinds that the usage defines
(Section 14.6). (Section 14.6).
o Defines the data structure for each of the Kinds (the value member o Define the data structure for each of the Kinds (the value member
in Section 7.2). If the data structure contains character string, in Section 7.2). If the data structure contains character
conversion rules between characters and the binary storage need to strings, conversion rules between characters and the binary
be specified. storage need to be specified.
o Define access control rules for each of the Kinds (Section 7.3). o Define access control rules for each of the Kinds (Section 7.3).
o Define how the Resource Name is used to form the Resource-ID where o Define how the Resource Name is used to form the Resource-ID where
each Kind is stored. each Kind is stored.
o Describe how values will be merged when a network partition is o Describe how values will be merged when a network partition is
being healed. being healed.
The Kinds defined by a usage may also be applied to other usages. The Kinds defined by a usage may also be applied to other usages.
However, a need for different parameters, such as a different access However, a need for different parameters, such as a different access
control model, would imply the need to create a new Kind. control model, would imply the need to create a new Kind.
4.3. Service Discovery 5.3. Service Discovery
RELOAD does not currently define a generic service discovery RELOAD does not currently define a generic service discovery
algorithm as part of the base protocol, although a simplistic TURN- algorithm as part of the base protocol, although a simplistic TURN-
specific discovery mechanism is provided. A variety of service specific discovery mechanism is provided. A variety of service
discovery algorithms can be implemented as extensions to the base discovery algorithms can be implemented as extensions to the base
protocol, such as the service discovery algorithm ReDIR protocol, such as the service discovery algorithm ReDIR
[opendht-sigcomm05] or [I-D.ietf-p2psip-service-discovery]. [opendht-sigcomm05] and [REDIR-RELOAD].
4.4. Application Connectivity 5.4. Application Connectivity
There is no requirement that a RELOAD usage needs to use RELOAD's There is no requirement that a RELOAD Usage needs to use RELOAD's
primitives for establishing its own communication if it already primitives for establishing its own communication if it already
possesses its own means of establishing connections. For example, possesses its own means of establishing connections. For example,
one could design a RELOAD-based resource discovery protocol which one could design a RELOAD-based resource discovery protocol which
used HTTP to retrieve the actual data. used HTTP to retrieve the actual data.
For more common situations, however, it is the overlay itself - For more common situations, however, it is the overlay itself --
rather than an external authority such as DNS - which is used to rather than an external authority such as DNS -- which is used to
establish a connection. RELOAD provides connectivity to applications establish a connection. RELOAD provides connectivity to applications
using the AppAttach method. For example, if a P2PSIP node wishes to using the AppAttach method. For example, if a P2PSIP node wishes to
establish a SIP dialog with another P2PSIP node, it will use establish a SIP dialog with another P2PSIP node, it will use
AppAttach to establish a direct connection with the other node. This AppAttach to establish a direct connection with the other node. This
new connection is separate from the peer protocol connection. It is new connection is separate from the peer protocol connection. It is
a dedicated DTLS or TLS flow used only for the SIP dialog. a dedicated DTLS or TLS flow used only for the SIP dialog.
5. RFC 2119 Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
6. Overlay Management Protocol 6. Overlay Management Protocol
This section defines the basic protocols used to create, maintain, This section defines the basic protocols used to create, maintain,
and use the RELOAD overlay network. We start by defining the basic and use the RELOAD overlay network. We start by defining the basic
concept of how message destinations are interpreted when routing concept of how message destinations are interpreted when routing
messages. We then describe the symmetric recursive routing model, messages. We then describe the symmetric recursive routing model,
which is RELOAD's default routing algorithm. We then define the which is RELOAD's default routing algorithm. Finally, we define the
message structure and then finally define the messages used to join message structure and the messages used to join and maintain the
and maintain the overlay. overlay.
6.1. Message Receipt and Forwarding 6.1. Message Receipt and Forwarding
When a node receives a message, it first examines the overlay, When a node receives a message, it first examines the overlay,
version, and other header fields to determine whether the message is version, and other header fields to determine whether the message is
one it can process. If any of these are incorrect, as defined in one it can process. If any of these are incorrect, as defined in
Section 6.3.2, it is an error and the message MUST be discarded. The Section 6.3.2, it is an error and the message MUST be discarded. The
peer SHOULD generate an appropriate error but local policy can peer SHOULD generate an appropriate error, but local policy can
override this and cause the messages to be silently dropped. override this and cause the message to be silently dropped.
Once the peer has determined that the message is correctly formatted Once the peer has determined that the message is correctly formatted
(note that this does not include signature checking on intermediate (note that this does not include signature-checking on intermediate
nodes as the message may be fragmented) it examines the first entry nodes as the message may be fragmented), it examines the first entry
on the destination list. There are three possible cases here: on the Destination List. There are three possible cases here:
o The first entry on the destination list is an ID for which the o The first entry on the Destination List is an ID for which the
peer is responsible. A peer is always responsible for the peer is responsible. A peer is always responsible for the
wildcard Node-ID. Handling of this case is described in wildcard Node-ID. Handling of this case is described in
Section 6.1.1. Section 6.1.1.
o The first entry on the destination list is an ID for which another o The first entry on the Destination List is an ID for which another
peer is responsible. Handling of this case is described in peer is responsible. Handling of this case is described in
Section 6.1.2. Section 6.1.2.
o The first entry on the destination list is an opaque ID that is o The first entry on the Destination List is an opaque ID that is
being used for destination list compression. Handling of this being used for Destination List compression. Handling of this
case is described in Section 6.1.3. Note that opaque IDs can be case is described in Section 6.1.3. Note that opaque IDs can be
distinguished from Node-IDs and Resource-IDs on the wire as distinguished from Node-IDs and Resource-IDs on the wire as
described in Section 6.3.2.2. described in Section 6.3.2.2.
These cases are handled as discussed below. These cases are handled as discussed below.
6.1.1. Responsible ID 6.1.1. Responsible ID
If the first entry on the destination list is an ID for which the If the first entry on the Destination List is an ID for which the
peer is responsible, there are several (mutually exclusive) sub-cases peer is responsible, there are several (mutually exclusive) subcases
to consider. to consider.
o If the entry is a Resource-ID, then it MUST be the only entry on 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 the Destination List. If there are other entries, the message
MUST be silently dropped. Otherwise, the message is destined for MUST be silently dropped. Otherwise, the message is destined for
this node so it MUST verify the signature as described in this node, so the node MUST verify the signature as described in
Section 7.1 and MUST pass it up to the upper layers. "Upper Section 7.1 and MUST pass it to the upper layers. "Upper layers"
layers" is used here to mean the components above the "Overlay is used here to mean the components above the "Overlay Link
Link Service Boundary" line in the figure in Section 1.2. Service Boundary" line in the figure in Section 1.2.
o If the entry is a Node-ID which equals this node's Node-ID, then 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 the message is destined for this node. If it is the only entry on
on the destination list, the message is destined for this node and the Destination List, the message is destined for this node and so
so the node passes it up to the upper layers. Otherwise the node the node passes it to the upper layers. Otherwise, the node
removes the entry from the destination list and repeats the removes the entry from the Destination List and repeats the
routing process with the next entry on the destination list. If routing process with the next entry on the Destination List. If
the message is a response and list compression was used, then the the message is a response and list compression was used, then the
node first modifies the destination list to reinsert the saved node first modifies the Destination List to reinsert the saved
state, e.g., by unpacking any opaque IDs. state, e.g., by unpacking any opaque IDs.
o If the entry is the wildcard Node-ID (all "1"s), the message is o If the entry is the wildcard Node-ID (all "1"s), the message is
destined for this node and it passes it up to the upper layers. A destined for this node, and the node passes the message to the
message with a wildcard Node-ID as first entry is never forwarded upper layers. A message with a wildcard Node-ID as its first
and is consumed locally. entry is never forwarded; it is consumed locally.
o If the entry is a Node-ID which is not equal to this node, then o If the entry is a Node-ID which is not equal to this node, then
the node MUST drop the message silently unless the Node-ID the node MUST drop the message silently unless the Node-ID
corresponds to a node which is directly connected to this node corresponds to a node which is directly connected to this node
(i.e., a client). In the latter case, it MUST forward the message (i.e., a client). In the latter case, the node MUST attempt to
to the destination node as described in the next section. forward the message to the destination node as described in the
next section (though this may fail for connectivity reasons,
because the TTL has expired, or because of some other error.)
Note that this implies that in order to address a message to "the Note that this process implies that in order to address a message to
peer that controls region X", a sender sends to Resource-ID X, not "the peer that controls region X", a sender sends to Resource-ID X,
Node-ID X. not Node-ID X.
6.1.2. Other ID 6.1.2. Other ID
If the first entry in the destination list is neither an opaque ID If the first entry on the Destination List is neither an opaque ID
nor an ID the peer is responsible for, then the peer MUST forward the nor an ID the peer is responsible for, then the peer MUST forward the
message towards this entry. This means that it MUST select one of message towards that entry. This means that it MUST select one of
the peers to which it is connected and which is most likely to be the peers to which it is connected and which is most likely to be
responsible (according to the topology plugin) for the first entry on responsible (according to the Topology Plug-in) for the first entry
the destination list. For the CHORD-RELOAD topology, the routing to on the Destination List. For the CHORD-RELOAD topology, the routing
the most likely responsible node is explained in Section 10.3. If to the most likely responsible node is explained in Section 10.3. If
the first entry on the destination list is in the peer's Connection the first entry on the Destination List is in the peer's Connection
Table, then it MUST forward the message to that peer directly. Table, the peer MUST forward the message to that peer directly.
Otherwise, the peer consults the Routing Table to forward the Otherwise, the peer consults the Routing Table to forward the
message. message.
Any intermediate peer which forwards a RELOAD request MUST ensure Any intermediate peer which forwards a RELOAD request MUST ensure
that if it receives a response to that message the response can be that if it receives a response to that message, the response can be
routed back through the set of nodes through which the request routed back through the set of nodes through which the request
passed. The peer selects one of these approaches: passed. The peer selects one of these approaches:
o The peer can add an entry to the via list in the forwarding header o The peer can add an entry to the Via List in the forwarding header
that will enable it to determine the correct node. This is done that will enable it to determine the correct node. This is done
by appending to the via list the Node-ID of the node that sent the by appending to the Via List the Node-ID of the node from which
request to this node. the request was received.
o The peer can keep per-transaction state which will allow it to o The peer can keep per-transaction state which will allow it to
determine the correct node. determine the correct node.
As an example of the first strategy, consider an example with nodes As an example of the first strategy, consider an example with nodes
A, B, C, D and E. If node D receives a message from node C with via A, B, C, D, and E. If node D receives a message from node C with Via
list [A, B], then D would forward to the next node E with via list List [A, B], then D would forward to the next node E with Via List
[A, B, C]. Now, if E wants to respond to the message, it reverses [A, B, C]. Now, if E wants to respond to the message, it reverses
the via list to produce the destination list, resulting in [D, C, B, the Via List to produce the Destination List, resulting in
A]. When D forwards the response to C, the destination list will [D, C, B, A]. When D forwards the response to C, the Destination
contain [C, B, A]. List will contain [C, B, A].
As an example of the second strategy, if node D receives a message As an example of the second strategy, if node D receives a message
from node C with transaction ID X (as assigned by A) and via list [A, from node C with transaction ID X (as assigned by A) and Via List
B], it could store [X, C] in its state database and forward the [A, B], it could store [X, C] in its state database and forward the
message with the via list unchanged. When D receives the response, message with the Via List unchanged. When D receives the response,
it consults its state database for transaction ID X, determines that it consults its state database for transaction ID X, determines that
the request came from C, and forwards the response to C. the request came from C, and forwards the response to C.
Intermediate peers which modify the via list are not required to Intermediate peers which modify the Via List are not required to
simply add entries. The only requirement is that the peer MUST be simply add entries. The only requirement is that the peer MUST be
able to reconstruct the correct destination list on the return route. able to reconstruct the correct Destination List on the return route.
RELOAD provides explicit support for this functionality in the form RELOAD provides explicit support for this functionality in the form
of opaque IDs, which can replace any number of via list entries. of opaque IDs, which can replace any number of Via List entries.
For instance, in the above example, Node D might send E a via list For instance, in the above example, Node D might send E a Via List
containing only the opaque ID I. E would then use the destination containing only the opaque ID I. E would then use the Destination
list [D, I] to send its return message. When D processes this List [D, I] to send its return message. When D processes this
destination list, it would detect that I is an opaque ID, recover the Destination List, it would detect that I is an opaque ID, recover the
via list [A, B, C], and reverse that to produce the correct 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 Destination List [C, B, A] before sending it to C. This feature is
called List Compression. Possibilities for an opaque ID include a called "list compression". Possibilities for an opaque ID include a
compressed version of the original via list or an index into a state compressed and/or encrypted version of the original Via List and an
database containing the original via list, but the details are a index into a state database containing the original Via List, but the
local matter. details are a local matter.
No matter what mechanism for storing via list state is used, if an No matter what mechanism for storing Via List state is used, if an
intermediate peer exits the overlay, then on the return trip the intermediate peer exits the overlay, then on the return trip the
message cannot be forwarded and will be dropped. The ordinary message cannot be forwarded and will be dropped. The ordinary
timeout and retransmission mechanisms provide stability over this timeout and retransmission mechanisms provide stability over this
type of failure. type of failure.
Note that if an intermediate peer retains per-transaction state Note that if an intermediate peer retains per-transaction state
instead of modifying the via list, it needs some mechanism for timing instead of modifying the Via List, it needs some mechanism for timing
out that state, otherwise its state database will grow without bound. out that state; otherwise, its state database will grow without
Whatever algorithm is used, unless a FORWARD_CRITICAL forwarding bound. Whatever algorithm is used, unless a FORWARD_CRITICAL
option (Section 6.3.2.3) or overlay configuration option explicitly forwarding option (Section 6.3.2.3) or an overlay configuration
indicates this state is not needed, the state MUST be maintained for option explicitly indicates this state is not needed, the state MUST
at least the value of the overlay-reliability-timer configuration be maintained for at least the value of the overlay-reliability-timer
parameter and MAY be kept longer. Future extension, such as configuration parameter and MAY be kept longer. Future extensions,
[I-D.ietf-p2psip-rpr], may define mechanisms for determining when such as [P2PSIP-RELAY], may define mechanisms for determining when
this state does not need to be retained. this state does not need to be retained.
There is no requirement to ensure that a request issued after the There is no requirement to ensure that a request issued after the
receipt of a response follows the same path as the response. As a receipt of a response follows the same path as the response. As a
consequence, there is no requirement to use either of the mechanisms consequence, there is no requirement to use either of the mechanisms
described above (via list or state retention) when processing a described above (Via List or state retention) when processing a
response message. response message.
An intermediate node receiving a request from another node MUST A node receiving a request from another node MUST ensure that any
return a response to this request with a destination list equal to response to that request exits that node with a Destination List
the concatenation of the Node-ID of the node that sent the request equal to the concatenation of the Node-ID of the node from which the
with the via list in the request. The intermediate node normally request was received with the Via List in the original request. The
learns the Node-ID the other node is using via an Attach, but a node intermediate node normally learns the Node-ID that the other node is
using a certificate with a single Node-ID MAY elect to not send an using via an Attach, but a node using a certificate with a single
Attach (see Section 3.2.1 bullet 2). If a node with a certificate Node-ID MAY elect not to send an Attach (see Section 4.2.1, bullet
with multiple Node-IDs attempts to route a message other than a Ping 2). If a node with a certificate with multiple Node-IDs attempts to
or Attach through a node without performing an Attach, the receiving route a message other than a Ping or Attach through a node without
node MUST reject the request with an Error_Forbidden error. The node performing an Attach, the receiving node MUST reject the request with
MUST implement support for returning responses to a Ping or Attach an Error_Forbidden error. The node MUST implement support for
request made by a joining node Attaching to its responsible peer. returning responses to a Ping or Attach request made by a Joining
Node Attaching to its responsible peer.
6.1.3. Opaque ID 6.1.3. Opaque ID
If the first entry in the destination list is an opaque ID (e.g., a If the first entry on the Destination List is an opaque ID (e.g., a
compressed via list), the peer MUST replace that entry with the compressed Via List), the peer MUST replace the entry with the
original via list that it replaced and then re-examine the original Via List that it replaced and then re-examine the
destination list to determine which of the three cases in Section 6.1 Destination List to determine which of the three cases in Section 6.1
now applies. now applies.
6.2. Symmetric Recursive Routing 6.2. Symmetric Recursive Routing
This Section defines RELOAD's Symmetric Recursive Routing (SRR) This section defines RELOAD's Symmetric Recursive Routing algorithm,
algorithm, which is the default algorithm used by nodes to route which is the default algorithm used by nodes to route messages
messages through the overlay. All implementations MUST implement through the overlay. All implementations MUST implement this routing
this routing algorithm. An overlay MAY be configured to use algorithm. An overlay MAY be configured to use alternative routing
alternative routing algorithms, and alternative routing algorithms algorithms, and alternative routing algorithms MAY be selected on a
MAY be selected on a per-message basis. I.e., a node in an overlay per-message basis. That is, a node in an overlay which supports
which supports SRR and some other routing algorithm called XXX might Symmetric Recursive Routing and some other routing algorithm called
use SRR some of the time and XXX some of the time. XXX might use Symmetric Recursive Routing some of the time and XXX at
other times.
6.2.1. Request Origination 6.2.1. Request Origination
In order to originate a message to a given Node-ID or Resource-ID, a In order to originate a message to a given Node-ID or Resource-ID, a
node MUST construct an appropriate destination list. The simplest node MUST construct an appropriate Destination List. The simplest
such destination list is a single entry containing the Node-ID or such Destination List is a single entry containing the Node-ID or
Resource-ID. The resulting message MUST use the normal overlay Resource-ID. The resulting message MUST be forwarded to its
routing mechanisms to forward the message to that destination. The destination via the normal overlay routing mechanisms. The node MAY
node MAY also construct a more complicated destination list for also construct a more complicated Destination List for source
source routing. routing.
Once the message is constructed, the node sends the message to some Once the message is constructed, the node sends the message to an
adjacent peer. If the first entry on the destination list is adjacent peer. If the first entry on the Destination List is
directly connected, then the message MUST be routed down that directly connected, then the message MUST be routed down that
connection. Otherwise, the topology plugin MUST be consulted to connection. Otherwise, the Topology Plug-in MUST be consulted to
determine the appropriate next hop. determine the appropriate next hop.
Parallel requests for a resource are a common solution to improve Parallel requests for a resource are a common solution to improve
reliability in the face of churn or of subversive peers. Parallel reliability in the face of churn or subversive peers. Parallel
searches for usage-specified replicas are managed by the usage layer, searches for usage-specified replicas are managed by the usage layer,
for instance by having the usage store data at multiple Resource-IDs for instance, by having the usage store data at multiple
with the requesting node sending requests to each of those Resource- Resource-IDs, with the requesting node sending requests to each of
IDs. However, a single request MAY also be routed through multiple those Resource-IDs. However, a single request MAY also be routed
adjacent peers, even when known to be sub-optimal, to improve through multiple adjacent peers, even when they are known to be
reliability [vulnerabilities-acsac04]. Such parallel searches MAY be suboptimal, to improve reliability [vulnerabilities-acsac04]. Such
specified by the topology plugin, in which case it would return parallel searches MAY be specified by the Topology Plug-in, in which
multiple next hops and the request would be routed to all of them. case it would return multiple next hops and the request would be
routed to all of them.
Because messages can be lost in transit through the overlay, RELOAD Because messages can be lost in transit through the overlay, RELOAD
incorporates an end-to-end reliability mechanism. When an incorporates an end-to-end reliability mechanism. When an
originating node transmits a request it MUST set a timer to the originating node transmits a request, it MUST set a timer to the
current overlay-reliability-timer. If a response has not been current overlay-reliability-timer. If a response has not been
received when the timer fires, the request MUST be retransmitted with received when the timer fires, the request MUST be retransmitted with
the same transaction identifier. The request MAY be retransmitted up the same transaction identifier. The request MAY be retransmitted up
to 4 times (for a total of 5 messages). After the timer for the to 4 times, for a total of 5 messages. After the timer for the fifth
fifth transmission fires, the message MUST be considered to have transmission fires, the message MUST be considered to have failed.
failed. Although the originating node will be doing both end-to-end
and hop-by-hop retransmissions, the end-by-end retransmission Although the originating node will be doing both end-to-end and hop-
procedure is not followed by intermediate nodes. They follow the by-hop retransmissions, the end-by-end retransmission procedure is
hop-by-hop reliability procedure described in Section 6.6.3. not followed by intermediate nodes. They follow the hop-by-hop
reliability procedure described in Section 6.6.3.
The above algorithm can result in multiple requests being delivered The above algorithm can result in multiple requests being delivered
to a node. Receiving nodes MUST generate semantically equivalent to a node. Receiving nodes MUST generate semantically equivalent
responses to retransmissions of the same request (this can be responses to retransmissions of the same request (this can be
determined by transaction ID) if the request is received within the determined by the transaction ID) if the request is received within
maximum request lifetime (15 seconds). For some requests (e.g., the maximum request lifetime (15 seconds). For some requests (e.g.,
Fetch) this can be accomplished merely by processing the request Fetch), this can be accomplished merely by processing the request
again. For other requests, (e.g., Store) it may be necessary to again. For other requests (e.g., Store), it may be necessary to
maintain state for the duration of the request lifetime. maintain state for the duration of the request lifetime.
6.2.2. Response Origination 6.2.2. Response Origination
When a peer sends a response to a request using this routing When a peer sends a response to a request using this routing
algorithm, it MUST construct the destination list by reversing the algorithm, it MUST construct the Destination List by reversing the
order of the entries on the via list. This has the result that the order of the entries on the Via List. This has the result that the
response traverses the same peers as the request traversed, except in response traverses the same peers as the request traversed, except in
reverse order (symmetric routing). reverse order (symmetric routing) and possibly with extra nodes
(loose routing).
6.3. Message Structure 6.3. Message Structure
RELOAD is a message-oriented request/response protocol. The messages RELOAD is a message-oriented request/response protocol. The messages
are encoded using binary fields. All integers are represented in are encoded using binary fields. All integers are represented in
network byte order. The general philosophy behind the design was to network byte order. The general philosophy behind the design was to
use Type, Length, Value fields to allow for extensibility. However, use Type, Length, Value (TLV) fields to allow for extensibility.
for the parts of a structure that were required in all messages, we However, for the parts of a structure that were required in all
just define these in a fixed position, as adding a type and length messages, we just define these in a fixed position, as adding a type
for them is unnecessary and would simply increase bandwidth and and length for them is unnecessary and would only increase bandwidth
introduces new potential for interoperability issues. and introduce new potential interoperability issues.
Each message has three parts, concatenated as shown below: Each message has three parts, which are concatenated, as shown below:
+-------------------------+ +-------------------------+
| Forwarding Header | | Forwarding Header |
+-------------------------+ +-------------------------+
| Message Contents | | Message Contents |
+-------------------------+ +-------------------------+
| Security Block | | Security Block |
+-------------------------+ +-------------------------+
The contents of these parts are as follows: The contents of these parts are as follows:
Forwarding Header: Each message has a generic header which is used Forwarding Header: Each message has a generic header which is used
to forward the message between peers and to its final destination. to forward the message between peers and to its final destination.
This header is the only information that an intermediate peer This header is the only information that an intermediate peer
(i.e., one that is not the target of a message) needs to examine. (i.e., one that is not the target of a message) needs to examine.
Section 6.3.2 describes the format of this part. Section 6.3.2 describes the format of this part.
Message Contents: The message being delivered between the peers. Message Contents: The message being delivered between the peers.
From the perspective of the forwarding layer, the contents are From the perspective of the forwarding layer, the contents are
opaque, however, they are interpreted by the higher layers. opaque; however, they are interpreted by the higher layers.
Section 6.3.3 describes the format of this part. Section 6.3.3 describes the format of this part.
Security Block: A security block containing certificates and a Security Block: A security block containing certificates and a
digital signature over the "Message Contents" section. Note that digital signature over the "Message Contents" section. Note that
this signature can be computed without parsing the message this signature can be computed without parsing the message
contents. All messages MUST be signed by their originator. contents. All messages MUST be signed by their originator.
Section 6.3.4 describes the format of this part. Section 6.3.4 describes the format of this part.
6.3.1. Presentation Language 6.3.1. Presentation Language
The structures defined in this document are defined using a C-like The structures defined in this document are defined using a C-like
syntax based on the presentation language used to define TLS syntax based on the presentation language used to define TLS
[RFC5246]. Advantages of this style include: [RFC5246]. Advantages of this style include:
o It is familiar enough looking that most readers can grasp it o It is familiar enough that most readers can grasp it quickly.
quickly.
o The ability to define nested structures allows a separation o The ability to define nested structures allows a separation
between high-level and low-level message structures. between high-level and low-level message structures.
o It has a straightforward wire encoding that allows quick o It has a straightforward wire encoding that allows quick
implementation, but the structures can be comprehended without implementation, but the structures can be comprehended without
knowing the encoding. knowing the encoding.
o The ability to mechanically compile encoders and decoders. o It is possible to mechanically compile encoders and decoders.
Several idiosyncrasies of this language are worth noting. Several idiosyncrasies of this language are worth noting:
o All lengths are denoted in bytes, not objects. o All lengths are denoted in bytes, not objects.
o Variable length values are denoted like arrays with angle o Variable-length values are denoted like arrays, with angle
brackets. brackets.
o "select" is used to indicate variant structures. o "select" is used to indicate variant structures.
For instance, "uint16 array<0..2^8-2>;" represents up to 254 bytes For instance, "uint16 array<0..2^8-2>;" represents up to 254 bytes,
which corresponds to up to 127 values of two bytes (16 bits) each. which corresponds to up to 127 values of two bytes (16 bits) each.
A repetitive structure member shares a common notation with a member A repetitive structure member shares a common notation with a member
containing a variable length block of data. The latter always starts containing a variable-length block of data. The latter always starts
with "opaque" whereas the former does not. For instance the with "opaque", whereas the former does not. For instance, the
following denotes a variable block of data: following denotes a variable block of data:
opaque data<0..2^32-1>; opaque data<0..2^32-1>;
whereas the following denotes a list of 0, 1 or more instances of the whereas the following denotes a list of 0, 1, or more instances of
Name element: the Name element:
Name names<0..2^32-1>; Name names<0..2^32-1>;
6.3.1.1. Common Definitions 6.3.1.1. Common Definitions
This section provides an introduction to the presentation language This section provides an introduction to the presentation language
used throughout RELOAD. used throughout RELOAD.
An enum represents an enumerated type. The values associated with An enum represents an enumerated type. The values associated with
each possibility are represented in parentheses and the maximum value each possibility are represented in parentheses, and the maximum
is represented as a nameless value, for purposes of describing the value is represented as a nameless value, for purposes of describing
width of the containing integral type. For instance, Boolean the width of the containing integral type. For instance, Boolean
represents a true or false: represents a true or false:
enum { false(0), true(1), (255) } Boolean; enum { false(0), true(1), (255) } Boolean;
A boolean value is either a 1 or a 0. The max value of 255 indicates 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. that this is represented as a single byte on the wire.
The NodeId, shown below, represents a single Node-ID. The NodeId, shown below, represents a single Node-ID.
typedef opaque NodeId[NodeIdLength]; typedef opaque NodeId[NodeIdLength];
A NodeId is a fixed-length structure represented as a series of 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 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). per-overlay basis within the range of 16-20 bytes (128 to 160 bits).
(See Section 11.1 for how NodeIdLength is set.) Note: the use of (See Section 11.1 for how NodeIdLength is set.) Note that the use of
"typedef" here is an extension to the TLS language, but its meaning "typedef" here is an extension to the TLS language, but its meaning
should be relatively obvious. Note the [ size ] syntax defines a should be relatively obvious. Also note that the [ size ] syntax
fixed length element that does not include the length of the element defines a fixed-length element that does not include the length of
in the on the wire encoding. the element in the on-the-wire encoding.
A ResourceId, shown below, represents a single Resource-ID. A ResourceId, shown below, represents a single Resource-ID.
typedef opaque ResourceId<0..2^8-1>; typedef opaque ResourceId<0..2^8-1>;
Like a NodeId, a ResourceId is an opaque string of bytes, but unlike Like a NodeId, a ResourceId is an opaque string of bytes, but unlike
NodeIds, ResourceIds are variable length, up to 254 bytes (2040 bits) NodeIds, ResourceIds are variable length, up to 254 bytes (2040 bits)
in length. On the wire, each ResourceId is preceded by a single in length. On the wire, each ResourceId is preceded by a single
length byte (allowing lengths up to 255). Thus, the 3-byte value length byte (allowing lengths up to 255 bytes). Thus, the 3-byte
"FOO" would be encoded as: 03 46 4f 4f. Note the < range > syntax value "FOO" would be encoded as: 03 46 4f 4f. Note the < range >
defines a variable length element that does include the length of the syntax defines a variable length element that includes the length of
element in the on the wire encoding. The number of bytes to encode the element in the on-the-wire encoding. The number of bytes to
the length on the wire is derived by range; i.e., it is the minimum encode the length on the wire is derived by range; i.e., it is the
number of bytes which can encode the largest range value. minimum number of bytes which can encode the largest range value.
A more complicated example is IpAddressPort, which represents a A more complicated example is IpAddressPort, which represents a
network address and can be used to carry either an IPv6 or IPv4 network address and can be used to carry either an IPv6 or IPv4
address: address:
enum { invalidAddressType(0), ipv4_address(1), ipv6_address(2), enum { invalidAddressType(0), ipv4_address(1), ipv6_address(2),
(255) } AddressType; (255) } AddressType;
struct { struct {
uint32 addr; uint32 addr;
skipping to change at page 47, line 36 skipping to change at page 45, line 46
case ipv6_address: case ipv6_address:
IPv6AddrPort v6addr_port; IPv6AddrPort v6addr_port;
/* This structure can be extended */ /* This structure can be extended */
}; };
} IpAddressPort; } IpAddressPort;
The first two fields in the structure are the same no matter what The first two fields in the structure are the same no matter what
kind of address is being represented: kind of address is being represented:
type: the type of address (v4 or v6). type: The type of address (IPv4 or IPv6).
length: the length of the rest of the structure. length: The length of the rest of the structure.
By having the type and the length appear at the beginning of the By having the type and the length appear at the beginning of the
structure regardless of the kind of address being represented, an structure regardless of the kind of address being represented, an
implementation which does not understand new address type X can still implementation which does not understand new address type X can still
parse the IpAddressPort field and then discard it if it is not parse the IpAddressPort field and then discard it if it is not
needed. needed.
The rest of the IpAddressPort structure is either an IPv4AddrPort or The rest of the IpAddressPort structure is either an IPv4AddrPort or
an IPv6AddrPort. Both of these simply consist of an address an IPv6AddrPort. Both of these simply consist of an address
represented as an integer and a 16-bit port. As an example, here is represented as an integer and a 16-bit port. As an example, here is
the wire representation of the IPv4 address "192.0.2.1" with port the wire representation of the IPv4 address "192.0.2.1" with port
"6084". "6084".
01 ; type = IPv4 01 ; type = IPv4
06 ; length = 6 06 ; length = 6
c0 00 02 01 ; address = 192.0.2.1 c0 00 02 01 ; address = 192.0.2.1
17 c4 ; port = 6084 17 c4 ; port = 6084
Unless a given structure that uses a select explicitly allows for Unless a given structure that uses a select explicitly allows for
unknown types in the select, any unknown type SHOULD be treated as an unknown types in the select, any unknown type SHOULD be treated as a
parsing error and the whole message discarded with no response. parsing error, and the whole message SHOULD be discarded with no
response.
6.3.2. Forwarding Header 6.3.2. Forwarding Header
The forwarding header is defined as a ForwardingHeader structure, as The forwarding header is defined as a ForwardingHeader structure, as
shown below. shown below.
struct { struct {
uint32 relo_token; uint32 relo_token;
uint32 overlay; uint32 overlay;
uint16 configuration_sequence; uint16 configuration_sequence;
skipping to change at page 48, line 44 skipping to change at page 47, line 9
Destination via_list[via_list_length]; Destination via_list[via_list_length];
Destination destination_list Destination destination_list
[destination_list_length]; [destination_list_length];
ForwardingOption options[options_length]; ForwardingOption options[options_length];
} ForwardingHeader; } ForwardingHeader;
The contents of the structure are: The contents of the structure are:
relo_token: The first four bytes identify this message as a RELOAD relo_token: The first four bytes identify this message as a RELOAD
message. This field MUST contain the value 0xd2454c4f (the string message. This field MUST contain the value 0xd2454c4f (the string
'RELO' with the high bit of the first byte set). "RELO" with the high bit of the first byte set).
overlay: The 32 bit checksum/hash of the overlay being used. This overlay: The 32-bit checksum/hash of the overlay being used. This
MUST be formed by taking the lower 32 bits of the SHA-1 [RFC3174] MUST be formed by taking the lower 32 bits of the SHA-1 [RFC3174]
hash of the overlay name. The purpose of this field is to allow hash of the overlay name. The purpose of this field is to allow
nodes to participate in multiple overlays and to detect accidental nodes to participate in multiple overlays and to detect accidental
misconfiguration. This is not a security critical function. The misconfiguration. This is not a security-critical function. The
overlay name MUST consist of a sequence of characters what would overlay name MUST consist of a sequence of characters that would
be allowable as a DNS name. Specifically, as it is used in a DNS be allowable as a DNS name. Specifically, as it is used in a DNS
lookup, it will need to be compliant with the grammar for the lookup, it will need to be compliant with the grammar for the
domain as specified in section 2.3.1 of [RFC1035] . domain as specified in Section 2.3.1 of [RFC1035].
configuration_sequence: The sequence number of the configuration configuration_sequence: The sequence number of the configuration
file. See Section 6.3.2.1 for details file. See Section 6.3.2.1 for details.
version: The version of the RELOAD protocol being used. This is a version: The version of the RELOAD protocol being used times 10.
fixed point integer between 0.1 and 25.4. This document describes RELOAD version numbers are fixed-point decimal numbers between
version 1.0, with a value of 0x0a. [Note: Pre-RFC versions used fixed-point integer between 0.1 and 25.4. This document describes
version number 0.1]. Nodes MUST reject messages with other version 1.0, with a value of 0x0a. (Note that versions used prior
versions. to the publication of this RFC used version number 0.1.) Nodes
MUST reject messages with other versions.
ttl: An 8 bit field indicating the number of iterations, or hops, a ttl: An 8-bit field indicating the number of iterations, or hops, a
message can experience before it is discarded. The TTL value MUST message can experience before it is discarded. The TTL (time-to-
be decremented by one at every hop along the route the message live) value MUST be decremented by one at every hop along the
traverses just before transmission. If a received message has a route the message traverses just before transmission. If a
TTL of 0, and the message is not destined for the receiving node, received message has a TTL of 0 and the message is not destined
then the message MUST NOT be propagated further and a for the receiving node, then the message MUST NOT be propagated
"Error_TTL_Exceeded" error should be generated. The initial value further, and an Error_TTL_Exceeded error should be generated. The
of the TTL SHOULD be 100 and MUST NOT exceed 100 unless defined initial value of the TTL SHOULD be 100 and MUST NOT exceed 100
otherwise by the overlay configuration. Implementations which unless defined otherwise by the overlay configuration.
receive message with a TTL greater than the current value of Implementations which receive messages with a TTL greater than the
initial-ttl (or the 100 default) MUST discard the message and send current value of initial-ttl (or the default of 100) MUST discard
an "Error_TTL_Exceeded" error. the message and send an Error_TTL_Exceeded error.
fragment: This field is used to handle fragmentation. The high bit fragment: This field is used to handle fragmentation. The high bit
(0x80000000) MUST be set for historical reasons. If the next bit (0x80000000) MUST be set for historical reasons. If the next bit
(0x40000000) is set to 1, it indicates that this is the last (or (0x40000000) is set to 1, it indicates that this is the last (or
only) fragment. The next six bits (0x20000000 to 0x01000000) are only) fragment. The next six bits (0x20000000 through 0x01000000)
reserved and SHOULD be set to zero. The remainder of the field is are reserved and SHOULD be set to zero. The remainder of the
used to indicate the fragment offset; see Section 6.7. field is used to indicate the fragment offset; see Section 6.7 for
details.
length: The count in bytes of the size of the message including the length: The count in bytes of the size of the message, including the
header, after the eventual fragmentation. header, after the eventual fragmentation.
transaction_id: A unique 64 bit number that identifies this transaction_id: A unique 64-bit number that identifies this
transaction and also allows receivers to disambiguate transactions transaction and also allows receivers to disambiguate transactions
which are otherwise identical. In order to provide a high which are otherwise identical. In order to provide a high
probability that transaction IDs are unique, they MUST be randomly probability that transaction IDs are unique, they MUST be randomly
generated. Responses use the same transaction ID as the request generated. Responses use the same transaction ID as the request
they correspond to. Transaction IDs are also used for fragment to which they correspond. Transaction IDs are also used for
reassembly. See Section 6.7 for details. fragment reassembly. See Section 6.7 for details.
max_response_length: The maximum size in bytes of a response. Used max_response_length: The maximum size in bytes of a response. This
by requesting nodes to avoid receiving (unexpected) very large is used by requesting nodes to avoid receiving (unexpected) very
responses. If this value is non-zero, responding peers MUST check large responses. If this value is non-zero, responding peers MUST
that any response would not exceed it and if so generate an check that any response would not exceed it and if so generate an
"Error_Incompatible_with_Overlay" value. This value SHOULD be set Error_Incompatible_with_Overlay value. This value SHOULD be set
to zero for responses. to zero for responses.
via_list_length: The length of the via list in bytes. Note that in 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 this field and the following two length fields, we depart from the
usual variable-length convention of having the length immediately usual variable-length convention of having the length immediately
precede the value in order to make it easier for hardware decoding precede the value, in order to make it easier for hardware
engines to quickly determine the length of the header. decoding engines to quickly determine the length of the header.
destination_list_length: The length of the destination list in destination_list_length: The length of the Destination List in
bytes. bytes.
options_length: The length of the header options in bytes. options_length: The length of the header options in bytes.
via_list: The via_list contains the sequence of destinations through via_list: The via_list contains the sequence of destinations through
which the message has passed. The via_list starts out empty and which the message has passed. The via_list starts out empty and
grows as the message traverses each peer. In stateless cases, the grows as the message traverses each peer. In stateless cases, the
previous hop that the message is from is appended to the via list previous hop that the message is from is appended to the Via List
as specified in Section 6.1.2. as specified in Section 6.1.2.
destination_list: The destination_list contains a sequence of destination_list: The destination_list contains a sequence of
destinations which the message should pass through. The destinations through which the message should pass. The
destination list is constructed by the message originator. The Destination List is constructed by the message originator. The
first element in the destination list is where the message goes first element on the Destination List is where the message goes
next. The list shrinks as the message traverses each listed peer. next. Generally, the list shrinks as the message traverses each
listed peer, though if list compression is used, this may not be
true.
options: Contains a series of ForwardingOption entries. See options: Contains a series of ForwardingOption entries. See
Section 6.3.2.3. Section 6.3.2.3.
6.3.2.1. Processing Configuration Sequence Numbers 6.3.2.1. Processing Configuration Sequence Numbers
In order to be part of the overlay, a node MUST have a copy of the In order to be part of the overlay, a node MUST have a copy of the
overlay configuration document. In order to allow for configuration overlay Configuration Document. In order to allow for configuration
document changes, each version of the configuration document MUST document changes, each version of the Configuration Document MUST
contain a sequence number which MUST be monotonically increasing mod contain a sequence number which MUST be monotonically increasing mod
65535. Because the sequence number may in principle wrap, greater 65535. Because the sequence number may, in principle, wrap, greater
than or less than are interpreted by modulo arithmetic as in TCP. than or less than are interpreted by modulo arithmetic as in TCP.
When a destination node receives a request, it MUST check that the When a destination node receives a request, it MUST check that the
configuration_sequence field is equal to its own configuration configuration_sequence field is equal to its own configuration
sequence number. If they do not match, it MUST generate an error, sequence number. If they do not match, the node MUST generate an
either Error_Config_Too_Old or Error_Config_Too_New. In addition, if error, either Error_Config_Too_Old or Error_Config_Too_New. In
the configuration file in the request is too old, it MUST generate a addition, if the configuration file in the request is too old, the
ConfigUpdate message to update the requesting node. This allows new node MUST generate a ConfigUpdate message to update the requesting
configuration documents to propagate quickly throughout the system. node. This allows new Configuration Documents to propagate quickly
The one exception to this rule is that if the configuration_sequence throughout the system. The one exception to this rule is that if the
field is equal to 65535, and the message type is ConfigUpdate, then configuration_sequence field is equal to 65535 and the message type
the message MUST be accepted regardless of the receiving node's is ConfigUpdate, then the message MUST be accepted regardless of the
configuration sequence number. Since 65535 is a special value, peers receiving node's configuration sequence number. Since 65535 is a
sending a new configuration when the configuration sequence is special value, peers sending a new configuration when the
currently 65534 MUST set the configuration sequence number to 0 when configuration sequence is currently 65534 MUST set the configuration
they send out a new configuration. sequence number to 0 when they send a new configuration.
6.3.2.2. Destination and Via Lists 6.3.2.2. Destination and Via Lists
The destination list and via list are sequences of Destination The Destination List and Via List are sequences of Destination
values: values:
enum { invalidDestinationType(0), node(1), resource(2), enum { invalidDestinationType(0), node(1), resource(2),
opaque_id_type(3), /* 128-255 not allowed */ (255) } opaque_id_type(3), /* 128-255 not allowed */ (255) }
DestinationType; DestinationType;
select (destination_type) { select (destination_type) {
case node: case node:
NodeId node_id; NodeId node_id;
skipping to change at page 52, line 29 skipping to change at page 50, line 34
/* This structure may be extended with new types */ /* This structure may be extended with new types */
} DestinationData; } DestinationData;
struct { struct {
DestinationType type; DestinationType type;
uint8 length; uint8 length;
DestinationData destination_data; DestinationData destination_data;
} Destination; } Destination;
struct { struct {
uint16 opaque_id; /* top bit MUST be 1 */ uint16 opaque_id; /* Top bit MUST be 1 */
} Destination; } Destination;
If the destination structure is a 16 bit integer, then the first bit If the destination structure is a 16-bit integer, then the first bit
MUST be set to 1 and it MUST be treated as if it were a full MUST be set to 1, and it MUST be treated as if it were a full
structure with a DestinationType of opaque_id_type and an opaque_id structure with a DestinationType of opaque_id_type and an opaque_id
that was 2 bytes long with the value of the 16 bit integer. If the that was 2 bytes long with the value of the 16-bit integer. If the
destination structure is starting with DestinationType, then the destination structure starts with DestinationType, then the first bit
first bit MUST be set to 0 and it is using the TLV structure with the MUST be set to 0, and the destination structure must use a TLV
following contents: structure with the following contents:
type type
The type of the DestinationData Payload Data Unit (PDU). This may The type of the DestinationData Payload Data Unit (PDU). It may
be one of "node", "resource", or "opaque_id_type". be one of "node", "resource", or "opaque_id_type".
length length
The length of the destination_data. The length of the destination_data.
destination_data destination_data
The destination value itself, which is an encoded DestinationData The destination value itself, which is an encoded DestinationData
structure, depending on the value of "type". structure that depends on the value of "type".
Note: This structure encodes a type, length, value. The length Note that the destination structure encodes a Type, Length, Value.
field specifies the length of the DestinationData values, which The Length field specifies the length of the DestinationData values,
allows the addition of new DestinationTypes. This allows an which allows the addition of new DestinationTypes. It also allows an
implementation which does not understand a given DestinationType implementation which does not understand a given DestinationType to
to skip over it. skip over it.
A DestinationData can be one of three types: A DestinationData can be one of three types:
node node
A Node-ID. A Node-ID.
opaque opaque
A compressed list of Node-IDs and an eventual Resource-ID. A compressed list of Node-IDs and an eventual Resource-ID.
Because this value was compressed by one of the peers, it is only Because this value has been compressed by one of the peers, it is
meaningful to that peer and cannot be decoded by other peers. meaningful only to that peer and cannot be decoded by other peers.
Thus, it is represented as an opaque string. Thus, it is represented as an opaque string.
resource resource
The Resource-ID of the resource which is desired. This type MUST The Resource-ID of the resource which is desired. This type MUST
only appear in the final location of a destination list and MUST appear only in the final location of a Destination List and MUST
NOT appear in a via list. It is meaningless to try to route NOT appear in a Via List. It is meaningless to try to route
through a resource. through a resource.
One possible encoding of the 16 bit integer version as an opaque One possible encoding of the 16-bit integer version as an opaque
identifier is to encode an index into a Connection Table. To avoid identifier is to encode an index into a Connection Table. To avoid
misrouting responses in the event a response is delayed and the 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 between an index and a generation counter for that index. When a
startup, the generation counters SHOULD be initialized to random Node first joins the overlay, the generation counters SHOULD be
values. An implementation MAY use 12 bits for the Connection Table initialized to random values. An implementation MAY use 12 bits for
index and 3 bits for the generation counter. (Note that this does the Connection Table index and 3 bits for the generation counter.
not suggest a 4096 entry Connection Table for every peer, only the (Note that this does not suggest a 4096-entry Connection Table for
ability to encode for a larger Connection Table.) When a Connection every peer, only the ability to encode for a larger Connection
Table slot is used for a new connection, the generation counter is Table.) When a Connection Table slot is used for a new connection,
incremented (with wrapping). Connection Table slots are used on a the generation counter is incremented (with wrapping). Connection
rotating basis to maximize the time interval between uses of the same Table slots are used on a rotating basis to maximize the time
slot for different connections. When routing a message to an entry interval between uses of the same slot for different connections.
in the destination list encoding a Connection Table entry, the peer When routing a message to an entry in the Destination List encoding a
MUST confirm that the generation counter matches the current Connection Table entry, the peer MUST confirm that the generation
generation counter of that index before forwarding the message. If counter matches the current generation counter of that index before
it does not match, the message MUST be silently dropped. forwarding the message. If it does not match, the message MUST be
silently dropped.
6.3.2.3. Forwarding Option 6.3.2.3. Forwarding Option
The Forwarding header can be extended with forwarding header options, The Forwarding header can be extended with forwarding header options,
which are a series of ForwardingOption structures: which are a series of ForwardingOption structures:
enum { invalidForwardingOptionType(0), (255) } enum { invalidForwardingOptionType(0), (255) }
ForwardingOptionType; ForwardingOptionType;
struct { struct {
skipping to change at page 54, line 34 skipping to change at page 52, line 29
}; };
} ForwardingOption; } ForwardingOption;
Each ForwardingOption consists of the following values: Each ForwardingOption consists of the following values:
type type
The type of the option. This structure allows for unknown options The type of the option. This structure allows for unknown options
types. types.
flags flags
Three flags are defined FORWARD_CRITICAL(0x01), Three flags are defined: FORWARD_CRITICAL(0x01),
DESTINATION_CRITICAL(0x02), and RESPONSE_COPY(0x04). These flags DESTINATION_CRITICAL(0x02), and RESPONSE_COPY(0x04). These flags
MUST NOT be set in a response. If the FORWARD_CRITICAL flag is MUST NOT be set in a response. If the FORWARD_CRITICAL flag is
set, any peer that would forward the message but does not set, any peer that would forward the message but does not
understand this options MUST reject the request with an understand this option MUST reject the request with an
Error_Unsupported_Forwarding_Option error response. If the Error_Unsupported_Forwarding_Option error response. If the
DESTINATION_CRITICAL flag is set, any node that generates a DESTINATION_CRITICAL flag is set, any node that generates a
response to the message but does not understand the forwarding response to the message but does not understand the forwarding
option MUST reject the request with an option MUST reject the request with an
Error_Unsupported_Forwarding_Option error response. If the Error_Unsupported_Forwarding_Option error response. If the
RESPONSE_COPY flag is set, any node generating a response MUST RESPONSE_COPY flag is set, any node generating a response MUST
copy the option from the request to the response except that the copy the option from the request to the response except that the
RESPONSE_COPY, FORWARD_CRITICAL and DESTINATION_CRITICAL flags RESPONSE_COPY, FORWARD_CRITICAL, and DESTINATION_CRITICAL flags
MUST be cleared. MUST be cleared.
length length
The length of the rest of the structure. Note that a 0 length may The length of the rest of the structure. Note that a 0 length may
be reasonable if the mere presence of the option is meaningful and be reasonable if the mere presence of the option is meaningful and
no value is required. no value is required.
option option
The option value. The option value.
skipping to change at page 55, line 38 skipping to change at page 53, line 29
struct { struct {
uint16 message_code; uint16 message_code;
opaque message_body<0..2^32-1>; opaque message_body<0..2^32-1>;
MessageExtension extensions<0..2^32-1>; MessageExtension extensions<0..2^32-1>;
} MessageContents; } MessageContents;
The contents of this structure are as follows: The contents of this structure are as follows:
message_code message_code
This indicates the message that is being sent. The code space is This indicates the message that is being sent. The code space is
broken up as follows. broken up as follows:
0 Reserved 0x0 Invalid Message Code. This code will never be assigned.
1 .. 0x7fff Requests and responses. These code points are always 0x1 .. 0x7FFF Requests and responses. These code points are
paired, with requests being odd and the corresponding response always paired, with requests being an odd value and the
being the request code plus 1. Thus, "probe_request" (the corresponding response being the request code plus 1. Thus,
Probe request) has value 1 and "probe_answer" (the Probe "probe_request" (the Probe request) has the value 1 and
response) has value 2 "probe_answer" (the Probe response) has the value 2
0x8000 .. 0xfffe Reserved 0x8000 .. 0xFFFE Reserved
0xffff Error 0xFFFF Error
The message codes are defined in Section 14.8 The message codes are defined in Section 14.8.
message_body message_body
The message body itself, represented as a variable-length string The message body itself, represented as a variable-length string
of bytes. The bytes themselves are dependent on the code value. of bytes. The bytes themselves are dependent on the code value.
See the sections describing the various RELOAD methods (Join, See the sections describing the various RELOAD methods (Join,
Update, Attach, Store, Fetch, etc.) for the definitions of the Update, Attach, Store, Fetch, etc.) for the definitions of the
payload contents. payload contents.
extensions extensions
Extensions to the message. Currently no extensions are defined, Extensions to the message. Currently no extensions are defined,
skipping to change at page 57, line 14 skipping to change at page 54, line 24
critical critical
Whether this extension needs to be understood in order to process Whether this extension needs to be understood in order to process
the message. If critical = True and the recipient does not the message. If critical = True and the recipient does not
understand the message, it MUST generate an understand the message, it MUST generate an
Error_Unknown_Extension error. If critical = False, the recipient Error_Unknown_Extension error. If critical = False, the recipient
MAY choose to process the message even if it does not understand MAY choose to process the message even if it does not understand
the extension. the extension.
extension_contents extension_contents
The contents of the extension (extension-dependent). The contents of the extension (which are extension dependent).
The subsections in Section 6.4.2, Section 6.5 and Section 7 describe The subsections 6.4.2, 6.5, and 7 describe structures that are
structures that are inserted inside the message_body member, inserted inside the message_body member, depending on the value of
depending on the value of the message_code value. For example a the message_code value. For example, a message_code value of
message_code value of join_req means that the structure named JoinReq join_req means that the structure named JoinReq is inserted inside
is inserted inside message_body. This document does not contain a message_body. This document does not contain a mapping between
mapping between message_code values and structure names as the message_code values and structure names, as the conversion between
conversion between the two is obvious. the two is obvious.
Similarly this document uses the name of the structure without the Similarly, this document uses the name of the structure without the
"Req" or "Ans" suffix to mean the execution of a transaction "Req" or "Ans" suffix to mean the execution of a transaction
comprised of the matching request and answer. For example when the consisting of the matching request and answer. For example, when the
text says "perform an Attach", it must be understood as performing a text says "perform an Attach", it must be understood as performing a
transaction composed of an AttachReq and an AttachAns. transaction composed of an AttachReq and an AttachAns.
6.3.3.1. Response Codes and Response Errors 6.3.3.1. Response Codes and Response Errors
A node processing a request MUST return its status in the A node processing a request MUST return its status in the
message_code field. If the request was a success, then the message message_code field. If the request was a success, then the message
code MUST be set to the response code that matches the request (i.e., code MUST be set to the response code that matches the request (i.e.,
the next code up). The response payload is then as defined in the the next code up). The response payload is then as defined in the
request/response descriptions. request/response descriptions.
If the request has failed, then the message code MUST be set to If the request has failed, then the message code MUST be set to
0xffff (error) and the payload MUST be an error_response message, as 0xffff (error) and the payload MUST be an error_response message, as
shown below. shown below.
When the message code is 0xffff, the payload MUST be an When the message code is 0xFFFF, the payload MUST be an
ErrorResponse. ErrorResponse:
public struct { public struct {
uint16 error_code; uint16 error_code;
opaque error_info<0..2^16-1>; opaque error_info<0..2^16-1>;
} ErrorResponse; } ErrorResponse;
The contents of this structure are as follows: The contents of this structure are as follows:
error_code error_code
A numeric error code indicating the error that occurred. A numeric error code indicating the error that occurred.
error_info error_info
An optional arbitrary byte string. Unless otherwise specified, An optional arbitrary byte string. Unless otherwise specified,
this will be a UTF-8 text string providing further information this will be a UTF-8 text string that provides further information
about what went wrong. Developers are encouraged to put enough about what went wrong. Developers are encouraged to include
diagnostic information to be useful in error_info. The specific enough diagnostic information to be useful in error_info. The
text to be used and any relevant language or encoding thereof is specific text to be used and any relevant language or encoding
left to the implementation. thereof is left to the implementation.
The following error code values are defined. The numeric values for The following error code values are defined. The numeric values for
these are defined in Section 14.9. these are defined in Section 14.9.
Error_Forbidden: The requesting node does not have permission to Error_Forbidden
make this request. The requesting node does not have permission to make this request.
Error_Not_Found: The resource or node cannot be found or does not Error_Not_Found
exist. The resource or node cannot be found or does not exist.
Error_Request_Timeout: A response to the request has not been Error_Request_Timeout
received in a suitable amount of time. The requesting node MAY A response to the request has not been received in a suitable
resend the request at a later time. 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 Error_Data_Too_Old
storage_time precedes the existing value. A store cannot be completed because the storage_time precedes the
existing value.
Error_Data_Too_Large: A store cannot be completed because the Error_Data_Too_Large
requested object exceeds the size limits for that Kind. 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 Error_Generation_Counter_Too_Low
because the generation counter precedes the existing value. A store cannot be completed because the generation counter
precedes the existing value.
Error_Incompatible_with_Overlay: A peer receiving the request is Error_Incompatible_with_Overlay
using a different overlay, overlay algorithm, or hash algorithm, A peer receiving the request is using a different overlay, overlay
or some other parameter that is inconsistent with the overlay algorithm, or hash algorithm, or some other parameter that is
configuration. inconsistent with the overlay configuration.
Error_Unsupported_Forwarding_Option: A node receiving the request Error_Unsupported_Forwarding_Option
with a forwarding options flagged as critical but the node does A node received the request with a forwarding options flagged as
not support this option. See section Section 6.3.2.3. critical, but the node does not support this option. See
Section 6.3.2.3.
Error_TTL_Exceeded: A peer receiving the request where the TTL got Error_TTL_Exceeded
decremented to zero. See section Section 6.3.2. A peer received the request in which the TTL was decremented to
zero. See Section 6.3.2.
Error_Message_Too_Large: A peer receiving the request that was too Error_Message_Too_Large
large. See section Section 6.6. A peer received a request that was too large. See Section 6.6.
Error_Response_Too_Large: A node would have generated a response Error_Response_Too_Large
that is too large per the max_response_length field. A node would have generated a response that is too large per the
max_response_length field.
Error_Config_Too_Old: A destination node received a request with a Error_Config_Too_Old
configuration sequence that's too old. See Section 6.3.2.1. A destination node received a request with a configuration
sequence that is too old. See Section 6.3.2.1.
Error_Config_Too_New: A destination node received a request with a Error_Config_Too_New
configuration sequence that's too new. See Section 6.3.2.1. A destination node received a request with a configuration
sequence that is too new. See Section 6.3.2.1.
Error_Unknown_Kind: A destination peer received a request with an Error_Unknown_Kind
unknown Kind-ID. See Section 7.4.1.2. A destination peer received a request with an unknown Kind-ID.
See Section 7.4.1.2.
Error_In_Progress: An Attach is already in progress to this peer. Error_In_Progress
See Section 6.5.1.2. An Attach to this peer is already in progress. See
Section 6.5.1.2.
Error_Unknown_Extension: A destination node received a request with Error_Unknown_Extension
an unknown extension. A destination node received a request with an unknown extension.
Error_Invalid_Message: Something about this message is invalid but Error_Invalid_Message
it doesn't fit the other error codes. When this message is sent, Something about this message is invalid, but it does not fit the
implementations SHOULD provide some meaningful description in other error codes. When this message is sent, implementations
error_info to aid in debugging. SHOULD provide some meaningful description in error_info to aid in
debugging.
Error_Exp_A: For the purposes of experimentation. Not meant for Error_Exp_A
vendor specific use of any sort and MUST NOT be used for For the purposes of experimentation. It is not meant for vendor-
operational deployments. specific use of any sort and MUST NOT be used for operational
deployments.
Error_Exp_B: For the purposes of experimentation. Not meant for Error_Exp_B
vendor specific use of any sort and MUST NOT be used for For the purposes of experimentation. It is not meant for vendor-
operational deployments. specific use of any sort and MUST NOT be used for operational
deployments.
6.3.4. Security Block 6.3.4. Security Block
The third part of a RELOAD message is the security block. The The third part of a RELOAD message is the security block. The
security block is represented by a SecurityBlock structure: security block is represented by a SecurityBlock structure:
struct { struct {
CertificateType type; CertificateType type; // From RFC 6091
opaque certificate<0..2^16-1>; opaque certificate<0..2^16-1>;
} GenericCertificate; } GenericCertificate;
struct { struct {
GenericCertificate certificates<0..2^16-1>; GenericCertificate certificates<0..2^16-1>;
Signature signature; Signature signature;
} SecurityBlock; } SecurityBlock;
The contents of this structure are: The contents of this structure are:
certificates certificates
A bucket of certificates. A bucket of certificates.
signature signature
A signature. A signature.
The certificates bucket SHOULD contain all the certificates necessary The certificates bucket SHOULD contain all the certificates necessary
to verify every signature in both the message and the internal to verify every signature in both the message and the internal
message objects, except for those certificates in a root-cert element message objects, except for those certificates in a root-cert element
of the current configuration file. This is the only location in the of the current configuration file. This is the only location in the
message which contains certificates, thus allowing for only a single message which contains certificates, thus allowing only a single copy
copy of each certificate to be sent. In systems that have an of each certificate to be sent. In systems that have an alternative
alternative certificate distribution mechanism, some certificates MAY certificate distribution mechanism, some certificates MAY be omitted.
be omitted. However, unless an alternative mechanism for immediately However, unless an alternative mechanism for immediately generating
generating certificates, such as shared secret security certificates, such as shared secret security (Section 13.4) is used,
(Section 13.4) is used, implementors MUST include all referenced implementers MUST include all referenced certificates.
certificates.
NOTE TO IMPLEMENTERS: This requirement implies that a peer storing NOTE TO IMPLEMENTERS: This requirement implies that a peer storing
data is obligated to retain certificates for the data it holds. data is obligated to retain certificates for the data that it holds.
Each certificate is represented by a GenericCertificate structure, Each certificate is represented by a GenericCertificate structure,
which has the following contents: which has the following contents:
type type
The type of the certificate, as defined in [RFC6091]. Only the The type of the certificate, as defined in [RFC6091]. Only the
use of X.509 certificates is defined in this document. use of X.509 certificates is defined in this document.
certificate certificate
The encoded version of the certificate. For X.509 certificates, The encoded version of the certificate. For X.509 certificates,
it is the DER form. it is the Distinguished Encoding Rules (DER) form.
The signature is computed over the payload and parts of the The signature is computed over the payload and parts of the
forwarding header. In case of a Store the payload MUST contain an forwarding header. In case of a Store, the payload MUST contain an
additional signature computed as described in Section 7.1. All additional signature computed as described in Section 7.1. All
signatures MUST be formatted using the Signature element. This signatures MUST be formatted using the Signature element. This
element is also used in other contexts where signatures are needed. element is also used in other contexts where signatures are needed.
The input structure to the signature computation MAY vary depending The input structure to the signature computation MAY vary depending
on the data element being signed. on the data element being signed.
enum { invalidSignerIdentityType(0), enum { invalidSignerIdentityType(0),
cert_hash(1), cert_hash_node_id(2), cert_hash(1), cert_hash_node_id(2),
none(3) none(3)
(255) } SignerIdentityType; (255) } SignerIdentityType;
skipping to change at page 62, line 44 skipping to change at page 59, line 15
SignatureAndHashAlgorithm algorithm; // From TLS SignatureAndHashAlgorithm algorithm; // From TLS
SignerIdentity identity; SignerIdentity identity;
opaque signature_value<0..2^16-1>; opaque signature_value<0..2^16-1>;
} Signature; } Signature;
The Signature construct contains the following values: The Signature construct contains the following values:
algorithm algorithm
The signature algorithm in use. The algorithm definitions are The signature algorithm in use. The algorithm definitions are
found in the IANA TLS SignatureAlgorithm and HashAlgorithm found in the IANA TLS SignatureAlgorithm and HashAlgorithm
Registries. All implementations MUST support RSASSA-PKCS1-v1_5 registries. All implementations MUST support RSASSA-PKCS1-v1_5
[RFC3447] signatures with SHA-256 hashes. [RFC3447] signatures with SHA-256 hashes [RFC6234].
identity identity
The identity, as defined in the two paragraphs following this The identity, as defined in the two paragraphs following this
list, used to form the signature. list, used to form the signature.
signature_value signature_value
The value of the signature. The value of the signature.
Note that storage operations allow for special values of algorithm Note that storage operations allow for special values of algorithm
and identity. See Store Request Definition (Section 7.4.1.1) and and identity. See the Store Request definition (Section 7.4.1.1)
Fetch Response Definition (Section 7.4.2.2). and the Fetch Response definition (Section 7.4.2.2).
There are two permitted identity formats, one for a certificate with There are two permitted identity formats, one for a certificate with
only one Node-ID and one for a certificate with multiple Node-IDs. only one Node-ID and one for a certificate with multiple Node-IDs.
In the first case, the cert_hash type MUST be used. The hash_alg In the first case, the cert_hash type MUST be used. The hash_alg
field is used to indicate the algorithm used to produce the hash. field is used to indicate the algorithm used to produce the hash.
The certificate_hash contains the hash of the certificate object The certificate_hash contains the hash of the certificate object
(i.e., the DER-encoded certificate). (i.e., the DER-encoded certificate).
In the second case, the cert_hash_node_id type MUST be used. The In the second case, the cert_hash_node_id type MUST be used. The
hash_alg is as in cert_hash but the cert_hash_node_id is computed hash_alg is as in cert_hash, but the cert_hash_node_id is computed
over the NodeId used to sign concatenated with the certificate. over the NodeId used to sign concatenated with the certificate; i.e.,
I.e., H(NodeId || certificate). The NodeId is represented without H(NodeId || certificate). The NodeId is represented without any
any framing or length fields, as simple raw bytes. This is safe framing or length fields, as simple raw bytes. This is safe because
because NodeIds are fixed-length for a given overlay. NodeIds are a fixed length for a given overlay.
For signatures over messages the input to the signature is computed For signatures over messages, the input to the signature is computed
over: over:
overlay || transaction_id || MessageContents || SignerIdentity overlay || transaction_id || MessageContents || SignerIdentity
where overlay and transaction_id come from the forwarding header and where overlay and transaction_id come from the forwarding header and
|| indicates concatenation. || indicates concatenation.
The input to signatures over data values is different, and is The input to signatures over data values is different and is
described in Section 7.1. described in Section 7.1.
All RELOAD messages MUST be signed. Intermediate nodes do not verify All RELOAD messages MUST be signed. Intermediate nodes do not verify
signatures. Upon receipt (and fragment reassembly if needed) the signatures. Upon receipt (and fragment reassembly, if needed), the
destination node MUST verify the signature and the authorizing destination node MUST verify the signature and the authorizing
certificate. If the signature fails, the implementation SHOULD certificate. If the signature fails, the implementation SHOULD
simply drop the message and MUST NOT process it. This check provides simply drop the message and MUST NOT process it. This check provides
a minimal level of assurance that the sending node is a valid part of a minimal level of assurance that the sending node is a valid part of
the overlay as well as cryptographic authentication of the sending the overlay, and it provides cryptographic authentication of the
node. In addition, responses MUST be checked as follows by the sending node. In addition, responses MUST be checked as follows by
requesting node: the requesting node:
1. The response to a message sent to a Node-ID MUST have been sent 1. The response to a message sent to a Node-ID MUST have been sent
by that Node-ID, unless it has being sent to the wildcard by that Node-ID unless the response has been sent to the wildcard
Node-ID. Node-ID.
2. The response to a message sent to a Resource-ID MUST have been 2. The response to a message sent to a Resource-ID MUST have been
sent by a Node-ID which is as close to or closer to the target sent by a Node-ID which is at least as close to the target
Resource-ID than any node in the requesting node's Neighbor Resource-ID as any node in the requesting node's Neighbor Table.
Table.
The second condition serves as a primitive check for responses from The second condition serves as a primitive check for responses from
wildly wrong nodes but is not a complete check. Note that in periods wildly wrong nodes but is not a complete check. Note that in periods
of churn, it is possible for the requesting node to obtain a closer of churn, it is possible for the requesting node to obtain a closer
neighbor while the request is outstanding. This will cause the neighbor while the request is outstanding. This will cause the
response to be rejected and the request to be retransmitted. response to be rejected and the request to be retransmitted.
In addition, some methods (especially Store) have additional In addition, some methods (especially Store) have additional
authentication requirements, which are described in the sections authentication requirements, which are described in the sections
covering those methods. covering those methods.
6.4. Overlay Topology 6.4. Overlay Topology
As discussed in previous sections RELOAD defines a default overlay As discussed in previous sections, RELOAD defines a default overlay
topology (CHORD-RELOAD) but allows for other topologies through the topology (CHORD-RELOAD) but allows for other topologies through the
use of Topology Plugins. This section describes the requirements for use of Topology Plug-ins. This section describes the requirements
new topology plugins and the methods that RELOAD provides for overlay for new Topology Plug-ins and the methods that RELOAD provides for
topology maintenance. overlay topology maintenance.
6.4.1. Topology Plugin Requirements 6.4.1. Topology Plug-in Requirements
When specifying a new overlay algorithm, at least the following MUST When specifying a new overlay algorithm, at least the following MUST
be described: be described:
o Joining procedures, including the contents of the Join message. o Joining procedures, including the contents of the Join message.
o Stabilization procedures, including the contents of the Update o Stabilization procedures, including the contents of the Update
message, the frequency of topology probes and keepalives, and the message, the frequency of topology probes and keepalives, and the
mechanism used to detect when peers have disconnected. mechanism used to detect when peers have disconnected.
o Exit procedures, including the contents of the Leave message. o Exit procedures, including the contents of the Leave message.
o The length of the Resource-IDs. For DHTs, the hash algorithm to o The length of the Resource-IDs and for DHTs the hash algorithm to
compute the hash of an identifier. compute the hash of an identifier.
o The procedures that peers use to route messages. o The procedures that peers use to route messages.
o The replication strategy used to ensure data redundancy. o The replication strategy used to ensure data redundancy.
All overlay algorithms MUST specify maintenance procedures that send All overlay algorithms MUST specify maintenance procedures that send
Updates to clients and peers that have established connections to the Updates to clients and peers that have established connections to the
peer responsible for a particular ID when the responsibility for that peer responsible for a particular ID when the responsibility for that
ID changes. Because tracking this information is difficult, overlay ID changes. Because tracking this information is difficult, overlay
algorithms MAY simply specify that an Update is sent to all members algorithms MAY simply specify that an Update is sent to all members
of the Connection Table whenever the range of IDs for which the peer of the Connection Table whenever the range of IDs for which the peer
is responsible changes. is responsible changes.
6.4.2. Methods and types for use by topology plugins 6.4.2. Methods and Types for Use by Topology Plug-ins
This section describes the methods that topology plugins use to join, This section describes the methods that Topology Plug-ins use to
leave, and maintain the overlay. join, leave, and maintain the overlay.
6.4.2.1. Join 6.4.2.1. Join
A new peer (but one that already has credentials) uses the JoinReq A new peer (which already has credentials) uses the JoinReq message
message to join the overlay. The JoinReq is sent to the responsible to join the overlay. The JoinReq is sent to the responsible peer
peer depending on the routing mechanism described in the topology depending on the routing mechanism described in the Topology Plug-in.
plugin. This notifies the responsible peer that the new peer is This message notifies the responsible peer that the new peer is
taking over some of the overlay and it needs to synchronize its taking over some of the overlay and that it needs to synchronize its
state. state.
struct { struct {
NodeId joining_peer_id; NodeId joining_peer_id;
opaque overlay_specific_data<0..2^16-1>; opaque overlay_specific_data<0..2^16-1>;
} JoinReq; } JoinReq;
The minimal JoinReq contains only the Node-ID which the sending peer The minimal JoinReq contains only the Node-ID which the sending peer
wishes to assume. Overlay algorithms MAY specify other data to wishes to assume. Overlay algorithms MAY specify other data to
appear in this request. Receivers of the JoinReq MUST verify that appear in this request. Receivers of the JoinReq MUST verify that
the joining_peer_id field matches the Node-ID used to sign the the joining_peer_id field matches the Node-ID used to sign the
message and if not MUST reject the message with an Error_Forbidden message and, if not, the message MUST be rejected with an
error. Error_Forbidden error.
Because joins may only be executed between nodes which are directly Because joins may be executed only between nodes which are directly
adjacent, receiving peers MUST verify that any JoinReq they receive adjacent, receiving peers MUST verify that any JoinReq they receive
arrives from a transport channel that is bound to the Node-ID to be arrives from a transport channel that is bound to the Node-ID to be
assumed by the joining node. This also prevents replay attacks assumed by the Joining Node. Implementations MUST use DTLS
provided that DTLS anti-replay is used. anti-replay mechanisms, thus preventing replay attacks.
If the request succeeds, the responding peer responds with a JoinAns If the request succeeds, the responding peer responds with a JoinAns
message, as defined below: message, as defined below:
struct { struct {
opaque overlay_specific_data<0..2^16-1>; opaque overlay_specific_data<0..2^16-1>;
} JoinAns; } JoinAns;
If the request succeeds, the responding peer MUST follow up by If the request succeeds, the responding peer MUST follow up by
executing the right sequence of Stores and Updates to transfer the executing the right sequence of Stores and Updates to transfer the
appropriate section of the overlay space to the joining node. In appropriate section of the overlay space to the Joining Node. In
addition, overlay algorithms MAY define data to appear in the addition, overlay algorithms MAY define data to appear in the
response payload that provides additional info. response payload that provides additional information.
Joining nodes MUST verify that the signature on the JoinAns message Joining Nodes MUST verify that the signature on the JoinAns message
matches the expected target (i.e., the adjacency over which they are matches the expected target (i.e., the adjacency over which they are
joining.) If not, they MUST discard the message. joining). If not, they MUST discard the message.
In general, nodes which cannot form connections SHOULD report an In general, nodes which cannot form connections SHOULD report an
error to the user. However, implementations MUST provide some error to the user. However, implementations MUST provide some
mechanism whereby nodes can determine that they are potentially the mechanism whereby nodes can determine that they are potentially the
first node and take responsibility for the overlay (the idea is to first node and can take responsibility for the overlay. (The idea is
avoid having ordinary nodes try to become responsible for the entire to avoid having ordinary nodes try to become responsible for the
overlay during a partition.) This specification does not mandate any entire overlay during a partition.) This specification does not
particular mechanism, but a configuration flag or setting seems mandate any particular mechanism, but a configuration flag or setting
appropriate. seems appropriate.
6.4.2.2. Leave 6.4.2.2. Leave
The LeaveReq message is used to indicate that a node is exiting the The LeaveReq message is used to indicate that a node is exiting the
overlay. A node SHOULD send this message to each peer with which it overlay. A node SHOULD send this message to each peer with which it
is directly connected prior to exiting the overlay. is directly connected prior to exiting the overlay.
struct { struct {
NodeId leaving_peer_id; NodeId leaving_peer_id;
opaque overlay_specific_data<0..2^16-1>; opaque overlay_specific_data<0..2^16-1>;
} LeaveReq; } LeaveReq;
LeaveReq contains only the Node-ID of the leaving peer. Overlay LeaveReq contains only the Node-ID of the leaving peer. Overlay
algorithms MAY specify other data to appear in this request. algorithms MAY specify other data to appear in this request.
Receivers of the LeaveReq MUST verify that the leaving_peer_id field Receivers of the LeaveReq MUST verify that the leaving_peer_id field
matches the Node-ID used to sign the message and if not MUST reject matches the Node-ID used to sign the message and, if not, the message
the message with an Error_Forbidden error. MUST be rejected with an Error_Forbidden error.
Because leaves may only be executed between nodes which are directly Because leaves may be executed only between nodes which are directly
adjacent, receiving peers MUST verify that any LeaveReq they receive adjacent, receiving peers MUST verify that any LeaveReq they receive
arrives from a transport channel that is bound to the Node-ID to be arrives from a transport channel that is bound to the Node-ID to be
assumed by the leaving peer. This also prevents replay attacks assumed by the leaving peer. This also prevents replay attacks,
provided that DTLS anti-replay is used. provided that DTLS anti-replay is used.
Upon receiving a Leave request, a peer MUST update its own Routing Upon receiving a Leave request, a peer MUST update its own Routing
Table, and send the appropriate Store/Update sequences to re- Table and send the appropriate Store/Update sequences to re-stabilize
stabilize the overlay. the overlay.
LeaveAns is an empty message.
6.4.2.3. Update 6.4.2.3. Update
Update is the primary overlay-specific maintenance message. It is Update is the primary overlay-specific maintenance message. It is
used by the sender to notify the recipient of the sender's view of 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 current state of the overlay (that is, its routing state), and it
the recipient to take whatever actions are appropriate to deal with is up to the recipient to take whatever actions are appropriate to
the state change. In general, peers send Update messages to all deal with the state change. In general, peers send Update messages
their adjacencies whenever they detect a topology shift. to all their adjacencies whenever they detect a topology shift.
When a peer receives an Attach request with the send_update flag set When a peer receives an Attach request with the send_update flag set
to True (Section 6.4.2.4.1), it MUST send an Update message back to to True (Section 6.4.2.4.1), it MUST send an Update message back to
the sender of the Attach request after the completion of the the sender of the Attach request after completion of the
corresponding ICE check and TLS connection. Note that the sender of corresponding ICE check and TLS connection. Note that the sender of
a such Attach request may not have joined the overlay yet. such an Attach request may not have joined the overlay yet.
When a peer detects through an Update that it is no longer When a peer detects through an Update that it is no longer
responsible for any data value it is storing, it MUST attempt to responsible for any data value it is storing, it MUST attempt to
Store a copy to the correct node unless it knows 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 responsible node already has a copy of the data. This prevents data
loss during large-scale topology shifts such as the merging of loss during large-scale topology shifts, such as the merging of
partitioned overlays. partitioned overlays.
The contents of the UpdateReq message are completely overlay- The contents of the UpdateReq message are completely overlay
specific. The UpdateAns response is expected to be either success or specific. The UpdateAns response is expected to be either success or
an error. an error.
6.4.2.4. RouteQuery 6.4.2.4. RouteQuery
The RouteQuery request allows the sender to ask a peer where they The RouteQuery request allows the sender to ask a peer where they
would route a message directed to a given destination. In other would route a message directed to a given destination. In other
words, a RouteQuery for a destination X requests the Node-ID for the words, a RouteQuery for a destination X requests the Node-ID for the
node that the receiving peer would next route to in order to get to node that the receiving peer would next route to in order to get to
X. A RouteQuery can also request that the receiving peer initiates an X. A RouteQuery can also request that the receiving peer initiate an
Update request to transfer the receiving peer's Routing Table. Update request to transfer the receiving peer's Routing Table.
One important use of the RouteQuery request is to support iterative One important use of the RouteQuery request is to support iterative
routing. The sender selects one of the peers in its Routing Table routing. The sender selects one of the peers in its Routing
and sends it a RouteQuery message with the destination field set to Table and sends it a RouteQuery message with the destination field
the Node-ID or Resource-ID it wishes to route to. The receiving peer set to the Node-ID or Resource-ID to which it wishes to route. The
responds with information about the peers to which the request would receiving peer responds with information about the peers to which the
be routed. The sending peer MAY then use the Attach method to attach request would be routed. The sending peer MAY then use the Attach
to that peer(s), and repeat the RouteQuery. Eventually, the sender method to attach to that peer(s) and repeat the RouteQuery.
gets a response from a peer that is closest to the identifier in the Eventually, the sender gets a response from a peer that is closest to
destination field as determined by the topology plugin. At that the identifier in the destination field as determined by the Topology
point, the sender can send messages directly to that peer. Plug-in. At that point, the sender can send messages directly to
that peer.
6.4.2.4.1. Request Definition 6.4.2.4.1. Request Definition
A RouteQueryReq message indicates the peer or resource that the A RouteQueryReq message indicates the peer or resource that the
requesting node is interested in. It also contains a "send_update" requesting node is interested in. It also contains a "send_update"
option allowing the requesting node to request a full copy of the option that allows the requesting node to request a full copy of the
other peer's Routing Table. other peer's Routing Table.
struct { struct {
Boolean send_update; Boolean send_update;
Destination destination; Destination destination;
opaque overlay_specific_data<0..2^16-1>; opaque overlay_specific_data<0..2^16-1>;
} RouteQueryReq; } RouteQueryReq;
The contents of the RouteQueryReq message are as follows: The contents of the RouteQueryReq message are as follows:
send_update send_update
A single byte. This may be set to True to indicate that the A single byte. This may be set to True to indicate that the
requester wishes the responder to initiate an Update request requester wishes the responder to initiate an Update request
immediately. Otherwise, this value MUST be set to False. immediately. Otherwise, this value MUST be set to False.
destination destination
The destination which the requester is interested in. This may be The destination which the requester is interested in. This may be
any valid destination object, including a Node-ID, opaque ID, or any valid destination object, including a Node-ID, opaque ID, or
Resource-ID. Resource-ID.
Note: If implementations are using opaque IDs for privacy
purposes, answering RouteQueryReqs for opaque IDs will allow the
requester to translate an opaque ID. Implementations MAY wish to
consider limiting the use of RouteQuery for opaque IDs in such
cases.
overlay_specific_data overlay_specific_data
Other data as appropriate for the overlay. Other data as appropriate for the overlay.
6.4.2.4.2. Response Definition 6.4.2.4.2. Response Definition
A response to a successful RouteQueryReq request is a RouteQueryAns A response to a successful RouteQueryReq request is a RouteQueryAns
message. This is completely overlay specific. message. This message is completely overlay specific.
6.4.2.5. Probe 6.4.2.5. Probe
Probe provides primitive "exploration" services: it allows a node to Probe provides primitive "exploration" services: it allows a node to
determine which resources another node is responsible for. A probe determine which resources another node is responsible for. A probe
can be addressed to a specific Node-ID, or the peer controlling a can be addressed to a specific Node-ID or to the peer controlling a
given location (by using a Resource-ID). In either case, the target given location (by using a Resource-ID). In either case, the target
node responds with a simple response containing some status node responds with a simple response containing some status
information. information.
6.4.2.5.1. Request Definition 6.4.2.5.1. Request Definition
The ProbeReq message contains a list (potentially empty) of the The ProbeReq message contains a list (potentially empty) of the
pieces of status information that the requester would like the pieces of status information that the requester would like the
responder to provide. responder to provide.
skipping to change at page 69, line 22 skipping to change at page 65, line 36
num_resources(2), uptime(3), (255) } num_resources(2), uptime(3), (255) }
ProbeInformationType; ProbeInformationType;
struct { struct {
ProbeInformationType requested_info<0..2^8-1>; ProbeInformationType requested_info<0..2^8-1>;
} ProbeReq; } ProbeReq;
The currently defined values for ProbeInformationType are: The currently defined values for ProbeInformationType are:
responsible_set responsible_set
indicates that the peer should Respond with the fraction of the Indicates that the peer should Respond with the fraction of the
overlay for which the responding peer is responsible. overlay for which the responding peer is responsible.
num_resources num_resources
indicates that the peer should Respond with the number of Indicates that the peer should Respond with the number of
resources currently being stored by the peer. resources currently being stored by the peer. Note that multiple
values under the same Resource-ID are counted only once.
uptime uptime
indicates that the peer should Respond with how long the peer has Indicates that the peer should Respond with how long the peer has
been up in seconds. been up, in seconds.
6.4.2.5.2. Response Definition 6.4.2.5.2. Response Definition
A successful ProbeAns response contains the information elements A successful ProbeAns response contains the information elements
requested by the peer. requested by the peer.
struct { struct {
select (type) { select (type) {
case responsible_set: case responsible_set:
uint32 responsible_ppb; uint32 responsible_ppb;
skipping to change at page 70, line 37 skipping to change at page 66, line 42
ProbeInformation probe_info<0..2^16-1>; ProbeInformation probe_info<0..2^16-1>;
} ProbeAns; } ProbeAns;
A ProbeAns message contains a sequence of ProbeInformation A ProbeAns message contains a sequence of ProbeInformation
structures. Each has a "length" indicating the length of the structures. Each has a "length" indicating the length of the
following value field. This structure allows for unknown option following value field. This structure allows for unknown option
types. types.
Each of the current possible Probe information types is a 32-bit Each of the current possible Probe information types is a 32-bit
unsigned integer. For type "responsible_ppb", it is the fraction of unsigned integer. For type "responsible_ppb", it is the fraction of
the overlay for which the peer is responsible in parts per billion. 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 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 storing. For the type "uptime", it is the number of seconds the peer
has been up. has been up.
The responding peer SHOULD include any values that the requesting The responding peer SHOULD include any values that the requesting
node requested and that it recognizes. They SHOULD be returned in node requested and that it recognizes. They SHOULD be returned in
the requested order. Any other values MUST NOT be returned. the requested order. Any other values MUST NOT be returned.
6.5. Forwarding and Link Management Layer 6.5. Forwarding and Link Management Layer
Each node maintains connections to a set of other nodes defined by Each node maintains connections to a set of other nodes defined by
the topology plugin. This section defines the methods RELOAD uses to the Topology Plug-in. This section defines the methods RELOAD uses
form and maintain connections between nodes in the overlay. Three to form and maintain connections between nodes in the overlay. Three
methods are defined: methods are defined:
Attach: used to form RELOAD connections between nodes using ICE Attach
for NAT traversal. When node A wants to connect to node B, it Used to form RELOAD connections between nodes using ICE for NAT
sends an Attach message to node B through the overlay. The Attach traversal. When node A wants to connect to node B, it sends an
contains A's ICE parameters. B responds with its ICE parameters Attach message to node B through the overlay. The Attach contains
and the two nodes perform ICE to form connection. Attach also A's ICE parameters. B responds with its ICE parameters, and the
allows two nodes to connect via No-ICE instead of full ICE. two nodes perform ICE to form connection. Attach also allows two
nodes to connect via No-ICE instead of full ICE.
AppAttach: used to form application layer connections between AppAttach
nodes. Used to form application-layer connections between nodes.
Ping: is a simple request/response which is used to verify Ping
connectivity of the target peer. A simple request/response which is used to verify connectivity of
the target peer.
6.5.1. Attach 6.5.1. Attach
A node sends an Attach request when it wishes to establish a direct A node sends an Attach request when it wishes to establish a direct
Overlay Link connection to another node for the purpose of sending Overlay Link connection to another node for the purpose of sending
RELOAD messages. A client that can establish a connection directly RELOAD messages. A client that can establish a connection directly
need not send an Attach as described in the second bullet of need not send an Attach, as described in the second bullet of
Section 3.2.1 Section 4.2.1.
As described in Section 6.1, an Attach may be routed to either a As described in Section 6.1, an Attach may be routed to either a
Node-ID or to a Resource-ID. An Attach routed to a specific Node-ID Node-ID or a Resource-ID. An Attach routed to a specific Node-ID
will fail if that node is not reached. An Attach routed to a will fail if that node is not reached. An Attach routed to a
Resource-ID will establish a connection with the peer currently Resource-ID will establish a connection with the peer currently
responsible for that Resource-ID, which may be useful in establishing responsible for that Resource-ID, which may be useful in establishing
a direct connection to the responsible peer for use with frequent or a direct connection to the responsible peer for use with frequent or
large resource updates. large resource updates.
An Attach in and of itself does not result in updating the Routing An Attach, in and of itself, does not result in updating the Routing
Table of either node. That function is performed by Updates. If Table of either node. That function is performed by Updates. If
node A has Attached to node B, but not received any Updates from B, node A has Attached to node B, but has not received any Updates from
it MAY route messages which are directly addressed to B through that B, it MAY route messages which are directly addressed to B through
channel but MUST NOT route messages through B to other peers via that that channel, but it MUST NOT route messages through B to other peers
channel. The process of Attaching is separate from the process of via that channel. The process of Attaching is separate from the
becoming a peer (using Join and Update), to prevent half-open states process of becoming a peer (using Join and Update), to prevent half-
where a node has started to form connections but is not really ready open states where a node has started to form connections but is not
to act as a peer. Thus, clients (unlike peers) can simply Attach really ready to act as a peer. Thus, clients (unlike peers) can
without sending Join or Update. simply Attach without sending Join or Update.
6.5.1.1. Request Definition 6.5.1.1. Request Definition
An Attach request message contains the requesting node ICE connection An Attach request message contains the requesting node ICE connection
parameters formatted into a binary structure. parameters formatted into a binary structure.
enum { invalidOverlayLinkType(0), DTLS-UDP-SR(1), enum { invalidOverlayLinkType(0), DTLS-UDP-SR(1),
DTLS-UDP-SR-NO-ICE(3), TLS-TCP-FH-NO-ICE(4), DTLS-UDP-SR-NO-ICE(3), TLS-TCP-FH-NO-ICE(4),
(255) } OverlayLinkType; (255) } OverlayLinkType;
enum { invalidCandType(0), enum { invalidCandType(0),
host(1), srflx(2), prflx(3), relay(4), host(1), srflx(2), /* RESERVED(3), */ relay(4),
(255) } CandType; (255) } CandType;
struct { struct {
opaque name<0..2^16-1>; opaque name<0..2^16-1>;
opaque value<0..2^16-1>; opaque value<0..2^16-1>;
} IceExtension; } IceExtension;
struct { struct {
IpAddressPort addr_port; IpAddressPort addr_port;
OverlayLinkType overlay_link; OverlayLinkType overlay_link;
opaque foundation<0..255>; opaque foundation<0..255>;
uint32 priority; uint32 priority;
CandType type; CandType type;
select (type) { select (type) {
case host: case host:
; /* Empty */ ; /* Empty */
case srflx: case srflx:
case prflx:
case relay: case relay:
IpAddressPort rel_addr_port; IpAddressPort rel_addr_port;
}; };
IceExtension extensions<0..2^16-1>; IceExtension extensions<0..2^16-1>;
} IceCandidate; } IceCandidate;
struct { struct {
opaque ufrag<0..2^8-1>; opaque ufrag<0..2^8-1>;
opaque password<0..2^8-1>; opaque password<0..2^8-1>;
opaque role<0..2^8-1>; opaque role<0..2^8-1>;
skipping to change at page 73, line 13 skipping to change at page 69, line 10
The values contained in AttachReqAns are: The values contained in AttachReqAns are:
ufrag ufrag
The username fragment (from ICE). The username fragment (from ICE).
password password
The ICE password. The ICE password.
role role
An active/passive/actpass attribute from RFC 4145 [RFC4145]. This An active/passive/actpass attribute from RFC 4145 [RFC4145]. This
value MUST be 'passive' for the offerer (the peer sending the value MUST be "passive" for the offerer (the peer sending the
Attach request) and 'active' for the answerer (the peer sending Attach request) and "active" for the answerer (the peer sending
the Attach response). the Attach response).
candidates candidates
One or more ICE candidate values, as described below. One or more ICE candidate values, as described below.
send_update send_update
Has the same meaning as the send_update field in RouteQueryReq. Has the same meaning as the send_update field in RouteQueryReq.
Each ICE candidate is represented as an IceCandidate structure, which Each ICE candidate is represented as an IceCandidate structure, which
is a direct translation of the information from the ICE string is a direct translation of the information from the ICE string
structures, with the exception of the component ID. Since there is structures, with the exception of the component ID. Since there is
only one component, it is always 1, and thus left out of the only one component, it is always 1, and thus left out of the
structure. The remaining values are specified as follows: structure. The remaining values are specified as follows:
addr_port addr_port
corresponds to the ICE connection-address and port productions. Corresponds to the ICE connection-address and port productions.
overlay_link overlay_link
corresponds to the ICE transport production, Overlay Link Corresponds to the ICE transport production. Overlay Link
protocols used with No-ICE MUST specify "No-ICE" in their protocols used with No-ICE MUST specify "No-ICE" in their
description. Future overlay link values can be added by defining description. Future overlay link values can be added by defining
new OverlayLinkType values in the IANA registry in Section 14.10. new OverlayLinkType values in the IANA registry as described in
Future extensions to the encapsulation or framing, that provide Section 14.10. Future extensions to the encapsulation or framing
for backward compatibility with the previously specified that provide for backward compatibility with the previously
encapsulation or framing, values MUST use that same specified encapsulation or framing values MUST use the same
OverlayLinkType value that was previously defined. OverlayLinkType value that was previously defined.
OverlayLinkType protocols are defined in Section 6.6 OverlayLinkType protocols are defined in Section 6.6
A single AttachReqAns MUST NOT include both candidates whose A single AttachReqAns MUST NOT include both candidates whose
OverlayLinkType protocols use ICE (the default) and candidates OverlayLinkType protocols use ICE (the default) and candidates
that specify "No-ICE". that specify "No-ICE".
foundation foundation
corresponds to the ICE foundation production. Corresponds to the ICE foundation production.
priority priority
corresponds to the ICE priority production. Corresponds to the ICE priority production.
type type
corresponds to the ICE cand-type production. Corresponds to the ICE cand-type production.
rel_addr_port rel_addr_port
corresponds to the ICE rel-addr and rel-port productions. Only Corresponds to the ICE rel-addr and rel-port productions. It is
present for types "relay", "srflx" and "prflx". present only for types "relay", "prfix", and "srflx".
extensions extensions
ICE extensions. The name and value fields correspond to binary ICE extensions. The name and value fields correspond to binary
translations of the equivalent fields in the ICE extensions. translations of the equivalent fields in the ICE extensions.
These values should be generated using the procedures described in These values should be generated using the procedures described in
Section 6.5.1.3. Section 6.5.1.3.
6.5.1.2. Response Definition 6.5.1.2. Response Definition
If a peer receives an Attach request, it MUST determine how to If a peer receives an Attach request, it MUST determine how to
process the request as follows: process the request as follows:
o If it has not initiated an Attach request to the originating peer o If the peer has not initiated an Attach request to the originating
of this Attach request, it MUST process this request and SHOULD peer of this Attach request, it MUST process this request and
generate its own response with an AttachReqAns. It should then SHOULD generate its own response with an AttachReqAns. It should
begin ICE checks. then begin ICE checks.
o If it has already sent an Attach request to and received the o If the peer has already sent an Attach request to and received the
response from the originating peer of this Attach request, and as response from the originating peer of this Attach request and, as
a result, an ICE check and TLS connection is in progress, then it a result, an ICE check and TLS connection are in progress, then it
SHOULD generate an Error_In_Progress error instead of an SHOULD generate an Error_In_Progress error instead of an
AttachReqAns. AttachReqAns.
o If it has already sent an Attach request to but not yet received o If the peer has already sent an Attach request to but not yet
the response from the originating peer of this Attach request, it received the response from the originating peer of this Attach
SHOULD apply the following tie-breaker heuristic to determine how request, it SHOULD apply the following tie-breaker heuristic to
to handle this Attach request and the incomplete Attach request it determine how to handle this Attach request and the incomplete
has sent out: Attach request it has sent out:
* If the peer's own Node-ID is smaller when compared as big- * If the peer's own Node-ID is smaller when compared as big-
endian unsigned integers, it MUST cancel retransmission of its endian unsigned integers, it MUST cancel retransmission of its
own incomplete Attach request. It MUST then process this own incomplete Attach request. It MUST then process this
Attach request, generate an AttachReqAns response, and proceed Attach request, generate an AttachReqAns response, and proceed
with the corresponding ICE check. with the corresponding ICE check.
* If the peer's own Node-ID is larger when compared as big-endian * If the peer's own Node-ID is larger when compared as big-endian
unsigned integers, it MUST generate an Error_In_Progress error unsigned integers, it MUST generate an Error_In_Progress error
to this Attach request, then proceed to wait for and complete to this Attach request, and then proceed to wait for and
the Attach and the corresponding ICE check it has originated. complete the Attach and the corresponding ICE check it has
originated.
o If the peer is overloaded or detects some other kind of error, it o If the peer is overloaded or detects some other kind of error, it
MAY generate an error instead of an AttachReqAns. MAY generate an error instead of an AttachReqAns.
When a peer receives an Attach response, it SHOULD parse the response When a peer receives an Attach response, it SHOULD parse the response
and begin its own ICE checks. and begin its own ICE checks.
6.5.1.3. Using ICE With RELOAD 6.5.1.3. Using ICE with RELOAD
This section describes the profile of ICE that is used with RELOAD. This section describes the profile of ICE that is used with RELOAD.
RELOAD implementations MUST implement full ICE. RELOAD implementations MUST implement full ICE.
In ICE as defined by [RFC5245], SDP is used to carry the ICE In ICE, as defined by [RFC5245], the Session Description Protocol
parameters. In RELOAD, this function is performed by a binary (SDP) is used to carry the ICE parameters. In RELOAD, this function
encoding in the Attach method. This encoding is more restricted than is performed by a binary encoding in the Attach method. This
the SDP encoding because the RELOAD environment is simpler: encoding is more restricted than the SDP encoding because the RELOAD
environment is simpler:
o Only a single media stream is supported. o Only a single media stream is supported.
o In this case, the "stream" refers not to RTP or other types of o In this case, the "stream" refers not to RTP or other types of
media, but rather to a connection for RELOAD itself or other media, but rather to a connection for RELOAD itself or other
application-layer protocols such as SIP. application-layer protocols, such as SIP.
o RELOAD only allows for a single offer/answer exchange. Unlike the o RELOAD allows only for a single offer/answer exchange. Unlike the
usage of ICE within SIP, there is never a need to send a usage of ICE within SIP, there is never a need to send a
subsequent offer to update the default candidates to match the subsequent offer to update the default candidates to match the
ones selected by ICE. ones selected by ICE.
An agent follows the ICE specification as described in [RFC5245] with An agent follows the ICE specification as described in [RFC5245] with
the changes and additional procedures described in the subsections the changes and additional procedures described in the subsections
below. below.
6.5.1.4. Collecting STUN Servers 6.5.1.4. Collecting STUN Servers
ICE relies on the node having one or more STUN servers to use. In ICE relies on the node having one or more Session Traversal Utilities
conventional ICE, it is assumed that nodes are configured with one or for NAT (STUN) servers to use. In conventional ICE, it is assumed
more STUN servers through some out of band mechanism. This is still that nodes are configured with one or more STUN servers through some
possible in RELOAD but RELOAD also learns STUN servers as it connects out-of-band mechanism. This is still possible in RELOAD, but RELOAD
to other peers. Because all RELOAD peers implement ICE and use STUN also learns STUN servers as it connects to other peers.
keepalives, every peer is a capable of responding to STUN Binding
requests [RFC5389]. Accordingly, any peer that a node knows about
can be used like a STUN server -- though of course it may be behind a
NAT.
A peer on a well-provisioned wide-area overlay will be configured A peer on a well-provisioned wide-area overlay will be configured
with one or more bootstrap nodes. These nodes make an initial list with one or more bootstrap nodes. These nodes make an initial list
of STUN servers. However, as the peer forms connections with of STUN servers. However, as the peer forms connections with
additional peers, it builds more peers it can use like STUN servers. additional peers, it builds more peers that it can use like STUN
servers.
Because complicated NAT topologies are possible, a peer may need more Because complicated NAT topologies are possible, a peer may need more
than one STUN server. Specifically, a peer that is behind a single than one STUN server. Specifically, a peer that is behind a single
NAT will typically observe only two IP addresses in its STUN checks: NAT will typically observe only two IP addresses in its STUN checks:
its local address and its server reflexive address from a STUN server its local address and its server reflexive address from a STUN server
outside its NAT. However, if there are more NATs involved, it may outside its NAT. However, if more NATs are involved, a peer may
learn additional server reflexive addresses (which vary based on learn additional server reflexive addresses (which vary based on
where in the topology the STUN server is). To maximize the chance of 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 achieving a direct connection, a peer SHOULD group other peers by the
peer-reflexive addresses it discovers through them. It SHOULD then peer-reflexive addresses it discovers through them. It SHOULD then
select one peer from each group to use as a STUN server for future select one peer from each group to use as a STUN server for future
connections. connections.
Only peers to which the peer currently has connections may be used. 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 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 MUST be 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 selected unless there are no others servers in the group, in which
case some other peer MAY be used. case some other peer MAY be used.
6.5.1.5. Gathering Candidates 6.5.1.5. Gathering Candidates
When a node wishes to establish a connection for the purposes of When a node wishes to establish a connection for the purposes of
RELOAD signaling or application signaling, it follows the process of RELOAD signaling or application signaling, it follows the process of
gathering candidates as described in Section 4 of ICE [RFC5245]. gathering candidates as described in Section 4 of ICE [RFC5245].
RELOAD utilizes a single component. Consequently, gathering for RELOAD utilizes a single component. Consequently, gathering for
these "streams" requires a single component. In the case where a 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 node has not yet found a TURN server, the agent would not include a
relayed candidate. relayed candidate.
The ICE specification assumes that an ICE agent is configured with, The ICE specification assumes that an ICE agent is configured with,
or somehow knows of, TURN and STUN servers. RELOAD provides a way 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 for an agent to learn these by querying the overlay, as described in
Section 6.5.1.4 and Section 9. Sections 6.5.1.4 and 9.
The default candidate selection described in Section 4.1.4 of ICE is The default candidate selection described in Section 4.1.4 of ICE is
ignored; defaults are not signaled or utilized by RELOAD. ignored; defaults are not signaled or utilized by RELOAD.
An alternative to using the full ICE supported by the Attach request An alternative to using the full ICE supported by the Attach request
is to use No-ICE mechanism by providing candidates with "No-ICE" is to use the No-ICE mechanism by providing candidates with "No-ICE"
Overlay Link protocols. Configuration for the overlay indicates Overlay Link protocols. Configuration for the overlay indicates
whether or not these Overlay Link protocols can be used. An overlay whether or not these Overlay Link protocols can be used. An overlay
MUST be either all ICE or all No-ICE. MUST be either all ICE or all No-ICE.
No-ICE will not work in all of the scenarios where ICE would work, No-ICE will not work in all the scenarios where ICE would work, but
but in some cases, particularly those with no NATs or firewalls, it in some cases, particularly those with no NATs or firewalls, it will
will work. work.
6.5.1.6. Prioritizing Candidates 6.5.1.6. Prioritizing Candidates
However, standardization of additional protocols for use with ICE is Standardization of additional protocols for use with ICE is expected,
expected, including TCP [RFC6544] and protocols such as SCTP including TCP [RFC6544] and protocols such as the Stream Control
[RFC4960] and DCCP [RFC4340]. UDP encapsulations for SCTP and DCCP Transmission Protocol (SCTP) [RFC4960] and Datagram Congestion
would expand the available Overlay Link protocols available for Control Protocol (DCCP) [RFC4340]. UDP encapsulations for SCTP and
RELOAD. When additional protocols are available, the following DCCP would expand the Overlay Link protocols available for RELOAD.
prioritization is RECOMMENDED:
When additional protocols are available, the following prioritization
is RECOMMENDED:
o Highest priority is assigned to protocols that offer well- o Highest priority is assigned to protocols that offer well-
understood congestion and flow control without head of line understood congestion and flow control without head-of-line
blocking. For example, SCTP without message ordering, DCCP, or blocking, for example, SCTP without message ordering, DCCP, and
those protocols encapsulated using UDP. those protocols encapsulated using UDP.
o Second highest priority is assigned to protocols that offer well- o Second highest priority is assigned to protocols that offer well-
understood congestion and flow control but have head of line understood congestion and flow control, but that have head-of-line
blocking such as TCP. blocking, such as TCP.
o Lowest priority is assigned to protocols encapsulated over UDP o Lowest priority is assigned to protocols encapsulated over UDP
that do not implement well-established congestion control that do not implement well-established congestion control
algorithms. The DTLS/UDP with SR overlay link protocol is an algorithms. The DTLS/UDP with Simple Reliability (SR) overlay
example of such a protocol. link protocol is an example of such a protocol.
Head of line blocking is undesirable in an Overlay Link protocol Head-of-line blocking is undesirable in an Overlay Link protocol,
because the messages carried on a RELOAD link are independent, rather because the messages carried on a RELOAD link are independent, rather
than stream-oriented. Therefore, if message N on a link is lost, than stream-oriented. Therefore, if message N on a link is lost,
delaying message N+1 on that same link until N is successfully delaying message N+1 on that same link until N is successfully
retransmitted does nothing other than increase the latency for the retransmitted does nothing other than increase the latency for the
transaction of message N+1 as they are unrelated to each other. transaction of message N+1, as they are unrelated to each other.
Therefore, while the high quality, performance, and availability of Therefore, while the high quality, performance, and availability of
modern TCP implementations makes them very attractive, their modern TCP implementations makes them very attractive, their
performance as an Overlay Link protocol is not optimal. performance as Overlay Link protocols is not optimal.
Note that none of the protocols defined in this document meets these Note that none of the protocols defined in this document meets these
conditions, but it is expected that new Overlay link protocols conditions, but it is expected that new Overlay Link protocols
defined in the future will fill this gap. defined in the future will fill this gap.
6.5.1.7. Encoding the Attach Message 6.5.1.7. Encoding the Attach Message
Section 4.3 of ICE describes procedures for encoding the SDP for Section 4.3 of ICE describes procedures for encoding the SDP for
conveying RELOAD candidates. Instead of actually encoding an SDP conveying RELOAD candidates. Instead of actually encoding an SDP
message, the candidate information (IP address and port and transport message, the candidate information (IP address and port and transport
protocol, priority, foundation, type and related address) is carried protocol, priority, foundation, type, and related address) is carried
within the attributes of the Attach request or its response. within the attributes of the Attach request or its response.
Similarly, the username fragment and password are carried in the Similarly, the username fragment and password are carried in the
Attach message or its response. Section 6.5.1 describes the detailed Attach message or its response. Section 6.5.1 describes the detailed
attribute encoding for Attach. The Attach request and its response attribute encoding for Attach. The Attach request and its response
do not contain any default candidates or the ice-lite attribute, as do not contain any default candidates or the ice-lite attribute, as
these features of ICE are not used by RELOAD. these features of ICE are not used by RELOAD.
Since the Attach request contains the candidate information and short Since the Attach request contains the candidate information and short
term credentials, it is considered as an offer for a single media term credentials, it is considered as an offer for a single media
stream that happens to be encoded in a format different than SDP, but stream that happens to be encoded in a format different than SDP, but
is otherwise considered a valid offer for the purposes of following is otherwise considered a valid offer for the purposes of following
the ICE specification. Similarly, the Attach response is considered the ICE specification. Similarly, the Attach response is considered
a valid answer for the purposes of following the ICE specification. a valid answer for the purposes of following the ICE specification.
6.5.1.8. Verifying ICE Support 6.5.1.8. Verifying ICE Support
An agent MUST skip the verification procedures in Section 5.1 and 6.1 An agent MUST skip the verification procedures in Sections 5.1 and
of ICE. Since RELOAD requires full ICE from all agents, this check 6.1 of ICE. Since RELOAD requires full ICE from all agents, this
is not required. check is not required.
6.5.1.9. Role Determination 6.5.1.9. Role Determination
The roles of controlling and controlled as described in Section 5.2 The roles of controlling and controlled, as described in Section 5.2
of ICE are still utilized with RELOAD. However, the offerer (the of ICE, are still utilized with RELOAD. However, the offerer (the
entity sending the Attach request) will always be controlling, and entity sending the Attach request) will always be controlling, and
the answerer (the entity sending the Attach response) will always be the answerer (the entity sending the Attach response) will always be
controlled. The connectivity checks MUST still contain the ICE- controlled. The connectivity checks MUST still contain the ICE-
CONTROLLED and ICE-CONTROLLING attributes, however, even though the CONTROLLED and ICE-CONTROLLING attributes, however, even though the
role reversal capability for which they are defined will never be role reversal capability for which they are defined will never be
needed with RELOAD. This is to allow for a common codebase between needed with RELOAD. This is to allow for a common codebase between
ICE for RELOAD and ICE for SDP. ICE for RELOAD and ICE for SDP.
6.5.1.10. Full ICE 6.5.1.10. Full ICE
skipping to change at page 79, line 26 skipping to change at page 74, line 46
6.5.1.10.2. Concluding ICE 6.5.1.10.2. Concluding ICE
The procedures in Section 8 of ICE are followed to conclude ICE, with The procedures in Section 8 of ICE are followed to conclude ICE, with
the following exceptions: the following exceptions:
o The controlling agent MUST NOT attempt to send an updated offer o The controlling agent MUST NOT attempt to send an updated offer
once the state of its single media stream reaches Completed. once the state of its single media stream reaches Completed.
o Once the state of ICE reaches Completed, the agent can immediately o Once the state of ICE reaches Completed, the agent can immediately
free all unused candidates. This is because RELOAD does not have free all unused candidates. This is because RELOAD does not have
the concept of forking, and thus the three second delay in Section the concept of forking, and thus the three-second delay in
8.3 of ICE does not apply. Section 8.3 of ICE does not apply.
6.5.1.10.3. Media Keepalives 6.5.1.10.3. Media Keepalives
STUN MUST be utilized for the keepalives described in Section 10 of STUN MUST be utilized for the keepalives described in Section 10 of
ICE. ICE.
6.5.1.11. No-ICE 6.5.1.11. No-ICE
No-ICE is selected when either side has provided "no ICE" Overlay No-ICE is selected when either side has provided "no ICE" Overlay
Link candidates. STUN is not used for connectivity checks when doing Link candidates. STUN is not used for connectivity checks when doing
No-ICE; instead the DTLS or TLS handshake (or similar security layer No-ICE; instead, the DTLS or TLS handshake (or similar security layer
of future overlay link protocols) forms the connectivity check. The of future overlay link protocols) forms the connectivity check. The
certificate exchanged during the (D)TLS handshake MUST match the node certificate exchanged during the TLS or DTLS handshake MUST match the
that sent the AttachReqAns and if it does not, the connection MUST be node which sent the AttachReqAns, and if it does not, the connection
closed. MUST be closed.
6.5.1.12. Subsequent Offers and Answers 6.5.1.12. Subsequent Offers and Answers
An agent MUST NOT send a subsequent offer or answer. Thus, the An agent MUST NOT send a subsequent offer or answer. Thus, the
procedures in Section 9 of ICE MUST be ignored. procedures in Section 9 of ICE MUST be ignored.
6.5.1.13. Sending Media 6.5.1.13. Sending Media
The procedures of Section 11 of ICE apply to RELOAD as well. The procedures of Section 11 of ICE apply to RELOAD as well.
However, in this case, the "media" takes the form of application However, in this case, the "media" takes the form of application-
layer protocols (e.g., RELOAD) over TLS or DTLS. Consequently, once layer protocols (e.g., RELOAD) over TLS or DTLS. Consequently, once
ICE processing completes, the agent will begin TLS or DTLS procedures ICE processing completes, the agent will begin TLS or DTLS procedures
to establish a secure connection. The node which sent the Attach to establish a secure connection. The node that sent the Attach
request MUST be the TLS server. The other node MUST be the TLS request MUST be the TLS server. The other node MUST be the TLS
client. The server MUST request TLS client authentication. The client. The server MUST request TLS client authentication. The
nodes MUST verify that the certificate presented in the handshake nodes MUST verify that the certificate presented in the handshake
matches the identity of the other peer as found in the Attach matches the identity of the other peer as found in the Attach
message. Once the TLS or DTLS signaling is complete, the application message. Once the TLS or DTLS signaling is complete, the application
protocol is free to use the connection. protocol is free to use the connection.
The concept of a previous selected pair for a component does not The concept of a previous selected pair for a component does not
apply to RELOAD, since ICE restarts are not possible with RELOAD. apply to RELOAD, since ICE restarts are not possible with RELOAD.
6.5.1.14. Receiving Media 6.5.1.14. Receiving Media
An agent MUST be prepared to receive packets for the application An agent MUST be prepared to receive packets for the application
protocol (TLS or DTLS carrying RELOAD) at any time. The jitter and protocol (TLS or DTLS carrying RELOAD) at any time. The jitter and
RTP considerations in Section 11 of ICE do not apply to RELOAD. RTP considerations in Section 11 of ICE do not apply to RELOAD.
6.5.2. AppAttach 6.5.2. AppAttach
A node sends an AppAttach request when it wishes to establish a A node sends an AppAttach request when it wishes to establish a
direct connection to another node for the purposes of sending direct connection to another node for the purposes of sending
application layer messages. AppAttach is nearly identical to Attach, application-layer messages. AppAttach is nearly identical to Attach,
except for the purpose of the connection: it is used to transport except for the purpose of the connection: it is used to transport
non-RELOAD "media". A separate request is used to avoid implementor non-RELOAD "media". A separate request is used to avoid implementer
confusion between the two methods (this was found to be a real confusion between the two methods (this was found to be a real
problem with initial implementations). The AppAttach request and its problem with initial implementations). The AppAttach request and its
response contain an application attribute, which indicates what response contain an application attribute, which indicates what
protocol is to be run over the connection. protocol is to be run over the connection.
6.5.2.1. Request Definition 6.5.2.1. Request Definition
An AppAttachReq message contains the requesting node's ICE connection An AppAttachReq message contains the requesting node's ICE connection
parameters formatted into a binary structure. parameters formatted into a binary structure.
skipping to change at page 81, line 6 skipping to change at page 76, line 27
opaque ufrag<0..2^8-1>; opaque ufrag<0..2^8-1>;
opaque password<0..2^8-1>; opaque password<0..2^8-1>;
uint16 application; uint16 application;
opaque role<0..2^8-1>; opaque role<0..2^8-1>;
IceCandidate candidates<0..2^16-1>; IceCandidate candidates<0..2^16-1>;
} AppAttachReq; } AppAttachReq;
The values contained in AppAttachReq and AppAttachAns are: The values contained in AppAttachReq and AppAttachAns are:
ufrag ufrag
The username fragment (from ICE) The username fragment (from ICE).
password password
The ICE password. The ICE password.
application application
A 16-bit application-id as defined in the Section 14.5. This A 16-bit Application-ID, as defined in the Section 14.5. This
number represents the IANA registered application that is going to number represents the IANA-registered application that is going to
send data on this connection. send data on this connection.
role role
An active/passive/actpass attribute from RFC 4145 [RFC4145]. An active/passive/actpass attribute from RFC 4145 [RFC4145].
candidates candidates
One or more ICE candidate values One or more ICE candidate values.
The application using connection set up with this request is The application using the connection that is set up with this request
responsible for providing sufficiently frequent keep traffic for NAT is responsible for providing traffic of sufficient frequency to keep
and Firewall keep alive and for deciding when to close the the NAT and Firewall binding alive. Applications will often send
connection. traffic every 25 seconds to ensure this.
6.5.2.2. Response Definition 6.5.2.2. Response Definition
If a peer receives an AppAttach request, it SHOULD process the If a peer receives an AppAttach request, it SHOULD process the
request and generate its own response with a AppAttachAns. It should request and generate its own response with a AppAttachAns. It should
then begin ICE checks. When a peer receives an AppAttach response, then begin ICE checks. When a peer receives an AppAttach response,
it SHOULD parse the response and begin its own ICE checks. If the it SHOULD parse the response and begin its own ICE checks. If the
application ID is not supported, the peer MUST reply with an Application ID is not supported, the peer MUST reply with an
Error_Not_Found error. Error_Not_Found error.
struct { struct {
opaque ufrag<0..2^8-1>; opaque ufrag<0..2^8-1>;
opaque password<0..2^8-1>; opaque password<0..2^8-1>;
uint16 application; uint16 application;
opaque role<0..2^8-1>; opaque role<0..2^8-1>;
IceCandidate candidates<0..2^16-1>; IceCandidate candidates<0..2^16-1>;
} AppAttachAns; } AppAttachAns;
The meaning of the fields is the same as in the AppAttachReq. The meaning of the fields is the same as in the AppAttachReq.
6.5.3. Ping 6.5.3. Ping
Ping is used to test connectivity along a path. A ping can be Ping is used to test connectivity along a path. A ping can be
addressed to a specific Node-ID, to the peer controlling a given addressed to a specific Node-ID, to the peer controlling a given
location (by using a Resource-ID) or to the wildcard Node-ID. location (by using a Resource-ID), or to the wildcard Node-ID.
6.5.3.1. Request Definition 6.5.3.1. Request Definition
The PingReq structure is used to make a Ping request.
struct { struct {
opaque<0..2^16-1> padding; opaque<0..2^16-1> padding;
} PingReq; } PingReq;
The Ping request is empty of meaningful contents. However, it may The Ping request is empty of meaningful contents. However, it may
contain up to 65535 bytes of padding to facilitate the discovery of contain up to 65535 bytes of padding to facilitate the discovery of
overlay maximum packet sizes. overlay maximum packet sizes.
6.5.3.2. Response Definition 6.5.3.2. Response Definition
skipping to change at page 82, line 40 skipping to change at page 78, line 12
uint64 time; uint64 time;
} PingAns; } PingAns;
A PingAns message contains the following elements: A PingAns message contains the following elements:
response_id response_id
A randomly generated 64-bit response ID. This is used to A randomly generated 64-bit response ID. This is used to
distinguish Ping responses. distinguish Ping responses.
time time
The time when the Ping response was created represented in the The time when the Ping response was created, represented in the
same way as storage_time defined in Section 7. same way as storage_time, defined in Section 7.
6.5.4. ConfigUpdate 6.5.4. ConfigUpdate
The ConfigUpdate 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 across the overlay. Whenever a node detects that another node has
old configuration data, it MUST generate a ConfigUpdate request. The old configuration data, it MUST generate a ConfigUpdate request. The
ConfigUpdate request allows updating of two kinds of data: the ConfigUpdate request allows updating of two kinds of data: the
configuration data (Section 6.3.2.1) and the Kind information configuration data (Section 6.3.2.1) and the Kind information
(Section 7.4.1.1). (Section 7.4.1.1).
6.5.4.1. Request Definition 6.5.4.1. Request Definition
The ConfigUpdateReq structure is used to provide updated
configuration information.
enum { invalidConfigUpdateType(0), config(1), kind(2), (255) } enum { invalidConfigUpdateType(0), config(1), kind(2), (255) }
ConfigUpdateType; ConfigUpdateType;
typedef uint32 KindId; typedef uint32 KindId;
typedef opaque KindDescription<0..2^16-1>; typedef opaque KindDescription<0..2^16-1>;
struct { struct {
ConfigUpdateType type; ConfigUpdateType type;
uint32 length; uint32 length;
select (type) { select (type) {
case config: case config:
opaque config_data<0..2^24-1>; opaque config_data<0..2^24-1>;
case kind: case kind:
KindDescription kinds<0..2^24-1>; KindDescription kinds<0..2^24-1>;
/* This structure may be extended with new types*/ /* This structure may be extended with new types */
}; };
} ConfigUpdateReq; } ConfigUpdateReq;
The ConfigUpdateReq message contains the following elements: The ConfigUpdateReq message contains the following elements:
type type
The type of the contents of the message. This structure allows The type of the contents of the message. This structure allows
for unknown content types. for unknown content types.
length length
The length of the remainder of the message. This is included to The length of the remainder of the message. This is included to
preserve backward compatibility and is 32 bits instead of 24 to preserve backward compatibility and is 32 bits instead of 24 to
facilitate easy conversion between network and host byte order. facilitate easy conversion between network and host byte order.
config_data (type==config) config_data (type==config)
The contents of the configuration document. The contents of the Configuration Document.
kinds (type==kind) kinds (type==kind)
One or more XML kind-block productions (see Section 11.1). These One or more XML kind-block productions (see Section 11.1). These
MUST be encoded with UTF-8 and assume a default namespace of MUST be encoded with UTF-8 and assume a default namespace of
"urn:ietf:params:xml:ns:p2p:config-base". "urn:ietf:params:xml:ns:p2p:config-base".
6.5.4.2. Response Definition 6.5.4.2. Response Definition
The ConfigUpdateAns structure is used to respond to a ConfigUpdateReq
request.
struct { struct {
} ConfigUpdateAns; } ConfigUpdateAns;
If the ConfigUpdateReq is of type "config" it MUST only be processed If the ConfigUpdateReq is of type "config", it MUST be processed only
if all the following are true: if all the following are true:
o The sequence number in the document is greater than the current o The sequence number in the document is greater than the current
configuration sequence number. configuration sequence number.
o The configuration document is correctly digitally signed (see o The Configuration Document is correctly digitally signed (see
Section 11 for details on signatures.) Section 11 for details on signatures).
Otherwise appropriate errors MUST be generated. Otherwise, appropriate errors MUST be generated.
If the ConfigUpdateReq is of type "kind" it MUST only be processed if If the ConfigUpdateReq is of type "kind", it MUST be processed only
it is correctly digitally signed by an acceptable Kind signer (i.e., if it is correctly digitally signed by an acceptable Kind signer
one listed in the current configuration file). Details on kind- (i.e., one listed in the current configuration file). Details on the
signer field in the configuration file are described in Section 11.1. kind-signer field in the configuration file are described in
In addition, if the Kind update conflicts with an existing known Kind Section 11.1. In addition, if the Kind update conflicts with an
(i.e., it is signed by a different signer), then it should be existing known Kind (i.e., it is signed by a different signer), then
rejected with "Error_Forbidden". This should not happen in correctly it should be rejected with an Error_Forbidden error. This should not
functioning overlays. happen in correctly functioning overlays.
If the update is acceptable, then the node MUST reconfigure itself to If the update is acceptable, then the node MUST reconfigure itself to
match the new information. This may include adding permissions for match the new information. This may include adding permissions for
new Kinds, deleting old Kinds, or even, in extreme circumstances, new Kinds, deleting old Kinds, or even, in extreme circumstances,
exiting and reentering the overlay, if, for instance, the DHT exiting and re-entering the overlay, if, for instance, the DHT
algorithm has changed. algorithm has changed.
If an implementation misses enough ConfigUpdates which include key If an implementation misses enough ConfigUpdates that include key
changes, it is possible that it will no longer be able to verify new changes, it is possible that it will no longer be able to verify new
valid ConfigUpdates. In that case, the only available recovery valid ConfigUpdates. In this case, the only available recovery
mechanism is to attempt to retrieve a new configuration document, mechanism is to attempt to retrieve a new Configuration Document,
typically by the mechanisms it would use for initial bootstrapping. typically by the mechanisms used for initial bootstrapping. It is up
It is up to implementors whether or how to decide to employ this sort to implementers whether or how to decide to employ this sort of
of recovery mechanism. recovery mechanism.
The response for ConfigUpdate is empty. The response for ConfigUpdate is empty.
6.6. Overlay Link Layer 6.6. Overlay Link Layer
RELOAD can use multiple Overlay Link protocols to send its messages. RELOAD can use multiple Overlay Link protocols to send its messages.
Because ICE is used to establish connections (see Section 6.5.1.3), Because ICE is used to establish connections (see Section 6.5.1.3),
RELOAD nodes are able to detect which Overlay Link protocols are RELOAD nodes are able to detect which Overlay Link protocols are
offered by other nodes and establish connections between them. Any offered by other nodes and establish connections between them. Any
link protocol needs to be able to establish a secure, authenticated link protocol needs to be able to establish a secure, authenticated
connection and to provide data origin authentication and message connection and to provide data origin authentication and message
integrity for individual data elements. RELOAD currently supports integrity for individual data elements. RELOAD currently supports
three Overlay Link protocols: three Overlay Link protocols:
o DTLS [RFC6347] over UDP with Simple Reliability (SR) o DTLS [RFC6347] over UDP with Simple Reliability (SR)
(OverlayLinkType=DTLS-UDP-SR) (OverlayLinkType=DTLS-UDP-SR)
o TLS [RFC5246] over TCP with Framing Header, No-ICE o TLS [RFC5246] over TCP with Framing Header, No-ICE
(OverlayLinkType=TLS-TCP-FH-NO-ICE) (OverlayLinkType=TLS-TCP-FH-NO-ICE)
o DTLS [RFC6347] over UDP with SR, No-ICE (OverlayLinkType=DTLS-UDP- o DTLS [RFC6347] over UDP with SR, No-ICE
SR-NO-ICE) (OverlayLinkType=DTLS-UDP-SR-NO-ICE)
Note that although UDP does not properly have "connections", both TLS Note that although UDP does not properly have "connections", both TLS
and DTLS have a handshake which establishes a similar, stateful and DTLS have a handshake that establishes a similar, stateful
association, and we simply refer to these as "connections" for the association. We refer to these as "connections" for the purposes of
purposes of this document. this document.
If a peer receives a message that is larger than value of max- If a peer receives a message that is larger than the value of max-
message-size defined in the overlay configuration, the peer SHOULD message-size defined in the overlay configuration, the peer SHOULD
send an Error_Message_Too_Large error and then close the TLS or DTLS send an Error_Message_Too_Large error and then close the TLS or DTLS
session from which the message was received. Note that this error session from which the message was received. Note that this error
can be sent and the session closed before receiving the complete can be sent and the session closed before the peer receives the
message. If the forwarding header is larger than the max-message- complete message. If the forwarding header is larger than the max-
size, the receiver SHOULD close the TLS or DTLS session without message-size, the receiver SHOULD close the TLS or DTLS session
sending an error. without sending an error.
The RELOAD mechanism requires that failed links are quickly removed The RELOAD mechanism requires that failed links be quickly removed
from the routing table so end-to-end retransmission can handle lost from the Routing Table so end-to-end retransmission can handle lost
messages. Overlay link protocols MUST be designed with a mechanism messages. Overlay Link protocols MUST be designed with a mechanism
that quickly signals a likely failure and implementations SHOULD that quickly signals a likely failure, and implementations SHOULD
quickly act to remove it from the routing table when receiving this quickly act to remove a failed link from the Routing Table when
signal. The entry can be restored if it proves to resume receiving this signal. The entry can be restored if it proves to
functioning, or replaced at some point in the future if necessary. resume functioning, or it can be replaced at some point in the future
Section 10.7.2 contains more details specific to the CHORD-RELOAD if necessary. Section 10.7.2 contains more details specific to the
topology plugin. CHORD-RELOAD Topology Plug-in.
The Framing Header (FH) is used to frame messages and provide timing The Framing Header (FH) is used to frame messages and provide timing
when used on a reliable stream-based transport protocol. Simple when used on a reliable stream-based transport protocol. Simple
Reliability (SR) makes use of the FH to provide congestion control Reliability (SR) uses the FH to provide congestion control and
and semi-reliability when using unreliable message-oriented transport partial reliability when using unreliable message-oriented transport
protocols. We will first define each of these algorithms in protocols. We will first define each of these algorithms in Sections
Section 6.6.2 and Section 6.6.3, then define overlay link protocols 6.6.2 and 6.6.3, and then define Overlay Link protocols that use them
that use them in Section 6.6.4, Section 6.6.5 and Section 6.6.6. in Sections 6.6.4, 6.6.5, and 6.6.6.
Note: We expect future Overlay Link protocols to define replacements Note: We expect future Overlay Link protocols to define replacements
for all components of these protocols, including the framing header. for all components of these protocols, including the Framing Header.
These three protocols have been chosen for simplicity of The three protocols that we will discuss have been chosen for
implementation and reasonable performance. simplicity of implementation and reasonable performance.
6.6.1. Future Overlay Link Protocols 6.6.1. Future Overlay Link Protocols
It is possible to define new link-layer protocols and apply them to a It is possible to define new link-layer protocols and apply them to a
new overlay using the "overlay-link-protocol" configuration directive new overlay using the "overlay-link-protocol" configuration directive
(see Section 11.1.). However, any new protocols MUST meet the (see Section 11.1.). However, any new protocols MUST meet the
following requirements. following requirements:
Endpoint authentication When a node forms an association with Endpoint authentication: When a node forms an association with
another endpoint, it MUST be possible to cryptographically verify another endpoint, it MUST be possible to cryptographically verify
that the endpoint has a given Node-ID. that the endpoint has a given Node-ID.
Traffic origin authentication and integrity When a node receives Traffic origin authentication and integrity: When a node receives
traffic from another endpoint, it MUST be possible to traffic from another endpoint, it MUST be possible to
cryptographically verify that the traffic came from a given cryptographically verify that the traffic came from a given
association and that it has not been modified in transit from the association and that it has not been modified in transit from the
other endpoint in the association. The overlay link protocol MUST other endpoint in the association. The overlay link protocol MUST
also provide replay prevention/detection. also provide replay prevention/detection.
Traffic confidentiality When a node sends traffic to another Traffic confidentiality: When a node sends traffic to another
endpoint, it MUST NOT be possible for a third party not involved endpoint, it MUST NOT be possible for a third party that is not
in the association to determine the contents of that traffic. involved in the association to determine the contents of that
traffic.
Any new overlay protocol MUST be defined via RFC 5226 Standards Any new overlay protocol MUST be defined via Standards Action
Action; see Section 14.11. [RFC5226]. See Section 14.11.
6.6.1.1. HIP 6.6.1.1. HIP
In a Host Identity Protocol Based Overlay Networking Environment (HIP In a Host Identity Protocol Based Overlay Networking Environment (HIP
BONE) [RFC6079] HIP [RFC5201] provides connection management (e.g., BONE) [RFC6079], HIP [RFC5201] provides connection management (e.g.,
NAT traversal and mobility) and security for the overlay network. NAT traversal and mobility) and security for the overlay network.
The P2PSIP Working Group has expressed interest in supporting a HIP- The P2PSIP Working Group has expressed interest in supporting a HIP-
based link protocol. Such support would require specifying such based link protocol. Such support would require specifying such
details as: details as:
o How to issue certificates which provided identities meaningful to o How to issue certificates which provide identities meaningful to
the HIP base exchange. We anticipate that this would require a the HIP base exchange. We anticipate that this would require a
mapping between ORCHIDs and NodeIds. mapping between Overlay Routable Cryptographic Hash Identifiers
(ORCHIDs) and NodeIds.
o How to carry the HIP I1 and I2 messages. o How to carry the HIP I1 and I2 messages.
o How to carry RELOAD messages over HIP. o How to carry RELOAD messages over HIP.
[I-D.ietf-hip-reload-instance] documents work in progress on using [HIP-RELOAD] documents work in progress on using RELOAD with the HIP
RELOAD with the HIP BONE. BONE.
6.6.1.2. ICE-TCP 6.6.1.2. ICE-TCP
The ICE-TCP RFC [RFC6544] allows TCP to be supported as an Overlay The ICE-TCP RFC [RFC6544] allows TCP to be supported as an Overlay
Link protocol that can be added using ICE. Link protocol that can be added using ICE.
6.6.1.3. Message-oriented Transports 6.6.1.3. Message-Oriented Transports
Modern message-oriented transports offer high performance, good Modern message-oriented transports offer high performance and good
congestion control, and avoid head of line blocking in case of lost congestion control, and they avoid head-of-line blocking in case of
data. These characteristics make them preferable as underlying lost data. These characteristics make them preferable as underlying
transport protocols for RELOAD links. SCTP without message ordering transport protocols for RELOAD links. SCTP without message ordering
and DCCP are two examples of such protocols. However, currently they and DCCP are two examples of such protocols. However, currently they
are not well-supported by commonly available NATs, and specifications are not well-supported by commonly available NATs, and specifications
for ICE session establishment are not available. for ICE session establishment are not available.
6.6.1.4. Tunneled Transports 6.6.1.4. Tunneled Transports
As of the time of this writing, there is significant interest in the As of the time of this writing, there is significant interest in the
IETF community in tunneling other transports over UDP, motivated by IETF community in tunneling other transports over UDP, which is
the situation that UDP is well-supported by modern NAT hardware, and motivated by the situation that UDP is well-supported by modern NAT
similar performance can be achieved to native implementation. hardware and by the fact that performance similar to a native
Currently SCTP, DCCP, and a generic tunneling extension are being implementation can be achieved. Currently, SCTP, DCCP, and a generic
proposed for message-oriented protocols. Once ICE traversal has been tunneling extension are being proposed for message-oriented
specified for these tunneled protocols, they should be protocols. Once ICE traversal has been specified for these tunneled
straightforward to support as overlay link protocols. protocols, they should be straightforward to support as overlay link
protocols.
6.6.2. Framing Header 6.6.2. Framing Header
In order to support unreliable links and to allow for quick detection In order to support unreliable links and to allow for quick detection
of link failures when using reliable end-to-end transports, each of link failures when using reliable end-to-end transports, each
message is wrapped in a very simple framing layer (FramedMessage) message is wrapped in a very simple framing layer (FramedMessage),
which is only used for each hop. This layer contains a sequence which is used only for each hop. This layer contains a sequence
number which can then be used for ACKs. The same header is used for number which can then be used for ACKs. The same header is used for
both reliable and unreliable transports for simplicity of both reliable and unreliable transports for simplicity of
implementation. implementation.
The definition of FramedMessage is: The definition of FramedMessage is:
enum { data(128), ack(129), (255) } FramedMessageType; enum { data(128), ack(129), (255) } FramedMessageType;
struct { struct {
FramedMessageType type; FramedMessageType type;
skipping to change at page 88, line 28 skipping to change at page 83, line 42
}; };
} FramedMessage; } FramedMessage;
The type field of the PDU is set to indicate whether the message is The type field of the PDU is set to indicate whether the message is
data or an acknowledgement. data or an acknowledgement.
If the message is of type "data", then the remainder of the PDU is as If the message is of type "data", then the remainder of the PDU is as
follows: follows:
sequence sequence
the sequence number. This increments by 1 for each framed message The sequence number. This increments by one for each framed
sent over this transport session. message sent over this transport session.
message message
the message that is being transmitted. The message that is being transmitted.
Each connection has it own sequence number space. Initially the Each connection has it own sequence number space. Initially, the
value is zero and it increments by exactly one for each message sent value is zero, and it increments by exactly one for each message sent
over that connection. over that connection.
When the receiver receives a message, it SHOULD immediately send an When the receiver receives a message, it SHOULD immediately send an
ACK message. The receiver MUST keep track of the 32 most recent ACK message. The receiver MUST keep track of the 32 most recent
sequence numbers received on this association in order to generate sequence numbers received on this association in order to generate
the appropriate ack. the appropriate ACK.
If the PDU is of type "ack", the contents are as follows: If the PDU is of type "ack", the contents are as follows:
ack_sequence ack_sequence
The sequence number of the message being acknowledged. The sequence number of the message being acknowledged.
received received
A bitmask indicating if each of the previous 32 sequence numbers A bitmask indicating if each of the previous 32 sequence numbers
before this packet has been among the 32 packets most recently before this packet has been among the 32 packets most recently
received on this connection. When a packet is received with a received on this connection. When a packet is received with a
sequence number N, the receiver looks at the sequence number of sequence number N, the receiver looks at the sequence number of
the previously 32 packets received on this connection. Call the the 32 previously received packets on this connection. We call
previously received packet number M. For each of the previous 32 the previously received packet number M. For each of the previous
packets, if the sequence number M is less than N but greater than 32 packets, if the sequence number M is less than N but greater
N-32, the N-M bit of the received bitmask is set to one; otherwise than N-32, the N-M bit of the received bitmask is set to one;
it is zero. Note that a bit being set to one indicates positively otherwise, it is set to zero. Note that a bit being set to one
that a particular packet was received, but a bit being set to zero indicates positively that a particular packet was received, but a
means only that it is unknown whether or not the packet has been bit being set to zero means only that it is unknown whether or not
received, because it might have been received before the 32 most the packet has been received, because it might have been received
recently received packets. before the 32 most recently received packets.
The received field bits in the ACK provide a 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 redundancy so that the sender can figure out which packets the
receiver has received and can then estimate packet loss rates. If receiver has received and can then estimate packet loss rates. If
the sender also keeps track of the time at which recent sequence the sender also keeps track of the time at which recent sequence
numbers have been sent, the RTT can be estimated. numbers have been sent, the RTT (round-trip time) can be estimated.
Note that because retransmissions receive new sequence numbers, Note that because retransmissions receive new sequence numbers,
multiple ACKs may be received for the same message. This approach multiple ACKs may be received for the same message. This approach
provides more information than traditional TCP sequence numbers, but provides more information than traditional TCP sequence numbers, but
care must be taken when applying algorithms designed based on TCP's care must be taken when applying algorithms designed based on TCP's
stream-oriented sequence number. stream-oriented sequence number.
6.6.3. Simple Reliability 6.6.3. Simple Reliability
When RELOAD is carried over DTLS or another unreliable link protocol, When RELOAD is carried over DTLS or another unreliable link protocol,
it needs to be used with a reliability and congestion control it needs to be used with a reliability and congestion control
mechanism, which is provided on a hop-by-hop basis. The basic mechanism, which is provided on a hop-by-hop basis. The basic
principle is that each message, regardless of whether or not it principle is that each message, regardless of whether or not it
carries a request or response, will get an ACK and be reliably carries a request or response, will get an ACK and be reliably
retransmitted. The receiver's job is very simple, limited to just retransmitted. The receiver's job is very simple, and is limited to
sending ACKs. All the complexity is at the sender side. This allows just sending ACKs. All the complexity is at the sender side. This
the sending implementation to trade off performance versus allows the sending implementation to trade off performance versus
implementation complexity without affecting the wire protocol. implementation complexity without affecting the wire protocol.
Because the receiver's role is limited to providing packet Because the receiver's role is limited to providing packet
acknowledgements, a wide variety of congestion control algorithms can acknowledgements, a wide variety of congestion control algorithms can
be implemented on the sender side while using the same basic wire be implemented on the sender side while using the same basic wire
protocol. The sender algorithm used MUST meet the requirements of protocol. The sender algorithm used MUST meet the requirements of
[RFC5405]. [RFC5405].
6.6.3.1. Stop and Wait Sender Algorithm 6.6.3.1. Stop and Wait Sender Algorithm
This section describes one possible implementation of a sender This section describes one possible implementation of a sender
algorithm for Simple Reliability. It is adequate for overlays algorithm for Simple Reliability. It is adequate for overlays
running on underlying networks with low latency and loss (LANs) or running on underlying networks with low latency and loss (LANs) or
low-traffic overlays on the Internet. low-traffic overlays on the Internet.
A node MUST NOT have more than one unacknowledged message on the DTLS A node MUST NOT have more than one unacknowledged message on the DTLS
connection at a time. Note that because retransmissions of the same connection at a time. Note that because retransmissions of the same
message are given new sequence numbers, there may be multiple message are given new sequence numbers, there may be multiple
unacknowledged sequence numbers in use. unacknowledged sequence numbers in use.
The RTO ("Retransmission TimeOut") is based on an estimate of the The RTO (Retransmission TimeOut) is based on an estimate of the RTT.
round-trip time (RTT). The value for RTO is calculated separately The value for RTO is calculated separately for each DTLS session.
for each DTLS session. Implementations can use a static value for Implementations can use a static value for RTO or a dynamic estimate,
RTO or a dynamic estimate which will result in better performance. which will result in better performance. For implementations that
For implementations that use a static value, the default value for use a static value, the default value for RTO is 500 ms. Nodes MAY
RTO is 500 ms. Nodes MAY use smaller values of RTO if it is known use smaller values of RTO if it is known that all nodes are within
that all nodes are within the local network. The default RTO MAY be the local network. The default RTO MAY be set to a larger value,
chosen larger, and this is RECOMMENDED if it is known in advance which is RECOMMENDED if it is known in advance (such as on high-
(such as on high latency access links) that the round-trip time is latency access links) that the RTT is larger.
larger.
Implementations that use a dynamic estimate to compute the RTO MUST Implementations that use a dynamic estimate to compute the RTO MUST
use the algorithm described in RFC 6298[RFC6298], with the exception use the algorithm described in RFC 6298 [RFC6298], with the exception
that the value of RTO SHOULD NOT be rounded up to the nearest second that the value of RTO SHOULD NOT be rounded up to the nearest second,
but instead rounded up to the nearest millisecond. The RTT of a but instead rounded up to the nearest millisecond. The RTT of a
successful STUN transaction from the ICE stage is used as the initial successful STUN transaction from the ICE stage is used as the initial
measurement for formula 2.2 of RFC 6298. The sender keeps track of measurement for formula 2.2 of RFC 6298. The sender keeps track of
the time each message was sent for all recently sent messages. Any the time each message was sent for all recently sent messages. Any
time an ACK is received, the sender can compute the RTT for that time an ACK is received, the sender can compute the RTT for that
message by looking at the time the ACK was received and the time when 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 the message was sent. This is used as a subsequent RTT measurement
for formula 2.3 of RFC 6298 to update the RTO estimate. (Note that for formula 2.3 of RFC 6298 to update the RTO estimate. (Note that
because retransmissions receive new sequence numbers, all received because retransmissions receive new sequence numbers, all received
ACKs are used.) ACKs are used.)
An initiating node SHOULD retransmit a message if it has not received An initiating node SHOULD retransmit a message if it has not received
an ACK after an interval of RTO (transit nodes do not retransmit at an ACK after an interval of RTO (transit nodes do not retransmit at
this layer). The node MUST double the time to wait after each this layer). The node MUST double the time to wait after each
retransmission. For each retransmission, the sequence number MUST be retransmission. For each retransmission, the sequence number MUST be
incremented. incremented.
Retransmissions continue until a response is received, or until a Retransmissions continue until a response is received, until a total
total of 5 requests have been sent or there has been a hard ICMP of 5 requests have been sent, until there has been a hard ICMP error
error [RFC1122] or a TLS alert. The sender knows a response was [RFC1122], or until a TLS alert indicating the end of the connection
received when it receives an ACK with a sequence number that has been sent or received. The sender knows a response was received
indicates it is a response to one of the transmissions of this when it receives an ACK with a sequence number that indicates it is a
messages. For example, assuming an RTO of 500 ms, requests would be response to one of the transmissions of this message. For example,
sent at times 0 ms, 500 ms, 1500 ms, 3500 ms, and 7500 ms. If all assuming an RTO of 500 ms, requests would be sent at times 0 ms, 500
retransmissions for a message fail, then the sending node SHOULD ms, 1500 ms, 3500 ms, and 7500 ms. If all retransmissions for a
close the connection routing the message. message fail, then the sending node SHOULD close the connection
routing the message.
To determine when a link might be failing without waiting for the To determine when a link might be failing without waiting for the
final timeout, observe when no ACKs have been received for an entire final timeout, observe when no ACKs have been received for an entire
RTO interval, and then wait for three retransmissions to occur beyond RTO interval, and then wait for three retransmissions to occur beyond
that point. If no ACKs have been received by the time the third that point. If no ACKs have been received by the time the third
retransmission occurs, it is RECOMMENDED that the link be removed retransmission occurs, it is RECOMMENDED that the link be removed
from the Routing Table. The link MAY be restored to the Routing from the Routing Table. The link MAY be restored to the Routing
Table if ACKs resume before the connection is closed, as described Table if ACKs resume before the connection is closed, as described
above. above.
A sender MUST wait 10ms between receipt of an ACK and transmission of A sender MUST wait 10 ms between receipt of an ACK and transmission
the next message. of the next message.
6.6.4. DTLS/UDP with SR 6.6.4. DTLS/UDP with SR
This overlay link protocol consists of DTLS over UDP while This overlay link protocol consists of DTLS over UDP while
implementing the Simple Reliability protocol. STUN Connectivity implementing the SR protocol. STUN connectivity checks and
checks and keepalives are used. Any compliant sender algorithm may keepalives are used. Any compliant sender algorithm may be used.
be used.
6.6.5. TLS/TCP with FH, No-ICE 6.6.5. TLS/TCP with FH, No-ICE
This overlay link protocol consists of TLS over TCP with the framing This overlay link protocol consists of TLS over TCP with the framing
header. Because ICE is not used, STUN connectivity checks are not header. Because ICE is not used, STUN connectivity checks are not
used upon establishing the TCP connection, nor are they used for used upon establishing the TCP connection, nor are they used for
keepalives. keepalives.
Because the TCP layer's application-level timeout is too slow to be Because the TCP layer's application-level timeout is too slow to be
useful for overlay routing, the Overlay Link implementation MUST use useful for overlay routing, the Overlay Link implementation MUST use
the framing header to measure the RTT of the connection and calculate the framing header to measure the RTT of the connection and calculate
an RTO as specified in Section 2 of [RFC6298]. The resulting RTO is an RTO as specified in Section 2 of [RFC6298]. The resulting RTO is
not used for retransmissions, but as a timeout to indicate when the not used for retransmissions, but rather as a timeout to indicate
link SHOULD be removed from the Routing Table. It is RECOMMENDED when the link SHOULD be removed from the Routing Table. It is
that such a connection be retained for 30s to determine if the RECOMMENDED that such a connection be retained for 30 seconds to
failure was transient before concluding the link has failed determine if the failure was transient before concluding the link has
permanently. failed permanently.
When sending candidates for TLS/TCP with FH, No-ICE, a passive When sending candidates for TLS/TCP with FH, No-ICE, a passive
candidate MUST be provided. candidate MUST be provided.
6.6.6. DTLS/UDP with SR, No-ICE 6.6.6. DTLS/UDP with SR, No-ICE
This overlay link protocol consists of DTLS over UDP while This overlay link protocol consists of DTLS over UDP while
implementing the Simple Reliability protocol. Because ICE is not implementing the Simple Reliability protocol. Because ICE is not
used, no STUN connectivity checks or keepalives are used. used, no STUN connectivity checks or keepalives are used.
6.7. Fragmentation and Reassembly 6.7. Fragmentation and Reassembly
In order to allow transmission over datagram protocols such as DTLS, In order to allow transmission over datagram protocols such as DTLS,
RELOAD messages may be fragmented. RELOAD messages may be fragmented.
Any node along the path can fragment the message but only the final Any node along the path can fragment the message, but only the final
destination reassembles the fragments. When a node takes a packet destination reassembles the fragments. When a node takes a packet
and fragments it, each fragment has a full copy of the Forwarding and fragments it, each fragment has a full copy of the forwarding
Header but the data after the Forwarding Header is broken up in header, but the data after the forwarding header is broken up into
appropriate sized chunks. The size of the payload chunks needs to appropriately sized chunks. The size of the payload chunks needs to
take into account space to allow the via and destination lists to take into account space to allow the Via and Destination Lists to
grow. Each fragment MUST contain a full copy of the via list, grow. Each fragment MUST contain a full copy of the Via List,
destination list, and ForwardingOptions and MUST contain at least 256 Destination List, and ForwardingOptions and MUST contain at least 256
bytes of the message body. If these elements cannot fit within the bytes of the message body. If these elements cannot fit within the
MTU of the underlying datagram protocol, RELOAD fragmentation is not MTU of the underlying datagram protocol, RELOAD fragmentation is not
performed and IP-layer fragmentation is allowed to occur. The length performed, and IP-layer fragmentation is allowed to occur. The
field MUST contain the size of the message after fragmentation. When length field MUST contain the size of the message after
a message MUST be fragmented, it SHOULD be split into equal-sized fragmentation. When a message MUST be fragmented, it SHOULD be split
fragments that are no larger than the PMTU of the next overlay link into equal-sized fragments that are no larger than the Path MTU
minus 32 bytes. This is to allow the via list to grow before further (PMTU) of the next overlay link minus 32 bytes. This is to allow the
fragmentation is required. Via List to grow before further fragmentation is required.
Note that this fragmentation is not optimal for the end-to-end path - Note that this fragmentation is not optimal for the end-to-end
a message may be refragmented multiple times as it traverses the path -- a message may be refragmented multiple times as it traverses
overlay but is only assembled at the final destination. This option the overlay, but it is assembled only at the final destination. This
has been chosen as it is far easier to implement than e2e PMTU option has been chosen as it is far easier to implement than end-to-
discovery across an ever-changing overlay, and it effectively end (e2e) PMTU discovery across an ever-changing overlay and it
addresses the reliability issues of relying on IP-layer effectively addresses the reliability issues of relying on IP-layer
fragmentation. However, Ping can be used to allow e2e PMTU discovery fragmentation. However, Ping can be used to allow e2e PMTU discovery
to be implemented if desired. to be implemented if desired.
Upon receipt of a fragmented message by the intended peer, the peer Upon receipt of a fragmented message by the intended peer, the peer
holds the fragments in a holding buffer until the entire message has holds the fragments in a holding buffer until the entire message has
been received. The message is then reassembled into a single message been received. The message is then reassembled into a single message
and processed. In order to mitigate denial of service attacks, and processed. In order to mitigate denial-of-service (DoS) attacks,
receivers SHOULD time out incomplete fragments after maximum request receivers SHOULD time out incomplete fragments after the maximum
lifetime (15 seconds). Note this time was derived from looking at request lifetime (15 seconds). This time was derived from looking at
the end-to-end retransmission time and saving fragments long enough the end-to-end retransmission time and saving fragments long enough
for the full end-to-end retransmissions to take place. Ideally the for the full end-to-end retransmissions to take place. Ideally, the
receiver would have enough buffer space to deal with as many receiver would have enough buffer space to deal with as many
fragments as can arrive in the maximum request lifetime. However, if fragments as can arrive in the maximum request lifetime. However, if
the receiver runs out of buffer space to reassemble the messages it the receiver runs out of buffer space to reassemble a message, it
MUST drop the message. MUST drop the message.
The fragment field of the forwarding header is used to encode The fragment field of the forwarding header is used to encode
fragmentation information. The offset is the number of bytes between fragmentation information. The offset is the number of bytes between
the end of the forwarding header and the start of the data. The the end of the forwarding header and the start of the data. The
first fragment therefore has an offset of 0. The last fragment first fragment therefore has an offset of 0. The last fragment
indicator MUST be appropriately set. If the message is not indicator MUST be appropriately set. If the message is not
fragmented, it is simply treated as if it is the only fragment: the fragmented, it is simply treated as if it is the only fragment: the
last fragment bit is set and the offset is 0 resulting in a fragment last fragment bit is set and the offset is 0, resulting in a fragment
value of 0xC0000000. value of 0xC0000000.
Note: the reason for this definition of the fragment field is that Note: The reason for this definition of the fragment field is that
originally the high bit was defined in part of the specification as originally, the high bit was defined in part of the specification as
"is fragmented" and so there was some specification ambiguity about "is fragmented", so there was some specification ambiguity about how
how to encode messages with only one fragment. This ambiguity was to encode messages with only one fragment. This ambiguity was
resolved in favor of always encoding as the "last" fragment with resolved in favor of always encoding as the "last" fragment with
offset 0, thus simplifying the receiver code path, but resulting in offset 0, thus simplifying the receiver code path, but resulting in
the high bit being redundant. Because messages MUST be set with the the high bit being redundant. Because messages MUST be set with the
high bit set to 1, implementations SHOULD discard any message with it high bit set to 1, implementations SHOULD discard any message with it
set to 0. Implementations (presumably legacy ones) which choose to set to 0. Implementations (presumably legacy ones) which choose to
accept such messages MUST either ignore the remaining bits or ensure accept such messages MUST either ignore the remaining bits or ensure
that they are 0. They MUST NOT try to interpret as fragmented that they are 0. They MUST NOT try to interpret as fragmented
messages with the high bit set low. messages with the high bit set low.
7. Data Storage Protocol 7. Data Storage Protocol