1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293
|
<pre>Internet Engineering Task Force (IETF) M. Stenberg
Request for Comments: 7787 S. Barth
Category: Standards Track Independent
ISSN: 2070-1721 April 2016
<span class="h1">Distributed Node Consensus Protocol</span>
Abstract
This document describes the Distributed Node Consensus Protocol
(DNCP), a generic state synchronization protocol that uses the
Trickle algorithm and hash trees. DNCP is an abstract protocol and
must be combined with a specific profile to make a complete
implementable protocol.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc7787">http://www.rfc-editor.org/info/rfc7787</a>.
Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Stenberg & Barth Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
Table of Contents
<a href="#section-1">1</a>. Introduction . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-1.1">1.1</a>. Applicability . . . . . . . . . . . . . . . . . . . . . . <a href="#page-4">4</a>
<a href="#section-2">2</a>. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
<a href="#section-2.1">2.1</a>. Requirements Language . . . . . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-3">3</a>. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-4">4</a>. Operation . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-4.1">4.1</a>. Hash Tree . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-4.1.1">4.1.1</a>. Calculating Network State and Node Data Hashes . . . <a href="#page-10">10</a>
<a href="#section-4.1.2">4.1.2</a>. Updating Network State and Node Data Hashes . . . . . <a href="#page-10">10</a>
<a href="#section-4.2">4.2</a>. Data Transport . . . . . . . . . . . . . . . . . . . . . <a href="#page-10">10</a>
<a href="#section-4.3">4.3</a>. Trickle-Driven Status Updates . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-4.4">4.4</a>. Processing of Received TLVs . . . . . . . . . . . . . . . <a href="#page-13">13</a>
<a href="#section-4.5">4.5</a>. Discovering, Adding, and Removing Peers . . . . . . . . . <a href="#page-15">15</a>
<a href="#section-4.6">4.6</a>. Data Liveliness Validation . . . . . . . . . . . . . . . <a href="#page-16">16</a>
<a href="#section-5">5</a>. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-17">17</a>
<a href="#section-6">6</a>. Optional Extensions . . . . . . . . . . . . . . . . . . . . . <a href="#page-19">19</a>
<a href="#section-6.1">6.1</a>. Keep-Alives . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-19">19</a>
<a href="#section-6.1.1">6.1.1</a>. Data Model Additions . . . . . . . . . . . . . . . . <a href="#page-20">20</a>
<a href="#section-6.1.2">6.1.2</a>. Per-Endpoint Periodic Keep-Alives . . . . . . . . . . <a href="#page-20">20</a>
<a href="#section-6.1.3">6.1.3</a>. Per-Peer Periodic Keep-Alives . . . . . . . . . . . . <a href="#page-20">20</a>
<a href="#section-6.1.4">6.1.4</a>. Received TLV Processing Additions . . . . . . . . . . <a href="#page-21">21</a>
<a href="#section-6.1.5">6.1.5</a>. Peer Removal . . . . . . . . . . . . . . . . . . . . <a href="#page-21">21</a>
<a href="#section-6.2">6.2</a>. Support for Dense Multicast-Enabled Links . . . . . . . . <a href="#page-21">21</a>
<a href="#section-7">7</a>. Type-Length-Value Objects . . . . . . . . . . . . . . . . . . <a href="#page-22">22</a>
<a href="#section-7.1">7.1</a>. Request TLVs . . . . . . . . . . . . . . . . . . . . . . <a href="#page-23">23</a>
<a href="#section-7.1.1">7.1.1</a>. Request Network State TLV . . . . . . . . . . . . . . <a href="#page-23">23</a>
<a href="#section-7.1.2">7.1.2</a>. Request Node State TLV . . . . . . . . . . . . . . . <a href="#page-24">24</a>
<a href="#section-7.2">7.2</a>. Data TLVs . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-24">24</a>
<a href="#section-7.2.1">7.2.1</a>. Node Endpoint TLV . . . . . . . . . . . . . . . . . . <a href="#page-24">24</a>
<a href="#section-7.2.2">7.2.2</a>. Network State TLV . . . . . . . . . . . . . . . . . . <a href="#page-25">25</a>
<a href="#section-7.2.3">7.2.3</a>. Node State TLV . . . . . . . . . . . . . . . . . . . <a href="#page-25">25</a>
<a href="#section-7.3">7.3</a>. Data TLVs within Node State TLV . . . . . . . . . . . . . <a href="#page-26">26</a>
<a href="#section-7.3.1">7.3.1</a>. Peer TLV . . . . . . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
<a href="#section-7.3.2">7.3.2</a>. Keep-Alive Interval TLV . . . . . . . . . . . . . . . <a href="#page-27">27</a>
<a href="#section-8">8</a>. Security and Trust Management . . . . . . . . . . . . . . . . <a href="#page-27">27</a>
<a href="#section-8.1">8.1</a>. Trust Method Based on Pre-Shared Key . . . . . . . . . . <a href="#page-27">27</a>
<a href="#section-8.2">8.2</a>. PKI-Based Trust Method . . . . . . . . . . . . . . . . . <a href="#page-28">28</a>
<a href="#section-8.3">8.3</a>. Certificate-Based Trust Consensus Method . . . . . . . . <a href="#page-28">28</a>
<a href="#section-8.3.1">8.3.1</a>. Trust Verdicts . . . . . . . . . . . . . . . . . . . <a href="#page-28">28</a>
<a href="#section-8.3.2">8.3.2</a>. Trust Cache . . . . . . . . . . . . . . . . . . . . . <a href="#page-29">29</a>
<a href="#section-8.3.3">8.3.3</a>. Announcement of Verdicts . . . . . . . . . . . . . . <a href="#page-30">30</a>
<a href="#section-8.3.4">8.3.4</a>. Bootstrap Ceremonies . . . . . . . . . . . . . . . . <a href="#page-31">31</a>
<a href="#section-9">9</a>. DNCP Profile-Specific Definitions . . . . . . . . . . . . . . <a href="#page-32">32</a>
<a href="#section-10">10</a>. Security Considerations . . . . . . . . . . . . . . . . . . . <a href="#page-34">34</a>
<a href="#section-11">11</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . . <a href="#page-35">35</a>
<span class="grey">Stenberg & Barth Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<a href="#section-12">12</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-36">36</a>
<a href="#section-12.1">12.1</a>. Normative References . . . . . . . . . . . . . . . . . . <a href="#page-36">36</a>
<a href="#section-12.2">12.2</a>. Informative References . . . . . . . . . . . . . . . . . <a href="#page-36">36</a>
<a href="#appendix-A">Appendix A</a>. Alternative Modes of Operation . . . . . . . . . . . <a href="#page-38">38</a>
<a href="#appendix-A.1">A.1</a>. Read-Only Operation . . . . . . . . . . . . . . . . . . . <a href="#page-38">38</a>
<a href="#appendix-A.2">A.2</a>. Forwarding Operation . . . . . . . . . . . . . . . . . . <a href="#page-38">38</a>
<a href="#appendix-B">Appendix B</a>. DNCP Profile Additional Guidance . . . . . . . . . . <a href="#page-38">38</a>
<a href="#appendix-B.1">B.1</a>. Unicast Transport -- UDP or TCP? . . . . . . . . . . . . <a href="#page-38">38</a>
<a href="#appendix-B.2">B.2</a>. (Optional) Multicast Transport . . . . . . . . . . . . . <a href="#page-39">39</a>
<a href="#appendix-B.3">B.3</a>. (Optional) Transport Security . . . . . . . . . . . . . . <a href="#page-39">39</a>
<a href="#appendix-C">Appendix C</a>. Example Profile . . . . . . . . . . . . . . . . . . <a href="#page-40">40</a>
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-41">41</a>
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-41">41</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
DNCP is designed to provide a way for each participating node to
publish a small set of TLV (Type-Length-Value) tuples (at most 64 KB)
and to provide a shared and common view about the data published by
every currently bidirectionally reachable DNCP node in a network.
For state synchronization, a hash tree is used. It is formed by
first calculating a hash for the data set published by each node,
called node data, and then calculating another hash over those node
data hashes. The single resulting hash, called network state hash,
is transmitted using the Trickle algorithm [<a href="./rfc6206" title=""The Trickle Algorithm"">RFC6206</a>] to ensure that
all nodes share the same view of the current state of the published
data within the network. The use of Trickle with only short network
state hashes sent infrequently (in steady state, once the maximum
Trickle interval per link or unicast connection has been reached)
makes DNCP very thrifty when updates happen rarely.
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 peers are present, transitively, the whole network
state also stays up to date.
<span class="grey">Stenberg & Barth Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Applicability</span>
DNCP is useful for cases like autonomous bootstrapping, discovery,
and negotiation of embedded network devices like routers.
Furthermore, it can be used as a basis to run distributed algorithms
like [<a href="./rfc7596" title=""Lightweight 4over6: An Extension to the Dual- Stack Lite Architecture"">RFC7596</a>] or use cases as described in <a href="#appendix-C">Appendix C</a>. DNCP is
abstract, which allows it to be tuned to a variety of applications by
defining profiles. These profiles include choices of:
- unicast transport: a datagram or stream-oriented protocol (e.g.,
TCP, UDP, or the Stream Control Transmission Protocol (SCTP)) for
generic protocol operation.
- optional transport security: whether and when to use security
based on Transport Layer Security (TLS) or Datagram Transport
Layer Security (DTLS), if supported over the chosen transport.
- optional multicast transport: a multicast-capable protocol like
UDP allowing autonomous peer discovery or more efficient use of
multiple access links.
- communication scopes: using either hop by hop only relying on
link-local addressing (e.g., for LANs), addresses with broader
scopes (e.g., over WANs or the Internet) relying on an existing
routing infrastructure, or a combination of both (e.g., to
exchange state between multiple LANs over a WAN or the Internet).
- payloads: additional specific payloads (e.g., IANA standardized,
enterprise-specific, or private use).
- extensions: possible protocol extensions, either as predefined in
this document or specific for a particular use case.
However, there are certain cases where the protocol as defined in
this document is a less suitable choice. This list provides an
overview while the following paragraphs provide more detailed
guidance on the individual matters.
- large amounts of data: nodes are limited to 64 KB of published
data.
- very dense unicast-only networks: nodes include information about
all immediate neighbors as part of their published data.
- predominantly minimal data changes: node data is always
transported as is, leading to a relatively large transmission
overhead for changes affecting only a small part of it.
<span class="grey">Stenberg & Barth Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
- frequently changing data: DNCP with its use of Trickle is
optimized for the steady state and less efficient otherwise.
- large amounts of very constrained nodes: DNCP requires each node
to store the entirety of the data published by all nodes.
The topology of the devices is not limited and automatically
discovered. When relying on link-local communication exclusively,
all links having DNCP nodes need to be at least transitively
connected by routers running the protocol on multiple endpoints in
order to form a connected network. However, there is no requirement
for every device in a physical network to run the protocol.
Especially if globally scoped addresses are used, DNCP peers do not
need to be on the same or even neighboring physical links.
Autonomous discovery features are usually used in local network
scenarios; however, with security enabled, DNCP can also be used over
unsecured public networks. Network size is restricted merely by the
capabilities of the devices, i.e., each DNCP node needs to be able to
store the entirety of the data published by all nodes. The data
associated with each individual node identifier is limited to about
64 KB in this document; however, protocol extensions could be defined
to mitigate this or other protocol limitations if the need arises.
DNCP is most suitable for data that changes only infrequently to gain
the maximum benefit from using Trickle. As the network of nodes
grows, or the frequency of data changes per node increases, 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.
The suitability of DNCP for a particular application can be roughly
evaluated by considering the expected average network-wide state
change interval A_NC_I; it is computed by dividing the mean interval
at which a node originates a new TLV set by the number of
participating nodes. If keep-alives are used, A_NC_I is the minimum
of the computed A_NC_I and the keep-alive interval. If A_NC_I is
less than the (application-specific) Trickle minimum interval, DNCP
is most likely unsuitable for the application as Trickle will not be
utilized most of the time.
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. Nevertheless, if doing so does not raise
A_NC_I above the (sensibly chosen) Trickle interval parameters for a
particular application, using DNCP is probably not suitable for the
application.
<span class="grey">Stenberg & Barth Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
Another consideration is the size of the published TLV set by a node
compared to the size of deltas in the TLV set. If the TLV set
published by a node is very large, and has frequent small changes,
DNCP as currently specified in this specification may be unsuitable
as it lacks a delta synchronization scheme to keep implementation
simple.
DNCP can be used in networks where only unicast transport is
available. While DNCP uses the least amount of bandwidth when
multicast is utilized, even in pure unicast mode, the use of Trickle
(ideally with k < 2) results in a protocol with an exponential
backoff timer and fewer transmissions than a simpler protocol not
using Trickle.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span>
DNCP profile the values for the set of parameters given in
<a href="#section-9">Section 9</a>. They are prefixed with DNCP_ in this
document. The profile also specifies the set of
optional DNCP extensions to be used. For a simple
example DNCP profile, see <a href="#appendix-C">Appendix C</a>.
DNCP-based a protocol that provides a DNCP profile, according
protocol to <a href="#section-9">Section 9</a>, and zero or more TLV assignments from
the per-DNCP profile TLV registry as well as their
processing rules.
DNCP node a single node that runs a DNCP-based protocol.
Link a link-layer media over which directly connected
nodes can communicate.
DNCP network a set of DNCP nodes running a DNCP-based
protocol(s) with a matching DNCP profile(s). The
set consists of nodes that have discovered each
other using the transport method defined in the
DNCP profile, via multicast on local links, and/or
by using unicast communication.
Node identifier an opaque fixed-length identifier consisting of
DNCP_NODE_IDENTIFIER_LENGTH bytes that uniquely
identifies a DNCP node within a DNCP network.
Interface a node's attachment to a particular link.
Address an identifier used as the source or destination of
a DNCP message flow, e.g., a tuple (IPv6 address,
UDP port) for an IPv6 UDP transport.
<span class="grey">Stenberg & Barth Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
Endpoint a locally configured termination point for
(potential or established) DNCP message flows. An
endpoint is the source and destination for separate
unicast message flows to individual nodes and
optionally for multicast messages to all thereby
reachable nodes (e.g., for node discovery).
Endpoints are usually in one of the transport modes
specified in <a href="#section-4.2">Section 4.2</a>.
Endpoint a 32-bit opaque and locally unique value, which
identifier identifies a particular endpoint of a particular
DNCP node. The value 0 is reserved for DNCP and
DNCP-based protocol purposes and not used to
identify an actual endpoint. This definition is in
sync with the interface index definition in
[<a href="./rfc3493" title=""Basic Socket Interface Extensions for IPv6"">RFC3493</a>], as the non-zero small positive integers
should comfortably fit within 32 bits.
Peer another DNCP node with which a DNCP node
communicates using at least one particular local
and remote endpoint pair.
Node data a set of TLVs published and owned by a node in the
DNCP network. Other nodes pass it along as is,
even if they cannot fully interpret it.
Origination time the (estimated) time when the node data set with
the current sequence number was published.
Node state a set of metadata attributes for node data. It
includes a sequence number for versioning, a hash
value for comparing equality of stored node data,
and a timestamp indicating the time passed since
its last publication (i.e., since the origination
time). The hash function and the length of the
hash value are defined in the DNCP profile.
Network state a hash value that represents the current state of
hash the network. The hash function and the length of
the hash value are defined in the DNCP profile.
Whenever a node is added, removed, or updates its
published node data, this hash value changes as
well. For calculation, please see <a href="#section-4.1">Section 4.1</a>.
Trust verdict a statement about the trustworthiness of a
certificate announced by a node participating in
the certificate-based trust consensus mechanism.
<span class="grey">Stenberg & Barth Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
Effective trust the trust verdict with the highest priority within
verdict the set of trust verdicts announced for the
certificate in the DNCP network.
Topology graph the undirected graph of DNCP nodes produced by
retaining only bidirectional peer relationships
between nodes.
Bidirectionally a peer is locally unidirectionally reachable if a
reachable consistent multicast or any unicast DNCP message
has been received by the local node (see <a href="#section-4.5">Section</a>
<a href="#section-4.5">4.5</a>). If said peer in return also considers the
local node unidirectionally reachable, then
bidirectionally reachability is established. As
this process is based on publishing peer
relationships and evaluating the resulting topology
graph as described in <a href="#section-4.6">Section 4.6</a>, this information
is available to the whole DNCP network.
Trickle instance a distinct Trickle [<a href="./rfc6206" title=""The Trickle Algorithm"">RFC6206</a>] algorithm state kept
by a node (<a href="#section-5">Section 5</a>) and related to an endpoint or
a particular (peer, endpoint) tuple with Trickle
variables I, t, and c. See <a href="#section-4.3">Section 4.3</a>.
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. Requirements Language</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in <a href="./rfc2119">RFC</a>
<a href="./rfc2119">2119</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Overview</span>
DNCP operates primarily using unicast exchanges between nodes, and it
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.
DNCP is based on exchanging TLVs (<a href="#section-7">Section 7</a>) and defines a set of
mandatory and optional ones for its operation. They are categorized
into TLVs for requesting information (<a href="#section-7.1">Section 7.1</a>), transmitting data
(<a href="#section-7.2">Section 7.2</a>), and being published as data (<a href="#section-7.3">Section 7.3</a>). DNCP-based
protocols usually specify additional ones to extend the capabilities.
DNCP discovers the topology of the nodes in the DNCP network and
maintains the liveliness of published node data by ensuring that the
publishing node is bidirectionally reachable. New potential peers
can be discovered autonomously on multicast-enabled links; their
<span class="grey">Stenberg & Barth Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
addresses may be manually configured or they may be found by some
other means defined in the particular DNCP profile. The DNCP profile
may specify, for example, a well-known anycast address or provision
the remote address to contact via some other protocol such as DHCPv6
[<a href="./rfc3315" title=""Dynamic Host Configuration Protocol for IPv6 (DHCPv6)"">RFC3315</a>].
A hash tree of height 1, rooted in itself, is maintained by each node
to represent the state of all currently reachable nodes (see
<a href="#section-4.1">Section 4.1</a>), and the Trickle algorithm is used to trigger
synchronization (see <a href="#section-4.3">Section 4.3</a>). The need to check peer nodes for
state changes is thereby determined by comparing the current root of
their respective hash trees, i.e., their individually calculated
network state hashes.
Before joining a DNCP network, a node starts with a hash tree that
has only one leaf if the node publishes some TLVs, and no leaves
otherwise. It then announces the network state hash calculated from
the hash tree by means of the Trickle algorithm on all its configured
endpoints.
When an update is detected by a node (e.g., by receiving a different
network state hash from a peer), the originator of the event is
requested to provide a list of the state of all nodes, i.e., all the
information it uses to calculate its own hash tree. The node uses
the list to determine whether its own information is outdated and --
if necessary -- requests the actual node data that has changed.
Whenever a node's local copy of any node data and its hash tree are
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.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Operation</span>
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Hash Tree</span>
Each DNCP node maintains an arbitrary width hash tree of height 1.
The root of the tree represents the overall network state hash and is
used to determine whether the view of the network of two or more
nodes is consistent and shared. Each leaf represents one
bidirectionally reachable DNCP node. Every time a node is added or
removed from the topology graph (<a href="#section-4.6">Section 4.6</a>), it is likewise added
or removed as a leaf. At any time, the leaves of the tree are
ordered in ascending order of the node identifiers of the nodes they
represent.
<span class="grey">Stenberg & Barth Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-4.1.1" href="#section-4.1.1">4.1.1</a>. Calculating Network State and Node Data Hashes</span>
The network state hash and the node data hashes are calculated using
the hash function defined in the DNCP profile (<a href="#section-9">Section 9</a>) and
truncated to the number of bits specified therein.
Individual node data hashes are calculated by applying the function
and truncation on the respective node's node data as published in the
Node State TLV. Such node data sets are always ordered as defined in
<a href="#section-7.2.3">Section 7.2.3</a>.
The network state hash is calculated by applying the function and
truncation on the concatenated network state. This state is formed
by first concatenating each node's sequence number (in network byte
order) with its node data hash to form a per-node datum for each
node. These per-node data are then concatenated in ascending order
of the respective node's node identifier, i.e., in the order that the
nodes appear in the hash tree.
<span class="h4"><a class="selflink" id="section-4.1.2" href="#section-4.1.2">4.1.2</a>. Updating Network State and Node Data Hashes</span>
The network state hash and the node data hashes are updated on-demand
and whenever any locally stored per-node state changes. This
includes local unidirectional reachability encoded in the published
Peer TLVs (<a href="#section-7.3.1">Section 7.3.1</a>) and -- when combined with remote data --
results in awareness of bidirectional reachability changes.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. Data Transport</span>
DNCP has few requirements for the underlying transport; it requires
some way of transmitting either a 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 that 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 [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] on top of TCP or DTLS
[<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>] on top of UDP -- is also required. They provide for
integrity protection and confidentiality of the node data, as well as
authentication and authorization using the schemes defined in
"Security and Trust Management" (<a href="#section-8">Section 8</a>). A specific definition
of the transport(s) in use and its parameters MUST be provided by the
DNCP profile.
TLVs (<a href="#section-7">Section 7</a>) are sent across the transport as is, and they SHOULD
be sent together where, e.g., MTU considerations do not recommend
sending them in multiple batches. DNCP does not fragment or
<span class="grey">Stenberg & Barth Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
reassemble TLVs; thus, it MUST be ensured that the underlying
transport performs these operations should they be necessary. If
this document indicates sending one or more TLVs, then the sending
node does not need to keep track of the packets sent after handing
them over to the respective transport, i.e., reliable DNCP operation
is ensured merely by the explicitly defined timers and state machines
such as Trickle (<a href="#section-4.3">Section 4.3</a>). TLVs in general are handled
individually and statelessly (and thus do not need to be sent in any
particular order) with one exception: To form bidirectional peer
relationships, DNCP requires identification of the endpoints used for
communication. As bidirectional peer relationships are required for
validating liveliness of published node data as described in
<a href="#section-4.6">Section 4.6</a>, a DNCP node MUST send a Node Endpoint TLV
(<a href="#section-7.2.1">Section 7.2.1</a>). When it is sent varies, depending on the underlying
transport, but conceptually it should be available whenever
processing a Network State TLV:
o If using a stream transport, the TLV MUST be sent at least once
per connection but SHOULD NOT be sent more than once.
o If using a datagram transport, it MUST be included in every
datagram that also contains a Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>)
and MUST be located before any such TLV. It SHOULD also be
included in any other datagram to speed up initial peer detection.
Given the assorted transport options as well as potential endpoint
configuration, a DNCP endpoint may be used in various transport
modes:
Unicast:
* If only reliable unicast transport is used, Trickle is not used
at all. Whenever the locally calculated network state hash
changes, a single Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) is sent to
every unicast peer. Additionally, recently changed Node State
TLVs (<a href="#section-7.2.3">Section 7.2.3</a>) MAY be included.
* If only unreliable unicast transport is used, Trickle state is
kept per peer, and it is used to send Network State TLVs
intermittently, as specified in <a href="#section-4.3">Section 4.3</a>.
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 periodically, as
specified in <a href="#section-4.3">Section 4.3</a>. Additionally, per-endpoint keep-alives
MAY be defined in the DNCP profile, as specified in <a href="#section-6.1.2">Section 6.1.2</a>.
<span class="grey">Stenberg & Barth Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
MulticastListen+Unicast: Just like unicast, except multicast
transmissions are listened to in order to detect changes of the
highest node identifier. This mode is used only if the DNCP
profile supports dense multicast-enabled link optimization
(<a href="#section-6.2">Section 6.2</a>).
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. Trickle-Driven Status Updates</span>
The Trickle algorithm [<a href="./rfc6206" title=""The Trickle Algorithm"">RFC6206</a>] is used to ensure protocol
reliability over unreliable multicast or unicast transports. For
reliable unicast transports, its actual algorithm is unnecessary and
omitted (<a href="#section-4.2">Section 4.2</a>). DNCP maintains multiple Trickle states as
defined in <a href="#section-5">Section 5</a>. Each such state can be based on different
parameters (see below) and is responsible for ensuring that a
specific peer or all peers on the respective endpoint are regularly
provided with the node's current locally calculated network state
hash for state comparison, i.e., to detect potential divergence in
the perceived network state.
Trickle defines 3 parameters: Imin, Imax, and k. Imin and Imax
represent the minimum value for I and the maximum number of doublings
of Imin, where I is the time interval during which at least k Trickle
updates must be seen on an endpoint to prevent local state
transmission. The actual suggested Trickle algorithm parameters are
DNCP profile specific, as described in <a href="#section-9">Section 9</a>.
The Trickle state for all Trickle instances defined in <a href="#section-5">Section 5</a> 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 the receipt of
more recent data from another node as explained in <a href="#section-4.1">Section 4.1</a>. A
node MUST NOT reset its Trickle state merely based on receiving a
Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) with a network state hash that is
different from its locally calculated one.
Every time a particular Trickle instance indicates that an update
should be sent, the node MUST send a Network State TLV
(<a href="#section-7.2.2">Section 7.2.2</a>) 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.
<span class="grey">Stenberg & Barth Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
A (sub)set of all Node State TLVs (<a href="#section-7.2.3">Section 7.2.3</a>) 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 secure
unicast.
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. Processing of Received TLVs</span>
This section describes how received TLVs are processed. The DNCP
profile may specify when to ignore particular TLVs, e.g., to modify
security properties -- see <a href="#section-9">Section 9</a> for what may be safely defined
to be ignored in a profile. Any 'reply' mentioned in the steps below
denotes the sending of the specified TLV(s) to the originator of the
TLV being processed. All such replies MUST be sent using unicast.
If the TLV being replied to was received via multicast and it was
sent to a multiple access link, the reply MUST be delayed by a random
time span in [0, Imin/2], to avoid potential simultaneous replies
that may cause problems on some links, unless specified differently
in the DNCP profile. The sending of replies MAY also be rate limited
or omitted for a short period of time by an implementation. However,
if the TLV is not forbidden by the DNCP profile, an implementation
MUST reply to retransmissions of the TLV with a non-zero probability
to avoid starvation, which would break the state synchronization.
A DNCP node MUST process TLVs received from any valid (e.g.,
correctly scoped) address, as specified by the DNCP profile and the
configuration of a particular endpoint, whether this address is known
to be the address of a peer or not. This provision satisfies the
needs of monitoring or other host software that needs to discover the
DNCP topology without adding to the state in the network.
Upon receipt of:
o Request Network State TLV (<a href="#section-7.1.1">Section 7.1.1</a>): The receiver MUST reply
with a Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) and a Node State TLV
(<a href="#section-7.2.3">Section 7.2.3</a>) for each node data used to calculate the network
state hash. The Node State TLVs SHOULD NOT contain the optional
node data part to avoid redundant transmission of node data,
unless explicitly specified in the DNCP profile.
o Request Node State TLV (<a href="#section-7.1.2">Section 7.1.2</a>): If the receiver has node
data for the corresponding node, it MUST reply with a Node State
TLV (<a href="#section-7.2.3">Section 7.2.3</a>) for the corresponding node. The optional node
data part MUST be included in the TLV.
o Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>): If the network state hash
differs from the locally calculated network state hash, and the
receiver is unaware of any particular node state differences with
<span class="grey">Stenberg & Barth Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
the sender, the receiver MUST reply with a Request Network State
TLV (<a href="#section-7.1.1">Section 7.1.1</a>). These replies MUST be rate limited to only
at most one reply per link per unique network state hash within
Imin. The simplest way to ensure this rate limit is a timestamp
indicating requests and sending at most one Request Network State
TLV (<a href="#section-7.1.1">Section 7.1.1</a>) per Imin. To facilitate faster state
synchronization, if a Request Network State TLV is sent in a
reply, a local, current Network State TLV MAY also be sent.
o Node State TLV (<a href="#section-7.2.3">Section 7.2.3</a>):
* If the node identifier matches the local node identifier and
the TLV has a greater sequence number than its current local
value, or the same sequence number and a different hash, the
node SHOULD republish its own node data with a sequence number
significantly greater than the received one (e.g., 1000) to
reclaim the node identifier. This difference is needed in
order to ensure that it is higher than any potentially
lingering copies of the node state in the network. This may
occur normally once due to the local node restarting and not
storing the most recently used sequence number. If this occurs
more than once or for nodes not republishing their own 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
identifier, and one or more of the following conditions are
true:
+ The local information is outdated for the corresponding node
(the local sequence number is less than that within the
TLV).
+ The local information is potentially incorrect (the local
sequence number matches but the node data hash differs).
+ There is no data for that node altogether.
Then:
+ If the TLV contains the Node Data field, it SHOULD also be
verified by ensuring that the locally calculated hash of the
node data matches the content of the H(Node Data) field
within the TLV. If they differ, the TLV SHOULD be ignored
and not processed further.
<span class="grey">Stenberg & Barth Standards Track [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
+ If the TLV does not contain the Node Data field, and the
H(Node Data) field within the TLV differs from the local
node data hash for that node (or there is none), the
receiver MUST reply with a Request Node State TLV
(<a href="#section-7.1.2">Section 7.1.2</a>) for the corresponding node.
+ Otherwise, the receiver MUST update its locally stored state
for that node (node data based on the Node Data field if
present, sequence number, and relative time) to match the
received TLV.
For comparison purposes of the 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 where (a % b) represents the remainder of a modulo b
and (a & b) represents bitwise conjunction of a and b is
RECOMMENDED unless the DNCP profile defines another.
o Any other TLV: TLVs not recognized by the receiver MUST be
silently ignored unless they are sent within another TLV (for
example, TLVs within the Node Data field of a Node State TLV).
TLVs within the Node Data field of the Node State TLV not
recognized by the receiver MUST be retained for distribution to
other nodes and for calculation of the node data hash as described
in <a href="#section-7.2.3">Section 7.2.3</a> but are ignored for other purposes.
If secure unicast transport is configured for an endpoint, any Node
State TLVs received over insecure multicast MUST be silently ignored.
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a>. Discovering, Adding, and Removing Peers</span>
Peer relations are established between neighbors using one or more
mutually connected endpoints. Such neighbors exchange information
about network state and published data directly, and through
transitivity, this information then propagates throughout the
network.
New peers are discovered using the regular unicast or multicast
transport defined in the DNCP profile (<a href="#section-9">Section 9</a>). This process is
not distinguished from peer addition, i.e., an unknown peer is simply
discovered by receiving regular DNCP protocol TLVs from it, and
dedicated discovery messages or TLVs do not exist. For unicast-only
transports, the individual node's transport addresses are
preconfigured or obtained using an external service discovery
protocol. In the presence of a multicast transport, messages from
unknown peers are handled in the same way as multicast messages from
peers that are already known; thus, new peers are simply discovered
when sending their regular DNCP protocol TLVs using multicast.
<span class="grey">Stenberg & Barth Standards Track [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
When receiving a Node Endpoint TLV (<a href="#section-7.2.1">Section 7.2.1</a>) on an endpoint
from an unknown peer:
o If received over unicast, the remote node MUST be added as a peer
on the endpoint, and a Peer TLV (<a href="#section-7.3.1">Section 7.3.1</a>) MUST be created
for it.
o If received over multicast, the node MAY be sent a (possibly rate-
limited) unicast Request Network State TLV (<a href="#section-7.1.1">Section 7.1.1</a>).
If keep-alives specified in <a href="#section-6.1">Section 6.1</a> are NOT sent by the peer
(either the DNCP profile does not specify the use of keep-alives or
the particular peer chooses not to send keep-alives), some other
existing local transport-specific means (such as Ethernet carrier
detection or TCP keep-alive) MUST be used to ensure its presence. If
the peer does not send keep-alives, and no means to verify presence
of the peer are available, the peer MUST be considered no longer
present, and it SHOULD NOT be added back as a peer until it starts
sending keep-alives again. When the peer is no longer present, the
Peer TLV and the local DNCP peer state MUST be removed. DNCP does
not define an explicit message or TLV for indicating the termination
of DNCP operation by the terminating node; however, a derived
protocol could specify an extension, if the need arises.
If the local endpoint is in the Multicast-Listen+Unicast transport
mode, a Peer TLV (<a href="#section-7.3.1">Section 7.3.1</a>) MUST NOT be published for the peers
not having the highest node identifier.
<span class="h3"><a class="selflink" id="section-4.6" href="#section-4.6">4.6</a>. Data Liveliness Validation</span>
Maintenance of the hash tree (<a href="#section-4.1">Section 4.1</a>) and thereby network state
hash updates depend on up-to-date information on bidirectional node
reachability derived from the contents of a topology graph. This
graph changes whenever nodes are added to or removed from the network
or when bidirectional connectivity between existing nodes is
established or lost. Therefore, the graph MUST be updated either
immediately or with a small delay shorter than the DNCP profile-
defined Trickle Imin whenever:
o A Peer TLV or a whole node is added or removed, or
o The origination time (in milliseconds) of some node's node data is
less than current time - 2^32 + 2^15.
The artificial upper limit for the origination time is used to
gracefully avoid overflows of the origination time and allow for the
node to republish its data as noted in <a href="#section-7.2.3">Section 7.2.3</a>.
<span class="grey">Stenberg & Barth Standards Track [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
The topology graph update starts with the local node marked as
reachable and all other nodes marked as unreachable. Other nodes are
then iteratively marked as reachable using the following algorithm: A
candidate not-yet-reachable node N with an endpoint NE is marked as
reachable if there is a reachable node R with an endpoint RE that
meets all of the following criteria:
o The origination time (in milliseconds) of R's node data is greater
than current time - 2^32 + 2^15.
o R publishes a Peer TLV with:
* Peer Node Identifier = N's node identifier
* Peer Endpoint Identifier = NE's endpoint identifier
* Endpoint Identifier = RE's endpoint identifier
o N publishes a Peer TLV with:
* Peer Node Identifier = R's node identifier
* Peer Endpoint Identifier = RE's endpoint identifier
* Endpoint Identifier = NE's endpoint identifier
The algorithm terminates when no more candidate nodes fulfilling
these criteria can be found.
DNCP nodes that have not been reachable in the most recent topology
graph traversal MUST NOT be used for calculation of the network state
hash, be provided to any applications that need to use the whole TLV
graph, or be provided to remote nodes. They MAY be forgotten
immediately after the topology graph traversal; however, it is
RECOMMENDED to keep them at least briefly to improve the speed of
DNCP network state convergence. This reduces the number of queries
needed to reconverge during both initial network convergence and when
a part of the network loses and regains bidirectional connectivity
within that time period.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Data Model</span>
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
(<a href="#section-6">Section 6</a>) describe additional data requirements, and some optional
parts of the core protocol may also require more.
<span class="grey">Stenberg & Barth Standards Track [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
A DNCP node has:
o A data structure containing data about the most recently sent
Request Network State TLVs (<a href="#section-7.1.1">Section 7.1.1</a>). The simplest option
is keeping a timestamp of the most recent request (required to
fulfill reply rate limiting specified in <a href="#section-4.4">Section 4.4</a>).
A DNCP node has the following for every DNCP node in the DNCP
network:
o Node identifier: the unique identifier of the node. The length,
how it is produced, and how collisions are handled is up to the
DNCP profile.
o Node data: the set of TLV tuples published by that particular
node. As they are transmitted in a particular order (see Node
State TLV (<a href="#section-7.2.3">Section 7.2.3</a>) for details), maintaining the order
within the data structure here may be reasonable.
o Latest 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 <a href="#section-4.4">Section 4.4</a>.
o Origination time: the (estimated) time when the current TLV set
with the current sequence number was published. It is used to
populate the Milliseconds Since Origination field in a Node State
TLV (<a href="#section-7.2.3">Section 7.2.3</a>). 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 locally unique value
identifying the endpoint within a node. It SHOULD NOT be reused
immediately after an endpoint is disabled.
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 Set of addresses: the DNCP nodes from which connections are
accepted.
<span class="grey">Stenberg & Barth Standards Track [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
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 an endpoint in unicast mode, when
using an unreliable unicast transport).
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Optional Extensions</span>
This section specifies extensions to the core protocol that a DNCP
profile may specify to be used.
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. Keep-Alives</span>
While DNCP provides mechanisms for discovery and adding new peers on
an endpoint (<a href="#section-4.5">Section 4.5</a>), as well as state change notifications,
another mechanism may be needed to get rid of old, no longer valid
peers if the transport or lower layers do not provide one as noted in
<a href="#section-4.6">Section 4.6</a>.
If keep-alives are not specified in the DNCP profile, the rest of
this subsection MUST be ignored.
A DNCP profile MAY specify either per-endpoint (sent using multicast
to all DNCP nodes connected to a multicast-enabled link) or per-peer
(sent using unicast to each peer individually) keep-alive support.
For every endpoint that a keep-alive is specified for in the DNCP
profile, the endpoint-specific keep-alive interval MUST be
maintained. By default, it is DNCP_KEEPALIVE_INTERVAL. If there is
a local value that is preferred for that for any reason
(configuration, energy conservation, media type, ...), it can be
substituted instead. If a non-default keep-alive interval is used on
any endpoint, a DNCP node MUST publish an appropriate Keep-Alive
Interval TLV(s) (<a href="#section-7.3.2">Section 7.3.2</a>) within its node data.
<span class="grey">Stenberg & Barth Standards Track [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-6.1.1" href="#section-6.1.1">6.1.1</a>. Data Model Additions</span>
The following additions to the Data Model (<a href="#section-5">Section 5</a>) are needed to
support keep-alives:
For each configured endpoint that has per-endpoint keep-alives
enabled:
o Last sent: If a timestamp that indicates the last time a Network
State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) 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 that indicates the last time a
consistent Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) was received from the
peer over multicast or when anything was received over unicast.
Failing to update it for a certain amount of time as specified in
<a href="#section-6.1.5">Section 6.1.5</a> results in the removal of the peer. When adding a
new peer, it is initialized to the current time.
o Last sent: If per-peer keep-alives are enabled, a timestamp that
indicates the last time a Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) was
sent to that point-to-point peer. When adding a new peer, it is
initialized to the current time.
<span class="h4"><a class="selflink" id="section-6.1.2" href="#section-6.1.2">6.1.2</a>. Per-Endpoint Periodic Keep-Alives</span>
If per-endpoint keep-alives are enabled on an endpoint in
Multicast+Unicast transport mode, and if no traffic containing a
Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) has been sent to a particular
endpoint within the endpoint-specific keep-alive interval, a Network
State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) MUST be sent on that endpoint, and a new
Trickle interval started, as specified in step 2 of <a href="./rfc6206#section-4.2">Section 4.2 of
[RFC6206]</a>. The actual sending time SHOULD be further delayed by a
random time span in [0, Imin/2].
<span class="h4"><a class="selflink" id="section-6.1.3" href="#section-6.1.3">6.1.3</a>. Per-Peer Periodic Keep-Alives</span>
If per-peer keep-alives are enabled on a unicast-only endpoint, and
if no traffic containing a Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) has been
sent to a particular peer within the endpoint-specific keep-alive
interval, a Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) MUST be sent to the
peer, and a new Trickle interval started, as specified in step 2 of
<a href="./rfc6206#section-4.2">Section 4.2 of [RFC6206]</a>.
<span class="grey">Stenberg & Barth Standards Track [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-6.1.4" href="#section-6.1.4">6.1.4</a>. Received TLV Processing Additions</span>
If a TLV is received over unicast from the peer, the Last contact
timestamp for the peer MUST be updated.
On receipt of a Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>) that is consistent
with the locally calculated network state hash, the Last contact
timestamp for the peer MUST be updated in order to maintain it as a
peer.
<span class="h4"><a class="selflink" id="section-6.1.5" href="#section-6.1.5">6.1.5</a>. Peer Removal</span>
For every peer on every endpoint, the endpoint-specific keep-alive
interval must be calculated by looking for Keep-Alive Interval TLVs
(<a href="#section-7.3.2">Section 7.3.2</a>) published by the node, and if none exist, use the
default value of DNCP_KEEPALIVE_INTERVAL. If the peer's Last contact
timestamp has not been updated for at least a locally chosen
potentially endpoint-specific keep-alive multiplier (defaults to
DNCP_KEEPALIVE_MULTIPLIER) times the peer's endpoint-specific keep-
alive interval, the Peer TLV for that peer and the local DNCP peer
state MUST be removed.
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. Support for Dense Multicast-Enabled Links</span>
This optimization is needed to avoid a state space explosion. Given
a large set of DNCP nodes publishing data on an endpoint that uses
multicast on a link, every node will add a Peer TLV (<a href="#section-7.3.1">Section 7.3.1</a>)
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 used, there will be O(N^2) keep-alives running on the link
if the liveliness of peers is not ensured using some other way (e.g.,
TCP connection lifetime, Layer 2 notification, or per-endpoint keep-
alive).
An upper bound for the number of peers that are allowed for a
particular type of link that an endpoint in Multicast+Unicast
transport mode is used on SHOULD be provided by a DNCP profile, but
it MAY also be chosen at runtime. The main consideration when
selecting a bound (if any) for a particular type of link should be
whether it supports multicast traffic and whether a too large number
of peers case is likely to happen during the use of that 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.
<span class="grey">Stenberg & Barth Standards Track [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
If a DNCP profile does not support this extension at all, the rest of
this subsection MUST be ignored. This is because when this extension
is used, the state within the DNCP network only contains a subset of
the full topology of the network. Therefore, every node must be
aware of the potential of it being used in a particular DNCP profile.
If the specified upper bound is exceeded for some endpoint in
Multicast+Unicast transport mode and if the node does not have the
highest node identifier on the link, it SHOULD treat the endpoint as
a unicast endpoint connected to the node that has the highest node
identifier detected on the link, therefore transitioning to
Multicast-listen+Unicast transport mode. See <a href="#section-4.2">Section 4.2</a> for
implications on the specific endpoint behavior. 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 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 form peer
relationships with all peers as specified in <a href="#section-4.5">Section 4.5</a>.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Type-Length-Value Objects</span>
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 | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value (if any) (+padding (if any)) |
..
| (variable # of bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (optional nested TLVs) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each TLV is encoded as:
o a 2-byte Type field
o a 2-byte Length field, which contains the length of the Value
field in bytes; 0 means no value
o the value itself (if any)
o padding bytes with a value of zero up to the next 4-byte boundary
if the Length is not divisible by 4
<span class="grey">Stenberg & Barth Standards Track [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
While padding bytes MUST NOT be included in the number stored in the
Length field of the TLV, if the TLV is enclosed within another TLV,
then the padding is included in the enclosing TLV's Length value.
Each TLV that does not define optional fields or variable-length
content MAY be sent with additional sub-TLVs appended after the TLV
to allow for extensibility. When handling such TLV types, each node
MUST accept received TLVs that are longer than the fixed fields
specified for the particular type and ignore the sub-TLVs with either
unknown types or types not supported within that particular TLV. If
any sub-TLVs are present, the Length field of the TLV describes the
number of bytes from the first byte of the TLV's own Value (if any)
to the last (padding) byte of the last sub-TLV.
For example, type=123 (0x7b) TLV with value 'x' (120 = 0x78) is
encoded as: 007B 0001 7800 0000. If it were to have a sub-TLV of
type=124 (0x7c) with value 'y', it would be encoded as 007B 000C 7800
0000 007C 0001 7900 0000.
In this section, the following special notation is used:
.. = octet string concatenation operation.
H(x) = non-cryptographic hash function specified by the DNCP
profile.
In addition to the TLV types defined in this document, TLV Types
11-31 and 512-767 are unassigned and may be sequentially registered,
starting at 11, by Standards Action [<a href="./rfc5226" title="">RFC5226</a>] by extensions to DNCP
that may be applicable in multiple DNCP profiles.
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. Request TLVs</span>
<span class="h4"><a class="selflink" id="section-7.1.1" href="#section-7.1.1">7.1.1</a>. Request Network State TLV</span>
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: Request network state (1)| Length: >= 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV is used to request response with a Network State TLV
(<a href="#section-7.2.2">Section 7.2.2</a>) and all Node State TLVs (<a href="#section-7.2.3">Section 7.2.3</a>) (without node
data).
<span class="grey">Stenberg & Barth Standards Track [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-7.1.2" href="#section-7.1.2">7.1.2</a>. Request Node State TLV</span>
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: Request node state (2) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier |
| (length fixed in DNCP profile) |
...
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV is used to request a Node State TLV (<a href="#section-7.2.3">Section 7.2.3</a>)
(including node data) for the node with the matching node identifier.
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. Data TLVs</span>
<span class="h4"><a class="selflink" id="section-7.2.1" href="#section-7.2.1">7.2.1</a>. Node Endpoint TLV</span>
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: Node endpoint (3) | Length: > 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier |
| (length fixed in DNCP profile) |
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV identifies both the local node's node identifier, as well as
the particular endpoint's endpoint identifier. <a href="#section-4.2">Section 4.2</a> specifies
when it is sent.
<span class="grey">Stenberg & Barth Standards Track [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-7.2.2" href="#section-7.2.2">7.2.2</a>. Network State TLV</span>
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: Network state (4) | Length: > 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| H(sequence number of node 1 .. H(node data of node 1) .. |
| .. sequence number of node N .. H(node data of node N)) |
| (length fixed in DNCP profile) |
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV contains the current network state hash calculated by its
sender (<a href="#section-4.1">Section 4.1</a> describes the algorithm).
<span class="h4"><a class="selflink" id="section-7.2.3" href="#section-7.2.3">7.2.3</a>. Node State TLV</span>
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: Node state (5) | Length: > 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Node Identifier |
| (length fixed in DNCP profile) |
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Milliseconds Since Origination |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| H(Node Data) |
| (length fixed in DNCP profile) |
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (optionally) Node Data (a set of nested TLVs) |
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV represents the local node's knowledge about the published
state of a node in the DNCP network identified by the Node Identifier
field in the TLV.
Every node, including the node publishing the node data, MUST update
the Milliseconds Since Origination whenever it sends a Node State TLV
based on when the node estimates the data was originally published.
This is, e.g., to ensure that any relative timestamps contained
within the published node data can be correctly offset and
<span class="grey">Stenberg & Barth Standards Track [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
interpreted. Ultimately, what is provided is just an approximation,
as transmission delays are not accounted for.
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 republish its TLVs even if
there is no change. In other words, absent any other changes, the
TLV set MUST be republished roughly every 48 days.
The actual node data of the node may be included within the TLV as
well as in the optional Node Data field. The 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. The
node data content MUST be passed along exactly as it was received.
It SHOULD be also verified on receipt that the locally calculated
H(Node Data) matches the content of the field within the TLV, and if
the hash differs, the TLV SHOULD be ignored.
<span class="h3"><a class="selflink" id="section-7.3" href="#section-7.3">7.3</a>. Data TLVs within Node State TLV</span>
These TLVs are published by the DNCP nodes and are therefore only
encoded in the Node Data field of Node State TLVs. If encountered
outside Node State TLV, they MUST be silently ignored.
<span class="h4"><a class="selflink" id="section-7.3.1" href="#section-7.3.1">7.3.1</a>. Peer TLV</span>
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: Peer (8) | Length: > 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Peer Node Identifier |
| (length fixed in DNCP profile) |
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Peer Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (Local) Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV indicates that the node in question vouches that the
specified peer is reachable by it on the specified local endpoint.
The presence of this TLV at least guarantees that the node publishing
it has received traffic from the peer recently. For guaranteed up-
to-date bidirectional reachability, the existence of both nodes'
matching Peer TLVs needs to be checked.
<span class="grey">Stenberg & Barth Standards Track [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-7.3.2" href="#section-7.3.2">7.3.2</a>. Keep-Alive Interval TLV</span>
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: Keep-alive interval (9) | Length: >= 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Endpoint Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Interval |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This TLV indicates a non-default interval being used to send keep-
alives as specified in <a href="#section-6.1">Section 6.1</a>.
Endpoint identifier is used to identify the particular (local)
endpoint for which the interval applies on the sending node. If 0,
it applies for ALL endpoints for which no specific TLV exists.
Interval specifies the interval in milliseconds at which the node
sends keep-alives. A value of zero means no keep-alives are sent at
all; in that case, some lower-layer mechanism that ensures the
presence of nodes MUST be available and used.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Security and Trust Management</span>
If specified in the DNCP profile, either DTLS [<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>] or TLS
[<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] may be used to authenticate and encrypt either some (if
specified optional in the profile) or all unicast traffic. The
following methods for establishing trust are defined, but it is up to
the DNCP profile to specify which ones may, should, or must be
supported.
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a>. Trust Method Based on Pre-Shared Key</span>
A trust model based on Pre-Shared Key (PSK) is a simple security
management mechanism that allows an administrator to deploy devices
to an existing network by configuring them with a predefined key,
similar to the configuration of an administrator password or Wi-Fi
Protected Access (WPA) key. Although limited in nature, it is useful
to provide a user-friendly security mechanism for smaller networks.
<span class="grey">Stenberg & Barth Standards Track [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a>. PKI-Based Trust Method</span>
A PKI-based trust model enables more advanced management capabilities
at the cost of increased complexity and bootstrapping effort.
However, it allows trust to be managed in a centralized manner and is
therefore useful for larger networks with a need for an authoritative
trust management.
<span class="h3"><a class="selflink" id="section-8.3" href="#section-8.3">8.3</a>. Certificate-Based Trust Consensus Method</span>
For some scenarios -- such as bootstrapping a mostly unmanaged
network -- the methods described above may not provide a desirable
trade-off between security and user experience. This section
includes guidance for implementing an opportunistic security
[<a href="./rfc7435" title=""Opportunistic Security: Some Protection Most of the Time"">RFC7435</a>] method that DNCP profiles can build upon and adapt for
their specific requirements.
The certificate-based consensus model is designed to be a compromise
between trust management effort and flexibility. It is based on
X.509 certificates and allows each DNCP node to provide a trust
verdict on any other certificate, and a consensus is found to
determine whether a node using this certificate or any certificate
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 one with the highest priority from all trust verdicts announced
for said certificate at the time.
<span class="h4"><a class="selflink" id="section-8.3.1" href="#section-8.3.1">8.3.1</a>. Trust Verdicts</span>
Trust verdicts are statements of DNCP nodes about the trustworthiness
of X.509 certificates. There are 5 possible trust verdicts in order
of ascending priority:
0 (Neutral): no trust verdict exists, but the DNCP network should
determine one.
1 (Cached Trust): the last known effective trust verdict was
Configured or Cached Trust.
2 (Cached Distrust): the last known effective trust verdict was
Configured or Cached Distrust.
<span class="grey">Stenberg & Barth Standards Track [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
3 (Configured Trust): trustworthy based upon an external ceremony
or configuration.
4 (Configured Distrust): not trustworthy based upon an external
ceremony or configuration.
Trust verdicts are differentiated in 3 groups:
o Configured verdicts are used to announce explicit trust verdicts a
node has based on any external trust bootstrap or predefined
relations a node has formed with a given certificate.
o Cached verdicts are used to retain the last known trust state in
case all nodes with configured verdicts about a given certificate
have been disconnected or turned off.
o The Neutral verdict is used to announce a new node intending to
join the network, so a final verdict for it can be found.
The current effective trust verdict for any certificate is defined as
the one with the highest priority within the set of trust verdicts
announced for the certificate in the DNCP network. A node MUST be
trusted for participating in the DNCP network if and only if the
current effective trust verdict for its own certificate or any one in
its certificate hierarchy is (Cached or Configured) Trust, and none
of the certificates in its hierarchy have an effective trust verdict
of (Cached or Configured) Distrust. In case a node has a configured
verdict, which is different from the current effective trust verdict
for a certificate, the current effective trust verdict takes
precedence in deciding trustworthiness. Despite that, the node still
retains and announces its configured verdict.
<span class="h4"><a class="selflink" id="section-8.3.2" href="#section-8.3.2">8.3.2</a>. Trust Cache</span>
Each node SHOULD maintain a trust cache containing the current
effective trust verdicts for all certificates currently announced in
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
known certificate. It SHOULD be saved to a non-volatile memory at
reasonable time intervals to survive a reboot or power outage.
Every time a node (re)joins the network or detects the change of an
effective trust verdict for any certificate, it will synchronize its
cache, i.e., store new effective trust verdicts overwriting any
previously cached verdicts. Configured verdicts are stored in the
cache as their respective cached counterparts. Neutral verdicts are
never stored and do not override existing cached verdicts.
<span class="grey">Stenberg & Barth Standards Track [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h4"><a class="selflink" id="section-8.3.3" href="#section-8.3.3">8.3.3</a>. Announcement of Verdicts</span>
A node SHOULD always announce any configured verdicts it has
established by itself, and it MUST do so if announcing the configured
verdict leads to a change in the current effective trust verdict for
the respective certificate. In absence of configured verdicts, it
MUST announce Cached Trust verdicts it has stored in its trust cache,
if one of the following conditions applies:
o The stored trust verdict is Cached Trust, and the current
effective trust verdict for the certificate is Neutral or does not
exist.
o The stored trust verdict is Cached Distrust, and the current
effective trust verdict for the certificate is Cached Trust.
A node rechecks these conditions whenever it detects changes of
announced trust verdicts anywhere in the network.
Upon encountering a node with a hierarchy of certificates for which
there is no effective trust verdict, a node adds a Neutral Trust-
Verdict TLV to its node data for all certificates found in the
hierarchy and publishes it until an effective trust verdict different
from Neutral can be found for any of the certificates, or a
reasonable amount of time (10 minutes is suggested) with no reaction
and no further authentication attempts has passed. Such trust
verdicts SHOULD also be limited in rate and number to prevent
denial-of-service attacks.
<span class="grey">Stenberg & Barth Standards Track [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
Trust verdicts are announced using Trust-Verdict TLVs:
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: Trust-Verdict (10) | Length: > 36 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Verdict | (reserved) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| |
| |
| SHA-256 Fingerprint |
| |
| |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Common Name |
Verdict represents the numerical index of the trust verdict.
(reserved) is reserved for future additions and MUST be set to 0
when creating TLVs and ignored when parsing them.
SHA-256 Fingerprint contains the SHA-256 [<a href="./rfc6234" title=""US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)"">RFC6234</a>] hash value of
the certificate in DER format.
Common name contains the variable-length (1-64 bytes) common name
of the certificate.
<span class="h4"><a class="selflink" id="section-8.3.4" href="#section-8.3.4">8.3.4</a>. Bootstrap Ceremonies</span>
The following non-exhaustive list of methods describes possible ways
to establish trust relationships between DNCP nodes and node
certificates. Trust establishment is a two-way process in which the
existing network must trust the newly added node, and the newly added
node must trust at least one of its peer nodes. It is therefore
necessary that both the newly added node and an already trusted node
perform such a ceremony to successfully introduce a node into the
DNCP network. In all cases, an administrator MUST be provided with
external means to identify the node belonging to a certificate based
on its fingerprint and a meaningful common name.
<span class="grey">Stenberg & Barth Standards Track [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h5"><a class="selflink" id="section-8.3.4.1" href="#section-8.3.4.1">8.3.4.1</a>. Trust by Identification</span>
A node implementing certificate-based trust MUST provide an interface
to retrieve the current set of effective trust verdicts,
fingerprints, and names of all certificates currently known and set
configured verdicts to be announced. Alternatively, it MAY provide a
companion DNCP node or application with these capabilities with which
it has a pre-established trust relationship.
<span class="h5"><a class="selflink" id="section-8.3.4.2" href="#section-8.3.4.2">8.3.4.2</a>. Preconfigured Trust</span>
A node MAY be preconfigured to trust a certain set of node or CA
certificates. However, such trust relationships MUST NOT result in
unwanted or unrelated trust for nodes not intended to be run inside
the same network (e.g., all other devices by the same manufacturer).
<span class="h5"><a class="selflink" id="section-8.3.4.3" href="#section-8.3.4.3">8.3.4.3</a>. Trust on Button Press</span>
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
it trusts the certificate of the first DNCP node it can successfully
establish a connection with.
<span class="h5"><a class="selflink" id="section-8.3.4.4" href="#section-8.3.4.4">8.3.4.4</a>. Trust on First Use</span>
A node that is not associated with any other DNCP node MAY trust the
certificate of the first DNCP node it can successfully establish a
connection with. This method MUST NOT be used when the node has
already associated with any other DNCP node.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. DNCP Profile-Specific Definitions</span>
Each DNCP profile MUST specify the following aspects:
o Unicast and optionally a multicast transport protocol(s) to be
used. If a multicast-based node and status discovery is desired,
a datagram-based transport supporting multicast has to be
available.
o How the chosen transport(s) is secured: Not at all, optionally, or
always with the TLS scheme defined here using one or more of the
methods, or with something else. If the links with DNCP nodes can
be sufficiently secured or isolated, it is possible to run DNCP in
a secure manner without using any form of authentication or
encryption.
<span class="grey">Stenberg & Barth Standards Track [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
o Transport protocols' parameters such as port numbers to be used or
multicast addresses to be used. Unicast, multicast, and secure
unicast may each require different parameters, if applicable.
o When receiving TLVs, what sort of TLVs are ignored in addition --
as specified in <a href="#section-4.4">Section 4.4</a> -- e.g., for security reasons. While
the security of the node data published within the Node State TLVs
is already ensured by the base specification (if secure unicast
transport is used, Node State TLVs are sent only via unicast as
multicast ones are ignored on receipt), if a profile adds TLVs
that are sent outside the node data, a profile should indicate
whether or not those TLVs should be ignored if they are received
via multicast or non-secured unicast. A DNCP profile may define
the following DNCP TLVs to be safely ignored:
* Anything received over multicast, except Node Endpoint TLV
(<a href="#section-7.2.1">Section 7.2.1</a>) and Network State TLV (<a href="#section-7.2.2">Section 7.2.2</a>).
* Any TLVs received over unreliable unicast or multicast at a
rate that is that is too high; Trickle will ensure eventual
convergence given the rate slows down at some point.
o How to deal with node identifier collision as described in
<a href="#section-4.4">Section 4.4</a>. Main options are either for one or both nodes to
assign new node identifiers to themselves or to notify someone
about a fatal error condition in the DNCP network.
o Imin, Imax, and k ranges to be suggested for implementations to be
used in the Trickle algorithm. The Trickle algorithm does not
require these to be the same across all implementations for it to
work, but similar orders of magnitude help implementations of a
DNCP profile to behave more consistently and to facilitate
estimation of lower and upper bounds for convergence behavior of
the network.
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
hashing of node data and producing network state hash, which is a
hash of node data hashes. SHA-256 defined in [<a href="./rfc6234" title=""US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)"">RFC6234</a>] is the
recommended default choice, but a non-cryptographic hash function
could be used as well. If there is a hash collision in the
network state hash, the network will effectively be partitioned to
partitions that believe they are up to date but are actually no
longer converged. The network will converge either when some node
data anywhere in the network changes or when conflicting Node
State TLVs get transmitted across the partition (either caused by
"Trickle-Driven Status Updates" (<a href="#section-4.3">Section 4.3</a>) or as part of the
"Processing of Received TLVs" (<a href="#section-4.4">Section 4.4</a>)). If a node publishes
<span class="grey">Stenberg & Barth Standards Track [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
node data with a hash that collides with any previously published
node data, the update may not be (fully) propagated, and the old
version of node data may be used instead.
o DNCP_NODE_IDENTIFIER_LENGTH: The fixed length of a node identifier
(in bytes).
o Whether to send keep-alives, and if so, whether it is per-endpoint
(requires multicast transport) or per-peer. Keep-alive also has
associated parameters:
* DNCP_KEEPALIVE_INTERVAL: How often keep-alives are to be sent
by default (if enabled).
* DNCP_KEEPALIVE_MULTIPLIER: How many times the
DNCP_KEEPALIVE_INTERVAL (or peer-supplied keep-alive interval
value) node may not be heard from to be considered still valid.
This is just a default used in absence of any other
configuration information or particular per-endpoint
configuration.
o Whether to support dense multicast-enabled link optimization
(<a href="#section-6.2">Section 6.2</a>) or not.
For some guidance on choosing transport and security options, please
see <a href="#appendix-B">Appendix B</a>.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. Security Considerations</span>
DNCP-based protocols may use multicast to indicate DNCP state changes
and for keep-alive purposes. However, no actual published data TLVs
will be sent across that channel. Therefore, an attacker may only
learn hash values of the state within DNCP and may be able to trigger
unicast synchronization attempts between nodes on a local link this
way. A DNCP node MUST therefore rate limit its reactions to
multicast packets.
When using DNCP to bootstrap a network, PKI-based solutions may have
issues when validating certificates due to potentially unavailable
accurate time or due to the inability to use the network to either
check Certificate Revocation Lists or perform online validation.
The Certificate-based trust consensus mechanism defined in this
document allows for a consenting revocation; however, in case of a
compromised device, the trust cache may be poisoned before the actual
revocation happens allowing the distrusted device to rejoin the
network using a different identity. Stopping such an attack might
require physical intervention and flushing of the trust caches.
<span class="grey">Stenberg & Barth Standards Track [Page 34]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h2"><a class="selflink" id="section-11" href="#section-11">11</a>. IANA Considerations</span>
IANA has set up a registry for the (decimal 16-bit) "DNCP TLV Types"
under "Distributed Node Consensus Protocol (DNCP)". The registration
procedure is Standards Action [<a href="./rfc5226" title="">RFC5226</a>]. The initial contents are:
0: Reserved
1: Request network state
2: Request node state
3: Node endpoint
4: Network state
5: Node state
6: Reserved for future use (was: Custom)
7: Reserved for future use (was: Fragment count)
8: Peer
9: Keep-alive interval
10: Trust-Verdict
11-31: Unassigned
32-511: Reserved for per-DNCP profile use
512-767: Unassigned
768-1023: Reserved for Private Use [<a href="./rfc5226" title="">RFC5226</a>]
1024-65535: Reserved for future use
<span class="grey">Stenberg & Barth Standards Track [Page 35]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h2"><a class="selflink" id="section-12" href="#section-12">12</a>. References</span>
<span class="h3"><a class="selflink" id="section-12.1" href="#section-12.1">12.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>,
DOI 10.17487/RFC2119, March 1997,
<<a href="http://www.rfc-editor.org/info/rfc2119">http://www.rfc-editor.org/info/rfc2119</a>>.
[<a id="ref-RFC5226">RFC5226</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>, <a href="./rfc5226">RFC 5226</a>,
DOI 10.17487/RFC5226, May 2008,
<<a href="http://www.rfc-editor.org/info/rfc5226">http://www.rfc-editor.org/info/rfc5226</a>>.
[<a id="ref-RFC6206">RFC6206</a>] Levis, P., Clausen, T., Hui, J., Gnawali, O., and J. Ko,
"The Trickle Algorithm", <a href="./rfc6206">RFC 6206</a>, DOI 10.17487/RFC6206,
March 2011, <<a href="http://www.rfc-editor.org/info/rfc6206">http://www.rfc-editor.org/info/rfc6206</a>>.
[<a id="ref-RFC6234">RFC6234</a>] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms
(SHA and SHA-based HMAC and HKDF)", <a href="./rfc6234">RFC 6234</a>,
DOI 10.17487/RFC6234, May 2011,
<<a href="http://www.rfc-editor.org/info/rfc6234">http://www.rfc-editor.org/info/rfc6234</a>>.
<span class="h3"><a class="selflink" id="section-12.2" href="#section-12.2">12.2</a>. Informative References</span>
[<a id="ref-RFC3315">RFC3315</a>] Droms, R., Ed., Bound, J., Volz, B., Lemon, T., Perkins,
C., and M. Carney, "Dynamic Host Configuration Protocol
for IPv6 (DHCPv6)", <a href="./rfc3315">RFC 3315</a>, DOI 10.17487/RFC3315, July
2003, <<a href="http://www.rfc-editor.org/info/rfc3315">http://www.rfc-editor.org/info/rfc3315</a>>.
[<a id="ref-RFC3493">RFC3493</a>] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W.
Stevens, "Basic Socket Interface Extensions for IPv6",
<a href="./rfc3493">RFC 3493</a>, DOI 10.17487/RFC3493, February 2003,
<<a href="http://www.rfc-editor.org/info/rfc3493">http://www.rfc-editor.org/info/rfc3493</a>>.
[<a id="ref-RFC5246">RFC5246</a>] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", <a href="./rfc5246">RFC 5246</a>,
DOI 10.17487/RFC5246, August 2008,
<<a href="http://www.rfc-editor.org/info/rfc5246">http://www.rfc-editor.org/info/rfc5246</a>>.
[<a id="ref-RFC6347">RFC6347</a>] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", <a href="./rfc6347">RFC 6347</a>, DOI 10.17487/RFC6347,
January 2012, <<a href="http://www.rfc-editor.org/info/rfc6347">http://www.rfc-editor.org/info/rfc6347</a>>.
[<a id="ref-RFC7435">RFC7435</a>] Dukhovni, V., "Opportunistic Security: Some Protection
Most of the Time", <a href="./rfc7435">RFC 7435</a>, DOI 10.17487/RFC7435,
December 2014, <<a href="http://www.rfc-editor.org/info/rfc7435">http://www.rfc-editor.org/info/rfc7435</a>>.
<span class="grey">Stenberg & Barth Standards Track [Page 36]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
[<a id="ref-RFC7596">RFC7596</a>] Cui, Y., Sun, Q., Boucadair, M., Tsou, T., Lee, Y., and I.
Farrer, "Lightweight 4over6: An Extension to the Dual-
Stack Lite Architecture", <a href="./rfc7596">RFC 7596</a>, DOI 10.17487/RFC7596,
July 2015, <<a href="http://www.rfc-editor.org/info/rfc7596">http://www.rfc-editor.org/info/rfc7596</a>>.
<span class="grey">Stenberg & Barth Standards Track [Page 37]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Alternative Modes of Operation</span>
Beyond what is described in the main text, the protocol allows for
other uses. These are provided as examples.
<span class="h3"><a class="selflink" id="appendix-A.1" href="#appendix-A.1">A.1</a>. Read-Only Operation</span>
If a node uses just a single endpoint and does not need to publish
any TLVs, full DNCP node functionality is not required. Such a
limited node can acquire and maintain a view of the TLV space by
implementing the processing logic as specified in <a href="#section-4.4">Section 4.4</a>. Such
node would not need Trickle, peer-maintenance, or even keep-alives at
all, as the DNCP nodes' use of it would guarantee eventual receipt of
network state hashes, and synchronization of node data, even in the
presence of unreliable transport.
<span class="h3"><a class="selflink" id="appendix-A.2" href="#appendix-A.2">A.2</a>. Forwarding Operation</span>
If a node with a pair of endpoints does not need to publish any TLVs,
it can detect (for example) nodes with the highest node identifier on
each of the endpoints (if any). Any TLVs received from one of them
would be forwarded verbatim as unicast to the other node with the
highest node identifier.
Any tinkering with the TLVs would remove guarantees of this scheme
working; however, passive monitoring would obviously be fine. This
type of simple forwarding cannot be chained, as it does not send
anything proactively.
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>. DNCP Profile Additional Guidance</span>
This appendix explains implications of design choices made when
specifying the DNCP profile to use particular transport or security
options.
<span class="h3"><a class="selflink" id="appendix-B.1" href="#appendix-B.1">B.1</a>. Unicast Transport -- UDP or TCP?</span>
The node data published by a DNCP node is limited to 64 KB due to the
16-bit size of the length field of the TLV it is published within.
Some transport choices may decrease this limit; if using, e.g., UDP
datagrams for unicast transport, the upper bound of the node data
size is whatever the nodes and the underlying network can pass to
each other as DNCP does not define its own fragmentation scheme. A
profile that chooses UDP has to be limited to small node data (e.g.,
somewhat smaller than IPv6 default MTU if using IPv6) or specify a
minimum that all nodes have to support. Even then, if using
non-link-local communications, there is some concern about what
middleboxes do to fragmented packets. Therefore, the use of stream
<span class="grey">Stenberg & Barth Standards Track [Page 38]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
transport such as TCP is probably a good idea if either
non-link-local communication is desired or fragmentation is expected
to cause problems.
TCP also provides some other facilities, such as a relatively long
built-in keep-alive, which in conjunction with connection closes
occurring from eventual failed retransmissions may be sufficient to
avoid the use of in-protocol keep-alive defined in <a href="#section-6.1">Section 6.1</a>.
Additionally, it is reliable, so there is no need for Trickle on such
unicast connections.
The major downside of using TCP instead of UDP with DNCP-based
profiles lies in the loss of control over the time at which TLVs are
received; while unreliable UDP datagrams also have some delay, TLVs
within reliable stream transport may be delayed significantly due to
retransmissions. This is not a problem if no relative time-dependent
information is stored within the TLVs in the DNCP-based protocol; for
such a protocol, TCP is a reasonable choice for unicast transport if
it is available.
<span class="h3"><a class="selflink" id="appendix-B.2" href="#appendix-B.2">B.2</a>. (Optional) Multicast Transport</span>
Multicast is needed for dynamic peer discovery and to trigger unicast
exchanges; for that, unreliable datagram transport (=typically UDP)
is the only transport option defined within this specification,
although DNCP-based protocols may themselves define some other
transport or peer discovery mechanism (e.g., based on Multicast DNS
(mDNS) or DNS).
If multicast is used, a well-known address should be specified and
for, e.g., IPv6, respectively, the desired address scopes. In most
cases, link-local and possibly site-local are useful scopes.
<span class="h3"><a class="selflink" id="appendix-B.3" href="#appendix-B.3">B.3</a>. (Optional) Transport Security</span>
In terms of provided security, DTLS and TLS are equivalent; they also
consume a similar amount of state on the devices. While TLS is on
top of a stream protocol, using DTLS also requires relatively long
session caching within the DTLS layer to avoid expensive
reauthentication/authorization steps if and when any state within the
DNCP network changes or per-peer keep-alive (if enabled) is sent.
TLS implementations (at the time of writing the specification) seem
more mature and available (as open source) than DTLS ones. This may
be due to a long history of use with HTTPS.
<span class="grey">Stenberg & Barth Standards Track [Page 39]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
Some libraries seem not to support multiplexing between insecure and
secure communication on the same port, so specifying distinct ports
for secured and unsecured communication may be beneficial.
<span class="h2"><a class="selflink" id="appendix-C" href="#appendix-C">Appendix C</a>. Example Profile</span>
This is the DNCP profile of SHSP, an experimental (and for the
purposes of this document fictional) home automation protocol. The
protocol itself is used to make a key-value store published by each
of the nodes available to all other nodes for distributed monitoring
and control of a home infrastructure. It defines only one additional
TLV type: a key=value TLV that contains a single key=value assignment
for publication.
o Unicast transport: IPv6 TCP on port EXAMPLE-P1 since only absolute
timestamps are used within the key=value data and since it focuses
primarily on Linux-based nodes that support both protocols as
well. Connections from and to non-link-local addresses are
ignored to avoid exposing this protocol outside the secure links.
o Multicast transport: IPv6 UDP on port EXAMPLE-P2 to link-local
scoped multicast address ff02:EXAMPLE. At least one node per link
in the home is assumed to facilitate node discovery without
depending on any other infrastructure.
o Security: None. It is to be used only on trusted links (WPA2-x
wireless, physically secure wired links).
o Additional TLVs to be ignored: None. No DNCP security is
specified, and no new TLVs are defined outside of node data.
o Node identifier length (DNCP_NODE_IDENTIFIER_LENGTH): 32 bits that
are randomly generated.
o Node identifier collision handling: Pick new random node
identifier.
o Trickle parameters: Imin = 200 ms, Imax = 7, k = 1. It means at
least one multicast per link in 25 seconds in stable state (0.2 *
2^7).
o Hash function H(x) + length: SHA-256, only 128 bits used. It's
relatively fast, and 128 bits should be plenty to prevent random
conflicts (64 bits would most likely be sufficient, too).
o No in-protocol keep-alives (<a href="#section-6.1">Section 6.1</a>); TCP keep-alive is to be
used. In practice, TCP keep-alive is seldom encountered anyway,
as changes in network state cause packets to be sent on the
<span class="grey">Stenberg & Barth Standards Track [Page 40]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
<span class="grey"><a href="./rfc7787">RFC 7787</a> Distributed Node Consensus Protocol April 2016</span>
unicast connections, and those that fail sufficiently many
retransmissions are dropped much before the keep-alive actually
would fire.
o No support for dense multicast-enabled link optimization
(<a href="#section-6.2">Section 6.2</a>); SHSP is a simple protocol for a few nodes (network
wide, not even to mention on a single link) and therefore would
not provide any benefit.
Acknowledgements
Thanks to Ole Troan, Pierre Pfister, Mark Baugher, Mark Townsley,
Juliusz Chroboczek, Jiazi Yi, Mikael Abrahamsson, Brian Carpenter,
Thomas Clausen, DENG Hui, and Margaret Cullen for their contributions
to the document.
Thanks to Kaiwen Jin and Xavier Bonnetain for their related research
work.
Authors' Addresses
Markus Stenberg
Independent
Helsinki 00930
Finland
Email: markus.stenberg@iki.fi
Steven Barth
Independent
Halle 06114
Germany
Email: cyrus@openwrt.org
Stenberg & Barth Standards Track [Page 41]
</pre>
|