idnits 2.17.1 draft-ietf-homenet-dncp-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 24, 2015) is 3283 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) Summary: 2 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Homenet Working Group M. Stenberg 3 Internet-Draft 4 Intended status: Standards Track S. Barth 5 Expires: October 26, 2015 6 April 24, 2015 8 Distributed Node Consensus Protocol 9 draft-ietf-homenet-dncp-03 11 Abstract 13 This document describes the Distributed Node Consensus Protocol 14 (DNCP), a generic state synchronization protocol which uses Trickle 15 and Merkle trees. DNCP is transport agnostic and leaves some of the 16 details to be specified in profiles, which define actual 17 implementable DNCP based protocols. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on October 26, 2015. 36 Copyright Notice 38 Copyright (c) 2015 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 54 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 55 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 4. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 57 5. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 6 58 5.1. Trickle-Driven Status Updates . . . . . . . . . . . . . . 7 59 5.2. Processing of Received TLVs . . . . . . . . . . . . . . . 7 60 5.3. Adding and Removing Peers . . . . . . . . . . . . . . . . 9 61 5.4. Purging Unreachable Nodes . . . . . . . . . . . . . . . . 9 62 6. Optional Extensions . . . . . . . . . . . . . . . . . . . . . 9 63 6.1. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . 9 64 6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 10 65 6.1.2. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . 10 66 6.1.3. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . 10 67 6.1.4. Received TLV Processing Additions . . . . . . . . . . 11 68 6.1.5. Neighbor Removal . . . . . . . . . . . . . . . . . . 11 69 6.2. Support For Dense Broadcast Links . . . . . . . . . . . . 11 70 6.3. Node Data Fragmentation . . . . . . . . . . . . . . . . . 12 71 7. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 12 72 7.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 13 73 7.1.1. Request Network State TLV . . . . . . . . . . . . . . 13 74 7.1.2. Request Node State TLV . . . . . . . . . . . . . . . 13 75 7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 14 76 7.2.1. Node Endpoint TLV . . . . . . . . . . . . . . . . . . 14 77 7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 14 78 7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 14 79 7.2.4. Custom TLV . . . . . . . . . . . . . . . . . . . . . 15 80 7.3. Data TLVs within Node State TLV . . . . . . . . . . . . . 16 81 7.3.1. Fragment Count TLV . . . . . . . . . . . . . . . . . 16 82 7.3.2. Neighbor TLV . . . . . . . . . . . . . . . . . . . . 16 83 7.3.3. Keep-Alive Interval TLV . . . . . . . . . . . . . . . 17 84 8. Security and Trust Management . . . . . . . . . . . . . . . . 18 85 8.1. Pre-Shared Key Based Trust Method . . . . . . . . . . . . 18 86 8.2. PKI Based Trust Method . . . . . . . . . . . . . . . . . 18 87 8.3. Certificate Based Trust Consensus Method . . . . . . . . 18 88 8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 18 89 8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 19 90 8.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 20 91 8.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 21 92 9. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 22 93 10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 94 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 95 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 96 12.1. Normative references . . . . . . . . . . . . . . . . . . 25 97 12.2. Informative references . . . . . . . . . . . . . . . . . 25 98 Appendix A. Some Questions and Answers [RFC Editor: please 99 remove] . . . . . . . . . . . . . . . . . . . . . . 25 100 Appendix B. Changelog [RFC Editor: please remove] . . . . . . . 25 101 Appendix C. Draft Source [RFC Editor: please remove] . . . . . . 27 102 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 27 103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 105 1. Introduction 107 DNCP is designed to provide a way for nodes to publish data 108 consisting of an ordered set of TLV (Type-Length-Value) tuples and to 109 receive the data published by all other reachable DNCP nodes. 111 DNCP validates the set of data within it by ensuring that it is 112 reachable via nodes that are currently accounted for; therefore, 113 unlike Time-To-Live (TTL) based solutions, it does not require 114 periodic re-publishing of the data by the nodes. On the other hand, 115 it does require the topology to be visible to every node that wants 116 to be able to identify unreachable nodes and therefore remove old, 117 stale data. Another notable feature is the use of Trickle to send 118 status updates as it makes the DNCP network very thrifty when there 119 are no updates. DNCP is most suitable for data that changes only 120 gradually to gain the maximum benefit from using Trickle, and if more 121 rapid state exchanges are needed, something point-to-point is 122 recommended and just e.g. publishing of addresses of the services 123 within DNCP. 125 DNCP has relatively few requirements for the underlying transport; it 126 requires some way of transmitting either unicast datagram or stream 127 data to a DNCP peer and, if used in multicast mode, a way of sending 128 multicast datagrams. If security is desired and one of the built-in 129 security methods is to be used, support for some TLS-derived 130 transport scheme - such as TLS [RFC5246] on top of TCP or DTLS 131 [RFC6347] on top of UDP - is also required. 133 2. Requirements Language 135 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 136 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 137 document are to be interpreted as described in RFC 2119 [RFC2119]. 139 3. Terminology 141 A DNCP profile is a definition of a set of rules and values listed in 142 Section 9 specifying the behavior of a DNCP based protocol, such as 143 the used transport method. For readability, any DNCP profile 144 specific parameters with a profile-specific fixed value are prefixed 145 with DNCP_. 147 A DNCP node is a single node which runs a protocol based on a DNCP 148 profile. 150 The DNCP network is a set of DNCP nodes running the same DNCP profile 151 that can reach each other, either via discovered connectivity in the 152 underlying network, or using each other's addresses learned via other 153 means. As DNCP exchanges are bidirectional, DNCP nodes connected via 154 only unidirectional links are not considered connected. 156 A DNCP message is an abstract concept: when using a reliable stream 157 transport, the whole stream of TLVs can be considered a single 158 message, with new TLVs becoming one by one available once they have 159 been fully received. On a datagram transport, each individual 160 datagram is considered a separate message. 162 The node identifier is an opaque fixed-length identifier consisting 163 of DNCP_NODE_IDENTIFIER_LENGTH bytes which uniquely identifies a DNCP 164 node within a DNCP network. 166 A link indicates a link-layer media over which directly connected 167 nodes can communicate. 169 An interface indicates a port of a node that is connected to a 170 particular link. 172 An endpoint denotes a locally configured use of DNCP on a DNCP node, 173 that is attached either to an interface, to a specific remote unicast 174 address to be contacted, or to a range of remote unicast addresses 175 that are allowed to contact. 177 The endpoint identifier is a 32-bit opaque value, which identifies a 178 particular endpoint of that particular DNCP node. The value 0 is 179 reserved for DNCP and sub-protocol purposes in the TLVs, and MUST NOT 180 be used to identify an actual endpoint. This definition is in sync 181 with the interface index definition in [RFC3493], as the non-zero 182 small positive integers should comfortably fit within 32 bits. 184 A (DNCP) peer refers to another DNCP node with which a DNCP node 185 communicates directly using a particular local and remote endpoint 186 pair. 188 The node data is a set of TLVs published by a node in the DNCP 189 network. The whole node data is owned by the node that publishes it, 190 and it MUST be passed along as-is, including TLVs unknown to the 191 forwarder. 193 The node state is a set of metadata attributes for node data. It 194 includes a sequence number for versioning, a hash value for comparing 195 and a timestamp indicating the time passed since its last 196 publication. The hash function and the number of bits used are 197 defined in the DNCP profile. 199 The network state (hash) is a hash value which represents the current 200 state of the network. The hash function and the number of bits used 201 are defined in the DNCP profile. Whenever any node is added, removed 202 or updates its published node data this hash value changes as well. 203 It is calculated over each reachable nodes' update number 204 concatenated with the hash value of its node data in ascending order 205 of the respective node identifier. 207 The effective (trust) verdict for a certificate is defined as the 208 verdict with the highest priority within the set of verdicts 209 announced for the certificate in the DNCP network. 211 The neighbor graph is the undirected graph of DNCP nodes produced by 212 retaining only bidirectional peer relationships between nodes. 214 4. Data Model 216 A DNCP node has: 218 o A timestamp indicating the most recent neighbor graph traversal 219 described in Section 5.4. 221 A DNCP node has for every DNCP node in the DNCP network: 223 o A node identifier, which uniquely identifies the node. 225 o The node data, an ordered set of TLV tuples published by that 226 particular node. This set of TLVs MUST use a well-defined order 227 based on ascending binary content (including TLV type and length). 228 This facilitates linear time state delta processing. 230 o The latest update sequence number, a 32 bit number that is 231 incremented any time the TLV set is published. For comparison 232 purposes, a looping comparison should be used to avoid problems in 233 case of overflow. An example would be: a < b <=> (a - b) % 2^32 & 234 2^31 != 0. 236 o The relative time (in milliseconds) since the current TLV data set 237 with the current update sequence number was published. It is also 238 a 32 bit number on the wire. If this number is close to overflow 239 (greater than 2^32-2^16), a node MUST re-publish its TLVs even if 240 there is no change to avoid overflow of the value. In other 241 words, absent any other changes, the TLV set MUST be re-published 242 roughly every 49 days. 244 o A timestamp identifying the time it was last reachable based on 245 neighbor graph traversal described in Section 5.4. 247 Additionally, a DNCP node has a set of endpoints for which DNCP is 248 configured to be used. For each such endpoint, a node has: 250 o An endpoint identifier, a 32-bit opaque value. 252 o An interface, a unicast address of a DNCP node it should connect 253 with, or a range of addresses from which DNCP nodes are allowed to 254 connect. 256 o A Trickle [RFC6206] instance with parameters I, T, and c. 258 For each remote (DNCP node, endpoint) pair detected on a local 259 endpoint, a DNCP node has: 261 o The node identifier of the DNCP peer. 263 o The endpoint identifier of the DNCP peer. 265 o The most recent address used by the DNCP peer (authenticated and 266 authorized, if security is enabled). 268 5. Operation 270 The DNCP protocol consists of Trickle [RFC6206] driven unicast or 271 multicast status payloads which indicate the current status of shared 272 TLV data and additional unicast exchanges which ensure DNCP peer 273 reachability and synchronize the data when necessary. 275 If DNCP is to be used on a multicast-capable interface, as opposed to 276 only point-to-point using unicast, a datagram-based transport which 277 supports multicast SHOULD be defined in the DNCP profile to be used 278 for the TLVs to be sent to the whole link. As this is used only to 279 identify potential new DNCP nodes and to notify that an unicast 280 exchange should be triggered, the multicast transport does not have 281 to be particularly secure. 283 To form bidirectional peer relationships DNCP requires identification 284 of the endpoints used for communication. A DNCP node therefore MUST 285 include an Endpoint TLV (Section 7.2.1) in each message intended to 286 maintain a DNCP peer relationship. 288 5.1. Trickle-Driven Status Updates 290 When employing unreliable transport, each node MUST send a Network 291 State TLV (Section 7.2.2) every time the endpoint-specific Trickle 292 algorithm [RFC6206] instance indicates that an update should be sent. 293 Multicast MUST be employed on a multicast-capable interface; 294 otherwise, unicast can be used as well. If possible, most recent, 295 recently changed, or best of all, all known Node State TLVs 296 (Section 7.2.3) SHOULD be also included, unless it is defined as 297 undesirable for some reason by the DNCP profile. Avoiding sending 298 some or all Node State TLVs may make sense to avoid fragmenting 299 packets to multicast destinations, or for security reasons. 301 A Trickle state MUST be maintained separately for each endpoint which 302 employs unreliable transport. The Trickle state for all endpoints is 303 considered inconsistent and reset if and only if the locally 304 calculated network state hash changes. This occurs either due to a 305 change in the local node's own node data, or due to receipt of more 306 recent data from another node. 308 The Trickle algorithm has 3 parameters: Imin, Imax and k. Imin and 309 Imax represent the minimum and maximum values for I, which is the 310 time interval during which at least k Trickle updates must be seen on 311 an endpoint to prevent local state transmission. The actual 312 suggested Trickle algorithm parameters are DNCP profile specific, as 313 described in Section 9. 315 5.2. Processing of Received TLVs 317 This section describes how received TLVs are processed. The DNCP 318 profile may specify criteria based on which particular TLVs are 319 ignored. Any 'reply' mentioned in the steps below denotes sending of 320 the specified TLV(s) via unicast to the originator of the TLV being 321 processed. If the TLV being replied to was received via multicast 322 and it was sent to a link with shared bandwidth, the reply SHOULD be 323 delayed by a random timespan in [0, Imin/2]. Sending of replies 324 SHOULD be rate-limited by the implementation, and in case of excess 325 load (or some other reason), a reply MAY be omitted altogether. 327 Upon receipt of: 329 o Request Network State TLV (Section 7.1.1): The receiver MUST reply 330 with a Network State TLV (Section 7.2.2) and a Node State TLV 331 (Section 7.2.3) for each node data used to calculate the network 332 state hash. The Node State TLVs SHOULD NOT contain the optional 333 node data part. 335 o Request Node State TLV (Section 7.1.2): If the receiver has node 336 data for the corresponding node, it MUST reply with a Node State 337 TLV (Section 7.2.3) for the corresponding node. The optional node 338 data part MUST be included in the TLV. 340 o Network State TLV (Section 7.2.2): If the network state hash 341 differs from the locally calculated network state hash, and the 342 receiver is unaware of any particular node state differences with 343 the sender, the receiver MUST reply with a Request Network State 344 TLV (Section 7.1.1). The receiver MAY omit this, if there are 345 already recent pending requests for network or node state. 347 o Node State TLV (Section 7.2.3): 349 * If the node identifier matches the local node identifier and 350 the TLV has a higher update sequence number than its current 351 local value, or the same update sequence number and a different 352 hash, the node SHOULD re-publish its own node data with an 353 update sequence number 1000 higher than the received one. This 354 may occur normally once due to the local node restarting and 355 not storing the most recently used update sequence number. If 356 this occurs more than once, the DNCP profile should provide 357 guidance on how to handle these situations as it indicates the 358 existence of another active node with the same node identifier. 360 * If the node identifier does not match the local node 361 identifier, and the local information is outdated for the 362 corresponding node (local update sequence number is lower than 363 that within the TLV), potentially incorrect (local update 364 sequence number matches but the node data hash differs), or the 365 data is altogether missing: 367 + If the TLV does not contain node data, and the hash of the 368 node data differs, the receiver MUST reply with a Request 369 Node State TLV (Section 7.1.2) for the corresponding node. 371 + Otherwise the receiver MUST update its locally stored state 372 for that node (node data if present, update sequence number, 373 relative time) to match the received TLV. 375 o Any other TLV: TLVs not recognized by the receiver MUST be 376 silently ignored. 378 If secure unicast transport is configured for an endpoint, any Node 379 State TLVs received via insecure multicast MUST be silently ignored. 381 5.3. Adding and Removing Peers 383 When receiving a Node Endpoint TLV (Section 7.2.1) on an endpoint 384 from an unknown peer: 386 o If it comes via unicast, the remote node MUST be added as a peer 387 on the endpoint and a Neighbor TLV (Section 7.3.2) MUST be created 388 for it. 390 o If it comes via multicast, the node SHOULD be sent a (possibly 391 rate-limited) unicast Request Network State TLV (Section 7.1.1). 393 If keep-alives specified in Section 6.1 are NOT sent by the peer 394 (either the DNCP profile does not specify the use of keep-alives or 395 the particular peer chooses not to send keep-alives), some other 396 means MUST be employed to ensure a DNCP peer is present. When the 397 peer is no longer present, the Neighbor TLV and the local DNCP peer 398 state MUST be removed. 400 5.4. Purging Unreachable Nodes 402 When a Neighbor TLV or a whole node is added or removed, the neighbor 403 graph SHOULD be traversed, starting from the local node. The edges 404 to be traversed are identified by looking for Neighbor TLVs on both 405 nodes, that have the other node's identifier in the neighbor node 406 identifier, and local and neighbor endpoint identifiers swapped. 407 Each node reached should be marked currently reachable. 409 DNCP nodes MUST be either purged immediately when not marked 410 reachable in a particular graph traversal, or eventually after they 411 have not been marked reachable within DNCP_GRACE_INTERVAL. During 412 the grace period, the nodes that were not marked reachable in the 413 most recent graph traversal MUST NOT be used for calculation of the 414 network state hash, be provided to any applications that need to use 415 the whole TLV graph, or be provided to remote nodes. 417 6. Optional Extensions 419 This section specifies extensions to the core protocol that a DNCP 420 profile may want to use. 422 6.1. Keep-Alives 424 Trickle-driven status updates (Section 5.1) provide a mechanism for 425 handling of new peer detection (if applicable) on an endpoint, as 426 well as state change notifications. Another mechanism may be needed 427 to get rid of old, no longer valid DNCP peers if the transport or 428 lower layers do not provide one. 430 If keep-alives are not specified in the DNCP profile, the rest of 431 this subsection MUST be ignored. 433 A DNCP profile MAY specify either per-endpoint or per-peer keep-alive 434 support. 436 For every endpoint that a keep-alive is specified for in the DNCP 437 profile, the endpoint-specific keep-alive interval MUST be 438 maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is 439 a local value that is preferred for that for any reason 440 (configuration, energy conservation, media type, ..), it should be 441 substituted instead. If a non-default keep-alive interval is used on 442 any endpoint, a DNCP node MUST publish appropriate Keep-Alive 443 Interval TLV(s) (Section 7.3.3) within its node data. 445 6.1.1. Data Model Additions 447 The following additions to the Data Model (Section 4) are needed to 448 support keep-alive: 450 Each node MUST have a timestamp which indicates the last time a 451 Network State TLV (Section 7.2.2) was sent for each endpoint, i.e. on 452 an interface or to the point-to-point peer(s). 454 Each node MUST have for each peer: 456 o Last contact timestamp: a timestamp which indicates the last time 457 a consistent Network State TLV (Section 7.2.2) was received from 458 the peer via multicast, or anything was received via unicast. 459 When adding a new peer, it should be initialized to the current 460 time. 462 6.1.2. Per-Endpoint Periodic Keep-Alives 464 If per-endpoint keep-alives are enabled on an endpoint with a 465 multicast-enabled link, and if no traffic containing a Network State 466 TLV (Section 7.2.2) has been sent to a particular endpoint within the 467 endpoint-specific keep-alive interval, a Network State TLV 468 (Section 7.2.2) MUST be sent on that endpoint, and a new Trickle 469 transmission time 't' in [I/2, I] MUST be randomly chosen. The 470 actual sending time SHOULD be further delayed by a random timespan in 471 [0, Imin/2]. 473 6.1.3. Per-Peer Periodic Keep-Alives 475 If per-peer keep-alives are enabled on a unicast-only endpoint, and 476 if no traffic containing a Network State TLV (Section 7.2.2) has been 477 sent to a particular peer within the endpoint-specific keep-alive 478 interval, a Network State TLV (Section 7.2.2) MUST be sent to the 479 peer and a new Trickle transmission time 't' in [I/2, I] MUST be 480 randomly chosen. 482 6.1.4. Received TLV Processing Additions 484 If a TLV is received via unicast from the peer, the Last contact 485 timestamp for the peer MUST be updated. 487 On receipt of a Network State TLV (Section 7.2.2) which is consistent 488 with the locally calculated network state hash, the Last contact 489 timestamp for the peer MUST be updated. 491 6.1.5. Neighbor Removal 493 For every peer on every endpoint, the endpoint-specific keep-alive 494 interval must be calculated by looking for Keep-Alive Interval TLVs 495 (Section 7.3.3) published by the node, and if none exist, using the 496 default value of DNCP_KEEPALIVE_INTERVAL. If the peer's last contact 497 state timestamp has not been updated for at least 498 DNCP_KEEPALIVE_MULTIPLIER times the peer's endpoint-specific keep- 499 alive interval, the Neighbor TLV for that peer and the local DNCP 500 peer state MUST be removed. 502 6.2. Support For Dense Broadcast Links 504 An upper bound for the number of neighbors that are allowed for a 505 (particular type of) link that an endpoint runs on SHOULD be provided 506 by a DNCP profile, user configuration, or some hardcoded default in 507 the implementation. If an implementation does not support this, the 508 rest of this subsection MUST be ignored. 510 If the specified limit is exceeded, nodes without the highest Node 511 Identifier on the link SHOULD treat the endpoint as a unicast 512 endpoint connected to the node that has the highest Node Identifier 513 detected on the link. The nodes MUST also keep listening to 514 multicast traffic to both detect the presence of that node, and to 515 react to nodes with a higher Node Identifier appearing. If the 516 highest Node Identifier present on the link changes, the remote 517 unicast address of unicast endpoints MUST be changed. If the Node 518 Identifier of the local node is the highest one, the node MUST keep 519 the endpoint in multicast mode, and the node MUST allow others to 520 peer with it over the link via unicast as well. 522 6.3. Node Data Fragmentation 524 A DNCP profile may be required to support node data which would not 525 the fit maximum size of a single Node State TLV (Section 7.2.3) 526 (roughly 64KB of payload), or use a datagram-only transport with a 527 limited MTU and no reliable support for fragmentation. To handle 528 such cases, a DNCP profile MAY specify a fixed number of trailing 529 bytes in the Node Identifier to represent a fragment number 530 indicating a part of a node's node data. The profile MAY also 531 specify an upper bound for the size of a single fragment to 532 accommodate limitations of links in the network. 534 The data within Node State TLVs of fragments with non-zero fragment 535 number must be treated as opaque (as they may not contain even a 536 single full TLV). However, the concatenated node data for a 537 particular node MUST be produced by concatenating all node data for 538 each fragment, in ascending fragment number order. The concatenated 539 node data MUST follow the ordering described in Section 4. 541 Any Node Identifiers on the wire used to identify the own or any 542 other node MUST have the fragment number 0. For algorithm purposes, 543 the relative time since the most recent fragment change MUST be used, 544 regardless of fragment number. Therefore, even if just part of the 545 node data fragments change, they all are considered refreshed if one 546 of them is. 548 If using fragmentation, the unreachable node purging defined in 549 Section 5.4 is extended so that if a Fragment Count TLV 550 (Section 7.3.1) is present within the fragment number 0, all 551 fragments up to fragment number specified in the Count field are also 552 considered reachable if the fragment number 0 itself is reachable 553 based on graph traversal. 555 7. Type-Length-Value Objects 557 Each TLV is encoded as a 2 byte type field, followed by a 2 byte 558 length field (of the value, excluding header; 0 means no value) 559 followed by the value itself (if any). Both type and length fields 560 in the header as well as all integer fields inside the value - unless 561 explicitly stated otherwise - are represented in network byte order. 562 Zero padding bytes MUST be added up to the next 4 byte boundary if 563 the length is not divisible by 4. These padding bytes MUST NOT be 564 included in the length field. 566 0 1 2 3 567 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 568 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 569 | Type | Length | 570 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 571 | Value | 572 | (variable # of bytes) | 573 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 575 For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is 576 encoded as: 007B 0001 7800 0000. 578 Notation: 580 .. = octet string concatenation operation. 582 H(x) = non-cryptographic hash function specified by DNCP profile. 584 7.1. Request TLVs 586 7.1.1. Request Network State TLV 588 0 1 2 3 589 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 590 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 591 | Type: REQ-NETWORK-STATE (1) | Length: 0 | 592 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 594 This TLV is used to request response with a Network State TLV 595 (Section 7.2.2) and all Node State TLVs (Section 7.2.3). 597 7.1.2. Request Node State TLV 599 0 1 2 3 600 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 601 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 602 | Type: REQ-NODE-STATE (2) | Length: >0 | 603 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 604 | Node Identifier | 605 | (length fixed in DNCP profile) | 606 ... 607 | | 608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 610 This TLV is used to request response with a Node State TLV 611 (Section 7.2.3) for the node with matching node identifier which also 612 includes the node data. 614 7.2. Data TLVs 616 7.2.1. Node Endpoint TLV 618 0 1 2 3 619 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 621 | Type: NODE-ENDPOINT (3) | Length: > 4 | 622 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 623 | Node Identifier | 624 | (length fixed in DNCP profile) | 625 ... 626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 627 | Endpoint Identifier | 628 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 630 This TLV identifies both the local node's node identifier, as well as 631 the particular endpoint's endpoint identifier. It MUST be sent in 632 every message if bidirectional peer relationship is desired with 633 remote nodes on that endpoint. Bidirectional peer relationship is 634 not necessary for read-only access to the DNCP state, but it is 635 required to be able to publish something. 637 7.2.2. Network State TLV 639 0 1 2 3 640 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 641 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 642 | Type: NETWORK-STATE (4) | Length: > 0 | 643 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 644 | H(H(update number of node 1) .. H(node data of node 1) .. | 645 | .. H(update number of node N) .. H(node data of node N)) | 646 | (length fixed in DNCP profile) | 647 ... 648 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 650 This TLV contains the current locally calculated network state hash. 651 It is calculated over each reachable nodes' update number 652 concatenated with the hash value of its node data in ascending order 653 of the respective node identifier. 655 7.2.3. Node State TLV 656 0 1 2 3 657 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 658 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 659 | Type: NODE-STATE (5) | Length: > 8 | 660 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 661 | Node Identifier | 662 | (length fixed in DNCP profile) | 663 ... 664 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 665 | Update Sequence Number | 666 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 667 | Milliseconds since Origination | 668 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 669 | H(node data) | 670 | (length fixed in DNCP profile) | 671 ... 672 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 673 |(optionally) Nested TLVs containing node information | 674 ... 675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 677 This TLV represents the local node's knowledge about the published 678 state of a node in the DNCP network identified by the node identifier 679 field in the TLV. 681 The whole network should have roughly same idea about the time since 682 origination of any particular published state. Therefore every node, 683 including the originating one, MUST increment the time whenever it 684 needs to send a Node State TLV for already published node data. 686 The actual node data of the node may be included within the TLV as 687 well; see Section 5.2 for the cases where it MUST or MUST NOT be 688 included. In a DNCP profile which supports fragmentation, described 689 in Section 6.3, the TLV data may be only partial and not really 690 usable without other fragments. 692 7.2.4. Custom TLV 694 0 1 2 3 695 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 696 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 697 | Type: CUSTOM-DATA (6) | Length: > 0 | 698 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 699 | H(URI) | 700 | (length fixed in DNCP profile) | 701 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 702 | Opaque Data | 703 This TLV can be used to contain anything; the URI used should be 704 under control of the author of that specification. The TLV may 705 appear within protocol exchanges, or within Node State TLV 706 (Section 7.2.3). For example: 708 V = H('http://example.com/author/json-for-dncp') .. '{"cool": "json 709 extension!"}' 711 or 713 V = H('mailto:author@example.com') .. '{"cool": "json extension!"}' 715 7.3. Data TLVs within Node State TLV 717 These TLVs are DNCP-specific parts of node-specific node data, and 718 are encoded within the Node State TLVs. If encountered outside Node 719 State TLV, they MUST be silently ignored. 721 7.3.1. Fragment Count TLV 723 0 1 2 3 724 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 725 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 726 | Type: FRAGMENT-COUNT (7) | Length: > 0 | 727 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 728 | Count | 729 | (length fixed in DNCP profile) | 730 ... 731 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 733 If the DNCP profile supports node data fragmentation as specified in 734 Section 6.3, this TLV indicates that the node data is encoded as a 735 sequence of Node State TLVs. Following Node State TLVs with Node 736 Identifiers up to Count higher than the current one MUST be 737 considered reachable and part of the same logical set of node data 738 that this TLV is within. The fragment portion of the Node Identifier 739 of the Node State TLV this is TLV appears in MUST be zeros. 741 7.3.2. Neighbor TLV 742 0 1 2 3 743 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 744 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 745 | Type: NEIGHBOR (8) | Length: > 8 | 746 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 747 | neighbor node identifier | 748 | (length fixed in DNCP profile) | 749 ... 750 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 751 | Neighbor Endpoint Identifier | 752 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 753 | Local Endpoint Identifier | 754 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 756 This TLV indicates that the node in question vouches that the 757 specified neighbor is reachable by it on the specified local 758 endpoint. The presence of this TLV at least guarantees that the node 759 publishing it has received traffic from the neighbor recently. For 760 guaranteed up-to-date bidirectional reachability, the existence of 761 both nodes' matching Neighbor TLVs should be checked. 763 7.3.3. Keep-Alive Interval TLV 765 0 1 2 3 766 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 767 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 768 | Type: KEEP-ALIVE-INTERVAL (9) | Length: 8 | 769 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 770 | Endpoint Identifier | 771 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 772 | Interval | 773 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 775 This TLV indicates a non-default interval being used to send keep- 776 alives specified in Section 6.1. 778 Endpoint identifier is used to identify the particular endpoint for 779 which the interval applies. If 0, it applies for ALL endpoints for 780 which no specific TLV exists. 782 Interval specifies the interval in milliseconds at which the node 783 sends keep-alives. A value of zero means no keep-alives are sent at 784 all; in that case, some lower layer mechanism that ensures presence 785 of nodes MUST be available and used. 787 8. Security and Trust Management 789 If specified in the DNCP profile, either DTLS [RFC6347] or TLS 790 [RFC5246] may be used to authenticate and encrypt either some (if 791 specified optional in the profile), or all unicast traffic. The 792 following methods for establishing trust are defined, but it is up to 793 the DNCP profile to specify which ones may, should or must be 794 supported. 796 8.1. Pre-Shared Key Based Trust Method 798 A PSK-based trust model is a simple security management mechanism 799 that allows an administrator to deploy devices to an existing network 800 by configuring them with a pre-defined key, similar to the 801 configuration of an administrator password or WPA-key. Although 802 limited in nature it is useful to provide a user-friendly security 803 mechanism for smaller networks. 805 8.2. PKI Based Trust Method 807 A PKI-based trust-model enables more advanced management capabilities 808 at the cost of increased complexity and bootstrapping effort. It 809 however allows trust to be managed in a centralized manner and is 810 therefore useful for larger networks with a need for an authoritative 811 trust management. 813 8.3. Certificate Based Trust Consensus Method 815 The certificate-based consensus model is designed to be a compromise 816 between trust management effort and flexibility. It is based on 817 X.509-certificates and allows each DNCP node to provide a verdict on 818 any other certificate and a consensus is found to determine whether a 819 node using this certificate or any certificate signed by it is to be 820 trusted. 822 The current effective trust verdict for any certificate is defined as 823 the one with the highest priority from all verdicts announced for 824 said certificate at the time. 826 8.3.1. Trust Verdicts 828 Trust Verdicts are statements of DNCP nodes about the trustworthiness 829 of X.509-certificates. There are 5 possible verdicts in order of 830 ascending priority: 832 0 Neutral : no verdict exists but the DNCP network should determine 833 one. 835 1 Cached Trust : the last known effective verdict was Configured or 836 Cached Trust. 838 2 Cached Distrust : the last known effective verdict was Configured 839 or Cached Distrust. 841 3 Configured Trust : trustworthy based upon an external ceremony or 842 configuration. 844 4 Configured Distrust : not trustworthy based upon an external 845 ceremony or configuration. 847 Verdicts are differentiated in 3 groups: 849 o Configured verdicts are used to announce explicit verdicts a node 850 has based on any external trust bootstrap or predefined relation a 851 node has formed with a given certificate. 853 o Cached verdicts are used to retain the last known trust state in 854 case all nodes with configured verdicts about a given certificate 855 have been disconnected or turned off. 857 o The Neutral verdict is used to announce a new node intending to 858 join the network so a final verdict for it can be found. 860 The current effective trust verdict for any certificate is defined as 861 the one with the highest priority within the set of verdicts + 862 announced for the certificate in the DNCP network. A node MUST be 863 trusted for participating in the DNCP network if and only if the 864 current effective verdict for its own certificate or any one in its 865 certificate hierarchy is (Cached or Configured) Trust and none of the 866 certificates in its hierarchy have an effective verdict of (Cached or 867 Configured) Distrust. In case a node has a configured verdict, which 868 is different from the current effective verdict for a certificate, 869 the current effective verdict takes precedence in deciding 870 trustworthiness. Despite that, the node still retains and announces 871 its configured verdict. 873 8.3.2. Trust Cache 875 Each node SHOULD maintain a trust cache containing the current 876 effective trust verdicts for all certificates currently announced in 877 the DNCP network. This cache is used as a backup of the last known 878 state in case there is no node announcing a configured verdict for a 879 known certificate. It SHOULD be saved to a non-volatile memory at 880 reasonable time intervals to survive a reboot or power outage. 882 Every time a node (re)joins the network or detects the change of an 883 effective trust verdict for any certificate, it will synchronize its 884 cache, i.e. store new effective verdicts overwriting any previously 885 cached verdicts. Configured verdicts are stored in the cache as 886 their respective cached counterparts. Neutral verdicts are never 887 stored and do not override existing cached verdicts. 889 8.3.3. Announcement of Verdicts 891 A node SHOULD always announce any configured trust verdicts it has 892 established by itself, and it MUST do so if announcing the configured 893 trust verdict leads to a change in the current effective verdict for 894 the respective certificate. In absence of configured verdicts, it 895 MUST announce cached trust verdicts it has stored in its trust cache, 896 if one of the following conditions applies: 898 o The stored verdict is Cached Trust and the current effective 899 verdict for the certificate is Neutral or does not exist. 901 o The stored verdict is Cached Distrust and the current effective 902 verdict for the certificate is Cached Trust. 904 A node rechecks these conditions whenever it detects changes of 905 announced trust verdicts anywhere in the network. 907 Upon encountering a node with a hierarchy of certificates for which 908 there is no effective verdict, a node adds a Neutral Trust-Verdict- 909 TLV to its node data for all certificates found in the hierarchy, and 910 publishes it until an effective verdict different from Neutral can be 911 found for any of the certificates, or a reasonable amount of time (10 912 minutes is suggested) with no reaction and no further authentication 913 attempts has passed. Such verdicts SHOULD also be limited in rate 914 and number to prevent denial-of-service attacks. 916 Trust verdicts are announced using Trust-Verdict TLVs: 918 0 1 2 3 919 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 920 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 921 | Type: Trust-Verdict (10) | Length: 37-100 | 922 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 923 | Verdict | (reserved) | 924 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 925 | | 926 | | 927 | | 928 | SHA-256 Fingerprint | 929 | | 930 | | 931 | | 932 | | 933 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 934 | Common Name | 936 Verdict represents the numerical index of the verdict. 938 (reserved) is reserved for future additions and MUST be set to 0 939 when creating TLVs and ignored when parsing them. 941 SHA-256 Fingerprint contains the SHA-256 [RFC6234] hash value of 942 the certificate in DER-format. 944 Common Name contains the variable-length (1-64 bytes) common name 945 of the certificate. Final byte MUST have value of 0. 947 8.3.4. Bootstrap Ceremonies 949 The following non-exhaustive list of methods describes possible ways 950 to establish trust relationships between DNCP nodes and node 951 certificates. Trust establishment is a two-way process in which the 952 existing network must trust the newly added node and the newly added 953 node must trust at least one of its neighboring nodes. It is 954 therefore necessary that both the newly added node and an already 955 trusted node perform such a ceremony to successfully introduce a node 956 into the DNCP network. In all cases an administrator MUST be 957 provided with external means to identify the node belonging to a 958 certificate based on its fingerprint and a meaningful common name. 960 8.3.4.1. Trust by Identification 962 A node implementing certificate-based trust MUST provide an interface 963 to retrieve the current set of effective trust verdicts, fingerprints 964 and names of all certificates currently known and set configured 965 trust verdicts to be announced. Alternatively it MAY provide a 966 companion DNCP node or application with these capabilities with which 967 it has a pre-established trust relationship. 969 8.3.4.2. Preconfigured Trust 971 A node MAY be preconfigured to trust a certain set of node or CA 972 certificates. However such trust relationships MUST NOT result in 973 unwanted or unrelated trust for nodes not intended to be run inside 974 the same network (e.g. all other devices by the same manufacturer). 976 8.3.4.3. Trust on Button Press 978 A node MAY provide a physical or virtual interface to put one or more 979 of its internal network interfaces temporarily into a mode in which 980 it trusts the certificate of the first DNCP node it can successfully 981 establish a connection with. 983 8.3.4.4. Trust on First Use 985 A node which is not associated with any other DNCP node MAY trust the 986 certificate of the first DNCP node it can successfully establish a 987 connection with. This method MUST NOT be used when the node has 988 already associated with any other DNCP node. 990 9. DNCP Profile-Specific Definitions 992 Each DNCP profile MUST define following: 994 o How the transport is secured: Not at all, optionally or always 995 with the TLS scheme defined here using one or more of the methods, 996 or with something else. If the links with DNCP nodes can be 997 sufficiently secured or isolated, it is possible to run DNCP in a 998 secure manner without using any form of authentication or 999 encryption. 1001 o Unicast and optionally multicast transport protocol(s) to be used. 1002 If TLS scheme within this document is to be used security, TLS or 1003 DTLS support for at least the unicast transport protocol is 1004 mandatory. 1006 o Transport protocols' parameters such as port numbers to be used, 1007 or multicast address to be used. Unicast, multicast, and secure 1008 unicast may each require different parameters, if applicable. 1010 o When receiving messages, what sort of messages are dropped, as 1011 specified in Section 5.2. 1013 o How to deal with node identifier collision as described in 1014 Section 5.2. Main options are either for one or both nodes to 1015 assign new node identifiers to themselves, or to notify someone 1016 about a fatal error condition in the DNCP network. 1018 o Imin, Imax and k ranges to be suggested for implementations to be 1019 used in the Trickle algorithm. The Trickle algorithm does not 1020 require these to be same across all implementations for it to 1021 work, but similar orders of magnitude helps implementations of a 1022 DNCP profile to behave more consistently and to facilitate 1023 estimation of lower and upper bounds for behavior of the network. 1025 o Hash function H(x) to be used, and how many bits of the input are 1026 actually used. The chosen hash function is used to handle both 1027 hashing of node specific data, and network state hash, which is a 1028 hash of node specific data hashes. SHA-256 defined in [RFC6234] 1029 is the recommended default choice. 1031 o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier 1032 (in bytes). 1034 o DNCP_GRACE_INTERVAL: How long node data for unreachable nodes is 1035 kept. 1037 o Whether to send keep-alives, and if so, on an interface, using 1038 multicast, or directly using unicast to peers. Keep-alive has 1039 also associated parameters: 1041 * DNCP_KEEPALIVE_INTERVAL: How often keep-alives are to be sent 1042 by default (if enabled). 1044 * DNCP_KEEPALIVE_MULTIPLIER: How many times the 1045 DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval 1046 value) a node may not be heard from to be considered still 1047 valid. 1049 o Whether to support fragmentation, and if so, the number of bytes 1050 reserved for fragment count in the node identifier. 1052 10. Security Considerations 1054 DNCP profiles may use multicast to indicate DNCP state changes and 1055 for keep-alive purposes. However, no actual data TLVs will be sent 1056 across that channel. Therefore an attacker may only learn hash 1057 values of the state within DNCP and may be able to trigger unicast 1058 synchronization attempts between nodes on a local link this way. A 1059 DNCP node should therefore rate-limit its reactions to multicast 1060 packets. 1062 When using DNCP to bootstrap a network, PKI based solutions may have 1063 issues when validating certificates due to potentially unavailable 1064 accurate time, or due to inability to use the network to either check 1065 Certifcate Revocation Lists or perform on-line validation. 1067 The Certificate-based trust consensus mechanism defined in this 1068 document allows for a consenting revocation, however in case of a 1069 compromised device the trust cache may be poisoned before the actual 1070 revocation happens allowing the distrusted device to rejoin the 1071 network using a different identity. Stopping such an attack might 1072 require physical intervention and flushing of the trust caches. 1074 11. IANA Considerations 1076 IANA should set up a registry for DNCP TLV types, with the following 1077 initial contents: 1079 0: Reserved (should not happen on wire) 1081 1: Request network state 1083 2: Request node state 1085 3: Node endpoint 1087 4: Network state 1089 5: Node state 1091 6: Custom 1093 7: Fragment count 1095 8: Neighbor 1097 9: Keep-alive interval 1099 10: Trust-Verdict 1101 32-191: Reserved for per-DNCP profile use 1103 192-255: Reserved for per-implementation experimentation. The nodes 1104 using TLV types in this range SHOULD use e.g. Custom TLV to identify 1105 each other and therefore eliminate potential conflict caused by 1106 potential different use of same TLV numbers. 1108 For the rest of the values (11-31, 256-65535), policy of 'standards 1109 action' should be used. 1111 12. References 1113 12.1. Normative references 1115 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1116 Requirement Levels", BCP 14, RFC 2119, March 1997. 1118 [RFC6206] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko, 1119 "The Trickle Algorithm", RFC 6206, March 2011. 1121 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1122 Security Version 1.2", RFC 6347, January 2012. 1124 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1125 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1127 12.2. Informative references 1129 [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W. 1130 Stevens, "Basic Socket Interface Extensions for IPv6", RFC 1131 3493, February 2003. 1133 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 1134 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 1136 Appendix A. Some Questions and Answers [RFC Editor: please remove] 1138 Q: 32-bit endpoint id? 1140 A: Here, it would save 32 bits per neighbor if it was 16 bits (and 1141 less is not realistic). However, TLVs defined elsewhere would not 1142 seem to even gain that much on average. 32 bits is also used for 1143 ifindex in various operating systems, making for simpler 1144 implementation. 1146 Q: Why have topology information at all? 1148 A: It is an alternative to the more traditional seq#/TTL-based 1149 flooding schemes. In steady state, there is no need to e.g. re- 1150 publish every now and then. 1152 Appendix B. Changelog [RFC Editor: please remove] 1154 draft-ietf-homenet-dncp-03: 1156 o Renamed connection -> endpoint. 1158 o !!! Backwards incompatible change: Renumbered TLVs, and got rid of 1159 node data TLV; instead, node data TLV's contents are optionally 1160 within node state TLV. 1162 draft-ietf-homenet-dncp-02: 1164 o Changed DNCP "messages" into series of TLV streams, allowing 1165 optimized round-trip saving synchronization. 1167 o Added fragmentation support for bigger node data and for chunking 1168 in absence of reliable L2 and L3 fragmentation. 1170 draft-ietf-homenet-dncp-01: 1172 o Fixed keep-alive semantics to consider unicast requests also 1173 updates of most recently consistent, and added proactive unicast 1174 request to ensure even inconsistent keep-alive messages eventually 1175 triggering consistency timestamp update. 1177 o Facilitated (simple) read-only clients by making Node Connection 1178 TLV optional if just using DNCP for read-only purposes. 1180 o Added text describing how to deal with "dense" networks, but left 1181 actual numbers and mechanics up to DNCP profiles and (local) 1182 configurations. 1184 draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf- 1185 homenet-hncp-03 generic parts. Changes that affect implementations: 1187 o TLVs were renumbered. 1189 o TLV length does not include header (=-4). This facilitates e.g. 1190 use of DHCPv6 option parsing libraries (same encoding), and 1191 reduces complexity (no need to handle error values of length less 1192 than 4). 1194 o Trickle is reset only when locally calculated network state hash 1195 is changes, not as remote different network state hash is seen. 1196 This prevents e.g. attacks by multicast with one multicast packet 1197 to force Trickle reset on every interface of every node on a link. 1199 o Instead of 'ping', use 'keep-alive' (optional) for dead peer 1200 detection. Different message used! 1202 Appendix C. Draft Source [RFC Editor: please remove] 1204 As usual, this draft is available at https://github.com/fingon/ietf- 1205 drafts/ in source format (with nice Makefile too). Feel free to send 1206 comments and/or pull requests if and when you have changes to it! 1208 Appendix D. Acknowledgements 1210 Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley, 1211 Juliusz Chroboczek, Jiazi Yi, Mikael Abrahamsson and Brian Carpenter 1212 for their contributions to the draft. 1214 Authors' Addresses 1216 Markus Stenberg 1217 Helsinki 00930 1218 Finland 1220 Email: markus.stenberg@iki.fi 1222 Steven Barth 1223 Halle 06114 1224 Germany 1226 Email: cyrus@openwrt.org