draft-ietf-homenet-dncp-12.txt   rfc7787.txt 
Homenet Working Group M. Stenberg Internet Engineering Task Force (IETF) M. Stenberg
Internet-Draft S. Barth Request for Comments: 7787 S. Barth
Intended status: Standards Track Independent Category: Standards Track Independent
Expires: May 5, 2016 November 2, 2015 ISSN: 2070-1721 April 2016
Distributed Node Consensus Protocol Distributed Node Consensus Protocol
draft-ietf-homenet-dncp-12
Abstract Abstract
This document describes the Distributed Node Consensus Protocol This document describes the Distributed Node Consensus Protocol
(DNCP), a generic state synchronization protocol that uses the (DNCP), a generic state synchronization protocol that uses the
Trickle algorithm and hash trees. DNCP is an abstract protocol, and Trickle algorithm and hash trees. DNCP is an abstract protocol and
must be combined with a specific profile to make a complete must be combined with a specific profile to make a complete
implementable protocol. implementable protocol.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This is an Internet Standards Track document.
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months This document is a product of the Internet Engineering Task Force
and may be updated, replaced, or obsoleted by other documents at any (IETF). It represents the consensus of the IETF community. It has
time. It is inappropriate to use Internet-Drafts as reference received public review and has been approved for publication by the
material or to cite them other than as "work in progress." Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
This Internet-Draft will expire on May 5, 2016. Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc7787.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Applicability . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Applicability . . . . . . . . . . . . . . . . . . . . . . 4
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Requirements Language . . . . . . . . . . . . . . . . . . 8 2.1. Requirements Language . . . . . . . . . . . . . . . . . . 8
3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.1. Hash Tree . . . . . . . . . . . . . . . . . . . . . . . . 9 4.1. Hash Tree . . . . . . . . . . . . . . . . . . . . . . . . 9
4.1.1. Calculating network state and node data hashes . . . 9 4.1.1. Calculating Network State and Node Data Hashes . . . 10
4.1.2. Updating network state and node data hashes . . . . . 10 4.1.2. Updating Network State and Node Data Hashes . . . . . 10
4.2. Data Transport . . . . . . . . . . . . . . . . . . . . . 10 4.2. Data Transport . . . . . . . . . . . . . . . . . . . . . 10
4.3. Trickle-Driven Status Updates . . . . . . . . . . . . . . 11 4.3. Trickle-Driven Status Updates . . . . . . . . . . . . . . 12
4.4. Processing of Received TLVs . . . . . . . . . . . . . . . 12 4.4. Processing of Received TLVs . . . . . . . . . . . . . . . 13
4.5. Discovering, Adding and Removing Peers . . . . . . . . . 15 4.5. Discovering, Adding, and Removing Peers . . . . . . . . . 15
4.6. Data Liveliness Validation . . . . . . . . . . . . . . . 16 4.6. Data Liveliness Validation . . . . . . . . . . . . . . . 16
5. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 17 5. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 17
6. Optional Extensions . . . . . . . . . . . . . . . . . . . . . 19 6. Optional Extensions . . . . . . . . . . . . . . . . . . . . . 19
6.1. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . 19 6.1. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . 19
6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 19 6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 20
6.1.2. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . 20 6.1.2. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . 20
6.1.3. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . 20 6.1.3. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . 20
6.1.4. Received TLV Processing Additions . . . . . . . . . . 20 6.1.4. Received TLV Processing Additions . . . . . . . . . . 21
6.1.5. Peer Removal . . . . . . . . . . . . . . . . . . . . 20 6.1.5. Peer Removal . . . . . . . . . . . . . . . . . . . . 21
6.2. Support For Dense Multicast-Enabled Links . . . . . . . . 21 6.2. Support for Dense Multicast-Enabled Links . . . . . . . . 21
7. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 22 7. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 22
7.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 23 7.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 23
7.1.1. Request Network State TLV . . . . . . . . . . . . . . 23 7.1.1. Request Network State TLV . . . . . . . . . . . . . . 23
7.1.2. Request Node State TLV . . . . . . . . . . . . . . . 23 7.1.2. Request Node State TLV . . . . . . . . . . . . . . . 24
7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 23 7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 24
7.2.1. Node Endpoint TLV . . . . . . . . . . . . . . . . . . 23 7.2.1. Node Endpoint TLV . . . . . . . . . . . . . . . . . . 24
7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 24 7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 25
7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 24 7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 25
7.3. Data TLVs within Node State TLV . . . . . . . . . . . . . 25 7.3. Data TLVs within Node State TLV . . . . . . . . . . . . . 26
7.3.1. Peer TLV . . . . . . . . . . . . . . . . . . . . . . 25 7.3.1. Peer TLV . . . . . . . . . . . . . . . . . . . . . . 26
7.3.2. Keep-Alive Interval TLV . . . . . . . . . . . . . . . 26 7.3.2. Keep-Alive Interval TLV . . . . . . . . . . . . . . . 27
8. Security and Trust Management . . . . . . . . . . . . . . . . 26 8. Security and Trust Management . . . . . . . . . . . . . . . . 27
8.1. Pre-Shared Key Based Trust Method . . . . . . . . . . . . 26 8.1. Trust Method Based on Pre-Shared Key . . . . . . . . . . 27
8.2. PKI Based Trust Method . . . . . . . . . . . . . . . . . 27 8.2. PKI-Based Trust Method . . . . . . . . . . . . . . . . . 28
8.3. Certificate Based Trust Consensus Method . . . . . . . . 27 8.3. Certificate-Based Trust Consensus Method . . . . . . . . 28
8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 27 8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 28
8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 28 8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 29
8.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 29 8.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 30
8.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 30 8.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 31
9. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 31 9. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 32
10. Security Considerations . . . . . . . . . . . . . . . . . . . 33 10. Security Considerations . . . . . . . . . . . . . . . . . . . 34
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 34 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 36
12.1. Normative references . . . . . . . . . . . . . . . . . . 34 12.1. Normative References . . . . . . . . . . . . . . . . . . 36
12.2. Informative references . . . . . . . . . . . . . . . . . 34 12.2. Informative References . . . . . . . . . . . . . . . . . 36
Appendix A. Alternative Modes of Operation . . . . . . . . . . . 35 Appendix A. Alternative Modes of Operation . . . . . . . . . . . 38
A.1. Read-only Operation . . . . . . . . . . . . . . . . . . . 35 A.1. Read-Only Operation . . . . . . . . . . . . . . . . . . . 38
A.2. Forwarding Operation . . . . . . . . . . . . . . . . . . 35 A.2. Forwarding Operation . . . . . . . . . . . . . . . . . . 38
Appendix B. DNCP Profile Additional Guidance . . . . . . . . . . 36 Appendix B. DNCP Profile Additional Guidance . . . . . . . . . . 38
B.1. Unicast Transport - UDP or TCP? . . . . . . . . . . . . . 36 B.1. Unicast Transport -- UDP or TCP? . . . . . . . . . . . . 38
B.2. (Optional) Multicast Transport . . . . . . . . . . . . . 36 B.2. (Optional) Multicast Transport . . . . . . . . . . . . . 39
B.3. (Optional) Transport Security . . . . . . . . . . . . . . 37 B.3. (Optional) Transport Security . . . . . . . . . . . . . . 39
Appendix C. Example Profile . . . . . . . . . . . . . . . . . . 37 Appendix C. Example Profile . . . . . . . . . . . . . . . . . . 40
Appendix D. Some Questions and Answers [RFC Editor: please Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 41
remove] . . . . . . . . . . . . . . . . . . . . . . 38
Appendix E. Changelog [RFC Editor: please remove] . . . . . . . 38
Appendix F. Draft Source [RFC Editor: please remove] . . . . . . 40
Appendix G. Acknowledgements . . . . . . . . . . . . . . . . . . 40
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 41 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 41
1. Introduction 1. Introduction
DNCP is designed to provide a way for each participating node to DNCP is designed to provide a way for each participating node to
publish a small set of TLV (Type-Length-Value) tuples (at most 64 publish a small set of TLV (Type-Length-Value) tuples (at most 64 KB)
KB), and to provide a shared and common view about the data published and to provide a shared and common view about the data published by
by every currently bidirectionally reachable DNCP node in a network. every currently bidirectionally reachable DNCP node in a network.
For state synchronization a hash tree is used. It is formed by first For state synchronization, a hash tree is used. It is formed by
calculating a hash for the dataset published by each node, called first calculating a hash for the data set published by each node,
node data, and then calculating another hash over those node data called node data, and then calculating another hash over those node
hashes. The single resulting hash, called network state hash, is data hashes. The single resulting hash, called network state hash,
transmitted using the Trickle algorithm [RFC6206] to ensure that all is transmitted using the Trickle algorithm [RFC6206] to ensure that
nodes share the same view of the current state of the published data all nodes share the same view of the current state of the published
within the network. The use of Trickle with only short network state data within the network. The use of Trickle with only short network
hashes sent infrequently (in steady state, once the maximum Trickle state hashes sent infrequently (in steady state, once the maximum
interval per link or unicast connection has been reached) makes DNCP Trickle interval per link or unicast connection has been reached)
very thrifty when updates happen rarely. makes DNCP very thrifty when updates happen rarely.
For maintaining liveliness of the topology and the data within it, a For maintaining liveliness of the topology and the data within it, a
combination of Trickled network state, keep-alives, and "other" means combination of Trickled network state, keep-alives, and "other" means
of ensuring reachability are used. The core idea is that if every of ensuring reachability are used. The core idea is that if every
node ensures its peers are present, transitively, the whole network node ensures its peers are present, transitively, the whole network
state also stays up-to-date. state also stays up to date.
1.1. Applicability 1.1. Applicability
DNCP is useful for cases like autonomous bootstrapping, discovery and DNCP is useful for cases like autonomous bootstrapping, discovery,
negotiation of embedded network devices like routers. Furthermore it and negotiation of embedded network devices like routers.
can be used as a basis to run distributed algorithms like Furthermore, it can be used as a basis to run distributed algorithms
[I-D.ietf-homenet-prefix-assignment] or usecases as described in like [RFC7596] or use cases as described in Appendix C. DNCP is
Appendix C. DNCP is abstract, which allows it to be tuned to a abstract, which allows it to be tuned to a variety of applications by
variety of applications by defining profiles. These profiles include defining profiles. These profiles include choices of:
choices of:
- unicast transport: datagram or stream oriented protocol (e.g., - unicast transport: a datagram or stream-oriented protocol (e.g.,
TCP, UDP, SCTP) for generic protocol operation TCP, UDP, or the Stream Control Transmission Protocol (SCTP)) for
generic protocol operation.
- optional transport security: whether and when to use security - optional transport security: whether and when to use security
based on (D)TLS, if supported over the chosen transport based on Transport Layer Security (TLS) or Datagram Transport
Layer Security (DTLS), if supported over the chosen transport.
- optional multicast transport: multicast-capable protocol like UDP - optional multicast transport: a multicast-capable protocol like
allowing autonomous peer discovery or more efficient use of UDP allowing autonomous peer discovery or more efficient use of
multiple access links multiple access links.
- communication scopes: either hop-by-hop only relying on link-local - communication scopes: using either hop by hop only relying on
addressing (e.g., for LANs) or using addresses with broader scopes link-local addressing (e.g., for LANs), addresses with broader
(e.g. over WANs or the internet) relying on an existing routing scopes (e.g., over WANs or the Internet) relying on an existing
infrastructure or a combination of both (e.g., to exchange state routing infrastructure, or a combination of both (e.g., to
between multiple LANs over a WAN or the internet) exchange state between multiple LANs over a WAN or the Internet).
- payloads: additional specific payloads (e.g., IANA standardized, - payloads: additional specific payloads (e.g., IANA standardized,
enterprise-specific or private use) enterprise-specific, or private use).
- extensions: possible protocol extensions, either as predefined in - extensions: possible protocol extensions, either as predefined in
this document or specific for a particular usecase this document or specific for a particular use case.
However, there are certain cases where the protocol as defined in However, there are certain cases where the protocol as defined in
this document is a less suitable choice. This list provides an this document is a less suitable choice. This list provides an
overview while the following paragraphs provide more detailed overview while the following paragraphs provide more detailed
guidance on the individual matters. guidance on the individual matters.
- large amounts of data: nodes are limited to 64KB of published data - large amounts of data: nodes are limited to 64 KB of published
data.
- very dense unicast-only networks: nodes include information about - very dense unicast-only networks: nodes include information about
all immediate neighbors as part of their published data. all immediate neighbors as part of their published data.
- predominantly minimal data changes: Node data is always - predominantly minimal data changes: node data is always
transported as-is, leading to a relatively large transmission transported as is, leading to a relatively large transmission
overhead for changes affecting only a small part of it. overhead for changes affecting only a small part of it.
- frequently changing data: DNCP with its use of Trickle is - frequently changing data: DNCP with its use of Trickle is
optimized for the steady state and less efficient otherwise. optimized for the steady state and less efficient otherwise.
- large amounts of very constrained nodes: DNCP requires each node - large amounts of very constrained nodes: DNCP requires each node
to store the entirety of the data published by all nodes. to store the entirety of the data published by all nodes.
The topology of the devices is not limited and automatically The topology of the devices is not limited and automatically
discovered. When relying on link-local communication exclusively, discovered. When relying on link-local communication exclusively,
all links having DNCP nodes need to be at least transitively all links having DNCP nodes need to be at least transitively
connected by routers running the protocol on multiple endpoints in connected by routers running the protocol on multiple endpoints in
order to form a connected network. However, there is no requirement order to form a connected network. However, there is no requirement
for every device in a physical network to run the protocol. for every device in a physical network to run the protocol.
Especially if globally scoped addresses are used, DNCP peers do not Especially if globally scoped addresses are used, DNCP peers do not
need to be on the same or even neighboring physical links. need to be on the same or even neighboring physical links.
Autonomous discovery features are usually used in local network Autonomous discovery features are usually used in local network
scenario however - with security enabled - DNCP can also be used over scenarios; however, with security enabled, DNCP can also be used over
unsecured public networks. Network size is restricted merely by the unsecured public networks. Network size is restricted merely by the
capabilities of the devices, i.e., each DNCP node needs to be able to capabilities of the devices, i.e., each DNCP node needs to be able to
store the entirety of the data published by all nodes. The data store the entirety of the data published by all nodes. The data
associated with each individual node identifier is limited to about associated with each individual node identifier is limited to about
64KB in this document, however protocol extensions could be defined 64 KB in this document; however, protocol extensions could be defined
to mitigate this or other protocol limitations if the need arises. to mitigate this or other protocol limitations if the need arises.
DNCP is most suitable for data that changes only infrequently to gain DNCP is most suitable for data that changes only infrequently to gain
the maximum benefit from using Trickle. As the network of nodes the maximum benefit from using Trickle. As the network of nodes
grows, or the frequency of data changes per node increases, Trickle grows, or the frequency of data changes per node increases, Trickle
is eventually used less and less and the benefit of using DNCP is eventually used less and less, and the benefit of using DNCP
diminishes. In these cases Trickle just provides extra complexity diminishes. In these cases, Trickle just provides extra complexity
within the specification and little added value. within the specification and little added value.
The suitability of DNCP for a particular application can roughly be The suitability of DNCP for a particular application can be roughly
evaluated by considering the expected average network-wide state evaluated by considering the expected average network-wide state
change interval A_NC_I; it is computed by dividing the mean interval change interval A_NC_I; it is computed by dividing the mean interval
at which a node originates a new TLV set by the number of at which a node originates a new TLV set by the number of
participating nodes. If keep-alives are used, A_NC_I is the minimum participating nodes. If keep-alives are used, A_NC_I is the minimum
of the computed A_NC_I and the keep-alive interval. If A_NC_I is of the computed A_NC_I and the keep-alive interval. If A_NC_I is
less than the (application-specific) Trickle minimum interval, DNCP less than the (application-specific) Trickle minimum interval, DNCP
is most likely unsuitable for the application as Trickle will not be is most likely unsuitable for the application as Trickle will not be
utilized most of the time. utilized most of the time.
If constant rapid state changes are needed, the preferable choice is If constant rapid state changes are needed, the preferable choice is
skipping to change at page 6, line 10 skipping to change at page 6, line 21
DNCP can be used in networks where only unicast transport is DNCP can be used in networks where only unicast transport is
available. While DNCP uses the least amount of bandwidth when available. While DNCP uses the least amount of bandwidth when
multicast is utilized, even in pure unicast mode, the use of Trickle multicast is utilized, even in pure unicast mode, the use of Trickle
(ideally with k < 2) results in a protocol with an exponential (ideally with k < 2) results in a protocol with an exponential
backoff timer and fewer transmissions than a simpler protocol not backoff timer and fewer transmissions than a simpler protocol not
using Trickle. using Trickle.
2. Terminology 2. Terminology
DNCP profile the values for the set of parameters, given in DNCP profile the values for the set of parameters given in
Section 9. They are prefixed with DNCP_ in this Section 9. They are prefixed with DNCP_ in this
document. The profile also specifies the set of document. The profile also specifies the set of
optional DNCP extensions to be used. For a simple optional DNCP extensions to be used. For a simple
example DNCP profile, see Appendix C. example DNCP profile, see Appendix C.
DNCP-based a protocol which provides a DNCP profile, according DNCP-based a protocol that provides a DNCP profile, according
protocol to Section 9, and zero or more TLV assignments from protocol to Section 9, and zero or more TLV assignments from
the per-DNCP profile TLV registry as well as their the per-DNCP profile TLV registry as well as their
processing rules. processing rules.
DNCP node a single node which runs a DNCP-based protocol. DNCP node a single node that runs a DNCP-based protocol.
Link a link-layer media over which directly connected Link a link-layer media over which directly connected
nodes can communicate. nodes can communicate.
DNCP network a set of DNCP nodes running DNCP-based protocol(s) DNCP network a set of DNCP nodes running a DNCP-based
with matching DNCP profile(s). The set consists of protocol(s) with a matching DNCP profile(s). The
nodes that have discovered each other using the set consists of nodes that have discovered each
transport method defined in the DNCP profile, via other using the transport method defined in the
multicast on local links, and / or by using unicast DNCP profile, via multicast on local links, and/or
communication. by using unicast communication.
Node identifier an opaque fixed-length identifier consisting of Node identifier an opaque fixed-length identifier consisting of
DNCP_NODE_IDENTIFIER_LENGTH bytes which uniquely DNCP_NODE_IDENTIFIER_LENGTH bytes that uniquely
identifies a DNCP node within a DNCP network. identifies a DNCP node within a DNCP network.
Interface a node's attachment to a particular link. Interface a node's attachment to a particular link.
Address an identifier used as source or destination of a Address an identifier used as the source or destination of
DNCP message flow, e.g., a tuple (IPv6 address, UDP a DNCP message flow, e.g., a tuple (IPv6 address,
port) for an IPv6 UDP transport. UDP port) for an IPv6 UDP transport.
Endpoint a locally configured termination point for Endpoint a locally configured termination point for
(potential or established) DNCP message flows. An (potential or established) DNCP message flows. An
endpoint is the source and destination for separate endpoint is the source and destination for separate
unicast message flows to individual nodes and unicast message flows to individual nodes and
optionally for multicast messages to all thereby optionally for multicast messages to all thereby
reachable nodes (e.g., for node discovery). reachable nodes (e.g., for node discovery).
Endpoints are usually in one of the transport modes Endpoints are usually in one of the transport modes
specified in Section 4.2. specified in Section 4.2.
Endpoint a 32-bit opaque and locally unique value, which Endpoint a 32-bit opaque and locally unique value, which
identifier identifies a particular endpoint of a particular identifier identifies a particular endpoint of a particular
DNCP node. The value 0 is reserved for DNCP and DNCP node. The value 0 is reserved for DNCP and
DNCP-based protocol purposes and not used to DNCP-based protocol purposes and not used to
identify an actual endpoint. This definition is in identify an actual endpoint. This definition is in
sync with the interface index definition in sync with the interface index definition in
[RFC3493], as the non-zero small positive integers [RFC3493], as the non-zero small positive integers
should comfortably fit within 32 bits. should comfortably fit within 32 bits.
Peer another DNCP node with which a DNCP node Peer another DNCP node with which a DNCP node
communicates using at least one particular local communicates using at least one particular local
and remote endpoint pair. and remote endpoint pair.
Node data a set of TLVs published and owned by a node in the Node data a set of TLVs published and owned by a node in the
DNCP network. Other nodes pass it along as-is, even DNCP network. Other nodes pass it along as is,
if they cannot fully interpret it. even if they cannot fully interpret it.
Origination Time the (estimated) time when the node data set with Origination time the (estimated) time when the node data set with
the current sequence number was published. the current sequence number was published.
Node state a set of metadata attributes for node data. It Node state a set of metadata attributes for node data. It
includes a sequence number for versioning, a hash includes a sequence number for versioning, a hash
value for comparing equality of stored node data, value for comparing equality of stored node data,
and a timestamp indicating the time passed since and a timestamp indicating the time passed since
its last publication (i.e., since the origination its last publication (i.e., since the origination
time). The hash function and the length of the hash time). The hash function and the length of the
value are defined in the DNCP profile. hash value are defined in the DNCP profile.
Network state a hash value which represents the current state of Network state a hash value that represents the current state of
hash the network. The hash function and the length of hash the network. The hash function and the length of
the hash value are defined in the DNCP profile. the hash value are defined in the DNCP profile.
Whenever a node is added, removed or updates its Whenever a node is added, removed, or updates its
published node data this hash value changes as published node data, this hash value changes as
well. For calculation, please see Section 4.1. well. For calculation, please see Section 4.1.
Trust verdict a statement about the trustworthiness of a Trust verdict a statement about the trustworthiness of a
certificate announced by a node participating in certificate announced by a node participating in
the certificate based trust consensus mechanism. the certificate-based trust consensus mechanism.
Effective trust the trust verdict with the highest priority within Effective trust the trust verdict with the highest priority within
verdict the set of trust verdicts announced for the verdict the set of trust verdicts announced for the
certificate in the DNCP network. certificate in the DNCP network.
Topology graph the undirected graph of DNCP nodes produced by Topology graph the undirected graph of DNCP nodes produced by
retaining only bidirectional peer relationships retaining only bidirectional peer relationships
between nodes. between nodes.
Bidirectionally a peer is locally unidirectionally reachable if a Bidirectionally a peer is locally unidirectionally reachable if a
reachable consistent multicast or any unicast DNCP message reachable consistent multicast or any unicast DNCP message
has been received by the local node (see Section has been received by the local node (see Section
4.5). If said peer in return also considers the 4.5). If said peer in return also considers the
local node unidirectionally reachable, then local node unidirectionally reachable, then
bidirectionally reachability is established. As bidirectionally reachability is established. As
this process is based on publishing peer this process is based on publishing peer
relationships and evaluating the resulting topology relationships and evaluating the resulting topology
graph as described in Section 4.6, this information graph as described in Section 4.6, this information
is available to the whole DNCP network. is available to the whole DNCP network.
Trickle Instance a distinct Trickle [RFC6206] algorithm state kept Trickle instance a distinct Trickle [RFC6206] algorithm state kept
by a node (Section 5) and related to an endpoint or by a node (Section 5) and related to an endpoint or
a particular (peer, endpoint) tuple with Trickle a particular (peer, endpoint) tuple with Trickle
variables I, t and c. See Section 4.3. variables I, t, and c. See Section 4.3.
2.1. Requirements Language 2.1. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in RFC "OPTIONAL" in this document are to be interpreted as described in RFC
2119 [RFC2119]. 2119 [RFC2119].
3. Overview 3. Overview
DNCP operates primarily using unicast exchanges between nodes, and DNCP operates primarily using unicast exchanges between nodes, and it
may use multicast for Trickle-based shared state dissemination and may use multicast for Trickle-based shared state dissemination and
topology discovery. If used in pure unicast mode with unreliable topology discovery. If used in pure unicast mode with unreliable
transport, Trickle is also used between peers. transport, Trickle is also used between peers.
DNCP is based on exchanging TLVs (Section 7) and defines a set of DNCP is based on exchanging TLVs (Section 7) and defines a set of
mandatory and optional ones for its operation. They are categorized mandatory and optional ones for its operation. They are categorized
into TLVs for requesting information (Section 7.1), transmitting data into TLVs for requesting information (Section 7.1), transmitting data
(Section 7.2) and being published as data (Section 7.3). DNCP based (Section 7.2), and being published as data (Section 7.3). DNCP-based
protocols usually specify additional ones to extend the capabilities. protocols usually specify additional ones to extend the capabilities.
DNCP discovers the topology of the nodes in the DNCP network and DNCP discovers the topology of the nodes in the DNCP network and
maintains the liveliness of published node data by ensuring that the maintains the liveliness of published node data by ensuring that the
publishing node is bidirectionally reachable. New potential peers publishing node is bidirectionally reachable. New potential peers
can be discovered autonomously on multicast-enabled links, their can be discovered autonomously on multicast-enabled links; their
addresses may be manually configured or they may be found by some addresses may be manually configured or they may be found by some
other means defined in the particular DNCP profile. The DNCP profile other means defined in the particular DNCP profile. The DNCP profile
may specify, for example, a well-known anycast address or may specify, for example, a well-known anycast address or provision
provisioning the remote address to contact via some other protocol the remote address to contact via some other protocol such as DHCPv6
such as DHCPv6 [RFC3315]. [RFC3315].
A hash tree of height 1, rooted in itself, is maintained by each node A hash tree of height 1, rooted in itself, is maintained by each node
to represent the state of all currently reachable nodes (see to represent the state of all currently reachable nodes (see
Section 4.1) and the Trickle algorithm is used to trigger Section 4.1), and the Trickle algorithm is used to trigger
synchronization (see Section 4.3). The need to check peer nodes for synchronization (see Section 4.3). The need to check peer nodes for
state changes is thereby determined by comparing the current root of state changes is thereby determined by comparing the current root of
their respective hash trees, i.e., their individually calculated their respective hash trees, i.e., their individually calculated
network state hashes. network state hashes.
Before joining a DNCP network, a node starts with a hash tree that Before joining a DNCP network, a node starts with a hash tree that
has only one leaf if the node publishes some TLVs, and no leaves has only one leaf if the node publishes some TLVs, and no leaves
otherwise. It then announces the network state hash calculated from otherwise. It then announces the network state hash calculated from
the hash tree by means of the Trickle algorithm on all its configured the hash tree by means of the Trickle algorithm on all its configured
endpoints. endpoints.
When an update is detected by a node (e.g., by receiving a different When an update is detected by a node (e.g., by receiving a different
network state hash from a peer) the originator of the event is network state hash from a peer), the originator of the event is
requested to provide a list of the state of all nodes, i.e., all the requested to provide a list of the state of all nodes, i.e., all the
information it uses to calculate its own hash tree. The node uses information it uses to calculate its own hash tree. The node uses
the list to determine whether its own information is outdated and - the list to determine whether its own information is outdated and --
if necessary - requests the actual node data that has changed. if necessary -- requests the actual node data that has changed.
Whenever a node's local copy of any node data and its hash tree are Whenever a node's local copy of any node data and its hash tree are
updated (e.g., due to its own or another node's node state changing updated (e.g., due to its own or another node's node state changing
or due to a peer being added or removed) its Trickle instances are or due to a peer being added or removed), its Trickle instances are
reset which eventually causes any update to be propagated to all of reset, which eventually causes any update to be propagated to all of
its peers. its peers.
4. Operation 4. Operation
4.1. Hash Tree 4.1. Hash Tree
Each DNCP node maintains an arbitrary width hash tree of height 1. Each DNCP node maintains an arbitrary width hash tree of height 1.
The root of the tree represents the overall network state hash and is The root of the tree represents the overall network state hash and is
used to determine whether the view of the network of two or more used to determine whether the view of the network of two or more
nodes is consistent and shared. Each leaf represents one nodes is consistent and shared. Each leaf represents one
bidirectionally reachable DNCP node. Every time a node is added or bidirectionally reachable DNCP node. Every time a node is added or
removed from the topology graph (Section 4.6) it is likewise added or removed from the topology graph (Section 4.6), it is likewise added
removed as a leaf. At any time the leaves of the tree are ordered in or removed as a leaf. At any time, the leaves of the tree are
ascending order of the node identifiers of the nodes they represent. ordered in ascending order of the node identifiers of the nodes they
represent.
4.1.1. Calculating network state and node data hashes 4.1.1. Calculating Network State and Node Data Hashes
The network state hash and the node data hashes are calculated using The network state hash and the node data hashes are calculated using
the hash function defined in the DNCP profile (Section 9) and the hash function defined in the DNCP profile (Section 9) and
truncated to the number of bits specified therein. truncated to the number of bits specified therein.
Individual node data hashes are calculated by applying the function Individual node data hashes are calculated by applying the function
and truncation on the respective node's node data as published in the and truncation on the respective node's node data as published in the
Node State TLV. Such node data sets are always ordered as defined in Node State TLV. Such node data sets are always ordered as defined in
Section 7.2.3. Section 7.2.3.
The network state hash is calculated by applying the function and The network state hash is calculated by applying the function and
truncation on the concatenated network state. This state is formed truncation on the concatenated network state. This state is formed
by first concatenating each node's sequence number (in network byte by first concatenating each node's sequence number (in network byte
order) with its node data hash to form a per-node datum for each order) with its node data hash to form a per-node datum for each
node. These per-node data are then concatenated in ascending order node. These per-node data are then concatenated in ascending order
of the respective node's node identifier, i.e., in the order that the of the respective node's node identifier, i.e., in the order that the
nodes appear in the hash tree. nodes appear in the hash tree.
4.1.2. Updating network state and node data hashes 4.1.2. Updating Network State and Node Data Hashes
The network state hash and the node data hashes are updated on-demand The network state hash and the node data hashes are updated on-demand
and whenever any locally stored per-node state changes. This and whenever any locally stored per-node state changes. This
includes local unidirectional reachability encoded in the published includes local unidirectional reachability encoded in the published
Peer TLVs (Section 7.3.1) and - when combined with remote data - Peer TLVs (Section 7.3.1) and -- when combined with remote data --
results in awareness of bidirectional reachability changes. results in awareness of bidirectional reachability changes.
4.2. Data Transport 4.2. Data Transport
DNCP has few requirements for the underlying transport; it requires DNCP has few requirements for the underlying transport; it requires
some way of transmitting either unicast datagram or stream data to a some way of transmitting either a unicast datagram or stream data to
peer and, if used in multicast mode, a way of sending multicast a peer and, if used in multicast mode, a way of sending multicast
datagrams. As multicast is used only to identify potential new DNCP datagrams. As multicast is used only to identify potential new DNCP
nodes and to send status messages which merely notify that a unicast nodes and to send status messages that merely notify that a unicast
exchange should be triggered, the multicast transport does not have exchange should be triggered, the multicast transport does not have
to be secured. If unicast security is desired and one of the built- to be secured. If unicast security is desired and one of the
in security methods is to be used, support for some TLS-derived built-in security methods is to be used, support for some TLS-derived
transport scheme - such as TLS [RFC5246] on top of TCP or DTLS transport scheme -- such as TLS [RFC5246] on top of TCP or DTLS
[RFC6347] on top of UDP - is also required. They provide for [RFC6347] on top of UDP -- is also required. They provide for
integrity protection and confidentiality of the node data, as well as integrity protection and confidentiality of the node data, as well as
authentication and authorization using the schemes defined in authentication and authorization using the schemes defined in
Security and Trust Management (Section 8). A specific definition of "Security and Trust Management" (Section 8). A specific definition
the transport(s) in use and their parameters MUST be provided by the of the transport(s) in use and its parameters MUST be provided by the
DNCP profile. DNCP profile.
TLVs (Section 7) are sent across the transport as is, and they SHOULD TLVs (Section 7) are sent across the transport as is, and they SHOULD
be sent together where, e.g., MTU considerations do not recommend be sent together where, e.g., MTU considerations do not recommend
sending them in multiple batches. DNCP does not fragment or sending them in multiple batches. DNCP does not fragment or
reassemble TLVs thus it MUST be ensured that the underlying transport reassemble TLVs; thus, it MUST be ensured that the underlying
performs these operations should they be necessary. If this document transport performs these operations should they be necessary. If
indicates sending one or more TLVs, then the sending node does not this document indicates sending one or more TLVs, then the sending
need to keep track of the packets sent after handing them over to the node does not need to keep track of the packets sent after handing
respective transport, i.e., reliable DNCP operation is ensured merely them over to the respective transport, i.e., reliable DNCP operation
by the explicitly defined timers and state machines such as Trickle is ensured merely by the explicitly defined timers and state machines
(Section 4.3). TLVs in general are handled individually and such as Trickle (Section 4.3). TLVs in general are handled
statelessly (and thus do not need to be sent in any particular order) individually and statelessly (and thus do not need to be sent in any
with one exception: To form bidirectional peer relationships DNCP particular order) with one exception: To form bidirectional peer
requires identification of the endpoints used for communication. As relationships, DNCP requires identification of the endpoints used for
bidirectional peer relationships are required for validating communication. As bidirectional peer relationships are required for
liveliness of published node data as described in Section 4.6, a DNCP validating liveliness of published node data as described in
node MUST send a Node Endpoint TLV (Section 7.2.1). When it is sent Section 4.6, a DNCP node MUST send a Node Endpoint TLV
varies, depending on the underlying transport, but conceptually it (Section 7.2.1). When it is sent varies, depending on the underlying
should be available whenever processing a Network State TLV: transport, but conceptually it should be available whenever
processing a Network State TLV:
o If using a stream transport, the TLV MUST be sent at least once o If using a stream transport, the TLV MUST be sent at least once
per connection, but SHOULD NOT be sent more than once. per connection but SHOULD NOT be sent more than once.
o If using a datagram transport, it MUST be included in every o If using a datagram transport, it MUST be included in every
datagram that also contains a Network State TLV (Section 7.2.2) datagram that also contains a Network State TLV (Section 7.2.2)
and MUST be located before any such TLV. It SHOULD also be and MUST be located before any such TLV. It SHOULD also be
included in any other datagram, to speed up initial peer included in any other datagram to speed up initial peer detection.
detection.
Given the assorted transport options as well as potential endpoint Given the assorted transport options as well as potential endpoint
configuration, a DNCP endpoint may be used in various transport configuration, a DNCP endpoint may be used in various transport
modes: modes:
Unicast: Unicast:
* If only reliable unicast transport is used, Trickle is not used * If only reliable unicast transport is used, Trickle is not used
at all. Whenever the locally calculated network state hash at all. Whenever the locally calculated network state hash
changes, a single Network State TLV (Section 7.2.2) is sent to changes, a single Network State TLV (Section 7.2.2) is sent to
every unicast peer. Additionally, recently changed Node State every unicast peer. Additionally, recently changed Node State
TLVs (Section 7.2.3) MAY be included. TLVs (Section 7.2.3) MAY be included.
* If only unreliable unicast transport is used, Trickle state is * If only unreliable unicast transport is used, Trickle state is
kept per peer and it is used to send Network State TLVs kept per peer, and it is used to send Network State TLVs
intermittently, as specified in Section 4.3. intermittently, as specified in Section 4.3.
Multicast+Unicast: If multicast datagram transport is available on Multicast+Unicast: If multicast datagram transport is available on
an endpoint, Trickle state is only maintained for the endpoint as an endpoint, Trickle state is only maintained for the endpoint as
a whole. It is used to send Network State TLVs periodically, as a whole. It is used to send Network State TLVs periodically, as
specified in Section 4.3. Additionally, per-endpoint keep-alives specified in Section 4.3. Additionally, per-endpoint keep-alives
MAY be defined in the DNCP profile, as specified in Section 6.1.2. MAY be defined in the DNCP profile, as specified in Section 6.1.2.
MulticastListen+Unicast: Just like Unicast, except multicast MulticastListen+Unicast: Just like unicast, except multicast
transmissions are listened to in order to detect changes of the transmissions are listened to in order to detect changes of the
highest node identifier. This mode is used only if the DNCP highest node identifier. This mode is used only if the DNCP
profile supports dense multicast-enabled link optimization profile supports dense multicast-enabled link optimization
(Section 6.2). (Section 6.2).
4.3. Trickle-Driven Status Updates 4.3. Trickle-Driven Status Updates
The Trickle algorithm [RFC6206] is used to ensure protocol The Trickle algorithm [RFC6206] is used to ensure protocol
reliability over unreliable multicast or unicast transports. For reliability over unreliable multicast or unicast transports. For
reliable unicast transports, its actual algorithm is unnecessary and reliable unicast transports, its actual algorithm is unnecessary and
omitted (Section 4.2). DNCP maintains multiple Trickle states as omitted (Section 4.2). DNCP maintains multiple Trickle states as
defined in Section 5. Each such state can be based on different defined in Section 5. Each such state can be based on different
parameters (see below) and is responsible for ensuring that a parameters (see below) and is responsible for ensuring that a
specific peer or all peers on the respective endpoint are regularly specific peer or all peers on the respective endpoint are regularly
provided with the node's current locally calculated network state provided with the node's current locally calculated network state
hash for state comparison, i.e., to detect potential divergence in hash for state comparison, i.e., to detect potential divergence in
the perceived network state. the perceived network state.
Trickle defines 3 parameters: Imin, Imax and k. Imin and Imax Trickle defines 3 parameters: Imin, Imax, and k. Imin and Imax
represent the minimum value for I and the maximum number of doublings represent the minimum value for I and the maximum number of doublings
of Imin, where I is the time interval during which at least k Trickle of Imin, where I is the time interval during which at least k Trickle
updates must be seen on an endpoint to prevent local state updates must be seen on an endpoint to prevent local state
transmission. The actual suggested Trickle algorithm parameters are transmission. The actual suggested Trickle algorithm parameters are
DNCP profile specific, as described in Section 9. DNCP profile specific, as described in Section 9.
The Trickle state for all Trickle instances defined in Section 5 is The Trickle state for all Trickle instances defined in Section 5 is
considered inconsistent and reset if and only if the locally considered inconsistent and reset if and only if the locally
calculated network state hash changes. This occurs either due to a calculated network state hash changes. This occurs either due to a
change in the local node's own node data, or due to receipt of more change in the local node's own node data or due to the receipt of
recent data from another node as explained in Section 4.1. A node more recent data from another node as explained in Section 4.1. A
MUST NOT reset its Trickle state merely based on receiving a Network node MUST NOT reset its Trickle state merely based on receiving a
State TLV (Section 7.2.2) with a network state hash which is Network State TLV (Section 7.2.2) with a network state hash that is
different from its locally calculated one. different from its locally calculated one.
Every time a particular Trickle instance indicates that an update Every time a particular Trickle instance indicates that an update
should be sent, the node MUST send a Network State TLV should be sent, the node MUST send a Network State TLV
(Section 7.2.2) if and only if: (Section 7.2.2) if and only if:
o the endpoint is in Multicast+Unicast transport mode, in which case o the endpoint is in Multicast+Unicast transport mode, in which case
the TLV MUST be sent over multicast. the TLV MUST be sent over multicast.
o the endpoint is NOT in Multicast+Unicast transport mode, and the o the endpoint is NOT in Multicast+Unicast transport mode, and the
unicast transport is unreliable, in which case the TLV MUST be unicast transport is unreliable, in which case the TLV MUST be
sent over unicast. sent over unicast.
A (sub)set of all Node State TLVs (Section 7.2.3) MAY also be A (sub)set of all Node State TLVs (Section 7.2.3) MAY also be
included, unless it is defined as undesirable for some reason by the included, unless it is defined as undesirable for some reason by the
DNCP profile, or to avoid exposure of the node state TLVs by DNCP profile or to avoid exposure of the node state TLVs by
transmitting them within insecure multicast when using secure transmitting them within insecure multicast when using secure
unicast. unicast.
4.4. Processing of Received TLVs 4.4. Processing of Received TLVs
This section describes how received TLVs are processed. The DNCP This section describes how received TLVs are processed. The DNCP
profile may specify when to ignore particular TLVs, e.g., to modify profile may specify when to ignore particular TLVs, e.g., to modify
security properties - see Section 9 for what may be safely defined to security properties -- see Section 9 for what may be safely defined
be ignored in a profile. Any 'reply' mentioned in the steps below to be ignored in a profile. Any 'reply' mentioned in the steps below
denotes sending of the specified TLV(s) to the originator of the TLV denotes the sending of the specified TLV(s) to the originator of the
being processed. All such replies MUST be sent using unicast. If TLV being processed. All such replies MUST be sent using unicast.
the TLV being replied to was received via multicast and it was sent If the TLV being replied to was received via multicast and it was
to a multiple access link, the reply MUST be delayed by a random sent to a multiple access link, the reply MUST be delayed by a random
timespan in [0, Imin/2], to avoid potential simultaneous replies that time span in [0, Imin/2], to avoid potential simultaneous replies
may cause problems on some links, unless specified differently in the that may cause problems on some links, unless specified differently
DNCP profile. Sending of replies MAY also be rate-limited or omitted in the DNCP profile. The sending of replies MAY also be rate limited
for a short period of time by an implementation. However, if the TLV or omitted for a short period of time by an implementation. However,
is not forbidden by the DNCP profile, an implementation MUST reply to if the TLV is not forbidden by the DNCP profile, an implementation
retransmissions of the TLV with a non-zero probability to avoid MUST reply to retransmissions of the TLV with a non-zero probability
starvation which would break the state synchronization. to avoid starvation, which would break the state synchronization.
A DNCP node MUST process TLVs received from any valid (e.g., A DNCP node MUST process TLVs received from any valid (e.g.,
correctly scoped) address, as specified by the DNCP profile and the correctly scoped) address, as specified by the DNCP profile and the
configuration of a particular endpoint, whether this address is known configuration of a particular endpoint, whether this address is known
to be the address of a peer or not. This provision satisfies the to be the address of a peer or not. This provision satisfies the
needs of monitoring or other host software that needs to discover the needs of monitoring or other host software that needs to discover the
DNCP topology without adding to the state in the network. DNCP topology without adding to the state in the network.
Upon receipt of: Upon receipt of:
skipping to change at page 13, line 42 skipping to change at page 14, line 8
TLV (Section 7.2.3) for the corresponding node. The optional node TLV (Section 7.2.3) for the corresponding node. The optional node
data part MUST be included in the TLV. data part MUST be included in the TLV.
o Network State TLV (Section 7.2.2): If the network state hash o Network State TLV (Section 7.2.2): If the network state hash
differs from the locally calculated network state hash, and the differs from the locally calculated network state hash, and the
receiver is unaware of any particular node state differences with receiver is unaware of any particular node state differences with
the sender, the receiver MUST reply with a Request Network State the sender, the receiver MUST reply with a Request Network State
TLV (Section 7.1.1). These replies MUST be rate limited to only TLV (Section 7.1.1). These replies MUST be rate limited to only
at most one reply per link per unique network state hash within at most one reply per link per unique network state hash within
Imin. The simplest way to ensure this rate limit is a timestamp Imin. The simplest way to ensure this rate limit is a timestamp
indicating requests, and sending at most one Request Network State indicating requests and sending at most one Request Network State
TLV (Section 7.1.1) per Imin. To facilitate faster state TLV (Section 7.1.1) per Imin. To facilitate faster state
synchronization, if a Request Network State TLV is sent in a synchronization, if a Request Network State TLV is sent in a
reply, a local, current Network State TLV MAY also be sent. reply, a local, current Network State TLV MAY also be sent.
o Node State TLV (Section 7.2.3): o Node State TLV (Section 7.2.3):
* If the node identifier matches the local node identifier and * If the node identifier matches the local node identifier and
the TLV has a greater sequence number than its current local the TLV has a greater sequence number than its current local
value, or the same sequence number and a different hash, the value, or the same sequence number and a different hash, the
node SHOULD re-publish its own node data with a sequence number node SHOULD republish its own node data with a sequence number
significantly (e.g., 1000) greater than the received one, to significantly greater than the received one (e.g., 1000) to
reclaim the node identifier. This difference is needed in reclaim the node identifier. This difference is needed in
order to ensure that it is higher than any potentially order to ensure that it is higher than any potentially
lingering copies of the node state in the network. This may lingering copies of the node state in the network. This may
occur normally once due to the local node restarting and not occur normally once due to the local node restarting and not
storing the most recently used sequence number. If this occurs storing the most recently used sequence number. If this occurs
more than once or for nodes not re-publishing their own node more than once or for nodes not republishing their own node
data, the DNCP profile MUST provide guidance on how to handle data, the DNCP profile MUST provide guidance on how to handle
these situations as it indicates the existence of another these situations as it indicates the existence of another
active node with the same node identifier. active node with the same node identifier.
* If the node identifier does not match the local node * If the node identifier does not match the local node
identifier, and one or more of the following conditions are identifier, and one or more of the following conditions are
true: true:
+ The local information is outdated for the corresponding node + The local information is outdated for the corresponding node
(local sequence number is less than that within the TLV). (the local sequence number is less than that within the
TLV).
+ The local information is potentially incorrect (local + The local information is potentially incorrect (the local
sequence number matches but the node data hash differs). sequence number matches but the node data hash differs).
+ There is no data for that node altogether. + There is no data for that node altogether.
Then: Then:
+ If the TLV contains the Node Data field, it SHOULD also be + If the TLV contains the Node Data field, it SHOULD also be
verified by ensuring that the locally calculated hash of the verified by ensuring that the locally calculated hash of the
Node Data matches the content of the H(Node Data) field node data matches the content of the H(Node Data) field
within the TLV. If they differ, the TLV SHOULD be ignored within the TLV. If they differ, the TLV SHOULD be ignored
and not processed further. and not processed further.
+ If the TLV does not contain the Node Data field, and the + If the TLV does not contain the Node Data field, and the
H(Node Data) field within the TLV differs from the local H(Node Data) field within the TLV differs from the local
node data hash for that node (or there is none), the node data hash for that node (or there is none), the
receiver MUST reply with a Request Node State TLV receiver MUST reply with a Request Node State TLV
(Section 7.1.2) for the corresponding node. (Section 7.1.2) for the corresponding node.
+ Otherwise the receiver MUST update its locally stored state + Otherwise, the receiver MUST update its locally stored state
for that node (node data based on Node Data field if for that node (node data based on the Node Data field if
present, sequence number and relative time) to match the present, sequence number, and relative time) to match the
received TLV. received TLV.
For comparison purposes of the sequence number, a looping For comparison purposes of the sequence number, a looping
comparison function MUST be used to avoid problems in case of comparison function MUST be used to avoid problems in case of
overflow. The comparison function a < b <=> ((a - b) % (2^32)) & overflow. The comparison function a < b <=> ((a - b) % (2^32)) &
(2^31) != 0 where (a % b) represents the remainder of a modulo b (2^31) != 0 where (a % b) represents the remainder of a modulo b
and (a & b) represents bitwise conjunction of a and b is and (a & b) represents bitwise conjunction of a and b is
RECOMMENDED unless the DNCP profile defines another. RECOMMENDED unless the DNCP profile defines another.
o Any other TLV: TLVs not recognized by the receiver MUST be o Any other TLV: TLVs not recognized by the receiver MUST be
silently ignored unless they are sent within another TLV (for silently ignored unless they are sent within another TLV (for
example, TLVs within the Node Data field of a Node State TLV). example, TLVs within the Node Data field of a Node State TLV).
TLVs within the Node Data field of the Node State TLV not TLVs within the Node Data field of the Node State TLV not
recognized by the receiver MUST be retained for distribution to recognized by the receiver MUST be retained for distribution to
other nodes and for calculating the node data hash as described in other nodes and for calculation of the node data hash as described
Section 7.2.3 but are ignored for other purposes. in Section 7.2.3 but are ignored for other purposes.
If secure unicast transport is configured for an endpoint, any Node If secure unicast transport is configured for an endpoint, any Node
State TLVs received over insecure multicast MUST be silently ignored. State TLVs received over insecure multicast MUST be silently ignored.
4.5. Discovering, Adding and Removing Peers 4.5. Discovering, Adding, and Removing Peers
Peer relations are established between neighbors using one or more Peer relations are established between neighbors using one or more
mutually connected endpoints. Such neighbors exchange information mutually connected endpoints. Such neighbors exchange information
about network state and published data directly and through about network state and published data directly, and through
transitivity this information then propagates throughout the network. transitivity, this information then propagates throughout the
network.
New peers are discovered using the regular unicast or multicast New peers are discovered using the regular unicast or multicast
transport defined in the DNCP profile (Section 9). This process is transport defined in the DNCP profile (Section 9). This process is
not distinguished from peer addition, i.e., an unknown peer is simply not distinguished from peer addition, i.e., an unknown peer is simply
discovered by receiving regular DNCP protocol TLVs from it and discovered by receiving regular DNCP protocol TLVs from it, and
dedicated discovery messages or TLVs do not exist. For unicast-only dedicated discovery messages or TLVs do not exist. For unicast-only
transports, the individual node's transport addresses are transports, the individual node's transport addresses are
preconfigured or obtained using an external service discovery preconfigured or obtained using an external service discovery
protocol. In the presence of a multicast transport, messages from protocol. In the presence of a multicast transport, messages from
unknown peers are handled in the same way as multicast messages from unknown peers are handled in the same way as multicast messages from
peers that are already known, thus new peers are simply discovered peers that are already known; thus, new peers are simply discovered
when sending their regular DNCP protocol TLVs using multicast. when sending their regular DNCP protocol TLVs using multicast.
When receiving a Node Endpoint TLV (Section 7.2.1) on an endpoint When receiving a Node Endpoint TLV (Section 7.2.1) on an endpoint
from an unknown peer: from an unknown peer:
o If received over unicast, the remote node MUST be added as a peer o If received over unicast, the remote node MUST be added as a peer
on the endpoint and a Peer TLV (Section 7.3.1) MUST be created for on the endpoint, and a Peer TLV (Section 7.3.1) MUST be created
it. for it.
o If received over multicast, the node MAY be sent a (possibly rate- o If received over multicast, the node MAY be sent a (possibly rate-
limited) unicast Request Network State TLV (Section 7.1.1). limited) unicast Request Network State TLV (Section 7.1.1).
If keep-alives specified in Section 6.1 are NOT sent by the peer If keep-alives specified in Section 6.1 are NOT sent by the peer
(either the DNCP profile does not specify the use of keep-alives or (either the DNCP profile does not specify the use of keep-alives or
the particular peer chooses not to send keep-alives), some other the particular peer chooses not to send keep-alives), some other
existing local transport-specific means (such as Ethernet carrier- existing local transport-specific means (such as Ethernet carrier
detection or TCP keep-alive) MUST be used to ensure its presence. If detection or TCP keep-alive) MUST be used to ensure its presence. If
the peer does not send keep-alives, and no means to verify presence the peer does not send keep-alives, and no means to verify presence
of the peer are available, the peer MUST be considered no longer of the peer are available, the peer MUST be considered no longer
present and it SHOULD NOT be added back as a peer until it starts present, and it SHOULD NOT be added back as a peer until it starts
sending keep-alives again. When the peer is no longer present, the sending keep-alives again. When the peer is no longer present, the
Peer TLV and the local DNCP peer state MUST be removed. DNCP does Peer TLV and the local DNCP peer state MUST be removed. DNCP does
not define an explicit message or TLV for indicating the termination not define an explicit message or TLV for indicating the termination
of DNCP operation by the terminating node, however a derived protocol of DNCP operation by the terminating node; however, a derived
could specify an extension, if the need arises. protocol could specify an extension, if the need arises.
If the local endpoint is in the Multicast-Listen+Unicast transport If the local endpoint is in the Multicast-Listen+Unicast transport
mode, a Peer TLV (Section 7.3.1) MUST NOT be published for the peers mode, a Peer TLV (Section 7.3.1) MUST NOT be published for the peers
not having the highest node identifier. not having the highest node identifier.
4.6. Data Liveliness Validation 4.6. Data Liveliness Validation
Maintenance of the hash tree (Section 4.1) and thereby network state Maintenance of the hash tree (Section 4.1) and thereby network state
hash updates depend on up-to-date information on bidirectional node hash updates depend on up-to-date information on bidirectional node
reachability derived from the contents of a topology graph. This reachability derived from the contents of a topology graph. This
graph changes whenever nodes are added to or removed from the network graph changes whenever nodes are added to or removed from the network
or when bidirectional connectivity between existing nodes is or when bidirectional connectivity between existing nodes is
established or lost. Therefore the graph MUST be updated either established or lost. Therefore, the graph MUST be updated either
immediately or with a small delay shorter than the DNCP profile- immediately or with a small delay shorter than the DNCP profile-
defined Trickle Imin, whenever: defined Trickle Imin whenever:
o A Peer TLV or a whole node is added or removed, or o A Peer TLV or a whole node is added or removed, or
o the origination time (in milliseconds) of some node's node data is o The origination time (in milliseconds) of some node's node data is
less than current time - 2^32 + 2^15. less than current time - 2^32 + 2^15.
The artificial upper limit for the origination time is used to The artificial upper limit for the origination time is used to
gracefully avoid overflows of the origination time and allow for the gracefully avoid overflows of the origination time and allow for the
node to republish its data as noted in Section 7.2.3. node to republish its data as noted in Section 7.2.3.
The topology graph update starts with the local node marked as The topology graph update starts with the local node marked as
reachable and all other nodes marked as unreachable. Other nodes are reachable and all other nodes marked as unreachable. Other nodes are
then iteratively marked as reachable using the following algorithm: A then iteratively marked as reachable using the following algorithm: A
candidate not-yet-reachable node N with an endpoint NE is marked as candidate not-yet-reachable node N with an endpoint NE is marked as
reachable if there is a reachable node R with an endpoint RE that reachable if there is a reachable node R with an endpoint RE that
meet all of the following criteria: meets all of the following criteria:
o The origination time (in milliseconds) of R's node data is greater o The origination time (in milliseconds) of R's node data is greater
than current time - 2^32 + 2^15. than current time - 2^32 + 2^15.
o R publishes a Peer TLV with: o R publishes a Peer TLV with:
* Peer Node Identifier = N's node identifier * Peer Node Identifier = N's node identifier
* Peer Endpoint Identifier = NE's endpoint identifier * Peer Endpoint Identifier = NE's endpoint identifier
* Endpoint Identifier = RE's endpoint identifier * Endpoint Identifier = RE's endpoint identifier
o N publishes a Peer TLV with: o N publishes a Peer TLV with:
* Peer Node Identifier = R's node identifier * Peer Node Identifier = R's node identifier
* Peer Endpoint Identifier = RE's endpoint identifier * Peer Endpoint Identifier = RE's endpoint identifier
* Endpoint Identifier = NE's endpoint identifier * Endpoint Identifier = NE's endpoint identifier
skipping to change at page 17, line 14 skipping to change at page 17, line 31
* Endpoint Identifier = RE's endpoint identifier * Endpoint Identifier = RE's endpoint identifier
o N publishes a Peer TLV with: o N publishes a Peer TLV with:
* Peer Node Identifier = R's node identifier * Peer Node Identifier = R's node identifier
* Peer Endpoint Identifier = RE's endpoint identifier * Peer Endpoint Identifier = RE's endpoint identifier
* Endpoint Identifier = NE's endpoint identifier * Endpoint Identifier = NE's endpoint identifier
The algorithm terminates, when no more candidate nodes fulfilling The algorithm terminates when no more candidate nodes fulfilling
these criteria can be found. these criteria can be found.
DNCP nodes that have not been reachable in the most recent topology DNCP nodes that have not been reachable in the most recent topology
graph traversal MUST NOT be used for calculation of the network state graph traversal MUST NOT be used for calculation of the network state
hash, be provided to any applications that need to use the whole TLV hash, be provided to any applications that need to use the whole TLV
graph, or be provided to remote nodes. They MAY be forgotten graph, or be provided to remote nodes. They MAY be forgotten
immediately after the topology graph traversal, however it is immediately after the topology graph traversal; however, it is
RECOMMENDED to keep them at least briefly to improve the speed of RECOMMENDED to keep them at least briefly to improve the speed of
DNCP network state convergence. This reduces the number of queries DNCP network state convergence. This reduces the number of queries
needed to reconverge during both initial network convergence and when needed to reconverge during both initial network convergence and when
a part of the network loses and regains bidirectional connectivity a part of the network loses and regains bidirectional connectivity
within that time period. within that time period.
5. Data Model 5. Data Model
This section describes the local data structures a minimal This section describes the local data structures a minimal
implementation might use. This section is provided only as a implementation might use. This section is provided only as a
skipping to change at page 17, line 43 skipping to change at page 18, line 12
(Section 6) describe additional data requirements, and some optional (Section 6) describe additional data requirements, and some optional
parts of the core protocol may also require more. parts of the core protocol may also require more.
A DNCP node has: A DNCP node has:
o A data structure containing data about the most recently sent o A data structure containing data about the most recently sent
Request Network State TLVs (Section 7.1.1). The simplest option Request Network State TLVs (Section 7.1.1). The simplest option
is keeping a timestamp of the most recent request (required to is keeping a timestamp of the most recent request (required to
fulfill reply rate limiting specified in Section 4.4). fulfill reply rate limiting specified in Section 4.4).
A DNCP node has for every DNCP node in the DNCP network: A DNCP node has the following for every DNCP node in the DNCP
network:
o Node identifier: the unique identifier of the node. The length, o Node identifier: the unique identifier of the node. The length,
how it is produced, and how collisions are handled, is up to the how it is produced, and how collisions are handled is up to the
DNCP profile. DNCP profile.
o Node data: the set of TLV tuples published by that particular o Node data: the set of TLV tuples published by that particular
node. As they are transmitted ordered (see Node State TLV node. As they are transmitted in a particular order (see Node
(Section 7.2.3) for details), maintaining the order within the State TLV (Section 7.2.3) for details), maintaining the order
data structure here may be reasonable. within the data structure here may be reasonable.
o Latest sequence number: the 32-bit sequence number that is o Latest sequence number: the 32-bit sequence number that is
incremented any time the TLV set is published. The comparison incremented any time the TLV set is published. The comparison
function used to compare them is described in Section 4.4. function used to compare them is described in Section 4.4.
o Origination time: the (estimated) time when the current TLV set o Origination time: the (estimated) time when the current TLV set
with the current sequence number was published. It is used to with the current sequence number was published. It is used to
populate the Milliseconds Since Origination field in a Node State populate the Milliseconds Since Origination field in a Node State
TLV (Section 7.2.3). Ideally it also has millisecond accuracy. TLV (Section 7.2.3). Ideally, it also has millisecond accuracy.
Additionally, a DNCP node has a set of endpoints for which DNCP is Additionally, a DNCP node has a set of endpoints for which DNCP is
configured to be used. For each such endpoint, a node has: configured to be used. For each such endpoint, a node has:
o Endpoint identifier: the 32-bit opaque locally unique value o Endpoint identifier: the 32-bit opaque locally unique value
identifying the endpoint within a node. It SHOULD NOT be reused identifying the endpoint within a node. It SHOULD NOT be reused
immediately after an endpoint is disabled. immediately after an endpoint is disabled.
o Trickle instance: the endpoint's Trickle instance with parameters o Trickle instance: the endpoint's Trickle instance with parameters
I, T, and c (only on an endpoint in Multicast+Unicast transport I, T, and c (only on an endpoint in Multicast+Unicast transport
skipping to change at page 18, line 48 skipping to change at page 19, line 17
o Node identifier: the unique identifier of the peer. o Node identifier: the unique identifier of the peer.
o Endpoint identifier: the unique endpoint identifier used by the o Endpoint identifier: the unique endpoint identifier used by the
peer. peer.
o Peer address: the most recently used address of the peer o Peer address: the most recently used address of the peer
(authenticated and authorized, if security is enabled). (authenticated and authorized, if security is enabled).
o Trickle instance: the particular peer's Trickle instance with o Trickle instance: the particular peer's Trickle instance with
parameters I, T, and c (only on an endpoint in Unicast mode, when parameters I, T, and c (only on an endpoint in unicast mode, when
using an unreliable unicast transport) . using an unreliable unicast transport).
6. Optional Extensions 6. Optional Extensions
This section specifies extensions to the core protocol that a DNCP This section specifies extensions to the core protocol that a DNCP
profile may specify to be used. profile may specify to be used.
6.1. Keep-Alives 6.1. Keep-Alives
While DNCP provides mechanisms for discovery and adding of new peers While DNCP provides mechanisms for discovery and adding new peers on
on an endpoint (Section 4.5), as well as state change notifications, an endpoint (Section 4.5), as well as state change notifications,
another mechanism may be needed to get rid of old, no longer valid another mechanism may be needed to get rid of old, no longer valid
peers if the transport or lower layers do not provide one as noted in peers if the transport or lower layers do not provide one as noted in
Section 4.6. Section 4.6.
If keep-alives are not specified in the DNCP profile, the rest of If keep-alives are not specified in the DNCP profile, the rest of
this subsection MUST be ignored. this subsection MUST be ignored.
A DNCP profile MAY specify either per-endpoint (sent using multicast A DNCP profile MAY specify either per-endpoint (sent using multicast
to all DNCP nodes connected to a multicast-enabled link) or per-peer to all DNCP nodes connected to a multicast-enabled link) or per-peer
(sent using unicast to each peer individually) keep-alive support. (sent using unicast to each peer individually) keep-alive support.
For every endpoint that a keep-alive is specified for in the DNCP For every endpoint that a keep-alive is specified for in the DNCP
profile, the endpoint-specific keep-alive interval MUST be profile, the endpoint-specific keep-alive interval MUST be
maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is
a local value that is preferred for that for any reason a local value that is preferred for that for any reason
(configuration, energy conservation, media type, ..), it can be (configuration, energy conservation, media type, ...), it can be
substituted instead. If a non-default keep-alive interval is used on substituted instead. If a non-default keep-alive interval is used on
any endpoint, a DNCP node MUST publish appropriate Keep-Alive any endpoint, a DNCP node MUST publish an appropriate Keep-Alive
Interval TLV(s) (Section 7.3.2) within its node data. Interval TLV(s) (Section 7.3.2) within its node data.
6.1.1. Data Model Additions 6.1.1. Data Model Additions
The following additions to the Data Model (Section 5) are needed to The following additions to the Data Model (Section 5) are needed to
support keep-alives: support keep-alives:
For each configured endpoint that has per-endpoint keep-alives For each configured endpoint that has per-endpoint keep-alives
enabled: enabled:
o Last sent: If a timestamp which indicates the last time a Network o Last sent: If a timestamp that indicates the last time a Network
State TLV (Section 7.2.2) was sent over that interface. State TLV (Section 7.2.2) was sent over that interface.
For each remote (peer, endpoint) pair detected on a local endpoint, a For each remote (peer, endpoint) pair detected on a local endpoint, a
DNCP node has: DNCP node has:
o Last contact timestamp: a timestamp which indicates the last time o Last contact timestamp: A timestamp that indicates the last time a
a consistent Network State TLV (Section 7.2.2) was received from consistent Network State TLV (Section 7.2.2) was received from the
the peer over multicast, or anything was received over unicast. peer over multicast or when anything was received over unicast.
Failing to update it for a certain amount of time as specified in Failing to update it for a certain amount of time as specified in
Section 6.1.5 results in the removal of the peer. When adding a Section 6.1.5 results in the removal of the peer. When adding a
new peer, it is initialized to the current time. new peer, it is initialized to the current time.
o Last sent: If per-peer keep-alives are enabled, a timestamp which o Last sent: If per-peer keep-alives are enabled, a timestamp that
indicates the last time a Network State TLV (Section 7.2.2) was indicates the last time a Network State TLV (Section 7.2.2) was
sent to to that point-to-point peer. When adding a new peer, it sent to that point-to-point peer. When adding a new peer, it is
is initialized to the current time. initialized to the current time.
6.1.2. Per-Endpoint Periodic Keep-Alives 6.1.2. Per-Endpoint Periodic Keep-Alives
If per-endpoint keep-alives are enabled on an endpoint in If per-endpoint keep-alives are enabled on an endpoint in
Multicast+Unicast transport mode, and if no traffic containing a Multicast+Unicast transport mode, and if no traffic containing a
Network State TLV (Section 7.2.2) has been sent to a particular Network State TLV (Section 7.2.2) has been sent to a particular
endpoint within the endpoint-specific keep-alive interval, a Network endpoint within the endpoint-specific keep-alive interval, a Network
State TLV (Section 7.2.2) MUST be sent on that endpoint, and a new State TLV (Section 7.2.2) MUST be sent on that endpoint, and a new
Trickle interval started, as specified in the step 2 of Section 4.2 Trickle interval started, as specified in step 2 of Section 4.2 of
of [RFC6206]. The actual sending time SHOULD be further delayed by a [RFC6206]. The actual sending time SHOULD be further delayed by a
random timespan in [0, Imin/2]. random time span in [0, Imin/2].
6.1.3. Per-Peer Periodic Keep-Alives 6.1.3. Per-Peer Periodic Keep-Alives
If per-peer keep-alives are enabled on a unicast-only endpoint, and If per-peer keep-alives are enabled on a unicast-only endpoint, and
if no traffic containing a Network State TLV (Section 7.2.2) has been if no traffic containing a Network State TLV (Section 7.2.2) has been
sent to a particular peer within the endpoint-specific keep-alive sent to a particular peer within the endpoint-specific keep-alive
interval, a Network State TLV (Section 7.2.2) MUST be sent to the interval, a Network State TLV (Section 7.2.2) MUST be sent to the
peer, and a new Trickle interval started, as specified in the step 2 peer, and a new Trickle interval started, as specified in step 2 of
of Section 4.2 of [RFC6206]. Section 4.2 of [RFC6206].
6.1.4. Received TLV Processing Additions 6.1.4. Received TLV Processing Additions
If a TLV is received over unicast from the peer, the Last contact If a TLV is received over unicast from the peer, the Last contact
timestamp for the peer MUST be updated. timestamp for the peer MUST be updated.
On receipt of a Network State TLV (Section 7.2.2) which is consistent On receipt of a Network State TLV (Section 7.2.2) that is consistent
with the locally calculated network state hash, the Last contact with the locally calculated network state hash, the Last contact
timestamp for the peer MUST be updated in order to maintain it as a timestamp for the peer MUST be updated in order to maintain it as a
peer. peer.
6.1.5. Peer Removal 6.1.5. Peer Removal
For every peer on every endpoint, the endpoint-specific keep-alive For every peer on every endpoint, the endpoint-specific keep-alive
interval must be calculated by looking for Keep-Alive Interval TLVs interval must be calculated by looking for Keep-Alive Interval TLVs
(Section 7.3.2) published by the node, and if none exist, using the (Section 7.3.2) published by the node, and if none exist, use the
default value of DNCP_KEEPALIVE_INTERVAL. If the peer's Last contact default value of DNCP_KEEPALIVE_INTERVAL. If the peer's Last contact
timestamp has not been updated for at least locally chosen timestamp has not been updated for at least a locally chosen
potentially endpoint-specific keep-alive multiplier (defaults to potentially endpoint-specific keep-alive multiplier (defaults to
DNCP_KEEPALIVE_MULTIPLIER) times the peer's endpoint-specific keep- DNCP_KEEPALIVE_MULTIPLIER) times the peer's endpoint-specific keep-
alive interval, the Peer TLV for that peer and the local DNCP peer alive interval, the Peer TLV for that peer and the local DNCP peer
state MUST be removed. state MUST be removed.
6.2. Support For Dense Multicast-Enabled Links 6.2. Support for Dense Multicast-Enabled Links
This optimization is needed to avoid a state space explosion. Given This optimization is needed to avoid a state space explosion. Given
a large set of DNCP nodes publishing data on an endpoint that uses a large set of DNCP nodes publishing data on an endpoint that uses
multicast on a link, every node will add a Peer TLV (Section 7.3.1) multicast on a link, every node will add a Peer TLV (Section 7.3.1)
for each peer. While Trickle limits the amount of traffic on the for each peer. While Trickle limits the amount of traffic on the
link in stable state to some extent, the total amount of data that is link in stable state to some extent, the total amount of data that is
added to and maintained in the DNCP network given N nodes on a added to and maintained in the DNCP network given N nodes on a
multicast-enabled link is O(N^2). Additionally if per-peer keep- multicast-enabled link is O(N^2). Additionally, if per-peer keep-
alives are used, there will be O(N^2) keep-alives running on the link alives are used, there will be O(N^2) keep-alives running on the link
if liveliness of peers is not ensured using some other way (e.g., TCP if the liveliness of peers is not ensured using some other way (e.g.,
connection lifetime, layer 2 notification, per-endpoint keep-alive). TCP connection lifetime, Layer 2 notification, or per-endpoint keep-
alive).
An upper bound for the number of peers that are allowed for a An upper bound for the number of peers that are allowed for a
particular type of link that an endpoint in Multicast+Unicast particular type of link that an endpoint in Multicast+Unicast
transport mode is used on SHOULD be provided by a DNCP profile, but transport mode is used on SHOULD be provided by a DNCP profile, but
MAY also be chosen at runtime. The main consideration when selecting it MAY also be chosen at runtime. The main consideration when
a bound (if any) for a particular type of link should be whether it selecting a bound (if any) for a particular type of link should be
supports multicast traffic, and whether a too large number of peers whether it supports multicast traffic and whether a too large number
case is likely to happen during the use of that DNCP profile on that of peers case is likely to happen during the use of that DNCP profile
particular type of link. If neither is likely, there is little point on that particular type of link. If neither is likely, there is
specifying support for this for that particular link type. little point specifying support for this for that particular link
type.
If a DNCP profile does not support this extension at all, the rest of If a DNCP profile does not support this extension at all, the rest of
this subsection MUST be ignored. This is because when this extension this subsection MUST be ignored. This is because when this extension
is used, the state within the DNCP network only contains a subset of is used, the state within the DNCP network only contains a subset of
the full topology of the network. Therefore every node must be aware the full topology of the network. Therefore, every node must be
of the potential of it being used in a particular DNCP profile. aware of the potential of it being used in a particular DNCP profile.
If the specified upper bound is exceeded for some endpoint in If the specified upper bound is exceeded for some endpoint in
Multicast+Unicast transport mode and if the node does not have the Multicast+Unicast transport mode and if the node does not have the
highest node identifier on the link, it SHOULD treat the endpoint as highest node identifier on the link, it SHOULD treat the endpoint as
a unicast endpoint connected to the node that has the highest node a unicast endpoint connected to the node that has the highest node
identifier detected on the link, therefore transitioning to identifier detected on the link, therefore transitioning to
Multicast-listen+Unicast transport mode. See Section 4.2 for Multicast-listen+Unicast transport mode. See Section 4.2 for
implications on the specific endpoint behavior. The nodes in implications on the specific endpoint behavior. The nodes in
Multicast-listen+Unicast transport mode MUST keep listening to Multicast-listen+Unicast transport mode MUST keep listening to
multicast traffic to both receive messages from the node(s) still in multicast traffic to both receive messages from the node(s) still in
Multicast+Unicast mode, and as well to react to nodes with a greater Multicast+Unicast mode and react to nodes with a greater node
node identifier appearing. If the highest node identifier present on identifier appearing. If the highest node identifier present on the
the link changes, the remote unicast address of the endpoints in link changes, the remote unicast address of the endpoints in
Multicast-Listen+Unicast transport mode MUST be changed. If the node Multicast-Listen+Unicast transport mode MUST be changed. If the node
identifier of the local node is the highest one, the node MUST switch identifier of the local node is the highest one, the node MUST switch
back to, or stay in Multicast+Unicast mode, and form peer back to, or stay in, Multicast+Unicast mode and form peer
relationships with all peers as specified in Section 4.5. relationships with all peers as specified in Section 4.5.
7. Type-Length-Value Objects 7. Type-Length-Value Objects
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value (if any) (+padding (if any)) | | Value (if any) (+padding (if any)) |
.. ..
| (variable # of bytes) | | (variable # of bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (Optional nested TLVs) | | (optional nested TLVs) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each TLV is encoded as: Each TLV is encoded as:
o a 2 byte Type field o a 2-byte Type field
o a 2 byte Length field which contains the length of the Value field o a 2-byte Length field, which contains the length of the Value
in bytes; 0 means no Value field in bytes; 0 means no value
o the Value itself (if any) o the value itself (if any)
o padding bytes with value of zero up to the next 4 byte boundary if o padding bytes with a value of zero up to the next 4-byte boundary
the Length is not divisible by 4. if the Length is not divisible by 4
While padding bytes MUST NOT be included in the number stored in the While padding bytes MUST NOT be included in the number stored in the
Length field of the TLV, if the TLV is enclosed within another TLV, Length field of the TLV, if the TLV is enclosed within another TLV,
then the padding is included in the enclosing TLV's Length value. then the padding is included in the enclosing TLV's Length value.
Each TLV which does not define optional fields or variable-length Each TLV that does not define optional fields or variable-length
content MAY be sent with additional sub-TLVs appended after the TLV content MAY be sent with additional sub-TLVs appended after the TLV
to allow for extensibility. When handling such TLV types, each node to allow for extensibility. When handling such TLV types, each node
MUST accept received TLVs that are longer than the fixed fields MUST accept received TLVs that are longer than the fixed fields
specified for the particular type, and ignore the sub-TLVs with specified for the particular type and ignore the sub-TLVs with either
either unknown types, or not supported within that particular TLV unknown types or types not supported within that particular TLV. If
type. If any sub-TLVs are present, the Length field of the TLV any sub-TLVs are present, the Length field of the TLV describes the
describes the number of bytes from the first byte of the TLV's own number of bytes from the first byte of the TLV's own Value (if any)
Value (if any) to the last (padding) byte of the last sub-TLV. to the last (padding) byte of the last sub-TLV.
For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is
encoded as: 007B 0001 7800 0000. If it were to have sub-TLV of encoded as: 007B 0001 7800 0000. If it were to have a sub-TLV of
type=124 (0x7c) with value 'y', it would be encoded as 007B 000C 7800 type=124 (0x7c) with value 'y', it would be encoded as 007B 000C 7800
0000 007C 0001 7900 0000. 0000 007C 0001 7900 0000.
In this section, the following special notation is used: In this section, the following special notation is used:
.. = octet string concatenation operation. .. = octet string concatenation operation.
H(x) = non-cryptographic hash function specified by DNCP profile. H(x) = non-cryptographic hash function specified by the DNCP
profile.
In addition to the TLV types defined in this document, TLV Types
11-31 and 512-767 are unassigned and may be sequentially registered,
starting at 11, by Standards Action [RFC5226] by extensions to DNCP
that may be applicable in multiple DNCP profiles.
7.1. Request TLVs 7.1. Request TLVs
7.1.1. Request Network State TLV 7.1.1. Request Network State TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: REQ-NETWORK-STATE (1) | Length: >= 0 | |Type: Request network state (1)| Length: >= 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV is used to request response with a Network State TLV This TLV is used to request response with a Network State TLV
(Section 7.2.2) and all Node State TLVs (Section 7.2.3) (without node (Section 7.2.2) and all Node State TLVs (Section 7.2.3) (without node
data). data).
7.1.2. Request Node State TLV 7.1.2. Request Node State TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: REQ-NODE-STATE (2) | Length: > 0 | | Type: Request node state (2) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier | | Node Identifier |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV is used to request a Node State TLV (Section 7.2.3) This TLV is used to request a Node State TLV (Section 7.2.3)
(including node data) for the node with the matching node identifier. (including node data) for the node with the matching node identifier.
7.2. Data TLVs 7.2. Data TLVs
7.2.1. Node Endpoint TLV 7.2.1. Node Endpoint TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: NODE-ENDPOINT (3) | Length: > 4 | | Type: Node endpoint (3) | Length: > 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier | | Node Identifier |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Endpoint Identifier | | Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV identifies both the local node's node identifier, as well as This TLV identifies both the local node's node identifier, as well as
the particular endpoint's endpoint identifier. Section 4.2 specifies the particular endpoint's endpoint identifier. Section 4.2 specifies
when it is sent. when it is sent.
7.2.2. Network State TLV 7.2.2. Network State TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: NETWORK-STATE (4) | Length: > 0 | | Type: Network state (4) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| H(sequence number of node 1 .. H(node data of node 1) .. | | H(sequence number of node 1 .. H(node data of node 1) .. |
| .. sequence number of node N .. H(node data of node N)) | | .. sequence number of node N .. H(node data of node N)) |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV contains the current network state hash calculated by its This TLV contains the current network state hash calculated by its
sender (Section 4.1 describes the algorithm). sender (Section 4.1 describes the algorithm).
7.2.3. Node State TLV 7.2.3. Node State TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: NODE-STATE (5) | Length: > 8 | | Type: Node state (5) | Length: > 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier | | Node Identifier |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number | | Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Milliseconds Since Origination | | Milliseconds Since Origination |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| H(Node Data) | | H(Node Data) |
skipping to change at page 25, line 14 skipping to change at page 26, line 8
Every node, including the node publishing the node data, MUST update Every node, including the node publishing the node data, MUST update
the Milliseconds Since Origination whenever it sends a Node State TLV the Milliseconds Since Origination whenever it sends a Node State TLV
based on when the node estimates the data was originally published. based on when the node estimates the data was originally published.
This is, e.g., to ensure that any relative timestamps contained This is, e.g., to ensure that any relative timestamps contained
within the published node data can be correctly offset and within the published node data can be correctly offset and
interpreted. Ultimately, what is provided is just an approximation, interpreted. Ultimately, what is provided is just an approximation,
as transmission delays are not accounted for. as transmission delays are not accounted for.
Absent any changes, if the originating node notices that the 32-bit Absent any changes, if the originating node notices that the 32-bit
milliseconds since origination value would be close to overflow Milliseconds Since Origination value would be close to overflow
(greater than 2^32-2^16), the node MUST re-publish its TLVs even if (greater than 2^32 - 2^16), the node MUST republish its TLVs even if
there is no change. In other words, absent any other changes, the there is no change. In other words, absent any other changes, the
TLV set MUST be re-published roughly every 48 days. TLV set MUST be republished roughly every 48 days.
The actual node data of the node may be included within the TLV as The actual node data of the node may be included within the TLV as
well in the optional Node Data field. The set of TLVs MUST be well as in the optional Node Data field. The set of TLVs MUST be
strictly ordered based on ascending binary content (including TLV strictly ordered based on ascending binary content (including TLV
type and length). This enables, e.g., efficient state delta type and length). This enables, e.g., efficient state delta
processing and no-copy indexing by TLV type by the recipient. The processing and no-copy indexing by TLV type by the recipient. The
Node Data content MUST be passed along exactly as it was received. node data content MUST be passed along exactly as it was received.
It SHOULD be also verified on receipt that the locally calculated It SHOULD be also verified on receipt that the locally calculated
H(Node Data) matches the content of the field within the TLV, and if H(Node Data) matches the content of the field within the TLV, and if
the hash differs, the TLV SHOULD be ignored. the hash differs, the TLV SHOULD be ignored.
7.3. Data TLVs within Node State TLV 7.3. Data TLVs within Node State TLV
These TLVs are published by the DNCP nodes, and therefore only These TLVs are published by the DNCP nodes and are therefore only
encoded in the Node Data field of Node State TLVs. If encountered encoded in the Node Data field of Node State TLVs. If encountered
outside Node State TLV, they MUST be silently ignored. outside Node State TLV, they MUST be silently ignored.
7.3.1. Peer TLV 7.3.1. Peer TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: PEER (8) | Length: > 8 | | Type: Peer (8) | Length: > 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Peer Node Identifier | | Peer Node Identifier |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Peer Endpoint Identifier | | Peer Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (Local) Endpoint Identifier | | (Local) Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 26, line 4 skipping to change at page 26, line 47
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Peer Endpoint Identifier | | Peer Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (Local) Endpoint Identifier | | (Local) Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV indicates that the node in question vouches that the This TLV indicates that the node in question vouches that the
specified peer is reachable by it on the specified local endpoint. specified peer is reachable by it on the specified local endpoint.
The presence of this TLV at least guarantees that the node publishing The presence of this TLV at least guarantees that the node publishing
it has received traffic from the peer recently. For guaranteed up- it has received traffic from the peer recently. For guaranteed up-
to-date bidirectional reachability, the existence of both nodes' to-date bidirectional reachability, the existence of both nodes'
matching Peer TLVs needs to be checked. matching Peer TLVs needs to be checked.
7.3.2. Keep-Alive Interval TLV 7.3.2. Keep-Alive Interval TLV
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: KEEP-ALIVE-INTERVAL (9) | Length: >= 8 | | Type: Keep-alive interval (9) | Length: >= 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Endpoint Identifier | | Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Interval | | Interval |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV indicates a non-default interval being used to send keep- This TLV indicates a non-default interval being used to send keep-
alives specified in Section 6.1. alives as specified in Section 6.1.
Endpoint identifier is used to identify the particular (local) Endpoint identifier is used to identify the particular (local)
endpoint for which the interval applies on the sending node. If 0, endpoint for which the interval applies on the sending node. If 0,
it applies for ALL endpoints for which no specific TLV exists. it applies for ALL endpoints for which no specific TLV exists.
Interval specifies the interval in milliseconds at which the node Interval specifies the interval in milliseconds at which the node
sends keep-alives. A value of zero means no keep-alives are sent at sends keep-alives. A value of zero means no keep-alives are sent at
all; in that case, some lower layer mechanism that ensures presence all; in that case, some lower-layer mechanism that ensures the
of nodes MUST be available and used. presence of nodes MUST be available and used.
8. Security and Trust Management 8. Security and Trust Management
If specified in the DNCP profile, either DTLS [RFC6347] or TLS If specified in the DNCP profile, either DTLS [RFC6347] or TLS
[RFC5246] may be used to authenticate and encrypt either some (if [RFC5246] may be used to authenticate and encrypt either some (if
specified optional in the profile), or all unicast traffic. The specified optional in the profile) or all unicast traffic. The
following methods for establishing trust are defined, but it is up to following methods for establishing trust are defined, but it is up to
the DNCP profile to specify which ones may, should or must be the DNCP profile to specify which ones may, should, or must be
supported. supported.
8.1. Pre-Shared Key Based Trust Method 8.1. Trust Method Based on Pre-Shared Key
A PSK-based trust model is a simple security management mechanism A trust model based on Pre-Shared Key (PSK) is a simple security
that allows an administrator to deploy devices to an existing network management mechanism that allows an administrator to deploy devices
by configuring them with a pre-defined key, similar to the to an existing network by configuring them with a predefined key,
configuration of an administrator password or WPA-key. Although similar to the configuration of an administrator password or Wi-Fi
limited in nature it is useful to provide a user-friendly security Protected Access (WPA) key. Although limited in nature, it is useful
mechanism for smaller networks. to provide a user-friendly security mechanism for smaller networks.
8.2. PKI Based Trust Method 8.2. PKI-Based Trust Method
A PKI-based trust-model enables more advanced management capabilities A PKI-based trust model enables more advanced management capabilities
at the cost of increased complexity and bootstrapping effort. It at the cost of increased complexity and bootstrapping effort.
however allows trust to be managed in a centralized manner and is However, it allows trust to be managed in a centralized manner and is
therefore useful for larger networks with a need for an authoritative therefore useful for larger networks with a need for an authoritative
trust management. trust management.
8.3. Certificate Based Trust Consensus Method 8.3. Certificate-Based Trust Consensus Method
For some scenarios - such as bootstrapping a mostly unmanaged network For some scenarios -- such as bootstrapping a mostly unmanaged
- the methods described above may not provide a desirable tradeoff network -- the methods described above may not provide a desirable
between security and user experience. This section includes guidance trade-off between security and user experience. This section
for implementing an opportunistic security [RFC7435] method which includes guidance for implementing an opportunistic security
DNCP profiles can build upon and adapt for their specific [RFC7435] method that DNCP profiles can build upon and adapt for
requirements. their specific requirements.
The certificate-based consensus model is designed to be a compromise The certificate-based consensus model is designed to be a compromise
between trust management effort and flexibility. It is based on between trust management effort and flexibility. It is based on
X.509-certificates and allows each DNCP node to provide a trust X.509 certificates and allows each DNCP node to provide a trust
verdict on any other certificate and a consensus is found to verdict on any other certificate, and a consensus is found to
determine whether a node using this certificate or any certificate determine whether a node using this certificate or any certificate
signed by it is to be trusted. signed by it is to be trusted.
A DNCP node not using this security method MUST ignore all announced A DNCP node not using this security method MUST ignore all announced
trust verdicts and MUST NOT announce any such verdicts by itself, trust verdicts and MUST NOT announce any such verdicts by itself,
i.e., any other normative language in this subsection does not apply i.e., any other normative language in this subsection does not apply
to it. to it.
The current effective trust verdict for any certificate is defined as The current effective trust verdict for any certificate is defined as
the one with the highest priority from all trust verdicts announced the one with the highest priority from all trust verdicts announced
for said certificate at the time. for said certificate at the time.
8.3.1. Trust Verdicts 8.3.1. Trust Verdicts
Trust verdicts are statements of DNCP nodes about the trustworthiness Trust verdicts are statements of DNCP nodes about the trustworthiness
of X.509-certificates. There are 5 possible trust verdicts in order of X.509 certificates. There are 5 possible trust verdicts in order
of ascending priority: of ascending priority:
0 (Neutral): no trust verdict exists but the DNCP network should 0 (Neutral): no trust verdict exists, but the DNCP network should
determine one. determine one.
1 (Cached Trust): the last known effective trust verdict was 1 (Cached Trust): the last known effective trust verdict was
Configured or Cached Trust. Configured or Cached Trust.
2 (Cached Distrust): the last known effective trust verdict was 2 (Cached Distrust): the last known effective trust verdict was
Configured or Cached Distrust. Configured or Cached Distrust.
3 (Configured Trust): trustworthy based upon an external ceremony 3 (Configured Trust): trustworthy based upon an external ceremony
or configuration. or configuration.
4 (Configured Distrust): not trustworthy based upon an external 4 (Configured Distrust): not trustworthy based upon an external
ceremony or configuration. ceremony or configuration.
Trust verdicts are differentiated in 3 groups: Trust verdicts are differentiated in 3 groups:
o Configured verdicts are used to announce explicit trust verdicts a o Configured verdicts are used to announce explicit trust verdicts a
node has based on any external trust bootstrap or predefined node has based on any external trust bootstrap or predefined
relation a node has formed with a given certificate. relations a node has formed with a given certificate.
o Cached verdicts are used to retain the last known trust state in o Cached verdicts are used to retain the last known trust state in
case all nodes with configured verdicts about a given certificate case all nodes with configured verdicts about a given certificate
have been disconnected or turned off. have been disconnected or turned off.
o The Neutral verdict is used to announce a new node intending to o The Neutral verdict is used to announce a new node intending to
join the network so a final verdict for it can be found. join the network, so a final verdict for it can be found.
The current effective trust verdict for any certificate is defined as The current effective trust verdict for any certificate is defined as
the one with the highest priority within the set of trust verdicts the one with the highest priority within the set of trust verdicts
announced for the certificate in the DNCP network. A node MUST be announced for the certificate in the DNCP network. A node MUST be
trusted for participating in the DNCP network if and only if the trusted for participating in the DNCP network if and only if the
current effective trust verdict for its own certificate or any one in current effective trust verdict for its own certificate or any one in
its certificate hierarchy is (Cached or Configured) Trust and none of its certificate hierarchy is (Cached or Configured) Trust, and none
the certificates in its hierarchy have an effective trust verdict of of the certificates in its hierarchy have an effective trust verdict
(Cached or Configured) Distrust. In case a node has a configured of (Cached or Configured) Distrust. In case a node has a configured
verdict, which is different from the current effective trust verdict verdict, which is different from the current effective trust verdict
for a certificate, the current effective trust verdict takes for a certificate, the current effective trust verdict takes
precedence in deciding trustworthiness. Despite that, the node still precedence in deciding trustworthiness. Despite that, the node still
retains and announces its configured verdict. retains and announces its configured verdict.
8.3.2. Trust Cache 8.3.2. Trust Cache
Each node SHOULD maintain a trust cache containing the current Each node SHOULD maintain a trust cache containing the current
effective trust verdicts for all certificates currently announced in effective trust verdicts for all certificates currently announced in
the DNCP network. This cache is used as a backup of the last known the DNCP network. This cache is used as a backup of the last known
skipping to change at page 29, line 7 skipping to change at page 30, line 7
Every time a node (re)joins the network or detects the change of an Every time a node (re)joins the network or detects the change of an
effective trust verdict for any certificate, it will synchronize its effective trust verdict for any certificate, it will synchronize its
cache, i.e., store new effective trust verdicts overwriting any cache, i.e., store new effective trust verdicts overwriting any
previously cached verdicts. Configured verdicts are stored in the previously cached verdicts. Configured verdicts are stored in the
cache as their respective cached counterparts. Neutral verdicts are cache as their respective cached counterparts. Neutral verdicts are
never stored and do not override existing cached verdicts. never stored and do not override existing cached verdicts.
8.3.3. Announcement of Verdicts 8.3.3. Announcement of Verdicts
A node SHOULD always announce any configured trust verdicts it has A node SHOULD always announce any configured verdicts it has
established by itself, and it MUST do so if announcing the configured established by itself, and it MUST do so if announcing the configured
trust verdict leads to a change in the current effective trust verdict leads to a change in the current effective trust verdict for
verdict for the respective certificate. In absence of configured the respective certificate. In absence of configured verdicts, it
verdicts, it MUST announce cached trust verdicts it has stored in its MUST announce Cached Trust verdicts it has stored in its trust cache,
trust cache, if one of the following conditions applies: if one of the following conditions applies:
o The stored trust verdict is Cached Trust and the current effective o The stored trust verdict is Cached Trust, and the current
trust verdict for the certificate is Neutral or does not exist. effective trust verdict for the certificate is Neutral or does not
exist.
o The stored trust verdict is Cached Distrust and the current o The stored trust verdict is Cached Distrust, and the current
effective trust verdict for the certificate is Cached Trust. effective trust verdict for the certificate is Cached Trust.
A node rechecks these conditions whenever it detects changes of A node rechecks these conditions whenever it detects changes of
announced trust verdicts anywhere in the network. announced trust verdicts anywhere in the network.
Upon encountering a node with a hierarchy of certificates for which Upon encountering a node with a hierarchy of certificates for which
there is no effective trust verdict, a node adds a Neutral Trust- there is no effective trust verdict, a node adds a Neutral Trust-
Verdict-TLV to its node data for all certificates found in the Verdict TLV to its node data for all certificates found in the
hierarchy, and publishes it until an effective trust verdict hierarchy and publishes it until an effective trust verdict different
different from Neutral can be found for any of the certificates, or a from Neutral can be found for any of the certificates, or a
reasonable amount of time (10 minutes is suggested) with no reaction reasonable amount of time (10 minutes is suggested) with no reaction
and no further authentication attempts has passed. Such trust and no further authentication attempts has passed. Such trust
verdicts SHOULD also be limited in rate and number to prevent denial- verdicts SHOULD also be limited in rate and number to prevent
of-service attacks. denial-of-service attacks.
Trust verdicts are announced using Trust-Verdict TLVs: Trust verdicts are announced using Trust-Verdict TLVs:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: Trust-Verdict (10) | Length: > 36 | | Type: Trust-Verdict (10) | Length: > 36 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Verdict | (reserved) | | Verdict | (reserved) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
| | | |
| | | |
| SHA-256 Fingerprint | | SHA-256 Fingerprint |
| | | |
skipping to change at page 30, line 4 skipping to change at page 31, line 24
| | | |
| | | |
| | | |
| SHA-256 Fingerprint | | SHA-256 Fingerprint |
| | | |
| | | |
| | | |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Common Name | | Common Name |
Verdict represents the numerical index of the trust verdict. Verdict represents the numerical index of the trust verdict.
(reserved) is reserved for future additions and MUST be set to 0 (reserved) is reserved for future additions and MUST be set to 0
when creating TLVs and ignored when parsing them. when creating TLVs and ignored when parsing them.
SHA-256 Fingerprint contains the SHA-256 [RFC6234] hash value of SHA-256 Fingerprint contains the SHA-256 [RFC6234] hash value of
the certificate in DER-format. the certificate in DER format.
Common Name contains the variable-length (1-64 bytes) common name Common name contains the variable-length (1-64 bytes) common name
of the certificate. of the certificate.
8.3.4. Bootstrap Ceremonies 8.3.4. Bootstrap Ceremonies
The following non-exhaustive list of methods describes possible ways The following non-exhaustive list of methods describes possible ways
to establish trust relationships between DNCP nodes and node to establish trust relationships between DNCP nodes and node
certificates. Trust establishment is a two-way process in which the certificates. Trust establishment is a two-way process in which the
existing network must trust the newly added node and the newly added existing network must trust the newly added node, and the newly added
node must trust at least one of its peer nodes. It is therefore node must trust at least one of its peer nodes. It is therefore
necessary that both the newly added node and an already trusted node necessary that both the newly added node and an already trusted node
perform such a ceremony to successfully introduce a node into the perform such a ceremony to successfully introduce a node into the
DNCP network. In all cases an administrator MUST be provided with DNCP network. In all cases, an administrator MUST be provided with
external means to identify the node belonging to a certificate based external means to identify the node belonging to a certificate based
on its fingerprint and a meaningful common name. on its fingerprint and a meaningful common name.
8.3.4.1. Trust by Identification 8.3.4.1. Trust by Identification
A node implementing certificate-based trust MUST provide an interface A node implementing certificate-based trust MUST provide an interface
to retrieve the current set of effective trust verdicts, fingerprints to retrieve the current set of effective trust verdicts,
and names of all certificates currently known and set configured fingerprints, and names of all certificates currently known and set
trust verdicts to be announced. Alternatively it MAY provide a configured verdicts to be announced. Alternatively, it MAY provide a
companion DNCP node or application with these capabilities with which companion DNCP node or application with these capabilities with which
it has a pre-established trust relationship. it has a pre-established trust relationship.
8.3.4.2. Preconfigured Trust 8.3.4.2. Preconfigured Trust
A node MAY be preconfigured to trust a certain set of node or CA A node MAY be preconfigured to trust a certain set of node or CA
certificates. However such trust relationships MUST NOT result in certificates. However, such trust relationships MUST NOT result in
unwanted or unrelated trust for nodes not intended to be run inside unwanted or unrelated trust for nodes not intended to be run inside
the same network (e.g., all other devices by the same manufacturer). the same network (e.g., all other devices by the same manufacturer).
8.3.4.3. Trust on Button Press 8.3.4.3. Trust on Button Press
A node MAY provide a physical or virtual interface to put one or more A node MAY provide a physical or virtual interface to put one or more
of its internal network interfaces temporarily into a mode in which of its internal network interfaces temporarily into a mode in which
it trusts the certificate of the first DNCP node it can successfully it trusts the certificate of the first DNCP node it can successfully
establish a connection with. establish a connection with.
8.3.4.4. Trust on First Use 8.3.4.4. Trust on First Use
A node which is not associated with any other DNCP node MAY trust the A node that is not associated with any other DNCP node MAY trust the
certificate of the first DNCP node it can successfully establish a certificate of the first DNCP node it can successfully establish a
connection with. This method MUST NOT be used when the node has connection with. This method MUST NOT be used when the node has
already associated with any other DNCP node. already associated with any other DNCP node.
9. DNCP Profile-Specific Definitions 9. DNCP Profile-Specific Definitions
Each DNCP profile MUST specify the following aspects: Each DNCP profile MUST specify the following aspects:
o Unicast and optionally multicast transport protocol(s) to be used. o Unicast and optionally a multicast transport protocol(s) to be
If multicast-based node and status discovery is desired, a used. If a multicast-based node and status discovery is desired,
datagram-based transport supporting multicast has to be available. a datagram-based transport supporting multicast has to be
available.
o How the chosen transport(s) are secured: Not at all, optionally or o How the chosen transport(s) is secured: Not at all, optionally, or
always with the TLS scheme defined here using one or more of the always with the TLS scheme defined here using one or more of the
methods, or with something else. If the links with DNCP nodes can methods, or with something else. If the links with DNCP nodes can
be sufficiently secured or isolated, it is possible to run DNCP in be sufficiently secured or isolated, it is possible to run DNCP in
a secure manner without using any form of authentication or a secure manner without using any form of authentication or
encryption. encryption.
o Transport protocols' parameters such as port numbers to be used, o Transport protocols' parameters such as port numbers to be used or
or multicast address to be used. Unicast, multicast, and secure multicast addresses to be used. Unicast, multicast, and secure
unicast may each require different parameters, if applicable. unicast may each require different parameters, if applicable.
o When receiving TLVs, what sort of TLVs are ignored in addition - o When receiving TLVs, what sort of TLVs are ignored in addition --
as specified in Section 4.4 - e.g., for security reasons. While as specified in Section 4.4 -- e.g., for security reasons. While
the security of the node data published within the Node State TLVs the security of the node data published within the Node State TLVs
is already ensured by the base specification (if secure mode is is already ensured by the base specification (if secure unicast
enabled, Node State TLVs are sent only via unicast as multicast transport is used, Node State TLVs are sent only via unicast as
ones are ignored on receipt), if a profile adds TLVs that are sent multicast ones are ignored on receipt), if a profile adds TLVs
outside the node data, a profile should indicate whether or not that are sent outside the node data, a profile should indicate
those TLVs should be ignored if they are received via multicast or whether or not those TLVs should be ignored if they are received
non-secured unicast. A DNCP profile may define the following DNCP via multicast or non-secured unicast. A DNCP profile may define
TLVs to be safely ignored: the following DNCP TLVs to be safely ignored:
* Anything received over multicast, except Node Endpoint TLV * Anything received over multicast, except Node Endpoint TLV
(Section 7.2.1) and Network State TLV (Section 7.2.2). (Section 7.2.1) and Network State TLV (Section 7.2.2).
* Any TLVs received over unreliable unicast or multicast at too * Any TLVs received over unreliable unicast or multicast at a
high rate; Trickle will ensure eventual convergence given the rate that is that is too high; Trickle will ensure eventual
rate slows down at some point. convergence given the rate slows down at some point.
o How to deal with node identifier collision as described in o How to deal with node identifier collision as described in
Section 4.4. Main options are either for one or both nodes to Section 4.4. Main options are either for one or both nodes to
assign new node identifiers to themselves, or to notify someone assign new node identifiers to themselves or to notify someone
about a fatal error condition in the DNCP network. about a fatal error condition in the DNCP network.
o Imin, Imax and k ranges to be suggested for implementations to be o Imin, Imax, and k ranges to be suggested for implementations to be
used in the Trickle algorithm. The Trickle algorithm does not used in the Trickle algorithm. The Trickle algorithm does not
require these to be the same across all implementations for it to require these to be the same across all implementations for it to
work, but similar orders of magnitude helps implementations of a work, but similar orders of magnitude help implementations of a
DNCP profile to behave more consistently and to facilitate DNCP profile to behave more consistently and to facilitate
estimation of lower and upper bounds for convergence behavior of estimation of lower and upper bounds for convergence behavior of
the network. the network.
o Hash function H(x) to be used, and how many bits of the output are o Hash function H(x) to be used, and how many bits of the output are
actually used. The chosen hash function is used to handle both actually used. The chosen hash function is used to handle both
hashing of node data, and to produce network state hash, which is hashing of node data and producing network state hash, which is a
a hash of node data hashes. SHA-256 defined in [RFC6234] is the hash of node data hashes. SHA-256 defined in [RFC6234] is the
recommended default choice, but a non-cryptographic hash function recommended default choice, but a non-cryptographic hash function
could be used as well. If there is a hash collision in the could be used as well. If there is a hash collision in the
network state hash, the network will effectively be partitioned to network state hash, the network will effectively be partitioned to
partitions that believe that they are up to date, but actually no partitions that believe they are up to date but are actually no
longer converged. The network will converge either when some node longer converged. The network will converge either when some node
data anywhere in the network changes, or when conflicting Node data anywhere in the network changes or when conflicting Node
State TLVs get transmitted across the partition (either caused by State TLVs get transmitted across the partition (either caused by
Trickle-Driven Status Updates (Section 4.3) or as part of the "Trickle-Driven Status Updates" (Section 4.3) or as part of the
Processing of Received TLVs (Section 4.4)). If a node publishes "Processing of Received TLVs" (Section 4.4)). If a node publishes
node data with a hash that collides with any previously published node data with a hash that collides with any previously published
node data, the update may not be (fully) propagated and the old node data, the update may not be (fully) propagated, and the old
version of node data may be used instead. version of node data may be used instead.
o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier
(in bytes). (in bytes).
o Whether to send keep-alives, and if so, whether per-endpoint o Whether to send keep-alives, and if so, whether it is per-endpoint
(requires multicast transport), or per-peer. Keep-alive has also (requires multicast transport) or per-peer. Keep-alive also has
associated parameters: associated parameters:
* DNCP_KEEPALIVE_INTERVAL: How often keep-alives are to be sent * DNCP_KEEPALIVE_INTERVAL: How often keep-alives are to be sent
by default (if enabled). by default (if enabled).
* DNCP_KEEPALIVE_MULTIPLIER: How many times the * DNCP_KEEPALIVE_MULTIPLIER: How many times the
DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval
value) a node may not be heard from to be considered still value) node may not be heard from to be considered still valid.
valid. This is just a default used in absence of any other This is just a default used in absence of any other
configuration information, or particular per-endpoint configuration information or particular per-endpoint
configuration. configuration.
o Whether to support dense multicast-enabled link optimization o Whether to support dense multicast-enabled link optimization
(Section 6.2) or not. (Section 6.2) or not.
For some guidance on choosing transport and security options, please For some guidance on choosing transport and security options, please
see Appendix B. see Appendix B.
10. Security Considerations 10. Security Considerations
DNCP-based protocols may use multicast to indicate DNCP state changes DNCP-based protocols may use multicast to indicate DNCP state changes
and for keep-alive purposes. However, no actual published data TLVs and for keep-alive purposes. However, no actual published data TLVs
will be sent across that channel. Therefore an attacker may only will be sent across that channel. Therefore, an attacker may only
learn hash values of the state within DNCP and may be able to trigger learn hash values of the state within DNCP and may be able to trigger
unicast synchronization attempts between nodes on a local link this unicast synchronization attempts between nodes on a local link this
way. A DNCP node MUST therefore rate-limit its reactions to way. A DNCP node MUST therefore rate limit its reactions to
multicast packets. multicast packets.
When using DNCP to bootstrap a network, PKI based solutions may have When using DNCP to bootstrap a network, PKI-based solutions may have
issues when validating certificates due to potentially unavailable issues when validating certificates due to potentially unavailable
accurate time, or due to inability to use the network to either check accurate time or due to the inability to use the network to either
Certificate Revocation Lists or perform on-line validation. check Certificate Revocation Lists or perform online validation.
The Certificate-based trust consensus mechanism defined in this The Certificate-based trust consensus mechanism defined in this
document allows for a consenting revocation, however in case of a document allows for a consenting revocation; however, in case of a
compromised device the trust cache may be poisoned before the actual compromised device, the trust cache may be poisoned before the actual
revocation happens allowing the distrusted device to rejoin the revocation happens allowing the distrusted device to rejoin the
network using a different identity. Stopping such an attack might network using a different identity. Stopping such an attack might
require physical intervention and flushing of the trust caches. require physical intervention and flushing of the trust caches.
11. IANA Considerations 11. IANA Considerations
IANA should set up a registry for the (decimal 16-bit) "DNCP TLV IANA has set up a registry for the (decimal 16-bit) "DNCP TLV Types"
Types" under "Distributed Node Consensus Protocol (DNCP)", with the under "Distributed Node Consensus Protocol (DNCP)". The registration
following initial contents: ([RFC Editor: please remove] ideally as procedure is Standards Action [RFC5226]. The initial contents are:
http://www.iana.org/assignments/dncp-registry)
0: Reserved 0: Reserved
1: Request network state 1: Request network state
2: Request node state 2: Request node state
3: Node endpoint 3: Node endpoint
4: Network state 4: Network state
5: Node state 5: Node state
6: Reserved (was: Custom) 6: Reserved for future use (was: Custom)
7: Reserved (was: Fragment count) 7: Reserved for future use (was: Fragment count)
8: Peer 8: Peer
9: Keep-alive interval 9: Keep-alive interval
10: Trust-Verdict 10: Trust-Verdict
11-31: Free - policy of standards action [RFC5226] should be used 11-31: Unassigned
32-511: Reserved for per-DNCP profile use 32-511: Reserved for per-DNCP profile use
512-767: Free - policy of standards action [RFC5226] should be 512-767: Unassigned
used
768-1023: Private use [RFC5226] 768-1023: Reserved for Private Use [RFC5226]
1024-65535: Reserved for future protocol evolution (for example, 1024-65535: Reserved for future use
DNCP version 2)
12. References 12. References
12.1. Normative references 12.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ Requirement Levels", BCP 14, RFC 2119,
RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>. <http://www.rfc-editor.org/info/rfc2119>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226,
DOI 10.17487/RFC5226, May 2008,
<http://www.rfc-editor.org/info/rfc5226>.
[RFC6206] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko, [RFC6206] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko,
"The Trickle Algorithm", RFC 6206, DOI 10.17487/RFC6206, "The Trickle Algorithm", RFC 6206, DOI 10.17487/RFC6206,
March 2011, <http://www.rfc-editor.org/info/rfc6206>. March 2011, <http://www.rfc-editor.org/info/rfc6206>.
[RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms
(SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI (SHA and SHA-based HMAC and HKDF)", RFC 6234,
10.17487/RFC6234, May 2011, DOI 10.17487/RFC6234, May 2011,
<http://www.rfc-editor.org/info/rfc6234>. <http://www.rfc-editor.org/info/rfc6234>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 12.2. Informative References
IANA Considerations Section in RFCs", BCP 26, RFC 5226,
DOI 10.17487/RFC5226, May 2008,
<http://www.rfc-editor.org/info/rfc5226>.
12.2. Informative references
[RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W.
Stevens, "Basic Socket Interface Extensions for IPv6", RFC
3493, DOI 10.17487/RFC3493, February 2003,
<http://www.rfc-editor.org/info/rfc3493>.
[RFC3315] Droms, R., Ed., Bound, J., Volz, B., Lemon, T., Perkins, [RFC3315] Droms, R., Ed., Bound, J., Volz, B., Lemon, T., Perkins,
C., and M. Carney, "Dynamic Host Configuration Protocol C., and M. Carney, "Dynamic Host Configuration Protocol
for IPv6 (DHCPv6)", RFC 3315, DOI 10.17487/RFC3315, July for IPv6 (DHCPv6)", RFC 3315, DOI 10.17487/RFC3315, July
2003, <http://www.rfc-editor.org/info/rfc3315>. 2003, <http://www.rfc-editor.org/info/rfc3315>.
[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W.
Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, Stevens, "Basic Socket Interface Extensions for IPv6",
January 2012, <http://www.rfc-editor.org/info/rfc6347>. RFC 3493, DOI 10.17487/RFC3493, February 2003,
<http://www.rfc-editor.org/info/rfc3493>.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ (TLS) Protocol Version 1.2", RFC 5246,
RFC5246, August 2008, DOI 10.17487/RFC5246, August 2008,
<http://www.rfc-editor.org/info/rfc5246>. <http://www.rfc-editor.org/info/rfc5246>.
[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
January 2012, <http://www.rfc-editor.org/info/rfc6347>.
[RFC7435] Dukhovni, V., "Opportunistic Security: Some Protection [RFC7435] Dukhovni, V., "Opportunistic Security: Some Protection
Most of the Time", RFC 7435, DOI 10.17487/RFC7435, Most of the Time", RFC 7435, DOI 10.17487/RFC7435,
December 2014, <http://www.rfc-editor.org/info/rfc7435>. December 2014, <http://www.rfc-editor.org/info/rfc7435>.
[I-D.ietf-homenet-prefix-assignment] [RFC7596] Cui, Y., Sun, Q., Boucadair, M., Tsou, T., Lee, Y., and I.
Pfister, P., Paterson, B., and J. Arkko, "Distributed Farrer, "Lightweight 4over6: An Extension to the Dual-
Prefix Assignment Algorithm", draft-ietf-homenet-prefix- Stack Lite Architecture", RFC 7596, DOI 10.17487/RFC7596,
assignment-08 (work in progress), August 2015. July 2015, <http://www.rfc-editor.org/info/rfc7596>.
Appendix A. Alternative Modes of Operation Appendix A. Alternative Modes of Operation
Beyond what is described in the main text, the protocol allows for Beyond what is described in the main text, the protocol allows for
other uses. These are provided as examples. other uses. These are provided as examples.
A.1. Read-only Operation A.1. Read-Only Operation
If a node uses just a single endpoint and does not need to publish If a node uses just a single endpoint and does not need to publish
any TLVs, full DNCP node functionality is not required. Such limited any TLVs, full DNCP node functionality is not required. Such a
node can acquire and maintain view of the TLV space by implementing limited node can acquire and maintain a view of the TLV space by
the processing logic as specified in Section 4.4. Such node would implementing the processing logic as specified in Section 4.4. Such
not need Trickle, peer-maintenance or even keep-alives at all, as the node would not need Trickle, peer-maintenance, or even keep-alives at
DNCP nodes' use of it would guarantee eventual receipt of network all, as the DNCP nodes' use of it would guarantee eventual receipt of
state hashes, and synchronization of node data, even in presence of network state hashes, and synchronization of node data, even in the
unreliable transport. presence of unreliable transport.
A.2. Forwarding Operation A.2. Forwarding Operation
If a node with a pair of endpoints does not need to publish any TLVs, If a node with a pair of endpoints does not need to publish any TLVs,
it can detect (for example) nodes with the highest node identifier on it can detect (for example) nodes with the highest node identifier on
each of the endpoints (if any). Any TLVs received from one of them each of the endpoints (if any). Any TLVs received from one of them
would be forwarded verbatim as unicast to the other node with highest would be forwarded verbatim as unicast to the other node with the
node identifier. highest node identifier.
Any tinkering with the TLVs would remove guarantees of this scheme Any tinkering with the TLVs would remove guarantees of this scheme
working; however passive monitoring would obviously be fine. This working; however, passive monitoring would obviously be fine. This
type of simple forwarding cannot be chained, as it does not send type of simple forwarding cannot be chained, as it does not send
anything proactively. anything proactively.
Appendix B. DNCP Profile Additional Guidance Appendix B. DNCP Profile Additional Guidance
This appendix explains implications of design choices made when This appendix explains implications of design choices made when
specifying DNCP profile to use particular transport or security specifying the DNCP profile to use particular transport or security
options. options.
B.1. Unicast Transport - UDP or TCP? B.1. Unicast Transport -- UDP or TCP?
The node data published by a DNCP node is limited to 64KB due to the The node data published by a DNCP node is limited to 64 KB due to the
16-bit size of the length field of the TLV it is published within. 16-bit size of the length field of the TLV it is published within.
Some transport choices may decrease this limit; if using e.g. UDP Some transport choices may decrease this limit; if using, e.g., UDP
datagrams for unicast transport the upper bound of node data size is datagrams for unicast transport, the upper bound of the node data
whatever the nodes and the underlying network can pass to each other size is whatever the nodes and the underlying network can pass to
as DNCP does not define its own fragmentation scheme. A profile each other as DNCP does not define its own fragmentation scheme. A
which chooses UDP has to be limited to small node data (e.g. somewhat profile that chooses UDP has to be limited to small node data (e.g.,
smaller than IPv6 default MTU if using IPv6), or specify a minimum somewhat smaller than IPv6 default MTU if using IPv6) or specify a
which all nodes have to support. Even then, if using non-link-local minimum that all nodes have to support. Even then, if using
communications, there is some concern about what middleboxes do to non-link-local communications, there is some concern about what
fragmented packets. Therefore, the use of stream transport such as middleboxes do to fragmented packets. Therefore, the use of stream
TCP is probably a good idea if either non-link-local communication is transport such as TCP is probably a good idea if either
desired, or fragmentation is expected to cause problems. non-link-local communication is desired or fragmentation is expected
to cause problems.
TCP also provides some other facilities, such as a relatively long TCP also provides some other facilities, such as a relatively long
built-in keep-alive which in conjunction with connection closes built-in keep-alive, which in conjunction with connection closes
occurring from eventual failed retransmissions may be sufficient to occurring from eventual failed retransmissions may be sufficient to
avoid the use of in-protocol keep-alive defined in Section 6.1. avoid the use of in-protocol keep-alive defined in Section 6.1.
Additionally it is reliable, so there is no need for Trickle on such Additionally, it is reliable, so there is no need for Trickle on such
unicast connections. unicast connections.
The major downside of using TCP instead of UDP with DNCP-based The major downside of using TCP instead of UDP with DNCP-based
profiles lies in the loss of control over the time at which TLVs are profiles lies in the loss of control over the time at which TLVs are
received; while unreliable UDP datagrams also have some delay, TLVs received; while unreliable UDP datagrams also have some delay, TLVs
within reliable stream transport may be delayed significantly due to within reliable stream transport may be delayed significantly due to
retransmissions. This is not a problem if no relative time dependent retransmissions. This is not a problem if no relative time-dependent
information is stored within the TLVs in the DNCP-based protocol; for information is stored within the TLVs in the DNCP-based protocol; for
such a protocol, TCP is a reasonable choice for unicast transport if such a protocol, TCP is a reasonable choice for unicast transport if
it is available. it is available.
B.2. (Optional) Multicast Transport B.2. (Optional) Multicast Transport
Multicast is needed for dynamic peer discovery and to trigger unicast Multicast is needed for dynamic peer discovery and to trigger unicast
exchanges; for that, unreliable datagram transport (=typically UDP) exchanges; for that, unreliable datagram transport (=typically UDP)
is the only transport option defined within this specification, is the only transport option defined within this specification,
although DNCP-based protocols may themselves define some other although DNCP-based protocols may themselves define some other
transport or peer discovery mechanism (e.g. based on mDNS or DNS). transport or peer discovery mechanism (e.g., based on Multicast DNS
(mDNS) or DNS).
If multicast is used, a well-known address should be specified, and If multicast is used, a well-known address should be specified and
for e.g. IPv6 respectively the desired address scopes. In most for, e.g., IPv6, respectively, the desired address scopes. In most
cases link-local and possibly site-local are useful scopes. cases, link-local and possibly site-local are useful scopes.
B.3. (Optional) Transport Security B.3. (Optional) Transport Security
In terms of provided security, DTLS and TLS are equivalent; they also In terms of provided security, DTLS and TLS are equivalent; they also
consume similar amount of state on the devices. While TLS is on top consume a similar amount of state on the devices. While TLS is on
of a stream protocol, using DTLS also requires relatively long top of a stream protocol, using DTLS also requires relatively long
session caching within the DTLS layer to avoid expensive re- session caching within the DTLS layer to avoid expensive
authentication/authorization steps if and when any state within the reauthentication/authorization steps if and when any state within the
DNCP network changes or per-peer keep-alive (if enabled) is sent. DNCP network changes or per-peer keep-alive (if enabled) is sent.
TLS implementations (at the time of the writing of the specification) TLS implementations (at the time of writing the specification) seem
seem more mature and available (as open source) than DTLS ones. This more mature and available (as open source) than DTLS ones. This may
may be due to a long history of use with HTTPS. be due to a long history of use with HTTPS.
Some libraries seem not to support multiplexing between insecure and Some libraries seem not to support multiplexing between insecure and
secure communication on the same port, so specifying distinct ports secure communication on the same port, so specifying distinct ports
for secured and unsecured communication may be beneficial. for secured and unsecured communication may be beneficial.
Appendix C. Example Profile Appendix C. Example Profile
This is the DNCP profile of SHSP, an experimental (and for the This is the DNCP profile of SHSP, an experimental (and for the
purposes of this document fictional) home automation protocol. The purposes of this document fictional) home automation protocol. The
protocol itself is used to make key-value store published by each of protocol itself is used to make a key-value store published by each
the nodes available to all other nodes for distributed monitoring and of the nodes available to all other nodes for distributed monitoring
control of a home infrastructure. It defines only one additional TLV and control of a home infrastructure. It defines only one additional
type: a key=value TLV which contains a single key=value assignment TLV type: a key=value TLV that contains a single key=value assignment
for publication. for publication.
o Unicast transport: IPv6 TCP on port EXAMPLE-P1 since only absolute o Unicast transport: IPv6 TCP on port EXAMPLE-P1 since only absolute
timestamps are used within the key=value data and since it focuses timestamps are used within the key=value data and since it focuses
primarily on Linux-based nodes which support both protocols well. primarily on Linux-based nodes that support both protocols as
Connections from and to non-link-local addresses are ignored to well. Connections from and to non-link-local addresses are
avoid exposing this protocol outside the secure links. ignored to avoid exposing this protocol outside the secure links.
o Multicast transport: IPv6 UDP on port EXAMPLE-P2 to link-local o Multicast transport: IPv6 UDP on port EXAMPLE-P2 to link-local
scoped multicast address ff02:EXAMPLE. At least one node per link scoped multicast address ff02:EXAMPLE. At least one node per link
in the home is assumed to facilitate node discovery without in the home is assumed to facilitate node discovery without
depending on any other infrastructure. depending on any other infrastructure.
o Security: None. It is to be used only on trusted links (WPA2-x o Security: None. It is to be used only on trusted links (WPA2-x
wireless, physically secure wired links). wireless, physically secure wired links).
o Additional TLVs to be ignored: None. No DNCP security is o Additional TLVs to be ignored: None. No DNCP security is
specified, and no new TLVs are defined outside of node data. specified, and no new TLVs are defined outside of node data.
o Node identifier length (DNCP_NODE_IDENTIFIER_LENGTH): 32 bits that o Node identifier length (DNCP_NODE_IDENTIFIER_LENGTH): 32 bits that
are randomly generated. are randomly generated.
o Node identifier collision handling: Pick new random node o Node identifier collision handling: Pick new random node
identifier. identifier.
o Trickle parameters: Imin = 200ms, Imax = 7, k = 1. It means at o Trickle parameters: Imin = 200 ms, Imax = 7, k = 1. It means at
least one multicast per link in 25 seconds in stable state (0.2 * least one multicast per link in 25 seconds in stable state (0.2 *
2^7). 2^7).
o Hash function H(x) + length: SHA-256, only 128 bits used. o Hash function H(x) + length: SHA-256, only 128 bits used. It's
Relatively fast, and 128 bits should be plenty to prevent random relatively fast, and 128 bits should be plenty to prevent random
conflicts (64 bits would most likely be sufficient, too). conflicts (64 bits would most likely be sufficient, too).
o No in-protocol keep-alives (Section 6.1); TCP keep-alive is to be o No in-protocol keep-alives (Section 6.1); TCP keep-alive is to be
used. In practice TCP keep-alive is seldom encountered anyway as used. In practice, TCP keep-alive is seldom encountered anyway,
changes in network state cause packets to be sent on the unicast as changes in network state cause packets to be sent on the
connections, and those that fail sufficiently many retransmissions unicast connections, and those that fail sufficiently many
are dropped much before keep-alive actually would fire. retransmissions are dropped much before the keep-alive actually
would fire.
o No support for dense multicast-enabled link optimization o No support for dense multicast-enabled link optimization
(Section 6.2); SHSP is a simple protocol for few nodes (network- (Section 6.2); SHSP is a simple protocol for a few nodes (network
wide, not even to mention on a single link), and therefore would wide, not even to mention on a single link) and therefore would
not provide any benefit. not provide any benefit.
Appendix D. Some Questions and Answers [RFC Editor: please remove] Acknowledgements
Q: 32-bit endpoint id?
A: Here, it would save 32 bits per peer if it was 16 bits (and less
is not realistic). However, TLVs defined elsewhere would not seem to
even gain that much on average. 32 bits is also used for ifindex in
various operating systems, making for simpler implementation.
Q: Why have topology information at all?
A: It is an alternative to the more traditional seq#/TTL-based
flooding schemes. In steady state, there is no need to, e.g., re-
publish every now and then.
Appendix E. Changelog [RFC Editor: please remove]
draft-ietf-homenet-dncp-10:
o Added profile guidance section, as well as example profile.
draft-ietf-homenet-dncp-09:
o Reserved 1024+ TLV types for future versions (=versioning
mechanism); private use section moved from 192-255 to 512-767.
o Added applicability statement and clarified some text based on
reviews.
draft-ietf-homenet-dncp-08:
o Removed fragmentation as it is somewhat underspecified and
unimplemented. It may be specified in some future extension draft
or new version of DNCP.
o Added generic sub-TLV extensibility mechanism.
draft-ietf-homenet-dncp-06:
o Removed custom TLV.
o Made keep-alive multipliers local implementation choice, profiles
just provide guidance on sane default value.
o Removed the DNCP_GRACE_INTERVAL as it is really implementation
choice.
o Simplified the suggested structures in data model.
o Reorganized the document and provided an overview section.
draft-ietf-homenet-dncp-04:
o Added mandatory rate limiting for network state requests, and
optional slightly faster convergence mechanism by including
current local network state in the remote network state requests.
draft-ietf-homenet-dncp-03:
o Renamed connection -> endpoint.
o !!! Backwards incompatible change: Renumbered TLVs, and got rid of
node data TLV; instead, node data TLV's contents are optionally
within node state TLV.
draft-ietf-homenet-dncp-02:
o Changed DNCP "messages" into series of TLV streams, allowing
optimized round-trip saving synchronization.
o Added fragmentation support for bigger node data and for chunking
in absence of reliable L2 and L3 fragmentation.
draft-ietf-homenet-dncp-01:
o Fixed keep-alive semantics to consider unicast requests also
updates of most recently consistent, and added proactive unicast
request to ensure even inconsistent keep-alive messages eventually
triggering consistency timestamp update.
o Facilitated (simple) read-only clients by making Node Connection
TLV optional if just using DNCP for read-only purposes.
o Added text describing how to deal with "dense" networks, but left
actual numbers and mechanics up to DNCP profiles and (local)
configurations.
draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf-
homenet-hncp-03 generic parts. Changes that affect implementations:
o TLVs were renumbered.
o TLV length does not include header (=-4). This facilitates, e.g.,
use of DHCPv6 option parsing libraries (same encoding), and
reduces complexity (no need to handle error values of length less
than 4).
o Trickle is reset only when locally calculated network state hash
is changes, not as remote different network state hash is seen.
This prevents, e.g., attacks by multicast with one multicast
packet to force Trickle reset on every interface of every node on
a link.
o Instead of 'ping', use 'keep-alive' (optional) for dead peer
detection. Different message used!
Appendix F. Draft Source [RFC Editor: please remove]
As usual, this draft is available at https://github.com/fingon/ietf-
drafts/ in source format (with nice Makefile too). Feel free to send
comments and/or pull requests if and when you have changes to it!
Appendix G. Acknowledgements
Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley, Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley,
Juliusz Chroboczek, Jiazi Yi, Mikael Abrahamsson, Brian Carpenter, Juliusz Chroboczek, Jiazi Yi, Mikael Abrahamsson, Brian Carpenter,
Thomas Clausen, DENG Hui and Margaret Cullen for their contributions Thomas Clausen, DENG Hui, and Margaret Cullen for their contributions
to the draft. to the document.
Thanks to Kaiwen Jin and Xavier Bonnetain for their related research Thanks to Kaiwen Jin and Xavier Bonnetain for their related research
work. work.
Authors' Addresses Authors' Addresses
Markus Stenberg Markus Stenberg
Independent Independent
Helsinki 00930 Helsinki 00930
Finland Finland
 End of changes. 245 change blocks. 
629 lines changed or deleted 528 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/