idnits 2.17.1 draft-ietf-homenet-dncp-01.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 (March 5, 2015) is 3312 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: September 6, 2015 6 March 5, 2015 8 Distributed Node Consensus Protocol 9 draft-ietf-homenet-dncp-01 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 September 6, 2015. 36 Copyright Notice 38 Copyright (c) 2015 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 54 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 55 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 4. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 57 5. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 6 58 5.1. Trickle-Driven Status Update Messages . . . . . . . . . . 6 59 5.2. Processing of Received Messages . . . . . . . . . . . . . 7 60 5.3. Adding and Removing Peers . . . . . . . . . . . . . . . . 8 61 5.4. Purging Unreachable Nodes . . . . . . . . . . . . . . . . 9 62 6. Keep-Alive Extension . . . . . . . . . . . . . . . . . . . . 9 63 6.1. Data Model Additions . . . . . . . . . . . . . . . . . . 10 64 6.2. Per-Connection Periodic Keep-Alive Messages . . . . . . . 10 65 6.3. Per-Peer Periodic Keep-Alive Messages . . . . . . . . . . 10 66 6.4. Received Message Processing Additions . . . . . . . . . . 10 67 6.5. Neighbor Removal . . . . . . . . . . . . . . . . . . . . 11 68 7. Support For Dense Broadcast Links . . . . . . . . . . . . . . 11 69 8. Protocol Messages . . . . . . . . . . . . . . . . . . . . . . 11 70 8.1. Short Network State Update Message . . . . . . . . . . . 12 71 8.2. Long Network State Update Message . . . . . . . . . . . . 12 72 8.3. Network State Request Message . . . . . . . . . . . . . . 13 73 8.4. Node Data Request Message . . . . . . . . . . . . . . . . 13 74 8.5. Node Data Reply Message . . . . . . . . . . . . . . . . . 13 75 9. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 13 76 9.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 14 77 9.1.1. Request Network State TLV . . . . . . . . . . . . . . 14 78 9.1.2. Request Node Data TLV . . . . . . . . . . . . . . . . 14 79 9.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 15 80 9.2.1. Node Connection TLV . . . . . . . . . . . . . . . . . 15 81 9.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 15 82 9.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 15 83 9.2.4. Node Data TLV . . . . . . . . . . . . . . . . . . . . 16 84 9.2.5. Neighbor TLV (within Node Data TLV) . . . . . . . . . 17 85 9.2.6. Keep-Alive Interval TLV (within Node Data TLV) . . . 17 86 9.3. Custom TLV (within/without Node Data TLV) . . . . . . . . 18 87 10. Security and Trust Management . . . . . . . . . . . . . . . . 18 88 10.1. Pre-Shared Key Based Trust Method . . . . . . . . . . . 18 89 10.2. PKI Based Trust Method . . . . . . . . . . . . . . . . . 18 90 10.3. Certificate Based Trust Consensus Method . . . . . . . . 19 91 10.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 19 92 10.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . 20 93 10.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 20 94 10.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 21 95 11. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 22 96 12. Security Considerations . . . . . . . . . . . . . . . . . . . 24 97 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 98 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 99 14.1. Normative references . . . . . . . . . . . . . . . . . . 25 100 14.2. Informative references . . . . . . . . . . . . . . . . . 25 101 Appendix A. Some Outstanding Issues . . . . . . . . . . . . . . 25 102 Appendix B. Some Obvious Questions and Answers . . . . . . . . . 26 103 Appendix C. Changelog . . . . . . . . . . . . . . . . . . . . . 26 104 Appendix D. Draft Source . . . . . . . . . . . . . . . . . . . . 27 105 Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 27 106 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 108 1. Introduction 110 DNCP is designed to provide a way for nodes to publish data 111 consisting of an ordered set of TLV (Type-Length-Value) tuples and to 112 receive the data published by all other reachable DNCP nodes. 114 DNCP validates the set of data within it by ensuring that it is 115 reachable via nodes that are currently accounted for; therefore, 116 unlike Time-To-Live (TTL) based solutions, it does not require 117 periodic re-publishing of the data by the nodes. On the other hand, 118 it does require the topology to be visible to every node that wants 119 to be able to identify unreachable nodes and therefore remove old, 120 stale data. Another notable feature is the use of Trickle to send 121 status updates as it makes the DNCP network very thrifty when there 122 are no updates. DNCP is most suitable for data that changes only 123 gradually to gain the maximum benefit from using Trickle, and if more 124 rapid state exchanges are needed, something point-to-point is 125 recommended and just e.g. publishing of addresses of the services 126 within DNCP. 128 DNCP has relatively few requirements for the underlying transport; it 129 requires some way of transmitting either unicast datagram or stream 130 data to a DNCP peer and, if used in multicast mode, a way of sending 131 multicast datagrams. If security is desired and one of the built-in 132 security methods is to be used, support for some TLS-derived 133 transport scheme - such as TLS [RFC5246] on top of TCP or DTLS 134 [RFC6347] on top of UDP - is also required. 136 2. Requirements Language 138 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 139 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 140 document are to be interpreted as described in RFC 2119 [RFC2119]. 142 3. Terminology 144 A DNCP profile is a definition of a set of rules and values listed in 145 Section 11 specifying the behavior of a DNCP based protocol, such as 146 the used transport method. For readability, any DNCP profile 147 specific parameters with a profile-specific fixed value are prefixed 148 with DNCP_. 150 A DNCP node is a single node which runs a protocol based on a DNCP 151 profile. 153 The DNCP network is a set of DNCP nodes running the same DNCP profile 154 that can reach each other, either via discovered connectivity in the 155 underlying network, or using each other's addresses learned via other 156 means. As DNCP exchanges are bidirectional, DNCP nodes connected via 157 only unidirectional links are not considered connected. 159 The node identifier is an opaque fixed-length identifier consisting 160 of DNCP_NODE_IDENTIFIER_LENGTH bytes which uniquely identifies a DNCP 161 node within a DNCP network. 163 A link indicates a link-layer media over which directly connected 164 nodes can communicate. 166 An interface indicates a port of a node that is connected to a 167 particular link. 169 A connection denotes a locally configured use of DNCP on a DNCP node, 170 that is attached either to an interface, to a specific remote unicast 171 address to be contacted, or to a range of remote unicast addresses 172 that are allowed to contact. 174 The connection identifier is a 32-bit opaque value, which identifies 175 a particular connection of that particular DNCP node. The value 0 is 176 reserved for DNCP and sub-protocol purposes in the TLVs, and MUST NOT 177 be used to identify an actual connection. This definition is in sync 178 with [RFC3493], as the non-zero small positive integers should 179 comfortably fit within 32 bits. 181 A (DNCP) peer refers to another DNCP node with which a DNCP node 182 communicates directly on a particular connection. 184 The node data is a set of TLVs published by a node in the DNCP 185 network. The whole node data is owned by the node that publishes it, 186 and it MUST be passed along as-is, including TLVs unknown to the 187 forwarder. 189 The node state is a set of metadata attributes for node data. It 190 includes a sequence number for versioning, a hash value for comparing 191 and a timestamp indicating the time passed since its last 192 publication. The hash function and the number of bits used are 193 defined in the DNCP profile. 195 The network state (hash) is a hash value which represents the current 196 state of the network. The hash function and the number of bits used 197 are defined in the DNCP profile. Whenever any node is added, removed 198 or changes its published node data this hash value changes as well. 199 It is calculated over the hash values of each reachable nodes' node 200 data in ascending order of the respective node identifier. 202 The effective (trust) verdict for a certificate is defined as the 203 verdict with the highest priority within the set of verdicts 204 announced for the certificate in the DNCP network. 206 The neighbor graph is the undirected graph of DNCP nodes produced by 207 retaining only bidirectional peer relationships between nodes. 209 4. Data Model 211 A DNCP node has: 213 o A timestamp indicating the most recent neighbor graph traversal 214 described in Section 5.4. 216 A DNCP node has for every DNCP node in the DNCP network: 218 o A node identifier, which uniquely identifies the node. 220 o The node data, an ordered set of TLV tuples published by that 221 particular node. This set of TLVs has a well-defined order based 222 on ascending binary content (including TLV type and length). This 223 facilitates linear time state delta processing. 225 o The latest update sequence number, a 32 bit number that is 226 incremented any time the TLV set is published. For comparison 227 purposes, a looping comparison should be used to avoid problems in 228 case of overflow. An example would be: a < b <=> (a - b) % 2^32 & 229 2^31 != 0. 231 o The relative time (in milliseconds) since the current TLV data set 232 with the current update sequence number was published. It is also 233 a 32 bit number on the wire. If this number is close to overflow 234 (greater than 2^32-2^16), a node MUST re-publish its TLVs even if 235 there is no change to avoid overflow of the value. In other 236 words, absent any other changes, the TLV set MUST be re-published 237 roughly every 49 days. 239 o A timestamp identifying the time it was last reachable based on 240 neighbor graph traversal described in Section 5.4. 242 Additionally, a DNCP node has a set of connections for which DNCP is 243 configured to be used. For each such connection, a node has: 245 o A connection identifier. 247 o An interface, a unicast address of a DNCP peer it should connect 248 with, or a range of addresses from which DNCP peers are allowed to 249 connect. 251 o A Trickle [RFC6206] instance with parameters I, T, and c. 253 For each DNCP peer detected on a connection, a DNCP node has: 255 o The node identifier of the DNCP peer. 257 o The connection identifier of the DNCP peer. 259 o The most recent address used by the DNCP peer (in an authenticated 260 message, if security is enabled). 262 5. Operation 264 The DNCP protocol consists of Trickle [RFC6206] driven unicast or 265 multicast status messages which indicate the current status of shared 266 TLV data and additional unicast message exchanges which ensure DNCP 267 peer reachability and synchronize the data when necessary. 269 If DNCP is to be used on a multicast-capable interface, as opposed to 270 only point-to-point using unicast, a datagram-based transport which 271 supports multicast SHOULD be defined in the DNCP profile to be used 272 for the messages to be sent to the whole link. As this is used only 273 to identify potential new DNCP nodes and to notify that an unicast 274 exchange should be triggered, the multicast transport does not have 275 to be particularly secure. 277 5.1. Trickle-Driven Status Update Messages 279 Each node MUST send either a Long Network State Update message 280 (Section 8.2) or a Short Network State Update message (Section 8.1) 281 every time the connection-specific Trickle algorithm [RFC6206] 282 instance indicates that an update should be sent. The destination 283 address of the message should be multicast in case of an interface 284 which is multicast-capable, or the unicast address of the remote 285 party in case of a point-to-point connection. By default, Long 286 Network State Update messages SHOULD be used, but if it is defined as 287 undesirable for some case by the DNCP profile, Short Network State 288 Update message MUST be sent instead. This may be useful to avoid 289 fragmenting packets to multicast destinations, or for security 290 reasons. 292 A Trickle state MUST be maintained separately for each connection. 293 The Trickle state for all connections is considered inconsistent and 294 reset if and only if the locally calculated network state hash 295 changes. This occurs either due to a change in the local node's own 296 node data, or due to receipt of more recent data from another node. 298 The Trickle algorithm has 3 parameters: Imin, Imax and k. Imin and 299 Imax represent the minimum and maximum values for I, which is the 300 time interval during which at least k Trickle updates must be seen on 301 a connection to prevent local state transmission. The actual 302 suggested Trickle algorithm parameters are DNCP profile specific, as 303 described in Section 11. 305 5.2. Processing of Received Messages 307 This section describes how received messages are processed. The DNCP 308 profile may specify criteria based on which received messages are 309 ignored. Any 'reply' mentioned in the steps below denotes sending of 310 the specified message via unicast to the originator of the message 311 being processed. If the reply was caused by a multicast message and 312 sent to a link with shared bandwidth it SHOULD be delayed by a random 313 timespan in [0, Imin/2]. Sending of replies SHOULD be rate-limited 314 by the implementation, and in case of excess load (or some other 315 reason), a reply MAY be omitted altogether. 317 Upon receipt of: 319 Short Network State Update (Section 8.1): If the network state 320 hash within the message differs from the locally calculated 321 network state hash, the receiver MUST reply with a Network State 322 Request message (Section 8.3). 324 Long Network State Update (Section 8.2): 326 * If the network state hash within the message matches the 327 locally calculated network state hash, stop processing. 329 * Otherwise the receiver MUST identify all nodes for which local 330 information is outdated (local update sequence number is lower 331 than that within the message), potentially incorrect (local 332 update sequence number matches but the hash of the node data 333 TLV differs) or missing. 335 * If any such nodes are identified, the receiver MUST reply with 336 one or more Node Data Request message(s) (Section 8.4) 337 containing Request Node Data TLV(s) (Section 9.1.2) for the 338 corresponding nodes. 340 Network State Request (Section 8.3): the receiver MUST reply with 341 a Long Network State Update (Section 8.2). 343 Node Data Request (Section 8.4): the receiver MUST reply with the 344 requested data in a Node Data Reply message (Section 8.5). 345 Optionally - if specified by the DNCP profile - multiple replies 346 MAY be sent in order to e.g. keep size of each datagram within the 347 PMTU to the destination. However these replies must be valid 348 stand-alone Node Data Reply messages, with the full state for the 349 particular nodes. 351 Node Data Reply (Section 8.5): If the message contains Node State 352 TLVs that are more recent than the local state (the received TLV 353 has a higher update sequence number, the node data TLV hash 354 differs from the local one, or local data is missing altogether) 355 and if the message also contains corresponding Node Data TLVs, the 356 receiver MUST update its locally stored state. 358 If a message containing Node State TLVs (Section 9.2.3) is received 359 with the node identifier matching the local node identifier and a 360 higher update sequence number than its current local value, or the 361 same update sequence number and a different hash, the node SHOULD re- 362 publish its own node data with an update sequence number 1000 higher 363 than the received one. This may occur normally once due to the local 364 node restarting and not storing the most recently used update 365 sequence number. If this occurs more than once, the DNCP profile 366 should provide guidance on how to handle these situations as it 367 indicates the existence of another active node with the same node 368 identifier. 370 5.3. Adding and Removing Peers 372 When receiving a message on a connection from an unknown peer: 374 If it is a unicast message, and the message contains a Node 375 Connection TLV (Section 9.2.1), the remote node MUST be added as a 376 peer on the connection and a Neighbor TLV (Section 9.2.5) MUST be 377 created for it. 379 If it is a multicast message, and the message contains a Node 380 Connection TLV (Section 9.2.1), the remote node SHOULD be sent a 381 (possibly rate-limited) unicast Network State Request Message 382 (Section 8.3). 384 If keep-alives are NOT sent by the peer (either the DNCP profile does 385 not specify the use of keep-alives or the particular peer chooses not 386 to send keep-alive messages), some other means MUST be employed to 387 ensure a DNCP peer is present. When the peer is no longer present, 388 the Neighbor TLV and the local DNCP peer state MUST be removed. 390 5.4. Purging Unreachable Nodes 392 When a Neighbor TLV or a whole node is added or removed, the neighbor 393 graph SHOULD be traversed, starting from the local node. The edges 394 to be traversed are identified by looking for Neighbor TLVs on both 395 nodes, that have the other node's identifier in the neighbor node 396 identifier, and local and neighbor connection identifiers swapped. 397 Each node reached should be marked currently reachable. 399 DNCP nodes MUST be either purged immediately when not marked 400 reachable in a particular graph traversal, or eventually after they 401 have not been marked reachable within DNCP_GRACE_INTERVAL. During 402 the grace period, the nodes that were not marked reachable in the 403 most recent graph traversal MUST NOT be used for calculation of the 404 network state hash, be provided to any applications that need to use 405 the whole TLV graph, or be provided to remote nodes. 407 6. Keep-Alive Extension 409 The Trickle-driven messages provide a mechanism for handling of new 410 peer detection (if applicable) on a connection, as well as state 411 change notifications. Another mechanism may be needed to get rid of 412 old, no longer valid DNCP peers if the transport or lower layers do 413 not provide one. 415 If keep-alives are not specified in the DNCP profile, the rest of 416 this section MUST be ignored. 418 A DNCP profile MAY specify either per-connection or per-peer keep- 419 alive support. 421 For every connection that a keep-alive is specified for in the DNCP 422 profile, the connection-specific keep-alive interval MUST be 423 maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is 424 a local value that is preferred for that for any reason 425 (configuration, energy conservation, media type, ..), it should be 426 substituted instead. If a non-default keep-alive interval is used on 427 any connection, a DNCP node MUST publish appropriate Keep-Alive 428 Interval TLV(s) (Section 9.2.6). 430 6.1. Data Model Additions 432 The following additions to the Data Model (Section 4) are needed to 433 support keep-alive: 435 Each node MUST have a timestamp which indicates the last time a 436 Network State TLV (Section 9.2.2) was sent for each connection, i.e. 437 on an interface or to the point-to-point peer(s). 439 Each node MUST have for each peer: 441 o Last consistent state timestamp: a timestamp which indicates the 442 last time a consistent Network State TLV (Section 9.2.2) was 443 received from the peer. When adding a new peer, it should be 444 initialized to the current time. 446 6.2. Per-Connection Periodic Keep-Alive Messages 448 If per-connection keep-alives are enabled on connection with a 449 multicast-enabled link, and if no traffic containing a Network State 450 TLV (Section 9.2.2) has been sent to a particular connection within 451 the connection-specific keep-alive interval, a Long Network State 452 Update message (Section 8.2) or a Short Network State Update message 453 (Section 8.1) MUST be sent on that connection. The type of message 454 should be chosen based on the considerations in Section 5.1. The 455 actual sending time SHOULD be further delayed by a random timespan in 456 [0, Imin/2]. When such a message is sent, a new Trickle transmission 457 time 't' in [I/2, I] MUST be randomly chosen. 459 6.3. Per-Peer Periodic Keep-Alive Messages 461 If per-peer keep-alives are enabled on a unicast-only connection, and 462 if no traffic containing a Network State TLV (Section 9.2.2) has been 463 sent to a particular peer within the connection-specific keep-alive 464 interval, a Long Network State Update message (Section 8.2) or a 465 Short Network State Update message (Section 8.1) MUST be sent to the 466 peer. The type of message should be chosen based on the 467 considerations in Section 5.1. When such a message is sent, a new 468 Trickle transmission time 't' in [I/2, I] MUST be randomly chosen. 470 6.4. Received Message Processing Additions 472 If a message is received via unicast from the peer, the Last 473 consistent state timestamp for the peer MUST be updated. 475 If the received multicast message contains a Network State TLV 476 (Section 9.2.2) which is consistent with the locally calculated 477 network state hash, the Last consistent state timestamp for the peer 478 MUST be updated. If the TLV is inconsistent, and would not cause any 479 unicast exchange, Network State Request (Section 8.3) SHOULD be sent 480 via unicast. 482 6.5. Neighbor Removal 484 For every peer on every connection, the connection-specific keep- 485 alive interval must be calculated by looking for Keep-Alive Interval 486 TLVs (Section 9.2.6) published by the node, and if none exist, using 487 the default value of DNCP_KEEPALIVE_INTERVAL. If the peer's last 488 consistent state timestamp has not been updated for at least 489 DNCP_KEEPALIVE_MULTIPLIER times the peer's connection-specific keep- 490 alive interval, the Neighbor TLV for that peer and the local DNCP 491 peer state MUST be removed. 493 7. Support For Dense Broadcast Links 495 The DNCP profile or a user configuration should limit the number of 496 neighbors that are allowed for a (particular type of) link that a 497 connection runs on. If that limit is exceeded, nodes without the 498 highest Node Identifier on the link SHOULD treat the connection as an 499 unicast connection connected to the node that has the highest Node 500 Identifier detected on the link. The nodes MUST also keep listening 501 to multicast traffic to both detect the presence of that node, and to 502 react to nodes with a higher Node Identifier appearing. If the 503 highest Node Identifier present on the link changes, the connection 504 endpoint MUST be changed. If the Node Identifier of the local node 505 is the highest one, the node MUST keep the connection in normal 506 multicast mode, and the node MUST allow others to peer with it over 507 the link. 509 8. Protocol Messages 511 For point-to-point exchanges, DNCP can run across datagram-based or 512 reliable ordered stream-based transports. If a stream-based 513 transport is used, a 32-bit length-value in network byte order is 514 sent before each message to indicate the number of bytes the 515 following message consists of. 517 DNCP messages are encoded as a concatenated sequence of Type-Length- 518 Value objects (Section 9). In order to facilitate fast comparing of 519 local state with that in a received message update, all TLVs in every 520 encoding scope (either within the message itself, or within a 521 container TLV) MUST be placed in ascending order based on the binary 522 comparison of both TLV header and value. By design, the TLVs which 523 MUST be present have the lowest available type values, ensuring they 524 will naturally occur at the start of the Protocol Message, resembling 525 a fixed format header. 527 DNCP profiles MAY add additional TLVs to the message specified here, 528 or even define additional messages as needed. TLVs not recognized by 529 the receiver MUST be ignored. 531 8.1. Short Network State Update Message 533 The Short Network State Update Message is used to announce the 534 sender's view of the network state using multicast. 536 The following TLVs MUST be present: 538 o One Node Connection TLV (Section 9.2.1) identifying the 539 originating node and connection. 541 o One Network State TLV (Section 9.2.2) containing the network state 542 hash as calculated by the sender. 544 The Short Network Status update message MUST NOT contain any Node 545 State TLV(s) (Section 9.2.3). 547 8.2. Long Network State Update Message 549 The Long Network State Update Message is used to announce the 550 sender's view of the network state and all node states using 551 multicast or unicast. 553 The following TLVs MUST be present: 555 o One Node Connection TLV (Section 9.2.1) identifying the 556 originating node and connection. 558 o One Network State TLV (Section 9.2.2) containing the network state 559 hash as calculated by the sender. 561 o One or more Node State TLVs (Section 9.2.3) containing the node 562 state of DNCP nodes as currently known to the sender. 564 The Long Network State Update message MUST include the corresponding 565 Node State TLV (Section 9.2.3) for each Node Data TLV used to 566 calculate the network state hash. 568 8.3. Network State Request Message 570 The Network State Request message is used to request the recipient's 571 view of the network state and all node states currently known to it. 573 The following TLVs MUST be present: 575 o One Request Network State TLV (Section 9.1.1) indicating the type 576 of request. 578 8.4. Node Data Request Message 580 The Node Data Request message is used to request the node state and 581 data of one or more DNCP nodes in the network. 583 The following TLVs MUST be present: 585 o One or more Request Node Data TLVs (Section 9.1.2) indicating the 586 nodes for which state and data is requested. 588 8.5. Node Data Reply Message 590 The Node Data Request message is used to provide the node data of one 591 or more DNCP nodes in the network. 593 The following TLVs MUST be present: 595 o One Node Connection TLV (Section 9.2.1) identifying the 596 originating node and connection. 598 o One or more Node State TLV (Section 9.2.3) and Node Data TLV 599 (Section 9.2.4) pairs with matching node identifiers for each node 600 previously requested in a Node Data Request message (Section 8.4). 602 9. Type-Length-Value Objects 604 Each TLV is encoded as a 2 byte type field, followed by a 2 byte 605 length field (of the value, excluding header; 0 means no value) 606 followed by the value itself (if any). Both type and length fields 607 in the header as well as all integer fields inside the value - unless 608 explicitly stated otherwise - are represented in network byte order. 609 Zero padding bytes MUST be added up to the next 4 byte boundary if 610 the length is not divisible by 4. These padding bytes MUST NOT be 611 included in the length field. 613 0 1 2 3 614 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 615 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 616 | Type | Length | 617 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 618 | Value | 619 | (variable # of bytes) | 620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 622 For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is 623 encoded as: 007B 0001 7800 0000. 625 Notation: 627 .. = octet string concatenation operation. 629 H(x) = non-cryptographic hash function specified by DNCP profile. 631 9.1. Request TLVs 633 9.1.1. Request Network State TLV 635 0 1 2 3 636 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 637 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 638 | Type: REQ-NETWORK-STATE (2) | Length: 0 | 639 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 641 This TLV is used to identify a Network State Request message 642 (Section 8.3). 644 9.1.2. Request Node Data TLV 646 0 1 2 3 647 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 648 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 649 | Type: REQ-NODE-DATA (3) | Length: >0 | 650 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 651 | Node Identifier | 652 | (length fixed in DNCP profile) | 653 ... 654 | | 655 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 657 This TLV is used within a Node Data Request message (Section 8.4) to 658 request node state and node data for the node with matching node 659 identifier, if any, to be included in a subsequent Node Data Reply 660 message (Section 8.5). 662 9.2. Data TLVs 664 9.2.1. Node Connection TLV 666 0 1 2 3 667 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 668 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 669 | Type: NODE-CONNECTION (1) | Length: > 4 | 670 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 671 | Node Identifier | 672 | (length fixed in DNCP profile) | 673 ... 674 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 675 | Connection Identifier | 676 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 678 This TLV identifies both the local node's node identifier, as well as 679 the particular connection identifier. It MUST be sent in all 680 messages if bidirectional peer relationship is desired with remote 681 nodes. Bidirectional peer relationship is not necessary for read- 682 only access to the DNCP state, but it is required to be able to 683 publish something. 685 9.2.2. Network State TLV 687 0 1 2 3 688 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 689 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 690 | Type: NETWORK-STATE (10) | Length: > 0 | 691 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 692 | H(H(node data TLV 1) .. [...] .. H(node data TLV N)) | 693 | (length fixed in DNCP profile) | 694 ... 695 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 697 This TLV contains the current locally calculated network state hash. 698 The network state hash is derived by calculating the hash value for 699 each currently reachable node's Node Data TLV, concatenating said 700 hash values based on the ascending order of their corresponding node 701 identifiers, and hashing the resulting concatenated hash values. 703 9.2.3. Node State TLV 704 0 1 2 3 705 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 706 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 707 | Type: NODE-STATE (11) | Length: > 8 | 708 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 709 | Node Identifier | 710 | (length fixed in DNCP profile) | 711 ... 712 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 713 | Update Sequence Number | 714 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 715 | Milliseconds since Origination | 716 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 717 | H(node data TLV) | 718 | (length fixed in DNCP profile) | 719 ... 720 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 722 This TLV represents the local node's knowledge about the published 723 state of a node in the DNCP network identified by the node identifier 724 field in the TLV. 726 The whole network should have roughly same idea about the time since 727 origination of any particular published state. Therefore every node, 728 including the originating one, MUST increment the time whenever it 729 needs to send a Node State TLV for an already published Node Data 730 TLV. This age value is not included within the Node Data TLV, 731 however, as that is immutable and used to detect changes in the 732 network state. 734 9.2.4. Node Data TLV 736 0 1 2 3 737 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 738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 739 | Type: NODE-DATA (12) | Length: > 4 | 740 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 741 | node identifier | 742 | (length fixed in DNCP profile) | 743 ... 744 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 745 | Update Sequence Number | 746 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 747 | Nested TLVs containing node information | 749 9.2.5. Neighbor TLV (within Node Data TLV) 751 0 1 2 3 752 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 753 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 754 | Type: NEIGHBOR (13) | Length: > 8 | 755 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 756 | neighbor node identifier | 757 | (length fixed in DNCP profile) | 758 ... 759 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 760 | Neighbor Connection Identifier | 761 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 762 | Local Connection Identifier | 763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 765 This TLV indicates that the node in question vouches that the 766 specified neighbor is reachable by it on the specified local 767 connection. The presence of this TLV at least guarantees that the 768 node publishing it has received traffic from the neighbor recently. 769 For guaranteed up-to-date bidirectional reachability, the existence 770 of both nodes' matching Neighbor TLVs should be checked. 772 9.2.6. Keep-Alive Interval TLV (within Node Data TLV) 774 0 1 2 3 775 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 776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 777 | Type: KEEP-ALIVE-INTERVAL (14)| Length: 8 | 778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 779 | Connection Identifier | 780 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 781 | Interval | 782 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 784 This TLV indicates a non-default interval being used to send keep- 785 alive messages specified in Section 6. 787 Connection identifier is used to identify the particular connection 788 for which the interval applies. If 0, it applies for ALL connections 789 for which no specific TLV exists. 791 Interval specifies the interval in milliseconds at which the node 792 sends keep-alives. A value of zero means no keep-alives are sent at 793 all; in that case, some lower layer mechanism that ensures presence 794 of nodes MUST be available and used. 796 9.3. Custom TLV (within/without Node Data TLV) 798 0 1 2 3 799 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 800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 801 | Type: CUSTOM-DATA (15) | Length: > 0 | 802 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 803 | H(URI) | 804 | (length fixed in DNCP profile) | 805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 806 | Opaque Data | 808 This TLV can be used to contain anything; the URI used should be 809 under control of the author of that specification. For example: 811 V = H('http://example.com/author/json-for-dncp') .. '{"cool": "json 812 extension!"}' 814 or 816 V = H('mailto:author@example.com') .. '{"cool": "json extension!"}' 818 10. Security and Trust Management 820 If specified in the DNCP profile, either DTLS [RFC6347] or TLS 821 [RFC5246] may be used to authenticate and encrypt either some (if 822 specified optional in the profile), or all unicast traffic. The 823 following methods for establishing trust are defined, but it is up to 824 the DNCP profile to specify which ones may, should or must be 825 supported. 827 10.1. Pre-Shared Key Based Trust Method 829 A PSK-based trust model is a simple security management mechanism 830 that allows an administrator to deploy devices to an existing network 831 by configuring them with a pre-defined key, similar to the 832 configuration of an administrator password or WPA-key. Although 833 limited in nature it is useful to provide a user-friendly security 834 mechanism for smaller networks. 836 10.2. PKI Based Trust Method 838 A PKI-based trust-model enables more advanced management capabilities 839 at the cost of increased complexity and bootstrapping effort. It 840 however allows trust to be managed in a centralized manner and is 841 therefore useful for larger networks with a need for an authoritative 842 trust management. 844 10.3. Certificate Based Trust Consensus Method 846 The certificate-based consensus model is designed to be a compromise 847 between trust management effort and flexibility. It is based on 848 X.509-certificates and allows each DNCP node to provide a verdict on 849 any other certificate and a consensus is found to determine whether a 850 node using this certificate or any certificate signed by it is to be 851 trusted. 853 The current effective trust verdict for any certificate is defined as 854 the one with the highest priority from all verdicts announced for 855 said certificate at the time. 857 10.3.1. Trust Verdicts 859 Trust Verdicts are statements of DNCP nodes about the trustworthiness 860 of X.509-certificates. There are 5 possible verdicts in order of 861 ascending priority: 863 0 Neutral : no verdict exists but the DNCP network should determine 864 one. 866 1 Cached Trust : the last known effective verdict was Configured or 867 Cached Trust. 869 2 Cached Distrust : the last known effective verdict was Configured 870 or Cached Distrust. 872 3 Configured Trust : trustworthy based upon an external ceremony or 873 configuration. 875 4 Configured Distrust : not trustworthy based upon an external 876 ceremony or configuration. 878 Verdicts are differentiated in 3 groups: 880 o Configured verdicts are used to announce explicit verdicts a node 881 has based on any external trust bootstrap or predefined relation a 882 node has formed with a given certificate. 884 o Cached verdicts are used to retain the last known trust state in 885 case all nodes with configured verdicts about a given certificate 886 have been disconnected or turned off. 888 o The Neutral verdict is used to announce a new node intending to 889 join the network so a final verdict for it can be found. 891 The current effective trust verdict for any certificate is defined as 892 the one with the highest priority within the set of verdicts + 893 announced for the certificate in the DNCP network. A node MUST be 894 trusted for participating in the DNCP network if and only if the 895 current effective verdict for its own certificate or any one in its 896 certificate hierarchy is (Cached or Configured) Trust and none of the 897 certificates in its hierarchy have an effective verdict of (Cached or 898 Configured) Distrust. In case a node has a configured verdict, which 899 is different from the current effective verdict for a certificate, 900 the current effective verdict takes precedence in deciding 901 trustworthiness. Despite that, the node still retains and announces 902 its configured verdict. 904 10.3.2. Trust Cache 906 Each node SHOULD maintain a trust cache containing the current 907 effective trust verdicts for all certificates currently announced in 908 the DNCP network. This cache is used as a backup of the last known 909 state in case there is no node announcing a configured verdict for a 910 known certificate. It SHOULD be saved to a non-volatile memory at 911 reasonable time intervals to survive a reboot or power outage. 913 Every time a node (re)joins the network or detects the change of an 914 effective trust verdict for any certificate, it will synchronize its 915 cache, i.e. store new effective verdicts overwriting any previously 916 cached verdicts. Configured verdicts are stored in the cache as 917 their respective cached counterparts. Neutral verdicts are never 918 stored and do not override existing cached verdicts. 920 10.3.3. Announcement of Verdicts 922 A node SHOULD always announce any configured trust verdicts it has 923 established by itself, and it MUST do so if announcing the configured 924 trust verdict leads to a change in the current effective verdict for 925 the respective certificate. In absence of configured verdicts, it 926 MUST announce cached trust verdicts it has stored in its trust cache, 927 if one of the following conditions applies: 929 o The stored verdict is Cached Trust and the current effective 930 verdict for the certificate is Neutral or does not exist. 932 o The stored verdict is Cached Distrust and the current effective 933 verdict for the certificate is Cached Trust. 935 A node rechecks these conditions whenever it detects changes of 936 announced trust verdicts anywhere in the network. 938 Upon encountering a node with a hierarchy of certificates for which 939 there is no effective verdict, a node adds a Neutral Trust-Verdict- 940 TLV to its node data for all certificates found in the hierarchy, and 941 publishes it until an effective verdict different from Neutral can be 942 found for any of the certificates, or a reasonable amount of time (10 943 minutes is suggested) with no reaction and no further authentication 944 attempts has passed. Such verdicts SHOULD also be limited in rate 945 and number to prevent denial-of-service attacks. 947 Trust verdicts are announced using Trust-Verdict TLVs: 949 0 1 2 3 950 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 951 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 952 | Type: Trust-Verdict (16) | Length: 37-100 | 953 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 954 | Verdict | (reserved) | 955 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 956 | | 957 | | 958 | | 959 | SHA-256 Fingerprint | 960 | | 961 | | 962 | | 963 | | 964 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 965 | Common Name | 967 Verdict represents the numerical index of the verdict. 969 (reserved) is reserved for future additions and MUST be set to 0 970 when creating TLVs and ignored when parsing them. 972 SHA-256 Fingerprint contains the SHA-256 [RFC6234] hash value of 973 the certificate in DER-format. 975 Common Name contains the variable-length (1-64 bytes) common name 976 of the certificate. Final byte MUST have value of 0. 978 10.3.4. Bootstrap Ceremonies 980 The following non-exhaustive list of methods describes possible ways 981 to establish trust relationships between DNCP nodes and node 982 certificates. Trust establishment is a two-way process in which the 983 existing network must trust the newly added node and the newly added 984 node must trust at least one of its neighboring nodes. It is 985 therefore necessary that both the newly added node and an already 986 trusted node perform such a ceremony to successfully introduce a node 987 into the DNCP network. In all cases an administrator MUST be 988 provided with external means to identify the node belonging to a 989 certificate based on its fingerprint and a meaningful common name. 991 10.3.4.1. Trust by Identification 993 A node implementing certificate-based trust MUST provide an interface 994 to retrieve the current set of effective trust verdicts, fingerprints 995 and names of all certificates currently known and set configured 996 trust verdicts to be announced. Alternatively it MAY provide a 997 companion DNCP node or application with these capabilities with which 998 it has a pre-established trust relationship. 1000 10.3.4.2. Preconfigured Trust 1002 A node MAY be preconfigured to trust a certain set of node or CA 1003 certificates. However such trust relationships MUST NOT result in 1004 unwanted or unrelated trust for nodes not intended to be run inside 1005 the same network (e.g. all other devices by the same manufacturer). 1007 10.3.4.3. Trust on Button Press 1009 A node MAY provide a physical or virtual interface to put one or more 1010 of its internal network interfaces temporarily into a mode in which 1011 it trusts the certificate of the first DNCP node it can successfully 1012 establish a connection with. 1014 10.3.4.4. Trust on First Use 1016 A node which is not associated with any other DNCP node MAY trust the 1017 certificate of the first DNCP node it can successfully establish a 1018 connection with. This method MUST NOT be used when the node has 1019 already associated with any other DNCP node. 1021 11. DNCP Profile-Specific Definitions 1023 Each DNCP profile MUST define following: 1025 o How the messages are secured: Not at all, optionally or always 1026 with the TLS scheme defined here using one or more of the methods, 1027 or with something else. If the links with DNCP nodes can be 1028 sufficiently secured or isolated, it is possible to run DNCP in a 1029 secure manner without using any form of authentication or 1030 encryption. 1032 o Unicast and optionally multicast transport protocol(s) to be used. 1033 If TLS scheme within this document is to be used security, TLS or 1034 DTLS support for at least the unicast transport protocol is 1035 mandatory. 1037 o Transport protocols' parameters such as port numbers to be used, 1038 or multicast address to be used. Unicast, multicast, and secure 1039 unicast may each require different parameters, if applicable. 1041 o When receiving messages, what sort of messages are dropped, as 1042 specified in Section 5.2. 1044 o What is the criteria for sending Trickle-based Long Network State 1045 Update message (Section 8.2) on an interface or to a DNCP peer. 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 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 behavior of the network. 1059 o Hash function H(x) to be used, and how many bits of the input are 1060 actually used. The chosen hash function is used to handle both 1061 hashing of node specific data, and network state hash, which is a 1062 hash of node specific data hashes. SHA-256 defined in [RFC6234] 1063 is the recommended default choice. 1065 o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier 1066 (in bytes). 1068 o DNCP_GRACE_INTERVAL: How long node data for unreachable nodes is 1069 kept. 1071 o Whether to send keep-alives, and if so, on an interface, using 1072 multicast, or directly using unicast to peers. Keep-alive has 1073 also associated parameters: 1075 * DNCP_KEEPALIVE_INTERVAL: How often keep-alive messages are to 1076 be sent by default (if enabled). 1078 * DNCP_KEEPALIVE_MULTIPLIER: How many times the 1079 DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval 1080 value) a node may not be heard from to be considered still 1081 valid. 1083 12. Security Considerations 1085 DNCP profiles may use multicast to indicate DNCP state changes and 1086 for keep-alive purposes. However, no actual data TLVs will be sent 1087 across that channel. Therefore an attacker may only learn hash 1088 values of the state within DNCP and may be able to trigger unicast 1089 synchronization attempts between nodes on a local link this way. A 1090 DNCP node should therefore rate-limit its reactions to multicast 1091 packets. 1093 When using DNCP to bootstrap a network, PKI based solutions may have 1094 issues when validating certificates due to potentially unavailable 1095 accurate time, or due to inability to use the network to either check 1096 Certifcate Revocation Lists or perform on-line validation. 1098 The Certificate-based trust consensus mechanism defined in this 1099 document allows for a consenting revocation, however in case of a 1100 compromised device the trust cache may be poisoned before the actual 1101 revocation happens allowing the distrusted device to rejoin the 1102 network using a different identity. Stopping such an attack might 1103 require physical intervention and flushing of the trust caches. 1105 13. IANA Considerations 1107 IANA should set up a registry for DNCP TLV types, with the following 1108 initial contents: 1110 0: Reserved (should not happen on wire) 1112 1: Node connection 1114 2: Request network state 1116 3: Request node data 1118 4-9: Reserved for DNCP profile use 1120 10: Network state 1122 11: Node state 1124 12: Node data 1126 13: Neighbor 1128 14: Keep-alive interval 1130 15: Custom 1131 16: Trust-Verdict 1133 17-31: Reserved for future DNCP versions. 1135 192-255: Reserved for per-implementation experimentation. The nodes 1136 using TLV types in this range SHOULD use e.g. Custom TLV to identify 1137 each other and therefore eliminate potential conflict caused by 1138 potential different use of same TLV numbers. 1140 For the rest of the values (32-191, 256-65535), policy of 'standards 1141 action' should be used. 1143 14. References 1145 14.1. Normative references 1147 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1148 Requirement Levels", BCP 14, RFC 2119, March 1997. 1150 [RFC6206] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko, 1151 "The Trickle Algorithm", RFC 6206, March 2011. 1153 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1154 Security Version 1.2", RFC 6347, January 2012. 1156 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1157 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1159 14.2. Informative references 1161 [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W. 1162 Stevens, "Basic Socket Interface Extensions for IPv6", RFC 1163 3493, February 2003. 1165 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 1166 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 1168 Appendix A. Some Outstanding Issues 1170 Should better forms of combined messages be defined? e.g. allow 1171 sending both request-network-state, and currently set of known local 1172 state at same time in one message. 1174 Should some sort of fragmentation scheme be defined for the data? 1175 Currently, DNCP uses Merkle tree of depth 2 (node data -> node hash 1176 -> network hash). However, it essentially treats all TLVs published 1177 by a single node as a single chunk on the protocol level. Is that a 1178 scalability problem? Adding one more level to the tree might address 1179 this. 1181 Appendix B. Some Obvious Questions and Answers 1183 Q: Should there be nested container syntax that is actually self- 1184 describing? (i.e. type flag that indicates container, no body except 1185 sub-TLVs?) 1187 A: Not for now, but perhaps valid design.. TBD. 1189 Q: Add third case for multicast - 'medium' network state, which is 1190 'long' one, but partial? 1192 A: Drops typical convergence on large networks 5->3 packets, at 1193 expense of some specification/implementation complexity. However, as 1194 anything else than short network state leaks information via 1195 multicast, it does not seem worth it as secure protocols probably 1196 want to prevent multicast sending of anything else than short network 1197 state in any case. Additionally, the long network state being 1198 complete set of nodes actually facilitates light-weight nodes that do 1199 not want to do graph-based pruning. So all in all, perhaps not worth 1200 it. 1202 Q: 32-bit connection id? 1204 A: Here, it would save 32 bits per neighbor if it was 16 bits (and 1205 less is not realistic). However, TLVs defined elsewhere would not 1206 seem to even gain that much on average. 32 bits is also used for 1207 ifindex in various operating systems, making for simpler 1208 implementation. 1210 Q: Why have topology information at all? 1212 A: It is an alternative to the more traditional seq#/TTL-based 1213 flooding schemes. In steady state, there is no need to e.g. re- 1214 publish every now and then. 1216 Appendix C. Changelog 1218 draft-ietf-homenet-dncp-01: 1220 o Fixed keep-alive semantics to consider unicast requests also 1221 updates of most recently consistent, and added proactive unicast 1222 request to ensure even inconsistent keep-alive messages eventually 1223 triggering consistency timestamp update. 1225 o Facilitated (simple) read-only clients by making Node Connection 1226 TLV optional if just using DNCP for read-only purposes. 1228 o Added text describing how to deal with "dense" networks, but left 1229 actual numbers and mechanics up to DNCP profiles and (local) 1230 configurations. 1232 draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf- 1233 homenet-hncp-03 generic parts. Changes that affect implementations: 1235 o TLVs were renumbered. 1237 o TLV length does not include header (=-4). This facilitates e.g. 1238 use of DHCPv6 option parsing libraries (same encoding), and 1239 reduces complexity (no need to handle error values of length less 1240 than 4). 1242 o Trickle is reset only when locally calculated network state hash 1243 is changes, not as remote different network state hash is seen. 1244 This prevents e.g. attacks by multicast with one multicast packet 1245 to force Trickle reset on every interface of every node on a link. 1247 o Instead of 'ping', use 'keep-alive' (optional) for dead peer 1248 detection. Different message used! 1250 Appendix D. Draft Source 1252 As usual, this draft is available at https://github.com/fingon/ietf- 1253 drafts/ in source format (with nice Makefile too). Feel free to send 1254 comments and/or pull requests if and when you have changes to it! 1256 Appendix E. Acknowledgements 1258 Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley, 1259 Juliusz Chroboczek and Jiazi Yi for their contributions to the draft. 1261 Authors' Addresses 1263 Markus Stenberg 1264 Helsinki 00930 1265 Finland 1267 Email: markus.stenberg@iki.fi 1268 Steven Barth 1269 Halle 06114 1270 Germany 1272 Email: cyrus@openwrt.org