draft-ietf-homenet-dncp-05.txt   draft-ietf-homenet-dncp-06.txt 
Homenet Working Group M. Stenberg Homenet Working Group M. Stenberg
Internet-Draft Internet-Draft
Intended status: Standards Track S. Barth Intended status: Standards Track S. Barth
Expires: December 5, 2015 Expires: December 22, 2015
June 3, 2015 June 20, 2015
Distributed Node Consensus Protocol Distributed Node Consensus Protocol
draft-ietf-homenet-dncp-05 draft-ietf-homenet-dncp-06
Abstract Abstract
This document describes the Distributed Node Consensus Protocol This document describes the Distributed Node Consensus Protocol
(DNCP), a generic state synchronization protocol which uses Trickle (DNCP), a generic state synchronization protocol which uses Trickle
and Merkle trees. DNCP is transport agnostic and leaves some of the and Merkle trees. DNCP leaves some details unspecified or provides
details to be specified in profiles, which define actual alternative options. Therefore, only profiles which specify those
implementable DNCP based protocols. missing parts define actual implementable DNCP based protocols.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 5, 2015. This Internet-Draft will expire on December 22, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2015 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
2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1. Requirements Language . . . . . . . . . . . . . . . . . . 5
4. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.1. Trickle-Driven Status Updates . . . . . . . . . . . . . . 7 4.1. Merkle Tree . . . . . . . . . . . . . . . . . . . . . . . 6
5.2. Processing of Received TLVs . . . . . . . . . . . . . . . 8 4.2. Data Transport . . . . . . . . . . . . . . . . . . . . . 7
5.3. Adding and Removing Peers . . . . . . . . . . . . . . . . 9 4.3. Trickle-Driven Status Updates . . . . . . . . . . . . . . 8
5.4. Purging Unreachable Nodes . . . . . . . . . . . . . . . . 10 4.4. Processing of Received TLVs . . . . . . . . . . . . . . . 9
6. Optional Extensions . . . . . . . . . . . . . . . . . . . . . 11 4.5. Adding and Removing Peers . . . . . . . . . . . . . . . . 11
6.1. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . 11 4.6. Data Liveliness Validation . . . . . . . . . . . . . . . 11
6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 11 5. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.1.2. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . 12 6. Optional Extensions . . . . . . . . . . . . . . . . . . . . . 13
6.1.3. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . 12 6.1. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . 13
6.1.4. Received TLV Processing Additions . . . . . . . . . . 12 6.1.1. Data Model Additions . . . . . . . . . . . . . . . . 14
6.1.5. Neighbor Removal . . . . . . . . . . . . . . . . . . 12 6.1.2. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . 14
6.2. Support For Dense Broadcast Links . . . . . . . . . . . . 12 6.1.3. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . 14
6.3. Node Data Fragmentation . . . . . . . . . . . . . . . . . 13 6.1.4. Received TLV Processing Additions . . . . . . . . . . 15
7. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 14 6.1.5. Neighbor Removal . . . . . . . . . . . . . . . . . . 15
7.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 14 6.2. Support For Dense Broadcast Links . . . . . . . . . . . . 15
7.1.1. Request Network State TLV . . . . . . . . . . . . . . 14 6.3. Node Data Fragmentation . . . . . . . . . . . . . . . . . 16
7.1.2. Request Node State TLV . . . . . . . . . . . . . . . 14 7. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . 17
7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 15 7.1. Request TLVs . . . . . . . . . . . . . . . . . . . . . . 17
7.2.1. Node Endpoint TLV . . . . . . . . . . . . . . . . . . 15 7.1.1. Request Network State TLV . . . . . . . . . . . . . . 17
7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 15 7.1.2. Request Node State TLV . . . . . . . . . . . . . . . 18
7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 16 7.2. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . 18
7.2.4. Custom TLV . . . . . . . . . . . . . . . . . . . . . 17 7.2.1. Node Endpoint TLV . . . . . . . . . . . . . . . . . . 18
7.3. Data TLVs within Node State TLV . . . . . . . . . . . . . 17 7.2.2. Network State TLV . . . . . . . . . . . . . . . . . . 18
7.3.1. Fragment Count TLV . . . . . . . . . . . . . . . . . 17 7.2.3. Node State TLV . . . . . . . . . . . . . . . . . . . 19
7.3.2. Neighbor TLV . . . . . . . . . . . . . . . . . . . . 18 7.3. Data TLVs within Node State TLV . . . . . . . . . . . . . 20
7.3.3. Keep-Alive Interval TLV . . . . . . . . . . . . . . . 18 7.3.1. Fragment Count TLV . . . . . . . . . . . . . . . . . 20
8. Security and Trust Management . . . . . . . . . . . . . . . . 19 7.3.2. Neighbor TLV . . . . . . . . . . . . . . . . . . . . 20
8.1. Pre-Shared Key Based Trust Method . . . . . . . . . . . . 19 7.3.3. Keep-Alive Interval TLV . . . . . . . . . . . . . . . 21
8.2. PKI Based Trust Method . . . . . . . . . . . . . . . . . 19 8. Security and Trust Management . . . . . . . . . . . . . . . . 22
8.3. Certificate Based Trust Consensus Method . . . . . . . . 19 8.1. Pre-Shared Key Based Trust Method . . . . . . . . . . . . 22
8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 20 8.2. PKI Based Trust Method . . . . . . . . . . . . . . . . . 22
8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 21 8.3. Certificate Based Trust Consensus Method . . . . . . . . 22
8.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 21 8.3.1. Trust Verdicts . . . . . . . . . . . . . . . . . . . 23
8.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 22 8.3.2. Trust Cache . . . . . . . . . . . . . . . . . . . . . 24
9. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 23 8.3.3. Announcement of Verdicts . . . . . . . . . . . . . . 24
10. Security Considerations . . . . . . . . . . . . . . . . . . . 24 8.3.4. Bootstrap Ceremonies . . . . . . . . . . . . . . . . 25
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 9. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . 26
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 10. Security Considerations . . . . . . . . . . . . . . . . . . . 28
12.1. Normative references . . . . . . . . . . . . . . . . . . 26 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 28
12.2. Informative references . . . . . . . . . . . . . . . . . 26 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 29
12.1. Normative references . . . . . . . . . . . . . . . . . . 29
12.2. Informative references . . . . . . . . . . . . . . . . . 29
Appendix A. Some Questions and Answers [RFC Editor: please Appendix A. Some Questions and Answers [RFC Editor: please
remove] . . . . . . . . . . . . . . . . . . . . . . 26 remove] . . . . . . . . . . . . . . . . . . . . . . 29
Appendix B. Changelog [RFC Editor: please remove] . . . . . . . 26 Appendix B. Changelog [RFC Editor: please remove] . . . . . . . 30
Appendix C. Draft Source [RFC Editor: please remove] . . . . . . 28 Appendix C. Draft Source [RFC Editor: please remove] . . . . . . 31
Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 28 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 31
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31
1. Introduction 1. Introduction
DNCP is designed to provide a way for nodes to publish data DNCP is designed to provide a way for each participating node to
consisting of an ordered set of TLV (Type-Length-Value) tuples and to publish a set of TLV (Type-Length-Value) tuples, and to provide a
receive the data published by all other reachable DNCP nodes. shared and common view about the data published by every currently or
recently bidirectionally reachable DNCP node in a network.
DNCP validates the set of data within it by ensuring that it is
reachable via nodes that are currently accounted for; therefore,
unlike Time-To-Live (TTL) based solutions, it does not require
periodic re-publishing of the data by the nodes. On the other hand,
it does require the topology to be visible to every node that wants
to be able to identify unreachable nodes and therefore remove old,
stale data. Another notable feature is the use of Trickle to send
status updates as it makes the DNCP network very thrifty when there
are no updates. DNCP is most suitable for data that changes only
gradually to gain the maximum benefit from using Trickle, and if more
rapid state exchanges are needed, something point-to-point is
recommended and just e.g. publishing of addresses of the services
within DNCP.
DNCP has relatively few requirements for the underlying transport; it For state synchronization a Merkle tree is used. It is formed by
requires some way of transmitting either unicast datagram or stream first calculating a hash for the dataset, called node data, published
data to a peer and, if used in multicast mode, a way of sending by each node, and then calculating another hash over those node data
multicast datagrams. If security is desired and one of the built-in hashes. The single resulting hash, called network state hash, is
security methods is to be used, support for some TLS-derived transmitted using the Trickle algorithm [RFC6206] to ensure that all
transport scheme - such as TLS [RFC5246] on top of TCP or DTLS nodes share the same view of the current state of the published data
[RFC6347] on top of UDP - is also required. within the network. The use of Trickle with only short network state
hashes sent infrequently (in steady state) makes DNCP very thrifty
when updates happen rarely.
2. Requirements Language For maintaining liveliness of the topology and the data within it, a
combination of Trickled network state, keep-alives, and "other" means
of ensuring reachability are used. The core idea is that if every
node ensures its neighbors are present, transitively, the whole
network state also stays up-to-date.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", DNCP is most suitable for data that changes only infrequently to gain
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this the maximum benefit from using Trickle. As the network of nodes, or
document are to be interpreted as described in RFC 2119 [RFC2119]. the rate of data changes grows over a given time interval, Trickle is
eventually used less and less and the benefit of using DNCP
diminishes. In these cases Trickle just provides extra complexity
within the specification and little added value. If constant rapid
state changes are needed, the preferable choice is to use an
additional point-to-point channel whose address or locator is
published using DNCP.
3. Terminology 2. Terminology
DNCP profile a definition of the set of rules and values listed DNCP profile a definition of the set of rules and values listed
in Section 9 specifying the behavior of a DNCP in Section 9 specifying the behavior of a DNCP
based protocol, such as the used transport method. based protocol, such as the transport method in
use. In this document, any DNCP profile specific
For readability, any DNCP profile specific parameter with a profile-specific fixed value is
parameters with a profile-specific fixed value are
prefixed with DNCP_. prefixed with DNCP_.
DNCP node a single node which runs a protocol based on a DNCP DNCP node a single node which runs a protocol based on a DNCP
profile. profile.
DNCP network a set of DNCP nodes running the same DNCP profile Link a link-layer media over which directly connected
that can reach each other, either via discovered nodes can communicate.
connectivity in the underlying network, or using DNCP network a set of DNCP nodes running the same DNCP profile.
each other's addresses learned via other means. As The set consists of nodes that have discovered each
DNCP exchanges are bidirectional, DNCP nodes other using the transport method defined in the
connected via only unidirectional links are not DNCP profile, via multicast on local links, and/or
considered connected. by using unicast communication.
DNCP message an abstract concept - when using a reliable stream
transport, the whole stream of TLVs can be
considered a single message, with new TLVs becoming
one by one available once they have been fully
received. On a datagram transport, each individual
datagram is considered a separate message.
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 which uniquely
identifies a DNCP node within a DNCP network. identifies a DNCP node within a DNCP network.
Link a link-layer media over which directly connected Interface a node's attachment to a particular link.
nodes can communicate.
Interface a port of a node that is connected to a particular
link.
Endpoint a locally configured use of DNCP on a DNCP node. It Endpoint a locally configured communication endpoint of a
is attached either to an interface, a specific DNCP node, such as a network socket. It is either
remote unicast address to be contacted, or a range bound to an Interface for multicast and unicast
of remote unicast addresses that are allowed to communication, or configured for explicit unicast
contact. communication with a predefined set of remote
addresses. Endpoints are usually in one of the
transport modes specified in Section 4.2.
Endpoint a 32-bit opaque value, which identifies a Endpoint a 32-bit opaque value, which identifies a
identifier particular endpoint of that particular DNCP node. identifier particular endpoint of a particular DNCP node. The
The value 0 is reserved for DNCP and sub-protocol value 0 is reserved for DNCP and DNCP profile
purposes and MUST NOT be used to identify an actual purposes and not used to identify an actual
endpoint. This definition is in sync with the endpoint. This definition is in sync with the
interface index definition in [RFC3493], as the interface index definition in [RFC3493], as the
non-zero small positive integers should comfortably non-zero small positive integers should comfortably
fit within 32 bits. fit within 32 bits.
Peer another DNCP node with which a DNCP node Peer another DNCP node with which a DNCP node
communicates directly using a particular local and communicates using a particular local and remote
remote endpoint pair. endpoint pair.
Node data a set of TLVs published by a node in the DNCP Node data a set of TLVs published and owned by a node in the
network. The whole node data is owned by the node DNCP network. Other nodes pass it along as-is, even
that publishes it, and it MUST be passed along as- if they cannot fully interpret it.
is, including TLVs unknown to the forwarder.
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 and a timestamp indicating the value for comparing equality of stored node data,
time passed since its last publication. The hash and a timestamp indicating the time passed since
function and the number of bits used are defined in its last publication. The hash function and the
the DNCP profile. length of the hash value are defined in the DNCP
profile.
Network state a hash value which represents the current state of Network state a hash value which represents the current state of
hash the network. The hash function and the number of hash the network. The hash function and the length of
bits used 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. It is calculated over each reachable nodes' well. For calculation, please see Section 4.1.
update number concatenated with the hash value of
its node data. For calculation these tuples are
sorted in ascending order of the respective node's
node identifier.
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.
Neighbor 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.
4. Data Model 2.1. Requirements Language
A DNCP node has:
o A timestamp indicating the most recent neighbor graph traversal The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
described in Section 5.4. "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in RFC
2119 [RFC2119].
o A data structure containing data about the most recently sent 3. Overview
Request Network State TLVs (Section 7.1.1). The simplest option
is keeping a timestamp of the most recent request (see
Section 5.2).
A DNCP node has for every DNCP node in the DNCP network: DNCP operates primarily using unicast exchanges between nodes, and
may use multicast for Trickle-based shared state dissemination and
topology discovery. If used in pure unicast mode with unreliable
transport, Trickle is also used between peers.
o Node identifier: the unique identifier of the node. DNCP discovers the topology of its nodes and maintains the liveliness
of published node data by ensuring that the publishing node was - at
least recently - bidirectionally reachable. This is determined,
e.g., by a recent and consistent multicast or unicast TLV exchange
with its peers. New potential peers can be discovered autonomously
on multicast-enabled links, their addresses may be manually
configured or they may be found by some other means defined in a
later specification.
o Node data: the ordered set of TLV tuples published by that A Merkle tree is maintained by each node to represent the state of
particular node. This set of TLVs MUST be strictly ordered based all currently reachable nodes and the Trickle algorithm is used to
on ascending binary content (including TLV type and length). This trigger synchronization. Consistency among neighboring nodes is
facilitates linear time state delta processing. thereby determined by comparing the current root of their respective
trees, i.e., their individually calculated network state hashes.
o Latest update sequence number: the 32-bit sequence number that is Before joining a DNCP network, a node starts with a Merkle tree (and
incremented any time the TLV set is published. For comparison therefore a calculated network state hash) only consisting of the
purposes, a looping comparison should be used to avoid problems in node itself. It then announces said hash by means of the Trickle
case of overflow. An example would be: a < b <=> (a - b) % 2^32 & algorithm on all its configured endpoints.
2^31 != 0.
o Relative time delta: the time (in milliseconds) since the current When an update is detected by a node (e.g., by receiving an
TLV data set with the current update sequence number was inconsistent network state hash from a peer) the originator of the
published. It is also a 32 bit number on the wire. If this event is requested to provide a list of the state of all nodes, i.e.,
number is close to overflow (greater than 2^32-2^16), a node MUST all the information it uses to calculate its own Merkle tree. The
re-publish its TLVs even if there is no change. In other words, node uses the list to determine whether its own information is
absent any other changes, the TLV set MUST be re-published roughly outdated and - if necessary - requests the actual node data that has
every 49 days. changed.
o Timestamp: the time it was last reachable based on neighbor graph Whenever a node's local copy of any node data and its Merkle tree are
traversal described in Section 5.4. 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
reset which eventually causes any update to be propagated to all of
its peers.
Additionally, a DNCP node has a set of endpoints for which DNCP is 4. Operation
configured to be used. For each such endpoint, a node has:
o Endpoint identifier: the 32-bit opaque value uniquely identifying 4.1. Merkle Tree
it.
o Trickle [RFC6206] instance: the endpoint's individual trickle Each DNCP node maintains a Merkle tree of height 1 to manage state
instance with parameters I, T, and c. updates of individual DNCP nodes, the leaves of the tree, and the
network as a whole, the root of the tree.
and one (or more) of the following: Each leaf represents one recently bidirectionally reachable node (see
Section 4.6), and is represented by a tuple consisting of the node's
update sequence number in network byte order concatenated with the
hash-value of the node's ordered node data published in the Node
State TLV (Section 7.2.3). These leaves are ordered in ascending
order of the respective node identifiers. The root of the tree - the
network state hash - is represented by the hash-value calculated over
all such leaf tuples concatenated in order. It is used to determine
whether the view of the network of two or more nodes is consistent
and shared.
o Interface: the assigned local network interface. The leaves and the root network state hash are updated on-demand and
whenever any locally stored per-node state changes. This includes
local unidirectional reachability encoded in the published Neighbor
TLV (Section 7.3.2)s and - when combined with remote data - results
in awareness of bidirectional reachability changes.
o Unicast address: the DNCP node it should connect with. 4.2. Data Transport
o Range of addresses: the DNCP nodes that are allowed to connect. DNCP has relatively few requirements for the underlying transport; it
requires some way of transmitting either unicast datagram or stream
data to a peer and, if used in multicast mode, a way of sending
multicast datagrams. As multicast is used only to identify potential
new DNCP nodes and to send status messages which merely notify that a
unicast exchange should be triggered, the multicast transport does
not have to be secured. If unicast security is desired and one of
the 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 [RFC6347] on top of UDP - is also required. A specific
definition of the transport(s) in use and their parameters MUST be
provided by the DNCP profile.
For each remote (peer, endpoint) pair detected on a local endpoint, a TLVs are sent across the transport as is, and they SHOULD be sent
DNCP node has: together where, e.g., MTU considerations do not recommend sending
them in multiple batches. TLVs in general are handled individually
and statelessly, with one exception. To form bidirectional peer
relationships DNCP requires identification of the endpoints used for
communication. A DNCP node desiring bidirectional peer relationship
therefore MUST send an Endpoint TLV (Section 7.2.1). When it is sent
varies, depending on the underlying transport:
o Node identifier: the unique identifier of the peer. o If using a stream transport, the TLV SHOULD be sent only once
within the stream.
o Endpoint identifier: the unique endpoint identifier used by the o If using datagram transport, it MUST be included in every
peer. datagram.
o Peer address: the most recently used address of the peer Bidirectional peer relationship is not necessary for read-only access
(authenticated and authorized, if security is enabled). to the DNCP state, but it is required to be able to publish data.
5. Operation Given the assorted transport options as well as potential endpoint
configuration, a DNCP endpoint may be used in various transport
modes:
The DNCP protocol consists of Trickle [RFC6206] driven unicast or Unicast:
multicast status payloads which indicate the current status of shared
TLV data and additional unicast exchanges which ensure peer
reachability and synchronize the data when necessary.
If DNCP is to be used on a multicast-capable interface, as opposed to * If only reliable unicast transport is employed, Trickle is not
only point-to-point using unicast, a datagram-based transport which used at all. Where Trickle reset occurs, a single Network
supports multicast SHOULD be defined in the DNCP profile to be used State TLV (Section 7.2.2) is sent instead to every unicast
for the TLVs to be sent to the whole link. As this is used only to peer. Additionally, recently changed Node State TLV
identify potential new DNCP nodes and to notify that a unicast (Section 7.2.3)s MAY be included.
exchange should be triggered, the multicast transport does not have
to be particularly secure.
To form bidirectional peer relationships DNCP requires identification * If only unreliable unicast transport is employed, Trickle state
of the endpoints used for communication. A DNCP node therefore MUST is kept per each peer and it is used to send Network State TLVs
include an Endpoint TLV (Section 7.2.1) in each message intended to every now and then, as specified in Section 4.3.
maintain a DNCP peer relationship.
5.1. Trickle-Driven Status Updates Multicast+Unicast: If multicast datagram transport is available on
an endpoint, Trickle state is only maintained for the endpoint as
a whole. It is used to send Network State TLVs every now and
then, as specified in Section 4.3. Additionally, per-endpoint
keep-alives MAY be defined in the DNCP profile, as specified in
Section 6.1.2.
When employing unreliable transport, each node MUST send a Network MulticastListen+Unicast: Just like Unicast, except multicast
State TLV (Section 7.2.2) every time the endpoint-specific Trickle transmissions are listened to in order to detect changes of the
algorithm [RFC6206] instance indicates that an update should be sent. highest node identifier. This mode is used only if the DNCP
Multicast MUST be employed on a multicast-capable interface; profile supports dense broadcast link optimization (Section 6.2).
otherwise, unicast can be used as well. If possible, most recent,
recently changed, or best of all, all known Node State TLVs
(Section 7.2.3) SHOULD be also included, unless it is defined as
undesirable for some reason by the DNCP profile. Avoiding sending
some or all Node State TLVs may make sense to avoid fragmenting
packets to multicast destinations, or for security reasons. If the
DNCP profile supports dense broadcast link optimization
(Section 6.2), and if a node does not have the highest node
identifier on a link, the endpoint may be in a unicast mode in which
multicast traffic is only listened to. In that mode, multicast
updates MUST NOT be sent.
A Trickle state MUST be maintained separately for each endpoint which 4.3. Trickle-Driven Status Updates
employs unreliable transport. The Trickle state for all endpoints is
considered inconsistent and reset if and only if the locally
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
recent data from another node.
The Trickle algorithm has 3 parameters: Imin, Imax and k. Imin and The Trickle algorithm has 3 parameters: Imin, Imax and k. Imin and
Imax represent the minimum and maximum values for I, which is the Imax represent the minimum and maximum values for I, which is the
time interval during which at least k Trickle updates must be seen on time interval during which at least k Trickle updates must be seen on
an endpoint to prevent local state transmission. The actual an endpoint to prevent local state transmission. The actual
suggested Trickle algorithm parameters are DNCP profile specific, as suggested Trickle algorithm parameters are DNCP profile specific, as
described in Section 9. described in Section 9.
5.2. Processing of Received TLVs The Trickle state for all Trickle instances is considered
inconsistent and reset if and only if the locally 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 recent data from
another node.
Every time a particular Trickle instance indicates that an update
should be sent, the node MUST send a Network State TLV
(Section 7.2.2) if and only if:
o the endpoint is in Multicast+Unicast transport mode, in which case
the TLV MUST be sent over multicast.
o the endpoint is NOT in Multicast+Unicast transport mode, and the
unicast transport is unreliable, in which case the TLV MUST be
sent over unicast.
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
DNCP profile, or to avoid exposure of the node state TLVs by
transmitting them within insecure multicast when using also secure
unicast.
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 criteria based on which particular TLVs are profile may specify when to ignore particular TLVs, e.g., to modify
ignored. Any 'reply' mentioned in the steps below denotes sending of security properties - see Section 9 for what may be safely defined to
the specified TLV(s) via unicast to the originator of the TLV being be ignored in a profile. Any 'reply' mentioned in the steps below
processed. If the TLV being replied to was received via multicast denotes sending of the specified TLV(s) over unicast to the
and it was sent to a link with shared bandwidth, the reply SHOULD be originator of the TLV being processed. If the TLV being replied to
delayed by a random timespan in [0, Imin/2]. Sending of replies was received via multicast and it was sent to a link with shared
SHOULD be rate-limited by the implementation, and in case of excess bandwidth, the reply SHOULD be delayed by a random timespan in [0,
load (or some other reason), a reply MAY be omitted altogether. Imin/2], to avoid potential simultaneous replies that may cause
problems on some links. Sending of replies MAY also be rate-limited
or omitted for a short period of time by an implementation. However,
an implementation MUST eventually reply to similar repeated requests,
as otherwise state synchronization would break.
A DNCP node MUST reply to a request from any valid address, as A DNCP node MUST process TLVs received from any valid address, as
specified by a given DNCP profile, whether this address is known to specified by a given DNCP profile and the configuration of a
be the address of a neighbour or not. (This provision satisfies the particular endpoint, whether this address is known to be the address
needs of monitoring or other host software that needs to discover the of a neighbor or not. This provision satisfies the needs of
DNCP topology without adding to the state in the network.) monitoring or other host software that needs to discover the DNCP
topology without adding to the state in the network.
Upon receipt of: Upon receipt of:
o Request Network State TLV (Section 7.1.1): The receiver MUST reply o Request Network State TLV (Section 7.1.1): The receiver MUST reply
with a Network State TLV (Section 7.2.2) and a Node State TLV with a Network State TLV (Section 7.2.2) and a Node State TLV
(Section 7.2.3) for each node data used to calculate the network (Section 7.2.3) for each node data used to calculate the network
state hash. The Node State TLVs SHOULD NOT contain the optional state hash. The Node State TLVs MUST NOT contain the optional
node data part. node data part unless explicitly specified in the DNCP profile.
o Request Node State TLV (Section 7.1.2): If the receiver has node o Request Node State TLV (Section 7.1.2): If the receiver has node
data for the corresponding node, it MUST reply with a Node State data for the corresponding node, it MUST reply with a Node State
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 SHOULD be also 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 higher update sequence number than its current the TLV has a greater update sequence number than its current
local value, or the same update sequence number and a different local value, or the same update sequence number and a different
hash, the node SHOULD re-publish its own node data with an hash, the node SHOULD re-publish its own node data with an
update sequence number 1000 higher than the received one. This update sequence number significantly (e.g., 1000) greater than
may occur normally once due to the local node restarting and the received one, to reclaim the node identifier. This may
not storing the most recently used update sequence number. If occur normally once due to the local node restarting and not
this occurs more than once, the DNCP profile should provide storing the most recently used update sequence number. If this
guidance on how to handle these situations as it indicates the occurs more than once or for nodes not re-publishing their own
existence of another active node with the same node identifier. node data, the DNCP profile MUST provide guidance on how to
handle these situations as it indicates the existence of
another 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 the local information is outdated for the identifier, and one or more of the following conditions are
corresponding node (local update sequence number is lower than true:
that within the TLV), potentially incorrect (local update
sequence number matches but the node data hash differs), or the + The local information is outdated for the corresponding node
data is altogether missing: (local update sequence number is less than that within the
TLV).
+ The local information is potentially incorrect (local update
sequence number matches but the node data hash differs).
+ There is no data for that node altogether.
Then:
+ If the TLV does not contain node data, and the hash of the + If the TLV does not contain node data, and the hash of the
node data differs, the receiver MUST reply with a Request node data differs, the receiver MUST reply with a Request
Node State TLV (Section 7.1.2) for the corresponding node. Node State TLV (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 if present, update sequence number, for that node (node data if present, update sequence number,
relative time) to match the received TLV. relative time) to match the received TLV.
For comparison purposes of the update sequence number, a looping
comparison function MUST be used to avoid problems in case of
overflow. The comparison function a < b <=> (a - b) % 2^32 & 2^31
!= 0 is 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. silently ignored.
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 via insecure multicast MUST be silently ignored. State TLVs received over insecure multicast MUST be silently ignored.
5.3. Adding and Removing Peers 4.5. Adding and Removing Peers
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 it comes via 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 Neighbor TLV (Section 7.3.2) MUST be created on the endpoint and a Neighbor TLV (Section 7.3.2) MUST be created
for it. for it.
o If it comes via multicast, the node SHOULD be sent a (possibly o If received over multicast, the node MAY be sent a (possibly rate-
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
means MUST be employed to ensure its presence. When the peer is no existing local transport-specific means (such as Ethernet carrier-
longer present, the Neighbor TLV and the local DNCP peer state MUST detection or TCP keep-alive) MUST be employed to ensure its presence.
be removed. When the peer is no longer present, the Neighbor TLV and the local
DNCP peer state MUST be removed.
If the DNCP profile supports dense broadcast link optimization If the local endpoint is in the Multicast-Listen+Unicast transport
(Section 6.2), and if a node does not have the highest node mode, a Neighbor TLV (Section 7.3.2) MUST NOT be published for the
identifier on a link, the endpoint may be in a unicast mode in which peers not having the highest node identifier.
multicast traffic is only listened to. In that mode, all peers
except the one with the highest node identifier MUST NOT have
Neighbor TLV (Section 7.3.2) published nor any local state.
5.4. Purging Unreachable Nodes 4.6. Data Liveliness Validation
DNCP validates the set of data within it by ensuring that it is When a Neighbor TLV or a whole node is added or removed, the topology
reachable via nodes that are currently accounted for; therefore, graph MUST be traversed either immediately or with a small delay
unlike Time-To-Live (TTL) based solutions, it does not require shorter than the DNCP profile-defined Trickle Imin.
periodic re-publishing of the data by the nodes. On the other hand,
it does require the topology to be visible to every node that wants
to be able to identify unreachable nodes and therefore remove old,
stale data.
When a Neighbor TLV or a whole node is added or removed, the neighbor The topology graph traversal starts with the local node. The edges
graph SHOULD be traversed, starting from the local node. The edges
to be traversed are identified by looking for Neighbor TLVs on both to be traversed are identified by looking for Neighbor TLVs on both
nodes, that have the other node's identifier in the neighbor node nodes, that have the other node's node identifier in the Neighbor
identifier, and local and neighbor endpoint identifiers swapped. Node Identifier, and local and neighbor endpoint identifiers swapped.
Each node reached should be marked currently reachable. Each node reached is marked currently reachable.
DNCP nodes MUST be either purged immediately when not marked DNCP nodes that have not been reachable in the most recent topology
reachable in a particular graph traversal, or eventually after they graph traversal MUST NOT be used for calculation of the network state
have not been marked reachable within DNCP_GRACE_INTERVAL. During hash, be provided to any applications that need to use the whole TLV
the grace period, the nodes that were not marked reachable in the graph, or be provided to remote nodes. They MAY be removed
most recent graph traversal MUST NOT be used for calculation of the immediately after the topology graph traversal, however it is
network state hash, be provided to any applications that need to use RECOMMENDED to keep them at least briefly to improve the speed of
the whole TLV graph, or be provided to remote nodes. DNCP network state convergence and to reduce the number of redundant
state transmissions between nodes.
5. Data Model
This section describes the local data structures a minimal
implementation might use. This section is provided only as a
convenience for the implementor. Some of the optional extensions
(Section 6) describe additional data requirements, and some optional
parts of the core protocol may also require more.
A DNCP node has:
o A data structure containing data about the most recently sent
Request Network State TLVs (Section 7.1.1). The simplest option
is keeping a timestamp of the most recent request (required to
fulfill reply rate limiting specified in Section 4.4).
A DNCP node has for every DNCP node in the DNCP network:
o Node identifier: the unique identifier of the node. The length,
how it is produced, and how collisions are handled, is up to the
particular DNCP profile.
o Node data: the set of TLV tuples published by that particular
node. As they are transmitted ordered (see Node State TLV
(Section 7.2.3) for details), maintaining the order within the
data structure here may be reasonable.
o Latest update sequence number: the 32-bit sequence number that is
incremented any time the TLV set is published. The comparison
function used to compare them is described in Section 4.4.
o Origination time: the (estimated) time when the current TLV set
with the current update sequence number was published. It is used
to populate the Milliseconds Since Origination field in a Node
State TLV (Section 7.2.3). Ideally it also has millisecond
accuracy.
Additionally, a DNCP node has a set of endpoints for which DNCP is
configured to be used. For each such endpoint, a node has:
o Endpoint identifier: the 32-bit opaque value uniquely identifying
it within the local node.
o Trickle instance: the endpoint's Trickle instance with parameters
I, T, and c (only on an endpoint in Multicast+Unicast transport
mode).
and one (or more) of the following:
o Interface: the assigned local network interface.
o Unicast address: the DNCP node it should connect with.
o Range of addresses: the DNCP nodes that are allowed to connect.
For each remote (peer, endpoint) pair detected on a local endpoint, a
DNCP node has:
o Node identifier: the unique identifier of the peer.
o Endpoint identifier: the unique endpoint identifier used by the
peer.
o Peer address: the most recently used address of the peer
(authenticated and authorized, if security is enabled).
o Trickle instance: the particular peer's Trickle instance with
parameters I, T, and c (only on a unicast-only endpoint with
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 want to use. profile may use.
6.1. Keep-Alives 6.1. Keep-Alives
Trickle-driven status updates (Section 5.1) provide a mechanism for Trickle-driven status updates (Section 4.3) provide a mechanism for
handling of new peer detection (if applicable) on an endpoint, as handling of new peer detection on an endpoint, as well as state
well as state change notifications. Another mechanism may be needed change notifications. Another mechanism may be needed to get rid of
to get rid of old, no longer valid peers if the transport or lower old, no longer valid peers if the transport or lower layers do not
layers do not provide one. provide one.
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 or per-peer keep-alive A DNCP profile MAY specify either per-endpoint or per-peer keep-alive
support. 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 should 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 appropriate Keep-Alive
Interval TLV(s) (Section 7.3.3) within its node data. Interval TLV(s) (Section 7.3.3) within its node data.
6.1.1. Data Model Additions 6.1.1. Data Model Additions
The following additions to the Data Model (Section 4) are needed to The following additions to the Data Model (Section 5) are needed to
support keep-alive: support keep-alives:
Each node MUST have a timestamp which indicates the last time a For each configured endpoint that has per-endpoint keep-alives
Network State TLV (Section 7.2.2) was sent for each endpoint, i.e. on enabled:
an interface or to the point-to-point peer(s).
Each node MUST have for each peer: o Last sent: If a timestamp which indicates the last time a Network
State TLV (Section 7.2.2) was sent over that interface.
For each remote (peer, endpoint) pair detected on a local endpoint, a
DNCP node has:
o Last contact timestamp: a timestamp which indicates the last time o Last contact timestamp: a timestamp which indicates the last time
a consistent Network State TLV (Section 7.2.2) was received from a consistent Network State TLV (Section 7.2.2) was received from
the peer via multicast, or anything was received via unicast. the peer over multicast, or anything was received over unicast.
When adding a new peer, it should be initialized to the current When adding a new peer, it is initialized to the current time.
time.
o Last sent: If per-peer keep-alives are enabled, a timestamp which
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
is 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 with a If per-endpoint keep-alives are enabled on an endpoint in
multicast-enabled link, and if no traffic containing a Network State Multicast+Unicast transport mode, and if no traffic containing a
TLV (Section 7.2.2) has been sent to a particular endpoint within the Network State TLV (Section 7.2.2) has been sent to a particular
endpoint-specific keep-alive interval, a Network State TLV endpoint within the endpoint-specific keep-alive interval, a Network
(Section 7.2.2) MUST be sent on that endpoint, and a new Trickle State TLV (Section 7.2.2) MUST be sent on that endpoint, and a new
transmission time 't' in [I/2, I] MUST be randomly chosen. The Trickle transmission time 't' in [I/2, I] MUST be randomly chosen.
actual sending time SHOULD be further delayed by a random timespan in The actual sending time SHOULD be further delayed by a random
[0, Imin/2]. timespan 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 transmission time 't' in [I/2, I] MUST be peer and a new Trickle transmission time 't' in [I/2, I] MUST be
randomly chosen. randomly chosen.
6.1.4. Received TLV Processing Additions 6.1.4. Received TLV Processing Additions
If a TLV is received via 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) which 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. timestamp for the peer MUST be updated.
6.1.5. Neighbor Removal 6.1.5. Neighbor 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.3) published by the node, and if none exist, using the (Section 7.3.3) published by the node, and if none exist, using 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
state timestamp has not been updated for at least timestamp has not been updated for at least locally chosen
DNCP_KEEPALIVE_MULTIPLIER times the peer's endpoint-specific keep- potentially endpoint-specific keep-alive multiplier (defaults to
DNCP_KEEPALIVE_MULTIPLIER) times the peer's endpoint-specific keep-
alive interval, the Neighbor TLV for that peer and the local DNCP alive interval, the Neighbor TLV for that peer and the local DNCP
peer state MUST be removed. peer state MUST be removed.
6.2. Support For Dense Broadcast Links 6.2. Support For Dense Broadcast Links
This optimization is needed to avoid a state space explosion. Given
a large set of DNCP nodes publishing data on an endpoint that
actually uses multicast on a link, every node will add a Neighbor TLV
(Section 7.3.2) 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 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-alives are employed, 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 connection lifetime, layer 2 notification, per-
endpoint keep-alive).
An upper bound for the number of neighbors that are allowed for a An upper bound for the number of neighbors that are allowed for a
(particular type of) link that an endpoint runs on SHOULD be provided particular type of link that an endpoint in Multicast+Unicast
by a DNCP profile, user configuration, or some hardcoded default in transport mode is used on SHOULD be provided by a DNCP profile, but
the implementation. If an implementation does not support this, the MAY also be chosen at runtime. Main consideration when selecting a
rest of this subsection MUST be ignored. bound (if any) for a particular type of link should be whether it
supports broadcast traffic, and whether a too large number of
neighbors case is likely to happen during the use of that particular
DNCP profile on that particular type of link. If neither is likely,
there is little point specifying support for this for that particular
link type.
If the specified limit is exceeded, nodes without the highest Node If a DNCP profile does not support this extension at all, the rest of
Identifier on the link SHOULD treat the endpoint as a unicast this subsection MUST be ignored. This is because when this extension
endpoint connected to the node that has the highest Node Identifier is employed, the state within the DNCP network only contains a subset
detected on the link. The nodes MUST also keep listening to of the full topology of the network. Therefore every node must be
multicast traffic to both detect the presence of that node, and to aware of the potential of it being used in a particular DNCP profile.
react to nodes with a higher Node Identifier appearing. If the
highest Node Identifier present on the link changes, the remote If the specified upper bound is exceeded for some endpoint in
unicast address of unicast endpoints MUST be changed. If the Node Multicast+Unicast transport mode and if the node does not have the
Identifier of the local node is the highest one, the node MUST keep highest node identifier on the link, it SHOULD treat the endpoint as
the endpoint in multicast mode, and the node MUST allow others to a unicast endpoint connected to the node that has the highest node
peer with it over the link via unicast as well. identifier detected on the link, therefore transitioning to
Multicast-listen+Unicast transport mode. The nodes in Multicast-
listen+Unicast transport mode MUST keep listening to 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
node identifier appearing. If the highest node identifier present on
the link changes, the remote unicast address of the endpoints in
Multicast-Listen+Unicast transport mode MUST be changed. If the node
identifier of the local node is the highest one, the node MUST switch
back to, or stay in Multicast+Unicast mode, and normally form peer
relationships with all peers.
6.3. Node Data Fragmentation 6.3. Node Data Fragmentation
A DNCP profile may be required to support node data which would not A DNCP profile may be required to support node data which would not
fit the maximum size of a single Node State TLV (Section 7.2.3) fit the maximum size of a single Node State TLV (Section 7.2.3)
(roughly 64KB of payload), or use a datagram-only transport with a (roughly 64KB of payload), or use a datagram-only transport with a
limited MTU and no reliable support for fragmentation. To handle limited MTU and no reliable support for fragmentation. To handle
such cases, a DNCP profile MAY specify a fixed number of trailing such cases, a DNCP profile MAY specify a fixed number of trailing
bytes in the Node Identifier to represent a fragment number bytes in the node identifier to represent a fragment number
indicating a part of a node's node data. The profile MAY also indicating a part of a node's node data. The profile MAY also
specify an upper bound for the size of a single fragment to specify an upper bound for the size of a single fragment to
accommodate limitations of links in the network. accommodate limitations of links in the network. Note that the
maximum size of fragment also constrains the maximum size of a single
TLV published by a node.
The data within Node State TLVs of fragments with non-zero fragment The data within Node State TLVs of all fragments MUST be valid, as
number must be treated as opaque (as they may not contain even a specified in Section 7.2.3. The locally used node data for a
single full TLV). However, the concatenated node data for a particular node MUST be produced by concatenating node data in each
particular node MUST be produced by concatenating all node data for fragment, in ascending fragment number order. The locally used
each fragment, in ascending fragment number order. The concatenated concatenated node data MUST still follow the ordering described in
node data MUST follow the ordering described in Section 4. Section 7.2.3.
Any Node Identifiers on the wire used to identify the own or any Any transmitted node identifiers used to identify the own or any
other node MUST have the fragment number 0. For algorithm purposes, other node MUST have the fragment number 0. For algorithm purposes,
the relative time since the most recent fragment change MUST be used, the relative time since the most recent fragment change MUST be used,
regardless of fragment number. Therefore, even if just part of the regardless of fragment number. Therefore, even if just some of the
node data fragments change, they all are considered refreshed if one node data fragments change, they all are considered refreshed if one
of them is. of them is.
If using fragmentation, the unreachable node purging defined in If using fragmentation, the data liveliness validation defined in
Section 5.4 is extended so that if a Fragment Count TLV Section 4.6 is extended so that if a Fragment Count TLV
(Section 7.3.1) is present within the fragment number 0, all (Section 7.3.1) is present within the fragment number 0, all
fragments up to fragment number specified in the Count field are also fragments up to fragment number specified in the Count field are also
considered reachable if the fragment number 0 itself is reachable considered reachable if the fragment number 0 itself is reachable
based on graph traversal. based on graph traversal.
7. Type-Length-Value Objects 7. Type-Length-Value Objects
Each TLV is encoded as a 2 byte type field, followed by a 2 byte Each TLV is encoded as a 2 byte type field, followed by a 2 byte
length field (of the value, excluding header; 0 means no value) length field (of the value excluding header, in bytes, 0 meaning no
followed by the value itself (if any). Both type and length fields value) followed by the value itself, if any. Both type and length
in the header as well as all integer fields inside the value - unless fields in the header as well as all integer fields inside the value -
explicitly stated otherwise - are represented in network byte order. unless explicitly stated otherwise - are represented in network byte
Padding bytes with value zero MUST be added up to the next 4 byte order. Padding bytes with value zero MUST be added up to the next 4
boundary if the length is not divisible by 4. These padding bytes byte boundary if the length is not divisible by 4. These padding
MUST NOT be included in the number stored in the length field. bytes MUST NOT be included in the number stored in the length field.
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 | | Value |
| (variable # of bytes) | | (variable # of bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 14, line 43 skipping to change at page 18, line 4
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: REQ-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). (Section 7.2.2) and all Node State TLVs (Section 7.2.3) (without node
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: REQ-NODE-STATE (2) | Length: >0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier | | Node Identifier |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 15, line 16 skipping to change at page 18, line 22
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: REQ-NODE-STATE (2) | Length: >0 | | Type: REQ-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 matching the 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. It MUST be sent in the particular endpoint's endpoint identifier. It is used when
every message if bidirectional peer relationship is desired with bidirectional peering is desired, as described in the Section 4.2.
remote nodes on that endpoint. Bidirectional peer relationship is
not necessary for read-only access to the DNCP state, but it is
required to be able to publish data.
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(H(update number of node 1) .. H(node data of node 1) .. | | H(update number of node 1 .. H(node data of node 1) .. |
| .. H(update number of node N) .. H(node data of node N)) | | .. update 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 locally calculated network state hash. This TLV contains the current locally calculated network state hash,
It is calculated over each reachable nodes' update number see Section 4.1 for how it is calculated.
concatenated with the hash value of its node data in ascending order
of the respective node identifiers.
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) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Update Sequence Number | | Update Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Milliseconds since Origination | | Milliseconds Since Origination |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| H(node data) | | H(node data) |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|(optionally) Nested TLVs containing node information | |(optionally) Nested TLVs containing node information |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV represents the local node's knowledge about the published This TLV represents the local node's knowledge about the published
state of a node in the DNCP network identified by the node identifier state of a node in the DNCP network identified by the Node Identifier
field in the TLV. field in the TLV.
The whole network should have roughly the same idea about the time Every node, including the originating one, MUST update the
since origination of any particular published state. Therefore every Milliseconds Since Origination whenever it sends a Node State TLV
node, including the originating one, MUST increment the time whenever based on when the node estimates the data was originally published.
it needs to send a Node State TLV for already published node data. This is, e.g., to ensure that any relative timestamps contained
within the published node data can be correctly offset and
The actual node data of the node may be included within the TLV as interpreted. Ultimately, what is provided is just an approximation,
well; see Section 5.2 for the cases where it MUST or MUST NOT be as transmission delays are not accounted for.
included. In a DNCP profile which supports fragmentation, described
in Section 6.3, the TLV data may be only partial and not really
usable without other fragments.
7.2.4. Custom TLV
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type: CUSTOM-DATA (6) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| H(URI) |
| (length fixed in DNCP profile) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opaque Data |
This TLV can be used to contain anything; the URI used should be
under control of the author of that specification. The TLV may
appear within protocol exchanges, or within Node State TLV
(Section 7.2.3). For example:
V = H('http://example.com/author/json-for-dncp') .. '{"cool": "json
extension!"}'
or Absent any changes, if the originating node notices that the 32-bit
milliseconds since origination value would be close to overflow
(greater than 2^32-2^16), the node MUST re-publish its TLVs even if
there is no change. In other words, absent any other changes, the
TLV set MUST be re-published roughly every 48 days.
V = H('mailto:author@example.com') .. '{"cool": "json extension!"}' The actual node data of the node may be included within the TLV as
well. In a DNCP profile which supports fragmentation, described in
Section 6.3, the TLV data may be only partial but it MUST contain
full individual TLVs. This set of TLVs MUST be strictly ordered
based on ascending binary content (including TLV type and length).
This enables, e.g., efficient state delta processing and no-copy
indexing by TLV type by the recipient.
7.3. Data TLVs within Node State TLV 7.3. Data TLVs within Node State TLV
These TLVs are DNCP-specific parts of node-specific node data, and These TLVs are published by the DNCP nodes, and therefore only
are encoded within the Node State TLVs. If encountered outside Node encoded within the Node State TLVs. If encountered outside Node
State TLV, they MUST be silently ignored. State TLV, they MUST be silently ignored.
7.3.1. Fragment Count TLV 7.3.1. Fragment Count 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: FRAGMENT-COUNT (7) | Length: > 0 | | Type: FRAGMENT-COUNT (7) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Count | | Count |
skipping to change at page 18, line 4 skipping to change at page 20, line 36
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: FRAGMENT-COUNT (7) | Length: > 0 | | Type: FRAGMENT-COUNT (7) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Count | | Count |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
If the DNCP profile supports node data fragmentation as specified in If the DNCP profile supports node data fragmentation as specified in
Section 6.3, this TLV indicates that the node data is encoded as a Section 6.3, this TLV indicates that the node data is encoded as a
sequence of Node State TLVs. Following Node State TLVs with Node sequence of Node State TLVs. Following Node State TLVs with Node
Identifiers up to Count higher than the current one MUST be Identifiers up to Count greater than the current one MUST be
considered reachable and part of the same logical set of node data considered reachable and part of the same logical set of node data
that this TLV is within. The fragment portion of the Node Identifier that this TLV is within. The fragment portion of the Node Identifier
of the Node State TLV this TLV appears in MUST be zero. of the Node State TLV this TLV appears in MUST be zero.
7.3.2. Neighbor TLV 7.3.2. Neighbor 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: NEIGHBOR (8) | Length: > 8 | | Type: NEIGHBOR (8) | Length: > 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Neighbor Node Identifier | | Neighbor Node Identifier |
| (length fixed in DNCP profile) | | (length fixed in DNCP profile) |
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Neighbor Endpoint Identifier | | Neighbor Endpoint Identifier |
skipping to change at page 18, line 33 skipping to change at page 21, line 23
| Neighbor Endpoint Identifier | | Neighbor 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 neighbor is reachable by it on the specified local specified neighbor is reachable by it on the specified local
endpoint. The presence of this TLV at least guarantees that the node endpoint. The presence of this TLV at least guarantees that the node
publishing it has received traffic from the neighbor recently. For publishing it has received traffic from the neighbor recently. For
guaranteed up-to-date bidirectional reachability, the existence of guaranteed up-to-date bidirectional reachability, the existence of
both nodes' matching Neighbor TLVs should be checked. both nodes' matching Neighbor TLVs needs to be checked.
7.3.3. Keep-Alive Interval TLV 7.3.3. 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 19, line 49 skipping to change at page 22, line 40
8.3. Certificate Based Trust Consensus Method 8.3. Certificate Based Trust Consensus Method
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
trust verdicts and MUST NOT announce any such verdicts by itself,
i.e., any other normative language in this subsection does not apply
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:
skipping to change at page 21, line 16 skipping to change at page 24, line 16
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
state in case there is no node announcing a configured verdict for a state in case there is no node announcing a configured verdict for a
known certificate. It SHOULD be saved to a non-volatile memory at known certificate. It SHOULD be saved to a non-volatile memory at
reasonable time intervals to survive a reboot or power outage. reasonable time intervals to survive a reboot or power outage.
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 trust 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 trust verdict leads to a change in the current effective trust
verdict for the respective certificate. In absence of configured verdict for the respective certificate. In absence of configured
skipping to change at page 23, line 12 skipping to change at page 26, line 12
and names of all certificates currently known and set configured and names of all certificates currently known and set configured
trust verdicts to be announced. Alternatively it MAY provide a trust 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 which 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 multicast transport protocol(s) to be used.
If multicast-based node and status discovery is desired, 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) are 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 multicast address to be used. Unicast, multicast, and secure or multicast address 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 messages, what sort of messages are dropped, as o When receiving TLVs, what sort of TLVs are ignored in addition -
specified in Section 5.2. as specified in Section 4.4 - e.g., for security reasons. A DNCP
profile may safely define the following DNCP TLVs to be safely
ignored:
* Anything received over multicast, except Node Endpoint TLV
(Section 7.2.1) and Network State TLV (Section 7.2.2).
* Any TLVs received over unreliable unicast or multicast at too
high rate; Trickle will ensure eventual 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 5.2. 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 helps 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 input 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 specific data, and network state hash, which is a hashing of node specific data, and network state hash, which is a
hash of node specific data hashes. SHA-256 defined in [RFC6234] hash of node specific data hashes. SHA-256 defined in [RFC6234]
is the recommended default choice. is the recommended default choice, but a non-cryptographic hash
function could be used as well.
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 DNCP_GRACE_INTERVAL: How long node data for unreachable nodes is o Whether to send keep-alives, and if so, whether per-endpoint
kept. (requires multicast transport), or per-peer. Keep-alive has also
associated parameters:
o Whether to send keep-alives, and if so, on an interface, using
multicast, or directly using unicast to peers. Keep-alive has
also 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) a node may not be heard from to be considered still
valid. valid. This is just a default used in absence of any other
configuration information, or particular per-endpoint
configuration.
o Whether to support fragmentation, and if so, the number of bytes o Whether to support fragmentation, and if so, the number of bytes
reserved for fragment count in the node identifier. reserved for fragment count in the node identifier.
10. Security Considerations 10. Security Considerations
DNCP profiles may use multicast to indicate DNCP state changes and DNCP profiles may use multicast to indicate DNCP state changes and
for keep-alive purposes. However, no actual data TLVs will be sent for keep-alive purposes. However, no actual published data TLVs will
across that channel. Therefore an attacker may only learn hash be sent across that channel. Therefore an attacker may only learn
values of the state within DNCP and may be able to trigger unicast hash values of the state within DNCP and may be able to trigger
synchronization attempts between nodes on a local link this way. A unicast synchronization attempts between nodes on a local link this
DNCP node should therefore rate-limit its reactions to multicast way. A DNCP node should therefore rate-limit its reactions to
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 inability to use the network to either check
Certifcate Revocation Lists or perform on-line validation. Certifcate Revocation Lists or perform on-line 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 DNCP TLV types, with the following IANA should set up a registry for DNCP TLV types, with the following
initial contents: initial contents:
0: Reserved (should not happen on wire) 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: Custom 6: Reserved (was: Custom)
7: Fragment count 7: Fragment count
8: Neighbor 8: Neighbor
9: Keep-alive interval 9: Keep-alive interval
10: Trust-Verdict 10: Trust-Verdict
32-191: Reserved for per-DNCP profile use 32-191: Reserved for per-DNCP profile use
192-255: Reserved for per-implementation experimentation. The nodes 192-255: Reserved for per-implementation experimentation. How
using TLV types in this range SHOULD use e.g. Custom TLV to identify collision is avoided is out of scope of this document.
each other and therefore eliminate potential conflict caused by
potential different use of same TLV numbers.
For the rest of the values (11-31, 256-65535), policy of 'standards For the rest of the values (11-31, 256-65535), policy of 'standards
action' should be used. action' should be used.
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, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
skipping to change at page 26, line 43 skipping to change at page 29, line 50
A: Here, it would save 32 bits per neighbor if it was 16 bits (and A: Here, it would save 32 bits per neighbor if it was 16 bits (and
less is not realistic). However, TLVs defined elsewhere would not less is not realistic). However, TLVs defined elsewhere would not
seem to even gain that much on average. 32 bits is also used for seem to even gain that much on average. 32 bits is also used for
ifindex in various operating systems, making for simpler ifindex in various operating systems, making for simpler
implementation. implementation.
Q: Why have topology information at all? Q: Why have topology information at all?
A: It is an alternative to the more traditional seq#/TTL-based 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- flooding schemes. In steady state, there is no need to, e.g., re-
publish every now and then. publish every now and then.
Appendix B. Changelog [RFC Editor: please remove] Appendix B. Changelog [RFC Editor: please remove]
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: draft-ietf-homenet-dncp-04:
o Added mandatory rate limiting for network state requests, and o Added mandatory rate limiting for network state requests, and
optional slightly faster convergence mechanism by including optional slightly faster convergence mechanism by including
current local network state in the remote network state requests. current local network state in the remote network state requests.
draft-ietf-homenet-dncp-03: draft-ietf-homenet-dncp-03:
o Renamed connection -> endpoint. o Renamed connection -> endpoint.
skipping to change at page 27, line 40 skipping to change at page 31, line 14
o Added text describing how to deal with "dense" networks, but left o Added text describing how to deal with "dense" networks, but left
actual numbers and mechanics up to DNCP profiles and (local) actual numbers and mechanics up to DNCP profiles and (local)
configurations. configurations.
draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf- draft-ietf-homenet-dncp-00: Split from pre-version of draft-ietf-
homenet-hncp-03 generic parts. Changes that affect implementations: homenet-hncp-03 generic parts. Changes that affect implementations:
o TLVs were renumbered. o TLVs were renumbered.
o TLV length does not include header (=-4). This facilitates e.g. o TLV length does not include header (=-4). This facilitates, e.g.,
use of DHCPv6 option parsing libraries (same encoding), and use of DHCPv6 option parsing libraries (same encoding), and
reduces complexity (no need to handle error values of length less reduces complexity (no need to handle error values of length less
than 4). than 4).
o Trickle is reset only when locally calculated network state hash o Trickle is reset only when locally calculated network state hash
is changes, not as remote different network state hash is seen. is changes, not as remote different network state hash is seen.
This prevents e.g. attacks by multicast with one multicast packet This prevents, e.g., attacks by multicast with one multicast
to force Trickle reset on every interface of every node on a link. 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 o Instead of 'ping', use 'keep-alive' (optional) for dead peer
detection. Different message used! detection. Different message used!
Appendix C. Draft Source [RFC Editor: please remove] Appendix C. Draft Source [RFC Editor: please remove]
As usual, this draft is available at https://github.com/fingon/ietf- As usual, this draft is available at https://github.com/fingon/ietf-
drafts/ in source format (with nice Makefile too). Feel free to send 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! comments and/or pull requests if and when you have changes to it!
Appendix D. Acknowledgements Appendix D. 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 and Brian Carpenter Juliusz Chroboczek, Jiazi Yi, Mikael Abrahamsson, Brian Carpenter and
for their contributions to the draft. Thomas Clausen for their contributions to the draft.
Authors' Addresses Authors' Addresses
Markus Stenberg Markus Stenberg
Helsinki 00930 Helsinki 00930
Finland Finland
Email: markus.stenberg@iki.fi Email: markus.stenberg@iki.fi
Steven Barth Steven Barth
Halle 06114 Halle 06114
Germany Germany
Email: cyrus@openwrt.org Email: cyrus@openwrt.org
 End of changes. 127 change blocks. 
429 lines changed or deleted 594 lines changed or added

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