idnits 2.17.1 draft-ietf-homenet-dncp-04.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 (June 1, 2015) is 3251 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: December 3, 2015 6 June 1, 2015 8 Distributed Node Consensus Protocol 9 draft-ietf-homenet-dncp-04 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 December 3, 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 . . . . . . . . . . . . . . . . 10 62 6. Optional Extensions . . . . . . . . . . . . . . . . . . . . . 10 63 6.1. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . 10 64 6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 11 65 6.1.2. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . 11 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 . . . . . . . . . . . . . . . . . . 12 69 6.2. Support For Dense Broadcast Links . . . . . . . . . . . . 12 70 6.3. Node Data Fragmentation . . . . . . . . . . . . . . . . . 12 71 7. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 13 72 7.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 14 73 7.1.1. Request Network State TLV . . . . . . . . . . . . . . 14 74 7.1.2. Request Node State TLV . . . . . . . . . . . . . . . 14 75 7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 14 76 7.2.1. Node Endpoint TLV . . . . . . . . . . . . . . . . . . 14 77 7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 15 78 7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 15 79 7.2.4. Custom TLV . . . . . . . . . . . . . . . . . . . . . 16 80 7.3. Data TLVs within Node State TLV . . . . . . . . . . . . . 16 81 7.3.1. Fragment Count TLV . . . . . . . . . . . . . . . . . 17 82 7.3.2. Neighbor TLV . . . . . . . . . . . . . . . . . . . . 17 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 . . . . . . . . 19 88 8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 19 89 8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 20 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 . . . . . . . . . . . . . . . . . . . 24 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] . . . . . . . 26 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 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 DNCP node is a single node which runs a protocol based on a DNCP 148 profile. 150 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 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 Node identifier is an opaque fixed-length identifier consisting of 163 DNCP_NODE_IDENTIFIER_LENGTH bytes which uniquely identifies a DNCP 164 node within a DNCP network. 166 Link indicates a link-layer media over which directly connected nodes 167 can communicate. 169 Interface indicates a port of a node that is connected to a 170 particular link. 172 Endpoint denotes a locally configured use of DNCP on a DNCP node. It 173 is attached either to an interface, a specific remote unicast address 174 to be contacted, or a range of remote unicast addresses that are 175 allowed to contact. 177 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 and MUST NOT be used to 180 identify an actual endpoint. This definition is in sync with the 181 interface index definition in [RFC3493], as the non-zero small 182 positive integers should comfortably fit within 32 bits. 184 (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 Node data is a set of TLVs published by a node in the DNCP network. 189 The whole node data is owned by the node that publishes it, and it 190 MUST be passed along as-is, including TLVs unknown to the forwarder. 192 Node state is a set of metadata attributes for node data. It 193 includes a sequence number for versioning, a hash value for comparing 194 and a timestamp indicating the time passed since its last 195 publication. The hash function and the number of bits used are 196 defined in the DNCP profile. 198 Network state (hash) is a hash value which represents the current 199 state of the network. The hash function and the number of bits used 200 are defined in the DNCP profile. Whenever a node is added, removed 201 or updates its published node data this hash value changes as well. 202 It is calculated over each reachable nodes' update number 203 concatenated with the hash value of its node data. For calculation 204 these tuples are sorted in ascending order of the respective node's 205 node identifier. 207 (Trust) verdict is a statement about the trustworthiness of a 208 certificate announced by a node participating in the certificate 209 based trust consensus mechanism. 211 Effective (trust) verdict for a certificate is defined as the verdict 212 with the highest priority within the set of verdicts announced for 213 the certificate in the DNCP network. 215 Neighbor graph is the undirected graph of DNCP nodes produced by 216 retaining only bidirectional peer relationships between nodes. 218 4. Data Model 220 A DNCP node has: 222 o A timestamp indicating the most recent neighbor graph traversal 223 described in Section 5.4. 225 o Something with data about most recent request(s) for network state 226 - simplest one being a timestamp for the most recent request for 227 network state (see Section 5.2). 229 A DNCP node has for every DNCP node in the DNCP network: 231 o Node identifier, which uniquely identifies the node. 233 o Node data, an ordered set of TLV tuples published by that 234 particular node. This set of TLVs MUST be strictly ordered based 235 on ascending binary content (including TLV type and length). This 236 facilitates linear time state delta processing. 238 o Latest update sequence number, a 32 bit number that is incremented 239 any time the TLV set is published. For comparison purposes, a 240 looping comparison should be used to avoid problems in case of 241 overflow. An example would be: a < b <=> (a - b) % 2^32 & 2^31 != 242 0. 244 o Relative time (in milliseconds), time since the current TLV data 245 set with the current update sequence number was published. It is 246 also a 32 bit number on the wire. If this number is close to 247 overflow (greater than 2^32-2^16), a node MUST re-publish its TLVs 248 even if there is no change. In other words, absent any other 249 changes, the TLV set MUST be re-published roughly every 49 days. 251 o Timestamp, the time it was last reachable based on neighbor graph 252 traversal described in Section 5.4. 254 Additionally, a DNCP node has a set of endpoints for which DNCP is 255 configured to be used. For each such endpoint, a node has: 257 o An endpoint identifier, a 32-bit opaque value. 259 o An interface, a unicast address of a DNCP node it should connect 260 with, or a range of addresses from which DNCP nodes are allowed to 261 connect. 263 o A Trickle [RFC6206] instance with parameters I, T, and c. 265 For each remote (DNCP node, endpoint) pair detected on a local 266 endpoint, a DNCP node has: 268 o The node identifier of the DNCP peer. 270 o The endpoint identifier of the DNCP peer. 272 o The most recent address used by the DNCP peer (authenticated and 273 authorized, if security is enabled). 275 5. Operation 277 The DNCP protocol consists of Trickle [RFC6206] driven unicast or 278 multicast status payloads which indicate the current status of shared 279 TLV data and additional unicast exchanges which ensure DNCP peer 280 reachability and synchronize the data when necessary. 282 If DNCP is to be used on a multicast-capable interface, as opposed to 283 only point-to-point using unicast, a datagram-based transport which 284 supports multicast SHOULD be defined in the DNCP profile to be used 285 for the TLVs to be sent to the whole link. As this is used only to 286 identify potential new DNCP nodes and to notify that a unicast 287 exchange should be triggered, the multicast transport does not have 288 to be particularly secure. 290 To form bidirectional peer relationships DNCP requires identification 291 of the endpoints used for communication. A DNCP node therefore MUST 292 include an Endpoint TLV (Section 7.2.1) in each message intended to 293 maintain a DNCP peer relationship. 295 5.1. Trickle-Driven Status Updates 297 When employing unreliable transport, each node MUST send a Network 298 State TLV (Section 7.2.2) every time the endpoint-specific Trickle 299 algorithm [RFC6206] instance indicates that an update should be sent. 300 Multicast MUST be employed on a multicast-capable interface; 301 otherwise, unicast can be used as well. If possible, most recent, 302 recently changed, or best of all, all known Node State TLVs 303 (Section 7.2.3) SHOULD be also included, unless it is defined as 304 undesirable for some reason by the DNCP profile. Avoiding sending 305 some or all Node State TLVs may make sense to avoid fragmenting 306 packets to multicast destinations, or for security reasons. If the 307 DNCP profile supports dense broadcast link optimization 308 (Section 6.2), and if a node does not have the highest node 309 identifier on a link, the endpoint may be in a unicast mode in which 310 multicast traffic is only listened to. In that mode, multicast 311 updates MUST NOT be sent. 313 A Trickle state MUST be maintained separately for each endpoint which 314 employs unreliable transport. The Trickle state for all endpoints is 315 considered inconsistent and reset if and only if the locally 316 calculated network state hash changes. This occurs either due to a 317 change in the local node's own node data, or due to receipt of more 318 recent data from another node. 320 The Trickle algorithm has 3 parameters: Imin, Imax and k. Imin and 321 Imax represent the minimum and maximum values for I, which is the 322 time interval during which at least k Trickle updates must be seen on 323 an endpoint to prevent local state transmission. The actual 324 suggested Trickle algorithm parameters are DNCP profile specific, as 325 described in Section 9. 327 5.2. Processing of Received TLVs 329 This section describes how received TLVs are processed. The DNCP 330 profile may specify criteria based on which particular TLVs are 331 ignored. Any 'reply' mentioned in the steps below denotes sending of 332 the specified TLV(s) via unicast to the originator of the TLV being 333 processed. If the TLV being replied to was received via multicast 334 and it was sent to a link with shared bandwidth, the reply SHOULD be 335 delayed by a random timespan in [0, Imin/2]. Sending of replies 336 SHOULD be rate-limited by the implementation, and in case of excess 337 load (or some other reason), a reply MAY be omitted altogether. 339 A DNCP node MUST reply to a request from any valid address, as 340 specified by a given DNCP profile, whether this address is known to 341 be the address of a neighbour or not. (This provision satisfies the 342 needs of monitoring or other host software that needs to discover the 343 DNCP topology without adding to the state in the network.) 345 Upon receipt of: 347 o Request Network State TLV (Section 7.1.1): The receiver MUST reply 348 with a Network State TLV (Section 7.2.2) and a Node State TLV 349 (Section 7.2.3) for each node data used to calculate the network 350 state hash. The Node State TLVs SHOULD NOT contain the optional 351 node data part. 353 o Request Node State TLV (Section 7.1.2): If the receiver has node 354 data for the corresponding node, it MUST reply with a Node State 355 TLV (Section 7.2.3) for the corresponding node. The optional node 356 data part MUST be included in the TLV. 358 o Network State TLV (Section 7.2.2): If the network state hash 359 differs from the locally calculated network state hash, and the 360 receiver is unaware of any particular node state differences with 361 the sender, the receiver MUST reply with a Request Network State 362 TLV (Section 7.1.1). These replies MUST be rate limited to only 363 at most one reply per link per unique network state hash within 364 Imin. The simplest way to ensure this rate limit is a timestamp 365 indicating requests, and just sending at most one request for 366 network state per Imin. To facilitate faster state 367 synchronization, if a Request Network State TLV is sent in a 368 reply, a local, current Network State TLV SHOULD be also sent. 370 o Node State TLV (Section 7.2.3): 372 * If the node identifier matches the local node identifier and 373 the TLV has a higher update sequence number than its current 374 local value, or the same update sequence number and a different 375 hash, the node SHOULD re-publish its own node data with an 376 update sequence number 1000 higher than the received one. This 377 may occur normally once due to the local node restarting and 378 not storing the most recently used update sequence number. If 379 this occurs more than once, the DNCP profile should provide 380 guidance on how to handle these situations as it indicates the 381 existence of another active node with the same node identifier. 383 * If the node identifier does not match the local node 384 identifier, and the local information is outdated for the 385 corresponding node (local update sequence number is lower than 386 that within the TLV), potentially incorrect (local update 387 sequence number matches but the node data hash differs), or the 388 data is altogether missing: 390 + If the TLV does not contain node data, and the hash of the 391 node data differs, the receiver MUST reply with a Request 392 Node State TLV (Section 7.1.2) for the corresponding node. 394 + Otherwise the receiver MUST update its locally stored state 395 for that node (node data if present, update sequence number, 396 relative time) to match the received TLV. 398 o Any other TLV: TLVs not recognized by the receiver MUST be 399 silently ignored. 401 If secure unicast transport is configured for an endpoint, any Node 402 State TLVs received via insecure multicast MUST be silently ignored. 404 5.3. Adding and Removing Peers 406 When receiving a Node Endpoint TLV (Section 7.2.1) on an endpoint 407 from an unknown peer: 409 o If it comes via unicast, the remote node MUST be added as a peer 410 on the endpoint and a Neighbor TLV (Section 7.3.2) MUST be created 411 for it. 413 o If it comes via multicast, the node SHOULD be sent a (possibly 414 rate-limited) unicast Request Network State TLV (Section 7.1.1). 416 If keep-alives specified in Section 6.1 are NOT sent by the peer 417 (either the DNCP profile does not specify the use of keep-alives or 418 the particular peer chooses not to send keep-alives), some other 419 means MUST be employed to ensure a DNCP peer is present. When the 420 peer is no longer present, the Neighbor TLV and the local DNCP peer 421 state MUST be removed. 423 If the DNCP profile supports dense broadcast link optimization 424 (Section 6.2), and if a node does not have the highest node 425 identifier on a link, the endpoint may be in a unicast mode in which 426 multicast traffic is only listened to. In that mode, all peers 427 except the one with the highest node identifier MUST NOT have 428 Neighbor TLV (Section 7.3.2) published nor any local state. 430 5.4. Purging Unreachable Nodes 432 DNCP validates the set of data within it by ensuring that it is 433 reachable via nodes that are currently accounted for; therefore, 434 unlike Time-To-Live (TTL) based solutions, it does not require 435 periodic re-publishing of the data by the nodes. On the other hand, 436 it does require the topology to be visible to every node that wants 437 to be able to identify unreachable nodes and therefore remove old, 438 stale data. 440 When a Neighbor TLV or a whole node is added or removed, the neighbor 441 graph SHOULD be traversed, starting from the local node. The edges 442 to be traversed are identified by looking for Neighbor TLVs on both 443 nodes, that have the other node's identifier in the neighbor node 444 identifier, and local and neighbor endpoint identifiers swapped. 445 Each node reached should be marked currently reachable. 447 DNCP nodes MUST be either purged immediately when not marked 448 reachable in a particular graph traversal, or eventually after they 449 have not been marked reachable within DNCP_GRACE_INTERVAL. During 450 the grace period, the nodes that were not marked reachable in the 451 most recent graph traversal MUST NOT be used for calculation of the 452 network state hash, be provided to any applications that need to use 453 the whole TLV graph, or be provided to remote nodes. 455 6. Optional Extensions 457 This section specifies extensions to the core protocol that a DNCP 458 profile may want to use. 460 6.1. Keep-Alives 462 Trickle-driven status updates (Section 5.1) provide a mechanism for 463 handling of new peer detection (if applicable) on an endpoint, as 464 well as state change notifications. Another mechanism may be needed 465 to get rid of old, no longer valid DNCP peers if the transport or 466 lower layers do not provide one. 468 If keep-alives are not specified in the DNCP profile, the rest of 469 this subsection MUST be ignored. 471 A DNCP profile MAY specify either per-endpoint or per-peer keep-alive 472 support. 474 For every endpoint that a keep-alive is specified for in the DNCP 475 profile, the endpoint-specific keep-alive interval MUST be 476 maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is 477 a local value that is preferred for that for any reason 478 (configuration, energy conservation, media type, ..), it should be 479 substituted instead. If a non-default keep-alive interval is used on 480 any endpoint, a DNCP node MUST publish appropriate Keep-Alive 481 Interval TLV(s) (Section 7.3.3) within its node data. 483 6.1.1. Data Model Additions 485 The following additions to the Data Model (Section 4) are needed to 486 support keep-alive: 488 Each node MUST have a timestamp which indicates the last time a 489 Network State TLV (Section 7.2.2) was sent for each endpoint, i.e. on 490 an interface or to the point-to-point peer(s). 492 Each node MUST have for each peer: 494 o Last contact timestamp: a timestamp which indicates the last time 495 a consistent Network State TLV (Section 7.2.2) was received from 496 the peer via multicast, or anything was received via unicast. 497 When adding a new peer, it should be initialized to the current 498 time. 500 6.1.2. Per-Endpoint Periodic Keep-Alives 502 If per-endpoint keep-alives are enabled on an endpoint with a 503 multicast-enabled link, and if no traffic containing a Network State 504 TLV (Section 7.2.2) has been sent to a particular endpoint within the 505 endpoint-specific keep-alive interval, a Network State TLV 506 (Section 7.2.2) MUST be sent on that endpoint, and a new Trickle 507 transmission time 't' in [I/2, I] MUST be randomly chosen. The 508 actual sending time SHOULD be further delayed by a random timespan in 509 [0, Imin/2]. 511 6.1.3. Per-Peer Periodic Keep-Alives 513 If per-peer keep-alives are enabled on a unicast-only endpoint, and 514 if no traffic containing a Network State TLV (Section 7.2.2) has been 515 sent to a particular peer within the endpoint-specific keep-alive 516 interval, a Network State TLV (Section 7.2.2) MUST be sent to the 517 peer and a new Trickle transmission time 't' in [I/2, I] MUST be 518 randomly chosen. 520 6.1.4. Received TLV Processing Additions 522 If a TLV is received via unicast from the peer, the Last contact 523 timestamp for the peer MUST be updated. 525 On receipt of a Network State TLV (Section 7.2.2) which is consistent 526 with the locally calculated network state hash, the Last contact 527 timestamp for the peer MUST be updated. 529 6.1.5. Neighbor Removal 531 For every peer on every endpoint, the endpoint-specific keep-alive 532 interval must be calculated by looking for Keep-Alive Interval TLVs 533 (Section 7.3.3) published by the node, and if none exist, using the 534 default value of DNCP_KEEPALIVE_INTERVAL. If the peer's last contact 535 state timestamp has not been updated for at least 536 DNCP_KEEPALIVE_MULTIPLIER times the peer's endpoint-specific keep- 537 alive interval, the Neighbor TLV for that peer and the local DNCP 538 peer state MUST be removed. 540 6.2. Support For Dense Broadcast Links 542 An upper bound for the number of neighbors that are allowed for a 543 (particular type of) link that an endpoint runs on SHOULD be provided 544 by a DNCP profile, user configuration, or some hardcoded default in 545 the implementation. If an implementation does not support this, the 546 rest of this subsection MUST be ignored. 548 If the specified limit is exceeded, nodes without the highest Node 549 Identifier on the link SHOULD treat the endpoint as a unicast 550 endpoint connected to the node that has the highest Node Identifier 551 detected on the link. The nodes MUST also keep listening to 552 multicast traffic to both detect the presence of that node, and to 553 react to nodes with a higher Node Identifier appearing. If the 554 highest Node Identifier present on the link changes, the remote 555 unicast address of unicast endpoints MUST be changed. If the Node 556 Identifier of the local node is the highest one, the node MUST keep 557 the endpoint in multicast mode, and the node MUST allow others to 558 peer with it over the link via unicast as well. 560 6.3. Node Data Fragmentation 562 A DNCP profile may be required to support node data which would not 563 fit the maximum size of a single Node State TLV (Section 7.2.3) 564 (roughly 64KB of payload), or use a datagram-only transport with a 565 limited MTU and no reliable support for fragmentation. To handle 566 such cases, a DNCP profile MAY specify a fixed number of trailing 567 bytes in the Node Identifier to represent a fragment number 568 indicating a part of a node's node data. The profile MAY also 569 specify an upper bound for the size of a single fragment to 570 accommodate limitations of links in the network. 572 The data within Node State TLVs of fragments with non-zero fragment 573 number must be treated as opaque (as they may not contain even a 574 single full TLV). However, the concatenated node data for a 575 particular node MUST be produced by concatenating all node data for 576 each fragment, in ascending fragment number order. The concatenated 577 node data MUST follow the ordering described in Section 4. 579 Any Node Identifiers on the wire used to identify the own or any 580 other node MUST have the fragment number 0. For algorithm purposes, 581 the relative time since the most recent fragment change MUST be used, 582 regardless of fragment number. Therefore, even if just part of the 583 node data fragments change, they all are considered refreshed if one 584 of them is. 586 If using fragmentation, the unreachable node purging defined in 587 Section 5.4 is extended so that if a Fragment Count TLV 588 (Section 7.3.1) is present within the fragment number 0, all 589 fragments up to fragment number specified in the Count field are also 590 considered reachable if the fragment number 0 itself is reachable 591 based on graph traversal. 593 7. Type-Length-Value Objects 595 Each TLV is encoded as a 2 byte type field, followed by a 2 byte 596 length field (of the value, excluding header; 0 means no value) 597 followed by the value itself (if any). Both type and length fields 598 in the header as well as all integer fields inside the value - unless 599 explicitly stated otherwise - are represented in network byte order. 600 Zeroed padding bytes MUST be added up to the next 4 byte boundary if 601 the length is not divisible by 4. These padding bytes MUST NOT be 602 included in the length field. 604 0 1 2 3 605 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 606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 607 | Type | Length | 608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 609 | Value | 610 | (variable # of bytes) | 611 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 613 For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is 614 encoded as: 007B 0001 7800 0000. 616 In this section, the following special notation is used: 618 .. = octet string concatenation operation. 620 H(x) = non-cryptographic hash function specified by DNCP profile. 622 7.1. Request TLVs 624 7.1.1. Request Network State TLV 626 0 1 2 3 627 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 628 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 629 | Type: REQ-NETWORK-STATE (1) | Length: 0 | 630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 632 This TLV is used to request response with a Network State TLV 633 (Section 7.2.2) and all Node State TLVs (Section 7.2.3). 635 7.1.2. Request Node State TLV 637 0 1 2 3 638 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 639 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 640 | Type: REQ-NODE-STATE (2) | Length: >0 | 641 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 642 | Node Identifier | 643 | (length fixed in DNCP profile) | 644 ... 645 | | 646 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 648 This TLV is used to request a Node State TLV (Section 7.2.3) 649 (including node data) for the node with matching node identifier. 651 7.2. Data TLVs 653 7.2.1. Node Endpoint TLV 655 0 1 2 3 656 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 657 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 658 | Type: NODE-ENDPOINT (3) | Length: > 4 | 659 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 660 | Node Identifier | 661 | (length fixed in DNCP profile) | 662 ... 663 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 664 | Endpoint Identifier | 665 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 666 This TLV identifies both the local node's node identifier, as well as 667 the particular endpoint's endpoint identifier. It MUST be sent in 668 every message if bidirectional peer relationship is desired with 669 remote nodes on that endpoint. Bidirectional peer relationship is 670 not necessary for read-only access to the DNCP state, but it is 671 required to be able to publish data. 673 7.2.2. Network State TLV 675 0 1 2 3 676 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 677 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 678 | Type: NETWORK-STATE (4) | Length: > 0 | 679 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 680 | H(H(update number of node 1) .. H(node data of node 1) .. | 681 | .. H(update number of node N) .. H(node data of node N)) | 682 | (length fixed in DNCP profile) | 683 ... 684 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 686 This TLV contains the current locally calculated network state hash. 687 It is calculated over each reachable nodes' update number 688 concatenated with the hash value of its node data in ascending order 689 of the respective node identifiers. 691 7.2.3. Node State TLV 693 0 1 2 3 694 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 695 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 696 | Type: NODE-STATE (5) | Length: > 8 | 697 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 698 | Node Identifier | 699 | (length fixed in DNCP profile) | 700 ... 701 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 702 | Update Sequence Number | 703 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 704 | Milliseconds since Origination | 705 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 706 | H(node data) | 707 | (length fixed in DNCP profile) | 708 ... 709 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 710 |(optionally) Nested TLVs containing node information | 711 ... 712 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 713 This TLV represents the local node's knowledge about the published 714 state of a node in the DNCP network identified by the node identifier 715 field in the TLV. 717 The whole network should have roughly the same idea about the time 718 since origination of any particular published state. Therefore every 719 node, including the originating one, MUST increment the time whenever 720 it needs to send a Node State TLV for already published node data. 722 The actual node data of the node may be included within the TLV as 723 well; see Section 5.2 for the cases where it MUST or MUST NOT be 724 included. In a DNCP profile which supports fragmentation, described 725 in Section 6.3, the TLV data may be only partial and not really 726 usable without other fragments. 728 7.2.4. Custom TLV 730 0 1 2 3 731 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 732 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 733 | Type: CUSTOM-DATA (6) | Length: > 0 | 734 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 735 | H(URI) | 736 | (length fixed in DNCP profile) | 737 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 738 | Opaque Data | 740 This TLV can be used to contain anything; the URI used should be 741 under control of the author of that specification. The TLV may 742 appear within protocol exchanges, or within Node State TLV 743 (Section 7.2.3). For example: 745 V = H('http://example.com/author/json-for-dncp') .. '{"cool": "json 746 extension!"}' 748 or 750 V = H('mailto:author@example.com') .. '{"cool": "json extension!"}' 752 7.3. Data TLVs within Node State TLV 754 These TLVs are DNCP-specific parts of node-specific node data, and 755 are encoded within the Node State TLVs. If encountered outside Node 756 State TLV, they MUST be silently ignored. 758 7.3.1. Fragment Count TLV 760 0 1 2 3 761 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 762 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 763 | Type: FRAGMENT-COUNT (7) | Length: > 0 | 764 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 765 | Count | 766 | (length fixed in DNCP profile) | 767 ... 768 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 770 If the DNCP profile supports node data fragmentation as specified in 771 Section 6.3, this TLV indicates that the node data is encoded as a 772 sequence of Node State TLVs. Following Node State TLVs with Node 773 Identifiers up to Count higher than the current one MUST be 774 considered reachable and part of the same logical set of node data 775 that this TLV is within. The fragment portion of the Node Identifier 776 of the Node State TLV this TLV appears in MUST be zero. 778 7.3.2. Neighbor TLV 780 0 1 2 3 781 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 782 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 783 | Type: NEIGHBOR (8) | Length: > 8 | 784 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 785 | Neighbor Node Identifier | 786 | (length fixed in DNCP profile) | 787 ... 788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 789 | Neighbor Endpoint Identifier | 790 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 791 | Local Endpoint Identifier | 792 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 794 This TLV indicates that the node in question vouches that the 795 specified neighbor is reachable by it on the specified local 796 endpoint. The presence of this TLV at least guarantees that the node 797 publishing it has received traffic from the neighbor recently. For 798 guaranteed up-to-date bidirectional reachability, the existence of 799 both nodes' matching Neighbor TLVs should be checked. 801 7.3.3. Keep-Alive Interval TLV 802 0 1 2 3 803 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 804 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 805 | Type: KEEP-ALIVE-INTERVAL (9) | Length: 8 | 806 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 807 | Endpoint Identifier | 808 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 809 | Interval | 810 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 812 This TLV indicates a non-default interval being used to send keep- 813 alives specified in Section 6.1. 815 Endpoint identifier is used to identify the particular endpoint for 816 which the interval applies. If 0, it applies for ALL endpoints for 817 which no specific TLV exists. 819 Interval specifies the interval in milliseconds at which the node 820 sends keep-alives. A value of zero means no keep-alives are sent at 821 all; in that case, some lower layer mechanism that ensures presence 822 of nodes MUST be available and used. 824 8. Security and Trust Management 826 If specified in the DNCP profile, either DTLS [RFC6347] or TLS 827 [RFC5246] may be used to authenticate and encrypt either some (if 828 specified optional in the profile), or all unicast traffic. The 829 following methods for establishing trust are defined, but it is up to 830 the DNCP profile to specify which ones may, should or must be 831 supported. 833 8.1. Pre-Shared Key Based Trust Method 835 A PSK-based trust model is a simple security management mechanism 836 that allows an administrator to deploy devices to an existing network 837 by configuring them with a pre-defined key, similar to the 838 configuration of an administrator password or WPA-key. Although 839 limited in nature it is useful to provide a user-friendly security 840 mechanism for smaller networks. 842 8.2. PKI Based Trust Method 844 A PKI-based trust-model enables more advanced management capabilities 845 at the cost of increased complexity and bootstrapping effort. It 846 however allows trust to be managed in a centralized manner and is 847 therefore useful for larger networks with a need for an authoritative 848 trust management. 850 8.3. Certificate Based Trust Consensus Method 852 The certificate-based consensus model is designed to be a compromise 853 between trust management effort and flexibility. It is based on 854 X.509-certificates and allows each DNCP node to provide a verdict on 855 any other certificate and a consensus is found to determine whether a 856 node using this certificate or any certificate signed by it is to be 857 trusted. 859 The current effective trust verdict for any certificate is defined as 860 the one with the highest priority from all verdicts announced for 861 said certificate at the time. 863 8.3.1. Trust Verdicts 865 Trust Verdicts are statements of DNCP nodes about the trustworthiness 866 of X.509-certificates. There are 5 possible verdicts in order of 867 ascending priority: 869 0 Neutral : no verdict exists but the DNCP network should determine 870 one. 872 1 Cached Trust : the last known effective verdict was Configured or 873 Cached Trust. 875 2 Cached Distrust : the last known effective verdict was Configured 876 or Cached Distrust. 878 3 Configured Trust : trustworthy based upon an external ceremony or 879 configuration. 881 4 Configured Distrust : not trustworthy based upon an external 882 ceremony or configuration. 884 Verdicts are differentiated in 3 groups: 886 o Configured verdicts are used to announce explicit verdicts a node 887 has based on any external trust bootstrap or predefined relation a 888 node has formed with a given certificate. 890 o Cached verdicts are used to retain the last known trust state in 891 case all nodes with configured verdicts about a given certificate 892 have been disconnected or turned off. 894 o The Neutral verdict is used to announce a new node intending to 895 join the network so a final verdict for it can be found. 897 The current effective trust verdict for any certificate is defined as 898 the one with the highest priority within the set of verdicts + 899 announced for the certificate in the DNCP network. A node MUST be 900 trusted for participating in the DNCP network if and only if the 901 current effective verdict for its own certificate or any one in its 902 certificate hierarchy is (Cached or Configured) Trust and none of the 903 certificates in its hierarchy have an effective verdict of (Cached or 904 Configured) Distrust. In case a node has a configured verdict, which 905 is different from the current effective verdict for a certificate, 906 the current effective verdict takes precedence in deciding 907 trustworthiness. Despite that, the node still retains and announces 908 its configured verdict. 910 8.3.2. Trust Cache 912 Each node SHOULD maintain a trust cache containing the current 913 effective trust verdicts for all certificates currently announced in 914 the DNCP network. This cache is used as a backup of the last known 915 state in case there is no node announcing a configured verdict for a 916 known certificate. It SHOULD be saved to a non-volatile memory at 917 reasonable time intervals to survive a reboot or power outage. 919 Every time a node (re)joins the network or detects the change of an 920 effective trust verdict for any certificate, it will synchronize its 921 cache, i.e. store new effective verdicts overwriting any previously 922 cached verdicts. Configured verdicts are stored in the cache as 923 their respective cached counterparts. Neutral verdicts are never 924 stored and do not override existing cached verdicts. 926 8.3.3. Announcement of Verdicts 928 A node SHOULD always announce any configured trust verdicts it has 929 established by itself, and it MUST do so if announcing the configured 930 trust verdict leads to a change in the current effective verdict for 931 the respective certificate. In absence of configured verdicts, it 932 MUST announce cached trust verdicts it has stored in its trust cache, 933 if one of the following conditions applies: 935 o The stored verdict is Cached Trust and the current effective 936 verdict for the certificate is Neutral or does not exist. 938 o The stored verdict is Cached Distrust and the current effective 939 verdict for the certificate is Cached Trust. 941 A node rechecks these conditions whenever it detects changes of 942 announced trust verdicts anywhere in the network. 944 Upon encountering a node with a hierarchy of certificates for which 945 there is no effective verdict, a node adds a Neutral Trust-Verdict- 946 TLV to its node data for all certificates found in the hierarchy, and 947 publishes it until an effective verdict different from Neutral can be 948 found for any of the certificates, or a reasonable amount of time (10 949 minutes is suggested) with no reaction and no further authentication 950 attempts has passed. Such verdicts SHOULD also be limited in rate 951 and number to prevent denial-of-service attacks. 953 Trust verdicts are announced using Trust-Verdict TLVs: 955 0 1 2 3 956 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 957 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 958 | Type: Trust-Verdict (10) | Length: 37-100 | 959 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 960 | Verdict | (reserved) | 961 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 962 | | 963 | | 964 | | 965 | SHA-256 Fingerprint | 966 | | 967 | | 968 | | 969 | | 970 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 971 | Common Name | 973 Verdict represents the numerical index of the verdict. 975 (reserved) is reserved for future additions and MUST be set to 0 976 when creating TLVs and ignored when parsing them. 978 SHA-256 Fingerprint contains the SHA-256 [RFC6234] hash value of 979 the certificate in DER-format. 981 Common Name contains the variable-length (1-64 bytes) common name 982 of the certificate. Final byte MUST have value of 0. 984 8.3.4. Bootstrap Ceremonies 986 The following non-exhaustive list of methods describes possible ways 987 to establish trust relationships between DNCP nodes and node 988 certificates. Trust establishment is a two-way process in which the 989 existing network must trust the newly added node and the newly added 990 node must trust at least one of its neighboring nodes. It is 991 therefore necessary that both the newly added node and an already 992 trusted node perform such a ceremony to successfully introduce a node 993 into the DNCP network. In all cases an administrator MUST be 994 provided with external means to identify the node belonging to a 995 certificate based on its fingerprint and a meaningful common name. 997 8.3.4.1. Trust by Identification 999 A node implementing certificate-based trust MUST provide an interface 1000 to retrieve the current set of effective trust verdicts, fingerprints 1001 and names of all certificates currently known and set configured 1002 trust verdicts to be announced. Alternatively it MAY provide a 1003 companion DNCP node or application with these capabilities with which 1004 it has a pre-established trust relationship. 1006 8.3.4.2. Preconfigured Trust 1008 A node MAY be preconfigured to trust a certain set of node or CA 1009 certificates. However such trust relationships MUST NOT result in 1010 unwanted or unrelated trust for nodes not intended to be run inside 1011 the same network (e.g. all other devices by the same manufacturer). 1013 8.3.4.3. Trust on Button Press 1015 A node MAY provide a physical or virtual interface to put one or more 1016 of its internal network interfaces temporarily into a mode in which 1017 it trusts the certificate of the first DNCP node it can successfully 1018 establish a connection with. 1020 8.3.4.4. Trust on First Use 1022 A node which is not associated with any other DNCP node MAY trust the 1023 certificate of the first DNCP node it can successfully establish a 1024 connection with. This method MUST NOT be used when the node has 1025 already associated with any other DNCP node. 1027 9. DNCP Profile-Specific Definitions 1029 Each DNCP profile MUST specify the following aspects: 1031 o Unicast and optionally multicast transport protocol(s) to be used. 1033 o How the chosen transport(s) are secured: Not at all, optionally or 1034 always with the TLS scheme defined here using one or more of the 1035 methods, or with something else. If the links with DNCP nodes can 1036 be sufficiently secured or isolated, it is possible to run DNCP in 1037 a secure manner without using any form of authentication or 1038 encryption. 1040 o Transport protocols' parameters such as port numbers to be used, 1041 or multicast address to be used. Unicast, multicast, and secure 1042 unicast may each require different parameters, if applicable. 1044 o When receiving messages, what sort of messages are dropped, as 1045 specified in Section 5.2. 1047 o How to deal with node identifier collision as described in 1048 Section 5.2. Main options are either for one or both nodes to 1049 assign new node identifiers to themselves, or to notify someone 1050 about a fatal error condition in the DNCP network. 1052 o Imin, Imax and k ranges to be suggested for implementations to be 1053 used in the Trickle algorithm. The Trickle algorithm does not 1054 require these to be the same across all implementations for it to 1055 work, but similar orders of magnitude helps implementations of a 1056 DNCP profile to behave more consistently and to facilitate 1057 estimation of lower and upper bounds for convergence behavior of 1058 the network. 1060 o Hash function H(x) to be used, and how many bits of the input are 1061 actually used. The chosen hash function is used to handle both 1062 hashing of node specific data, and network state hash, which is a 1063 hash of node specific data hashes. SHA-256 defined in [RFC6234] 1064 is the recommended default choice. 1066 o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier 1067 (in bytes). 1069 o DNCP_GRACE_INTERVAL: How long node data for unreachable nodes is 1070 kept. 1072 o Whether to send keep-alives, and if so, on an interface, using 1073 multicast, or directly using unicast to peers. Keep-alive has 1074 also associated parameters: 1076 * DNCP_KEEPALIVE_INTERVAL: How often keep-alives are to be sent 1077 by default (if enabled). 1079 * DNCP_KEEPALIVE_MULTIPLIER: How many times the 1080 DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval 1081 value) a node may not be heard from to be considered still 1082 valid. 1084 o Whether to support fragmentation, and if so, the number of bytes 1085 reserved for fragment count in the node identifier. 1087 10. Security Considerations 1089 DNCP profiles may use multicast to indicate DNCP state changes and 1090 for keep-alive purposes. However, no actual data TLVs will be sent 1091 across that channel. Therefore an attacker may only learn hash 1092 values of the state within DNCP and may be able to trigger unicast 1093 synchronization attempts between nodes on a local link this way. A 1094 DNCP node should therefore rate-limit its reactions to multicast 1095 packets. 1097 When using DNCP to bootstrap a network, PKI based solutions may have 1098 issues when validating certificates due to potentially unavailable 1099 accurate time, or due to inability to use the network to either check 1100 Certifcate Revocation Lists or perform on-line validation. 1102 The Certificate-based trust consensus mechanism defined in this 1103 document allows for a consenting revocation, however in case of a 1104 compromised device the trust cache may be poisoned before the actual 1105 revocation happens allowing the distrusted device to rejoin the 1106 network using a different identity. Stopping such an attack might 1107 require physical intervention and flushing of the trust caches. 1109 11. IANA Considerations 1111 IANA should set up a registry for DNCP TLV types, with the following 1112 initial contents: 1114 0: Reserved (should not happen on wire) 1116 1: Request network state 1118 2: Request node state 1120 3: Node endpoint 1122 4: Network state 1124 5: Node state 1126 6: Custom 1128 7: Fragment count 1130 8: Neighbor 1132 9: Keep-alive interval 1134 10: Trust-Verdict 1135 32-191: Reserved for per-DNCP profile use 1137 192-255: Reserved for per-implementation experimentation. The nodes 1138 using TLV types in this range SHOULD use e.g. Custom TLV to identify 1139 each other and therefore eliminate potential conflict caused by 1140 potential different use of same TLV numbers. 1142 For the rest of the values (11-31, 256-65535), policy of 'standards 1143 action' should be used. 1145 12. References 1147 12.1. Normative references 1149 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1150 Requirement Levels", BCP 14, RFC 2119, March 1997. 1152 [RFC6206] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko, 1153 "The Trickle Algorithm", RFC 6206, March 2011. 1155 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1156 Security Version 1.2", RFC 6347, January 2012. 1158 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1159 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1161 12.2. Informative references 1163 [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W. 1164 Stevens, "Basic Socket Interface Extensions for IPv6", RFC 1165 3493, February 2003. 1167 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 1168 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 1170 Appendix A. Some Questions and Answers [RFC Editor: please remove] 1172 Q: 32-bit endpoint id? 1174 A: Here, it would save 32 bits per neighbor if it was 16 bits (and 1175 less is not realistic). However, TLVs defined elsewhere would not 1176 seem to even gain that much on average. 32 bits is also used for 1177 ifindex in various operating systems, making for simpler 1178 implementation. 1180 Q: Why have topology information at all? 1181 A: It is an alternative to the more traditional seq#/TTL-based 1182 flooding schemes. In steady state, there is no need to e.g. re- 1183 publish every now and then. 1185 Appendix B. Changelog [RFC Editor: please remove] 1187 draft-ietf-homenet-dncp-04: 1189 o Added mandatory rate limiting for network state requests, and 1190 optional slightly faster convergence mechanism by including 1191 current local network state in the remote network state requests. 1193 draft-ietf-homenet-dncp-03: 1195 o Renamed connection -> endpoint. 1197 o !!! Backwards incompatible change: Renumbered TLVs, and got rid of 1198 node data TLV; instead, node data TLV's contents are optionally 1199 within node state TLV. 1201 draft-ietf-homenet-dncp-02: 1203 o Changed DNCP "messages" into series of TLV streams, allowing 1204 optimized round-trip saving synchronization. 1206 o Added fragmentation support for bigger node data and for chunking 1207 in absence of reliable L2 and L3 fragmentation. 1209 draft-ietf-homenet-dncp-01: 1211 o Fixed keep-alive semantics to consider unicast requests also 1212 updates of most recently consistent, and added proactive unicast 1213 request to ensure even inconsistent keep-alive messages eventually 1214 triggering consistency timestamp update. 1216 o Facilitated (simple) read-only clients by making Node Connection 1217 TLV optional if just using DNCP for read-only purposes. 1219 o Added text describing how to deal with "dense" networks, but left 1220 actual numbers and mechanics up to DNCP profiles and (local) 1221 configurations. 1223 draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf- 1224 homenet-hncp-03 generic parts. Changes that affect implementations: 1226 o TLVs were renumbered. 1228 o TLV length does not include header (=-4). This facilitates e.g. 1229 use of DHCPv6 option parsing libraries (same encoding), and 1230 reduces complexity (no need to handle error values of length less 1231 than 4). 1233 o Trickle is reset only when locally calculated network state hash 1234 is changes, not as remote different network state hash is seen. 1235 This prevents e.g. attacks by multicast with one multicast packet 1236 to force Trickle reset on every interface of every node on a link. 1238 o Instead of 'ping', use 'keep-alive' (optional) for dead peer 1239 detection. Different message used! 1241 Appendix C. Draft Source [RFC Editor: please remove] 1243 As usual, this draft is available at https://github.com/fingon/ietf- 1244 drafts/ in source format (with nice Makefile too). Feel free to send 1245 comments and/or pull requests if and when you have changes to it! 1247 Appendix D. Acknowledgements 1249 Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley, 1250 Juliusz Chroboczek, Jiazi Yi, Mikael Abrahamsson and Brian Carpenter 1251 for their contributions to the draft. 1253 Authors' Addresses 1255 Markus Stenberg 1256 Helsinki 00930 1257 Finland 1259 Email: markus.stenberg@iki.fi 1261 Steven Barth 1262 Halle 06114 1263 Germany 1265 Email: cyrus@openwrt.org