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