idnits 2.17.1 draft-ietf-homenet-dncp-02.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 22, 2015) is 3263 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 24, 2015 6 April 22, 2015 8 Distributed Node Consensus Protocol 9 draft-ietf-homenet-dncp-02 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 24, 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 . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 4. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 57 5. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 6 58 5.1. Trickle-Driven Status Update Messages . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . . . 10 64 6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 10 65 6.1.2. Per-Connection Periodic Keep-Alives . . . . . . . . . 10 66 6.1.3. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . 11 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 Data TLV . . . . . . . . . . . . . . . . 13 75 7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 14 76 7.2.1. Node Connection TLV . . . . . . . . . . . . . . . . . 14 77 7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 14 78 7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 14 79 7.2.4. Node Data TLV . . . . . . . . . . . . . . . . . . . . 15 80 7.2.5. Custom TLV . . . . . . . . . . . . . . . . . . . . . 16 81 7.3. Data TLVs within Node Data TLV . . . . . . . . . . . . . 16 82 7.3.1. Fragment Count TLV . . . . . . . . . . . . . . . . . 16 83 7.3.2. Neighbor TLV . . . . . . . . . . . . . . . . . . . . 17 84 7.3.3. Keep-Alive Interval TLV . . . . . . . . . . . . . . . 17 85 8. Security and Trust Management . . . . . . . . . . . . . . . . 18 86 8.1. Pre-Shared Key Based Trust Method . . . . . . . . . . . . 18 87 8.2. PKI Based Trust Method . . . . . . . . . . . . . . . . . 18 88 8.3. Certificate Based Trust Consensus Method . . . . . . . . 18 89 8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 18 90 8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 19 91 8.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 20 92 8.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 21 93 9. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 22 94 10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 95 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 96 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 97 12.1. Normative references . . . . . . . . . . . . . . . . . . 25 98 12.2. Informative references . . . . . . . . . . . . . . . . . 25 99 Appendix A. Some Questions and Answers [RFC Editor: please 100 remove] . . . . . . . . . . . . . . . . . . . . . . 25 101 Appendix B. Changelog [RFC Editor: please remove] . . . . . . . 26 102 Appendix C. Draft Source [RFC Editor: please remove] . . . . . . 26 103 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 27 104 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 106 1. Introduction 108 DNCP is designed to provide a way for nodes to publish data 109 consisting of an ordered set of TLV (Type-Length-Value) tuples and to 110 receive the data published by all other reachable DNCP nodes. 112 DNCP validates the set of data within it by ensuring that it is 113 reachable via nodes that are currently accounted for; therefore, 114 unlike Time-To-Live (TTL) based solutions, it does not require 115 periodic re-publishing of the data by the nodes. On the other hand, 116 it does require the topology to be visible to every node that wants 117 to be able to identify unreachable nodes and therefore remove old, 118 stale data. Another notable feature is the use of Trickle to send 119 status updates as it makes the DNCP network very thrifty when there 120 are no updates. DNCP is most suitable for data that changes only 121 gradually to gain the maximum benefit from using Trickle, and if more 122 rapid state exchanges are needed, something point-to-point is 123 recommended and just e.g. publishing of addresses of the services 124 within DNCP. 126 DNCP has relatively few requirements for the underlying transport; it 127 requires some way of transmitting either unicast datagram or stream 128 data to a DNCP peer and, if used in multicast mode, a way of sending 129 multicast datagrams. If security is desired and one of the built-in 130 security methods is to be used, support for some TLS-derived 131 transport scheme - such as TLS [RFC5246] on top of TCP or DTLS 132 [RFC6347] on top of UDP - is also required. 134 2. Requirements Language 136 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 137 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 138 document are to be interpreted as described in RFC 2119 [RFC2119]. 140 3. Terminology 142 A DNCP profile is a definition of a set of rules and values listed in 143 Section 9 specifying the behavior of a DNCP based protocol, such as 144 the used transport method. For readability, any DNCP profile 145 specific parameters with a profile-specific fixed value are prefixed 146 with DNCP_. 148 A DNCP node is a single node which runs a protocol based on a DNCP 149 profile. 151 The DNCP network is a set of DNCP nodes running the same DNCP profile 152 that can reach each other, either via discovered connectivity in the 153 underlying network, or using each other's addresses learned via other 154 means. As DNCP exchanges are bidirectional, DNCP nodes connected via 155 only unidirectional links are not considered connected. 157 The node identifier is an opaque fixed-length identifier consisting 158 of DNCP_NODE_IDENTIFIER_LENGTH bytes which uniquely identifies a DNCP 159 node within a DNCP network. 161 A link indicates a link-layer media over which directly connected 162 nodes can communicate. 164 An interface indicates a port of a node that is connected to a 165 particular link. 167 A connection denotes a locally configured use of DNCP on a DNCP node, 168 that is attached either to an interface, to a specific remote unicast 169 address to be contacted, or to a range of remote unicast addresses 170 that are allowed to contact. 172 The connection identifier is a 32-bit opaque value, which identifies 173 a particular connection of that particular DNCP node. The value 0 is 174 reserved for DNCP and sub-protocol purposes in the TLVs, and MUST NOT 175 be used to identify an actual connection. This definition is in sync 176 with [RFC3493], as the non-zero small positive integers should 177 comfortably fit within 32 bits. 179 A (DNCP) peer refers to another DNCP node with which a DNCP node 180 communicates directly using a particular local and remote connection 181 pair. 183 The node data is a set of TLVs published by a node in the DNCP 184 network. The whole node data is owned by the node that publishes it, 185 and it MUST be passed along as-is, including TLVs unknown to the 186 forwarder. 188 The node state is a set of metadata attributes for node data. It 189 includes a sequence number for versioning, a hash value for comparing 190 and a timestamp indicating the time passed since its last 191 publication. The hash function and the number of bits used are 192 defined in the DNCP profile. 194 The network state (hash) is a hash value which represents the current 195 state of the network. The hash function and the number of bits used 196 are defined in the DNCP profile. Whenever any node is added, removed 197 or changes its published node data this hash value changes as well. 198 It is calculated over the hash values of each reachable nodes' node 199 data in ascending order of the respective node identifier. 201 The effective (trust) verdict for a certificate is defined as the 202 verdict with the highest priority within the set of verdicts 203 announced for the certificate in the DNCP network. 205 The neighbor graph is the undirected graph of DNCP nodes produced by 206 retaining only bidirectional peer relationships between nodes. 208 4. Data Model 210 A DNCP node has: 212 o A timestamp indicating the most recent neighbor graph traversal 213 described in Section 5.4. 215 A DNCP node has for every DNCP node in the DNCP network: 217 o A node identifier, which uniquely identifies the node. 219 o The node data, an ordered set of TLV tuples published by that 220 particular node. This set of TLVs has a well-defined order based 221 on ascending binary content (including TLV type and length). This 222 facilitates linear time state delta processing. 224 o The latest update sequence number, a 32 bit number that is 225 incremented any time the TLV set is published. For comparison 226 purposes, a looping comparison should be used to avoid problems in 227 case of overflow. An example would be: a < b <=> (a - b) % 2^32 & 228 2^31 != 0. 230 o The relative time (in milliseconds) since the current TLV data set 231 with the current update sequence number was published. It is also 232 a 32 bit number on the wire. If this number is close to overflow 233 (greater than 2^32-2^16), a node MUST re-publish its TLVs even if 234 there is no change to avoid overflow of the value. In other 235 words, absent any other changes, the TLV set MUST be re-published 236 roughly every 49 days. 238 o A timestamp identifying the time it was last reachable based on 239 neighbor graph traversal described in Section 5.4. 241 Additionally, a DNCP node has a set of connections for which DNCP is 242 configured to be used. For each such connection, a node has: 244 o A connection identifier. 246 o An interface, a unicast address of a DNCP node it should connect 247 with, or a range of addresses from which DNCP nodes are allowed to 248 connect. 250 o A Trickle [RFC6206] instance with parameters I, T, and c. 252 For each remote (DNCP node,connection) pair detected on a particular 253 connection, a DNCP node has: 255 o The node identifier of the DNCP peer. 257 o The connection identifier of the DNCP peer. 259 o The most recent address used by the DNCP peer (in an authenticated 260 message, if security is enabled). 262 5. Operation 264 The DNCP protocol consists of Trickle [RFC6206] driven unicast or 265 multicast status payloads which indicate the current status of shared 266 TLV data and additional unicast exchanges which ensure DNCP peer 267 reachability and synchronize the data when necessary. 269 If DNCP is to be used on a multicast-capable interface, as opposed to 270 only point-to-point using unicast, a datagram-based transport which 271 supports multicast SHOULD be defined in the DNCP profile to be used 272 for the TLVs to be sent to the whole link. As this is used only to 273 identify potential new DNCP nodes and to notify that an unicast 274 exchange should be triggered, the multicast transport does not have 275 to be particularly secure. 277 A DNCP message in and of itself is just an abstraction; when using 278 reliable stream transport, the whole stream of TLVs can be considered 279 a single message, with new TLVs becoming gradually available once 280 they have been fully received. On datagram transport, each 281 individual datagram is a separate message. In order to facilitate 282 fast comparing of local state with that in a received update, TLVs in 283 every container TLV MUST be placed in ascending order based on the 284 binary comparison of both TLV header and value. 286 5.1. Trickle-Driven Status Update Messages 288 When employing unreliable transport, each node MUST send a Network 289 State TLV (Section 7.2.2) every time the connection-specific Trickle 290 algorithm [RFC6206] instance indicates that an update should be sent. 291 Multicast MUST be employed on a multicast-capable interface; 292 otherwise, unicast can be used as well. If possible, most recent, 293 recently changed, or best of all, all known Node State TLVs 294 (Section 7.2.3) SHOULD be also included, unless it is defined as 295 undesirable for some reason by the DNCP profile. Avoiding sending 296 some or all Node State TLVs may make sense to avoid fragmenting 297 packets to multicast destinations, or for security reasons. 299 A Trickle state MUST be maintained separately for each connection 300 which employs unreliable transport. The Trickle state for all 301 connections is considered inconsistent and reset if and only if the 302 locally calculated network state hash changes. This occurs either 303 due to a change in the local node's own node data, or due to receipt 304 of more recent data from another node. 306 The Trickle algorithm has 3 parameters: Imin, Imax and k. Imin and 307 Imax represent the minimum and maximum values for I, which is the 308 time interval during which at least k Trickle updates must be seen on 309 a connection to prevent local state transmission. The actual 310 suggested Trickle algorithm parameters are DNCP profile specific, as 311 described in Section 9. 313 5.2. Processing of Received TLVs 315 This section describes how received TLVs are processed. The DNCP 316 profile may specify criteria based on which particular TLVs are 317 ignored. Any 'reply' mentioned in the steps below denotes sending of 318 the specified TLV(s) via unicast to the originator of the message 319 being processed. If the reply was caused by a multicast message and 320 sent to a link with shared bandwidth it SHOULD be delayed by a random 321 timespan in [0, Imin/2]. Sending of replies SHOULD be rate-limited 322 by the implementation, and in case of excess load (or some other 323 reason), a reply MAY be omitted altogether. 325 Upon receipt of: 327 o Request Network State TLV (Section 7.1.1): The receiver MUST reply 328 with a Network State TLV (Section 7.2.2) and a Node State TLV 329 (Section 7.2.3) for each Node Data TLV used to calculate the 330 network state hash. 332 o Network State TLV (Section 7.2.2): If the network state hash 333 differs from the locally calculated network state hash, and the 334 receiver is unaware of any particular node state differences with 335 the sender, the receiver MUST reply with a Request Network State 336 TLV (Section 7.1.1). The receiver MAY omit this, if there are 337 already recent pending requests for node state or node data. 339 o Node State TLV (Section 7.2.3): 341 * If the node identifier matches the local node identifier and 342 the TLV has a higher update sequence number than its current 343 local value, or the same update sequence number and a different 344 hash, the node SHOULD re-publish its own node data with an 345 update sequence number 1000 higher than the received one. This 346 may occur normally once due to the local node restarting and 347 not storing the most recently used update sequence number. If 348 this occurs more than once, the DNCP profile should provide 349 guidance on how to handle these situations as it indicates the 350 existence of another active node with the same node identifier. 352 * If the node identifier does not match the local node 353 identifier, and the local information is outdated for the 354 corresponding node (local update sequence number is lower than 355 that within the TLV), potentially incorrect (local update 356 sequence number matches but the hash of the node data TLV 357 differs), or the data is altogether missing, and there is no 358 corresponding Node Data TLV available, the receiver MUST reply 359 with a Request Node Data TLV (Section 7.1.2) for the 360 corresponding node. 362 o Request Node Data TLV (Section 7.1.2): If the receiver has node 363 data for the corresponding node, it MUST reply with a Node State 364 TLV (Section 7.2.3) and a Node Data TLV (Section 7.2.4) for the 365 corresponding node. 367 o Node Data TLV (Section 7.2.4): If the message contains also a Node 368 State TLV (Section 7.2.3) with the same update sequence number, 369 that is more recent than the local state (the received TLV has a 370 higher update sequence number, the node data TLV hash differs from 371 the local one, or local data is missing altogether), the receiver 372 MUST update its locally stored state for that node (node data, 373 update sequence number, relative time) to match the received TLVs. 375 o Any other TLV: DNCP profiles MAY add additional TLVs to the 376 message specified here, or even define additional messages as 377 needed. TLVs not recognized by the receiver MUST be silently 378 ignored. 380 If secure unicast transport is configured for a connection, any Node 381 Data TLVs and Node State TLVs received via insecure multicast MUST be 382 silently ignored. 384 5.3. Adding and Removing Peers 386 When receiving a message on a connection from an unknown peer: 388 o If it is a unicast message, and the message contains a Node 389 Connection TLV (Section 7.2.1), the remote node MUST be added as a 390 peer on the connection and a Neighbor TLV (Section 7.3.2) MUST be 391 created for it. 393 o If it is a multicast message, and the message contains a Node 394 Connection TLV (Section 7.2.1), the node SHOULD be sent a 395 (possibly rate-limited) unicast Request Network State TLV 396 (Section 7.1.1). 398 If keep-alives specified in Section 6.1 are NOT sent by the peer 399 (either the DNCP profile does not specify the use of keep-alives or 400 the particular peer chooses not to send keep-alives), some other 401 means MUST be employed to ensure a DNCP peer is present. When the 402 peer is no longer present, the Neighbor TLV and the local DNCP peer 403 state MUST be removed. 405 5.4. Purging Unreachable Nodes 407 When a Neighbor TLV or a whole node is added or removed, the neighbor 408 graph SHOULD be traversed, starting from the local node. The edges 409 to be traversed are identified by looking for Neighbor TLVs on both 410 nodes, that have the other node's identifier in the neighbor node 411 identifier, and local and neighbor connection identifiers swapped. 412 Each node reached should be marked currently reachable. 414 DNCP nodes MUST be either purged immediately when not marked 415 reachable in a particular graph traversal, or eventually after they 416 have not been marked reachable within DNCP_GRACE_INTERVAL. During 417 the grace period, the nodes that were not marked reachable in the 418 most recent graph traversal MUST NOT be used for calculation of the 419 network state hash, be provided to any applications that need to use 420 the whole TLV graph, or be provided to remote nodes. 422 6. Optional Extensions 424 This section specifies extensions to the core protocol that a DNCP 425 profile may want to use. 427 6.1. Keep-Alives 429 The Trickle-driven messages provide a mechanism for handling of new 430 peer detection (if applicable) on a connection, as well as state 431 change notifications. Another mechanism may be needed to get rid of 432 old, no longer valid DNCP peers if the transport or lower layers do 433 not provide one. 435 If keep-alives are not specified in the DNCP profile, the rest of 436 this subsection MUST be ignored. 438 A DNCP profile MAY specify either per-connection or per-peer keep- 439 alive support. 441 For every connection that a keep-alive is specified for in the DNCP 442 profile, the connection-specific keep-alive interval MUST be 443 maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is 444 a local value that is preferred for that for any reason 445 (configuration, energy conservation, media type, ..), it should be 446 substituted instead. If a non-default keep-alive interval is used on 447 any connection, a DNCP node MUST publish appropriate Keep-Alive 448 Interval TLV(s) (Section 7.3.3) within its node data. 450 6.1.1. Data Model Additions 452 The following additions to the Data Model (Section 4) are needed to 453 support keep-alive: 455 Each node MUST have a timestamp which indicates the last time a 456 Network State TLV (Section 7.2.2) was sent for each connection, i.e. 457 on an interface or to the point-to-point peer(s). 459 Each node MUST have for each peer: 461 o Last contact timestamp: a timestamp which indicates the last time 462 a consistent Network State TLV (Section 7.2.2) was received from 463 the peer via multicast, or anything was received via unicast. 464 When adding a new peer, it should be initialized to the current 465 time. 467 6.1.2. Per-Connection Periodic Keep-Alives 469 If per-connection keep-alives are enabled on a connection with a 470 multicast-enabled link, and if no traffic containing a Network State 471 TLV (Section 7.2.2) has been sent to a particular connection within 472 the connection-specific keep-alive interval, a Network State TLV 473 (Section 7.2.2) MUST be sent on that connection, and a new Trickle 474 transmission time 't' in [I/2, I] MUST be randomly chosen. The 475 actual sending time SHOULD be further delayed by a random timespan in 476 [0, Imin/2]. 478 6.1.3. Per-Peer Periodic Keep-Alives 480 If per-peer keep-alives are enabled on a unicast-only connection, and 481 if no traffic containing a Network State TLV (Section 7.2.2) has been 482 sent to a particular peer within the connection-specific keep-alive 483 interval, a Network State TLV (Section 7.2.2) MUST be sent to the 484 peer and a new Trickle transmission time 't' in [I/2, I] MUST be 485 randomly chosen. 487 6.1.4. Received TLV Processing Additions 489 If a TLV is received via unicast from the peer, the Last contact 490 timestamp for the peer MUST be updated. 492 On receipt of a Network State TLV (Section 7.2.2) which is consistent 493 with the locally calculated network state hash, the Last contact 494 timestamp for the peer MUST be updated. 496 6.1.5. Neighbor Removal 498 For every peer on every connection, the connection-specific keep- 499 alive interval must be calculated by looking for Keep-Alive Interval 500 TLVs (Section 7.3.3) published by the node, and if none exist, using 501 the default value of DNCP_KEEPALIVE_INTERVAL. If the peer's last 502 contact state timestamp has not been updated for at least 503 DNCP_KEEPALIVE_MULTIPLIER times the peer's connection-specific keep- 504 alive interval, the Neighbor TLV for that peer and the local DNCP 505 peer state MUST be removed. 507 6.2. Support For Dense Broadcast Links 509 An upper bound for the number of neighbors that are allowed for a 510 (particular type of) link that a connection runs on SHOULD be 511 provided by a DNCP profile, user configuration, or some hardcoded 512 default in the implementation. If an implementation does not support 513 this, the rest of this subsection MUST be ignored. 515 If the specified limit is exceeded, nodes without the highest Node 516 Identifier on the link SHOULD treat the connection as an unicast 517 connection connected to the node that has the highest Node Identifier 518 detected on the link. The nodes MUST also keep listening to 519 multicast traffic to both detect the presence of that node, and to 520 react to nodes with a higher Node Identifier appearing. If the 521 highest Node Identifier present on the link changes, the connection 522 endpoint MUST be changed. If the Node Identifier of the local node 523 is the highest one, the node MUST keep the connection in normal 524 multicast mode, and the node MUST allow others to peer with it over 525 the link. 527 6.3. Node Data Fragmentation 529 A DNCP profile may require a node to exceed the maximum size of a 530 single Node Data TLV (Section 7.2.4) (65535 bytes of payload), or use 531 a datagram-only transport with a limited MTU and no reliable support 532 for fragmentation. To handle such cases, a DNCP profile MAY specify 533 a fixed number of trailing bytes in the Node Identifier to represent 534 a fragment number indicating a part of a node's node data. The 535 profile MAY also specify an upper bound for the size of a single 536 fragment to accommodate limitations of links in the network. 538 The data within Node Data TLVs of fragments with non-zero fragment 539 number must be treated as opaque (as they may not contain even a 540 single full TLV). However, the concatenated node data for a 541 particular node MUST be produced by concatenating all node data for 542 each fragment, in ascending fragment number order. The concatenated 543 node data MUST follow the ordering described in Section 4. 545 Any Node Identifiers on the wire used to identify the own or any 546 other node MUST have the fragment number 0. For algorithm purposes, 547 the relative time since the most recent fragment change MUST be used, 548 regardless of fragment number. Therefore, even if just part of the 549 node data fragments change, they all are considered refreshed if one 550 of them is. 552 If using fragmentation, the unreachable node purging defined in 553 Section 5.4 is extended so that if a Fragment Count TLV 554 (Section 7.3.1) is present within the fragment number 0, all 555 fragments up to fragment number specified in the Count field are also 556 considered reachable if the fragment number 0 itself is reachable 557 based on graph traversal. 559 7. Type-Length-Value Objects 561 Each TLV is encoded as a 2 byte type field, followed by a 2 byte 562 length field (of the value, excluding header; 0 means no value) 563 followed by the value itself (if any). Both type and length fields 564 in the header as well as all integer fields inside the value - unless 565 explicitly stated otherwise - are represented in network byte order. 566 Zero padding bytes MUST be added up to the next 4 byte boundary if 567 the length is not divisible by 4. These padding bytes MUST NOT be 568 included in the length field. 570 0 1 2 3 571 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 572 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 573 | Type | Length | 574 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 575 | Value | 576 | (variable # of bytes) | 577 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 579 For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is 580 encoded as: 007B 0001 7800 0000. 582 Notation: 584 .. = octet string concatenation operation. 586 H(x) = non-cryptographic hash function specified by DNCP profile. 588 7.1. Request TLVs 590 7.1.1. Request Network State TLV 592 0 1 2 3 593 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 594 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 595 | Type: REQ-NETWORK-STATE (2) | Length: 0 | 596 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 598 This TLV is used to request response with a Network State TLV 599 (Section 7.2.2) and all Node State TLVs (Section 7.2.3). 601 7.1.2. Request Node Data TLV 603 0 1 2 3 604 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 605 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 606 | Type: REQ-NODE-DATA (3) | Length: >0 | 607 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 608 | Node Identifier | 609 | (length fixed in DNCP profile) | 610 ... 611 | | 612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 614 This TLV is used to request response with a Node State TLV 615 (Section 7.2.3) and a Node Data TLV (Section 7.2.4) for the node with 616 matching node identifier. 618 7.2. Data TLVs 620 7.2.1. Node Connection TLV 622 0 1 2 3 623 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 624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 625 | Type: NODE-CONNECTION (1) | Length: > 4 | 626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 627 | Node Identifier | 628 | (length fixed in DNCP profile) | 629 ... 630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 631 | Connection Identifier | 632 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 634 This TLV identifies both the local node's node identifier, as well as 635 the particular connection identifier. It MUST be sent in every 636 message if bidirectional peer relationship is desired with remote 637 nodes. Bidirectional peer relationship is not necessary for read- 638 only access to the DNCP state, but it is required to be able to 639 publish something. 641 7.2.2. Network State TLV 643 0 1 2 3 644 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 645 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 646 | Type: NETWORK-STATE (10) | Length: > 0 | 647 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 648 | H(H(node data TLV 1) .. [...] .. H(node data TLV N)) | 649 | (length fixed in DNCP profile) | 650 ... 651 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 653 This TLV contains the current locally calculated network state hash. 654 The network state hash is derived by calculating the hash value for 655 each currently reachable node's Node Data TLV, concatenating said 656 hash values based on the ascending order of their corresponding node 657 identifiers, and hashing the resulting concatenated hash values. 659 7.2.3. Node State TLV 660 0 1 2 3 661 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 662 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 663 | Type: NODE-STATE (11) | Length: > 8 | 664 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 665 | Node Identifier | 666 | (length fixed in DNCP profile) | 667 ... 668 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 669 | Update Sequence Number | 670 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 671 | Milliseconds since Origination | 672 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 673 | H(node data TLV) | 674 | (length fixed in DNCP profile) | 675 ... 676 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 678 This TLV represents the local node's knowledge about the published 679 state of a node in the DNCP network identified by the node identifier 680 field in the TLV. 682 The whole network should have roughly same idea about the time since 683 origination of any particular published state. Therefore every node, 684 including the originating one, MUST increment the time whenever it 685 needs to send a Node State TLV for an already published Node Data 686 TLV. This age value is not included within the Node Data TLV, 687 however, as that is immutable and used to detect changes in the 688 network state. 690 7.2.4. Node Data TLV 692 0 1 2 3 693 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 694 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 695 | Type: NODE-DATA (12) | Length: > 4 | 696 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 697 | node identifier | 698 | (length fixed in DNCP profile) | 699 ... 700 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 701 | Update Sequence Number | 702 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 703 | Nested TLVs containing node information | 705 7.2.5. Custom TLV 707 0 1 2 3 708 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 709 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 710 | Type: CUSTOM-DATA (15) | Length: > 0 | 711 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 712 | H(URI) | 713 | (length fixed in DNCP profile) | 714 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 715 | Opaque Data | 717 This TLV can be used to contain anything; the URI used should be 718 under control of the author of that specification. The TLV may 719 appear within protocol exchanges, or within Node Data TLV 720 (Section 7.2.4). For example: 722 V = H('http://example.com/author/json-for-dncp') .. '{"cool": "json 723 extension!"}' 725 or 727 V = H('mailto:author@example.com') .. '{"cool": "json extension!"}' 729 7.3. Data TLVs within Node Data TLV 731 7.3.1. Fragment Count TLV 733 0 1 2 3 734 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 735 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 736 | Type: FRAGMENT-COUNT (9) | Length: > 0 | 737 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 738 | Count | 739 | (length fixed in DNCP profile) | 740 ... 741 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 743 If the DNCP profile supports Node Data fragmentation as specified in 744 Section 6.3, this TLV indicates that the Node Data is encoded as a 745 series of Node Data TLVs. Subsequent Node Data with Node Identifiers 746 up to Count higher than the current one MUST be considered reachable 747 and part of the same logical set of Node Data that this TLV is 748 within. The fragment portion of the Node Identifier of the Node Data 749 this is within MUST be zeros. 751 7.3.2. Neighbor TLV 753 0 1 2 3 754 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 755 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 756 | Type: NEIGHBOR (13) | Length: > 8 | 757 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 758 | neighbor node identifier | 759 | (length fixed in DNCP profile) | 760 ... 761 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 762 | Neighbor Connection Identifier | 763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 764 | Local Connection Identifier | 765 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 767 This TLV indicates that the node in question vouches that the 768 specified neighbor is reachable by it on the specified local 769 connection. The presence of this TLV at least guarantees that the 770 node publishing it has received traffic from the neighbor recently. 771 For guaranteed up-to-date bidirectional reachability, the existence 772 of both nodes' matching Neighbor TLVs should be checked. 774 7.3.3. Keep-Alive Interval TLV 776 0 1 2 3 777 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 778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 779 | Type: KEEP-ALIVE-INTERVAL (14)| Length: 8 | 780 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 781 | Connection Identifier | 782 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 783 | Interval | 784 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 786 This TLV indicates a non-default interval being used to send keep- 787 alives specified in Section 6.1. 789 Connection identifier is used to identify the particular connection 790 for which the interval applies. If 0, it applies for ALL connections 791 for which no specific TLV exists. 793 Interval specifies the interval in milliseconds at which the node 794 sends keep-alives. A value of zero means no keep-alives are sent at 795 all; in that case, some lower layer mechanism that ensures presence 796 of nodes MUST be available and used. 798 8. Security and Trust Management 800 If specified in the DNCP profile, either DTLS [RFC6347] or TLS 801 [RFC5246] may be used to authenticate and encrypt either some (if 802 specified optional in the profile), or all unicast traffic. The 803 following methods for establishing trust are defined, but it is up to 804 the DNCP profile to specify which ones may, should or must be 805 supported. 807 8.1. Pre-Shared Key Based Trust Method 809 A PSK-based trust model is a simple security management mechanism 810 that allows an administrator to deploy devices to an existing network 811 by configuring them with a pre-defined key, similar to the 812 configuration of an administrator password or WPA-key. Although 813 limited in nature it is useful to provide a user-friendly security 814 mechanism for smaller networks. 816 8.2. PKI Based Trust Method 818 A PKI-based trust-model enables more advanced management capabilities 819 at the cost of increased complexity and bootstrapping effort. It 820 however allows trust to be managed in a centralized manner and is 821 therefore useful for larger networks with a need for an authoritative 822 trust management. 824 8.3. Certificate Based Trust Consensus Method 826 The certificate-based consensus model is designed to be a compromise 827 between trust management effort and flexibility. It is based on 828 X.509-certificates and allows each DNCP node to provide a verdict on 829 any other certificate and a consensus is found to determine whether a 830 node using this certificate or any certificate signed by it is to be 831 trusted. 833 The current effective trust verdict for any certificate is defined as 834 the one with the highest priority from all verdicts announced for 835 said certificate at the time. 837 8.3.1. Trust Verdicts 839 Trust Verdicts are statements of DNCP nodes about the trustworthiness 840 of X.509-certificates. There are 5 possible verdicts in order of 841 ascending priority: 843 0 Neutral : no verdict exists but the DNCP network should determine 844 one. 846 1 Cached Trust : the last known effective verdict was Configured or 847 Cached Trust. 849 2 Cached Distrust : the last known effective verdict was Configured 850 or Cached Distrust. 852 3 Configured Trust : trustworthy based upon an external ceremony or 853 configuration. 855 4 Configured Distrust : not trustworthy based upon an external 856 ceremony or configuration. 858 Verdicts are differentiated in 3 groups: 860 o Configured verdicts are used to announce explicit verdicts a node 861 has based on any external trust bootstrap or predefined relation a 862 node has formed with a given certificate. 864 o Cached verdicts are used to retain the last known trust state in 865 case all nodes with configured verdicts about a given certificate 866 have been disconnected or turned off. 868 o The Neutral verdict is used to announce a new node intending to 869 join the network so a final verdict for it can be found. 871 The current effective trust verdict for any certificate is defined as 872 the one with the highest priority within the set of verdicts + 873 announced for the certificate in the DNCP network. A node MUST be 874 trusted for participating in the DNCP network if and only if the 875 current effective verdict for its own certificate or any one in its 876 certificate hierarchy is (Cached or Configured) Trust and none of the 877 certificates in its hierarchy have an effective verdict of (Cached or 878 Configured) Distrust. In case a node has a configured verdict, which 879 is different from the current effective verdict for a certificate, 880 the current effective verdict takes precedence in deciding 881 trustworthiness. Despite that, the node still retains and announces 882 its configured verdict. 884 8.3.2. Trust Cache 886 Each node SHOULD maintain a trust cache containing the current 887 effective trust verdicts for all certificates currently announced in 888 the DNCP network. This cache is used as a backup of the last known 889 state in case there is no node announcing a configured verdict for a 890 known certificate. It SHOULD be saved to a non-volatile memory at 891 reasonable time intervals to survive a reboot or power outage. 893 Every time a node (re)joins the network or detects the change of an 894 effective trust verdict for any certificate, it will synchronize its 895 cache, i.e. store new effective verdicts overwriting any previously 896 cached verdicts. Configured verdicts are stored in the cache as 897 their respective cached counterparts. Neutral verdicts are never 898 stored and do not override existing cached verdicts. 900 8.3.3. Announcement of Verdicts 902 A node SHOULD always announce any configured trust verdicts it has 903 established by itself, and it MUST do so if announcing the configured 904 trust verdict leads to a change in the current effective verdict for 905 the respective certificate. In absence of configured verdicts, it 906 MUST announce cached trust verdicts it has stored in its trust cache, 907 if one of the following conditions applies: 909 o The stored verdict is Cached Trust and the current effective 910 verdict for the certificate is Neutral or does not exist. 912 o The stored verdict is Cached Distrust and the current effective 913 verdict for the certificate is Cached Trust. 915 A node rechecks these conditions whenever it detects changes of 916 announced trust verdicts anywhere in the network. 918 Upon encountering a node with a hierarchy of certificates for which 919 there is no effective verdict, a node adds a Neutral Trust-Verdict- 920 TLV to its node data for all certificates found in the hierarchy, and 921 publishes it until an effective verdict different from Neutral can be 922 found for any of the certificates, or a reasonable amount of time (10 923 minutes is suggested) with no reaction and no further authentication 924 attempts has passed. Such verdicts SHOULD also be limited in rate 925 and number to prevent denial-of-service attacks. 927 Trust verdicts are announced using Trust-Verdict TLVs: 929 0 1 2 3 930 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 931 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 932 | Type: Trust-Verdict (16) | Length: 37-100 | 933 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 934 | Verdict | (reserved) | 935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 936 | | 937 | | 938 | | 939 | SHA-256 Fingerprint | 940 | | 941 | | 942 | | 943 | | 944 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 945 | Common Name | 947 Verdict represents the numerical index of the verdict. 949 (reserved) is reserved for future additions and MUST be set to 0 950 when creating TLVs and ignored when parsing them. 952 SHA-256 Fingerprint contains the SHA-256 [RFC6234] hash value of 953 the certificate in DER-format. 955 Common Name contains the variable-length (1-64 bytes) common name 956 of the certificate. Final byte MUST have value of 0. 958 8.3.4. Bootstrap Ceremonies 960 The following non-exhaustive list of methods describes possible ways 961 to establish trust relationships between DNCP nodes and node 962 certificates. Trust establishment is a two-way process in which the 963 existing network must trust the newly added node and the newly added 964 node must trust at least one of its neighboring nodes. It is 965 therefore necessary that both the newly added node and an already 966 trusted node perform such a ceremony to successfully introduce a node 967 into the DNCP network. In all cases an administrator MUST be 968 provided with external means to identify the node belonging to a 969 certificate based on its fingerprint and a meaningful common name. 971 8.3.4.1. Trust by Identification 973 A node implementing certificate-based trust MUST provide an interface 974 to retrieve the current set of effective trust verdicts, fingerprints 975 and names of all certificates currently known and set configured 976 trust verdicts to be announced. Alternatively it MAY provide a 977 companion DNCP node or application with these capabilities with which 978 it has a pre-established trust relationship. 980 8.3.4.2. Preconfigured Trust 982 A node MAY be preconfigured to trust a certain set of node or CA 983 certificates. However such trust relationships MUST NOT result in 984 unwanted or unrelated trust for nodes not intended to be run inside 985 the same network (e.g. all other devices by the same manufacturer). 987 8.3.4.3. Trust on Button Press 989 A node MAY provide a physical or virtual interface to put one or more 990 of its internal network interfaces temporarily into a mode in which 991 it trusts the certificate of the first DNCP node it can successfully 992 establish a connection with. 994 8.3.4.4. Trust on First Use 996 A node which is not associated with any other DNCP node MAY trust the 997 certificate of the first DNCP node it can successfully establish a 998 connection with. This method MUST NOT be used when the node has 999 already associated with any other DNCP node. 1001 9. DNCP Profile-Specific Definitions 1003 Each DNCP profile MUST define following: 1005 o How the messages are secured: Not at all, optionally or always 1006 with the TLS scheme defined here using one or more of the methods, 1007 or with something else. If the links with DNCP nodes can be 1008 sufficiently secured or isolated, it is possible to run DNCP in a 1009 secure manner without using any form of authentication or 1010 encryption. 1012 o Unicast and optionally multicast transport protocol(s) to be used. 1013 If TLS scheme within this document is to be used security, TLS or 1014 DTLS support for at least the unicast transport protocol is 1015 mandatory. 1017 o Transport protocols' parameters such as port numbers to be used, 1018 or multicast address to be used. Unicast, multicast, and secure 1019 unicast may each require different parameters, if applicable. 1021 o When receiving messages, what sort of messages are dropped, as 1022 specified in Section 5.2. 1024 o How to deal with node identifier collision as described in 1025 Section 5.2. Main options are either for one or both nodes to 1026 assign new node identifiers to themselves, or to notify someone 1027 about a fatal error condition in the DNCP network. 1029 o Imin, Imax and k ranges to be suggested for implementations to be 1030 used in the Trickle algorithm. The Trickle algorithm does not 1031 require these to be same across all implementations for it to 1032 work, but similar orders of magnitude helps implementations of a 1033 DNCP profile to behave more consistently and to facilitate 1034 estimation of lower and upper bounds for behavior of the network. 1036 o Hash function H(x) to be used, and how many bits of the input are 1037 actually used. The chosen hash function is used to handle both 1038 hashing of node specific data, and network state hash, which is a 1039 hash of node specific data hashes. SHA-256 defined in [RFC6234] 1040 is the recommended default choice. 1042 o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier 1043 (in bytes). 1045 o DNCP_GRACE_INTERVAL: How long node data for unreachable nodes is 1046 kept. 1048 o Whether to send keep-alives, and if so, on an interface, using 1049 multicast, or directly using unicast to peers. Keep-alive has 1050 also associated parameters: 1052 * DNCP_KEEPALIVE_INTERVAL: How often keep-alives are to be sent 1053 by default (if enabled). 1055 * DNCP_KEEPALIVE_MULTIPLIER: How many times the 1056 DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval 1057 value) a node may not be heard from to be considered still 1058 valid. 1060 o Whether to support fragmentation, and if so, the number of bytes 1061 reserved for fragment count in the node identifier. 1063 10. Security Considerations 1065 DNCP profiles may use multicast to indicate DNCP state changes and 1066 for keep-alive purposes. However, no actual data TLVs will be sent 1067 across that channel. Therefore an attacker may only learn hash 1068 values of the state within DNCP and may be able to trigger unicast 1069 synchronization attempts between nodes on a local link this way. A 1070 DNCP node should therefore rate-limit its reactions to multicast 1071 packets. 1073 When using DNCP to bootstrap a network, PKI based solutions may have 1074 issues when validating certificates due to potentially unavailable 1075 accurate time, or due to inability to use the network to either check 1076 Certifcate Revocation Lists or perform on-line validation. 1078 The Certificate-based trust consensus mechanism defined in this 1079 document allows for a consenting revocation, however in case of a 1080 compromised device the trust cache may be poisoned before the actual 1081 revocation happens allowing the distrusted device to rejoin the 1082 network using a different identity. Stopping such an attack might 1083 require physical intervention and flushing of the trust caches. 1085 11. IANA Considerations 1087 IANA should set up a registry for DNCP TLV types, with the following 1088 initial contents: 1090 0: Reserved (should not happen on wire) 1092 1: Node connection 1094 2: Request network state 1096 3: Request node data 1098 4-8: Reserved for DNCP profile use 1100 9: Fragment count 1102 10: Network state 1104 11: Node state 1106 12: Node data 1108 13: Neighbor 1110 14: Keep-alive interval 1112 15: Custom 1114 16: Trust-Verdict 1116 17-31: Reserved for future DNCP versions. 1118 192-255: Reserved for per-implementation experimentation. The nodes 1119 using TLV types in this range SHOULD use e.g. Custom TLV to identify 1120 each other and therefore eliminate potential conflict caused by 1121 potential different use of same TLV numbers. 1123 For the rest of the values (32-191, 256-65535), policy of 'standards 1124 action' should be used. 1126 12. References 1128 12.1. Normative references 1130 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1131 Requirement Levels", BCP 14, RFC 2119, March 1997. 1133 [RFC6206] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko, 1134 "The Trickle Algorithm", RFC 6206, March 2011. 1136 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1137 Security Version 1.2", RFC 6347, January 2012. 1139 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1140 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1142 12.2. Informative references 1144 [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W. 1145 Stevens, "Basic Socket Interface Extensions for IPv6", RFC 1146 3493, February 2003. 1148 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 1149 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 1151 Appendix A. Some Questions and Answers [RFC Editor: please remove] 1153 Q: 32-bit connection id? 1155 A: Here, it would save 32 bits per neighbor if it was 16 bits (and 1156 less is not realistic). However, TLVs defined elsewhere would not 1157 seem to even gain that much on average. 32 bits is also used for 1158 ifindex in various operating systems, making for simpler 1159 implementation. 1161 Q: Why have topology information at all? 1163 A: It is an alternative to the more traditional seq#/TTL-based 1164 flooding schemes. In steady state, there is no need to e.g. re- 1165 publish every now and then. 1167 Appendix B. Changelog [RFC Editor: please remove] 1169 draft-ietf-homenet-dncp-02: 1171 o Changed DNCP "messages" into series of TLV streams, allowing 1172 optimized round-trip saving synchronization. 1174 o Added fragmentation support for bigger node data and for chunking 1175 in absence of reliable L2 and L3 fragmentation. 1177 draft-ietf-homenet-dncp-01: 1179 o Fixed keep-alive semantics to consider unicast requests also 1180 updates of most recently consistent, and added proactive unicast 1181 request to ensure even inconsistent keep-alive messages eventually 1182 triggering consistency timestamp update. 1184 o Facilitated (simple) read-only clients by making Node Connection 1185 TLV optional if just using DNCP for read-only purposes. 1187 o Added text describing how to deal with "dense" networks, but left 1188 actual numbers and mechanics up to DNCP profiles and (local) 1189 configurations. 1191 draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf- 1192 homenet-hncp-03 generic parts. Changes that affect implementations: 1194 o TLVs were renumbered. 1196 o TLV length does not include header (=-4). This facilitates e.g. 1197 use of DHCPv6 option parsing libraries (same encoding), and 1198 reduces complexity (no need to handle error values of length less 1199 than 4). 1201 o Trickle is reset only when locally calculated network state hash 1202 is changes, not as remote different network state hash is seen. 1203 This prevents e.g. attacks by multicast with one multicast packet 1204 to force Trickle reset on every interface of every node on a link. 1206 o Instead of 'ping', use 'keep-alive' (optional) for dead peer 1207 detection. Different message used! 1209 Appendix C. Draft Source [RFC Editor: please remove] 1211 As usual, this draft is available at https://github.com/fingon/ietf- 1212 drafts/ in source format (with nice Makefile too). Feel free to send 1213 comments and/or pull requests if and when you have changes to it! 1215 Appendix D. Acknowledgements 1217 Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley, 1218 Juliusz Chroboczek and Jiazi Yi for their contributions to the draft. 1220 Authors' Addresses 1222 Markus Stenberg 1223 Helsinki 00930 1224 Finland 1226 Email: markus.stenberg@iki.fi 1228 Steven Barth 1229 Halle 06114 1230 Germany 1232 Email: cyrus@openwrt.org