summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc8431.txt
blob: 544332d5b5d47b5b2b5bbf1528db91f005ca8b31 (plain) (blame)
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
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
Internet Engineering Task Force (IETF)                           L. Wang
Request for Comments: 8431                                    Individual
Category: Standards Track                                        M. Chen
ISSN: 2070-1721                                                   Huawei
                                                                 A. Dass
                                                                Ericsson
                                                      H. Ananthakrishnan
                                                                 Netflix
                                                                 S. Kini
                                                              Individual
                                                              N. Bahadur
                                                                    Uber
                                                          September 2018


        A YANG Data Model for the Routing Information Base (RIB)

Abstract

   This document defines a YANG data model for the Routing Information
   Base (RIB) that aligns with the Interface to the Routing System
   (I2RS) RIB information model.

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 Section 2 of RFC 7841.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   https://www.rfc-editor.org/info/rfc8431.















Wang, et al.                 Standards Track                    [Page 1]
^L
RFC 8431                     RIB Data Model               September 2018


Copyright Notice

   Copyright (c) 2018 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) 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.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Requirements Language . . . . . . . . . . . . . . . . . .   3
     1.2.  Definitions and Abbreviations . . . . . . . . . . . . . .   3
     1.3.  Tree Diagrams . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Model Structure . . . . . . . . . . . . . . . . . . . . . . .   3
     2.1.  RIB Capability  . . . . . . . . . . . . . . . . . . . . .   8
     2.2.  Routing Instance and RIB  . . . . . . . . . . . . . . . .   8
     2.3.  Route . . . . . . . . . . . . . . . . . . . . . . . . . .   9
     2.4.  Nexthop . . . . . . . . . . . . . . . . . . . . . . . . .  11
     2.5.  RPC Operations  . . . . . . . . . . . . . . . . . . . . .  15
     2.6.  Notifications . . . . . . . . . . . . . . . . . . . . . .  20
   3.  YANG Module . . . . . . . . . . . . . . . . . . . . . . . . .  22
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  67
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  67
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  68
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  68
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  69
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  70
   Contributors  . . . . . . . . . . . . . . . . . . . . . . . . . .  70
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  71














Wang, et al.                 Standards Track                    [Page 2]
^L
RFC 8431                     RIB Data Model               September 2018


1.  Introduction

   The Interface to the Routing System (I2RS) [RFC7921] provides read
   and write access to the information and state within the routing
   process that exists inside the routing elements; this is achieved via
   protocol message exchange between I2RS clients and I2RS agents
   associated with the routing system.  One of the functions of I2RS is
   to read and write data of the Routing Information Base (RIB).
   [I2RS-REQS] introduces a set of RIB use cases.  The RIB information
   model is defined in [RFC8430].

   This document defines a YANG data model [RFC7950] [RFC6991] for the
   RIB that satisfies the RIB use cases and aligns with the RIB
   information model.

1.1.  Requirements Language

   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
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

1.2.  Definitions and Abbreviations

   RIB: Routing Information Base

   FIB: Forwarding Information Base

   RPC: Remote Procedure Call

   IM: Information Model.  An abstract model of a conceptual domain,
   which is independent of a specific implementation or data
   representation.

1.3.  Tree Diagrams

   Tree diagrams used in this document follow the notation defined in
   [RFC8340].

2.  Model Structure

   The following figure shows an overview of the structure tree of the
   ietf-i2rs-rib module.  To give a whole view of the structure tree,
   some details of the tree are omitted.  The relevant details are
   introduced in the subsequent subsections.





Wang, et al.                 Standards Track                    [Page 3]
^L
RFC 8431                     RIB Data Model               September 2018


   module: ietf-i2rs-rib
      +--rw routing-instance
         +--rw name              string
         +--rw interface-list* [name]
         |  +--rw name if:interface-ref
         +--rw router-id?        yang:dotted-quad
         +--rw lookup-limit?     uint8
         +--rw rib-list* [name]
            +--rw name              string
            +--rw address-family address-family-definition
            +--rw ip-rpf-check?     boolean
            +--rw route-list* [route-index]
            |  +--rw route-index                uint64
            |  +--rw match
            |  |  +--rw (route-type)?
            |  |     +--:(ipv4)
            |  |     |  ...
            |  |     +--:(ipv6)
            |  |     |  ...
            |  |     +--:(mpls-route)
            |  |     |  ...
            |  |     +--:(mac-route)
            |  |     |  ...
            |  |     +--:(interface-route)
            |  |        ...
            |  +--rw nexthop
            |  |  +--rw nexthop-id?           uint32
            |  |  +--rw sharing-flag?         boolean
            |  |  +--rw (nexthop-type)?
            |  |     +--:(nexthop-base)
            |  |     |  ...
            |  |     +--:(nexthop-chain) {nexthop-chain}?
            |  |     |  ...
            |  |     +--:(nexthop-replicate) {nexthop-replicate}?
            |  |     |  ...
            |  |     +--:(nexthop-protection) {nexthop-protection}?
            |  |     |  ...
            |  |     +--:(nexthop-load-balance) {nexthop-load-balance}?
            |  |        ...
            |  +--rw route-status
            |  |  ...
            |  +--rw route-attributes
            |  |  ...
            |  +--rw route-vendor-attributes
            +--rw nexthop-list* [nexthop-member-id]
               +--rw nexthop-member-id uint32





Wang, et al.                 Standards Track                    [Page 4]
^L
RFC 8431                     RIB Data Model               September 2018


   rpcs:
      +---x rib-add
      |  +---w input
      |  |  +---w name        string
      |  |  +---w address-family      address-family-definition
      |  |  +---w ip-rpf-check?   boolean
      |  +--ro output
      |     +--ro result boolean
      |     +--ro reason? string
      +---x rib-delete
      |  +---w input
      |  |  +---w name string
      |  +--ro output
      |     +--ro result boolean
      |     +--ro reason? string
      +---x route-add
      |  +---w input
      |  |  +---w return-failure-detail?   boolean
      |  |  +---w rib-name                 string
      |  |  +---w routes
      |  |     +---w route-list* [route-index]
      |  |        ...
      |  +--ro output
      |     +--ro success-count     uint32
      |     +--ro failed-count      uint32
      |     +--ro failure-detail
      |        +--ro failed-routes* [route-index]
      |           +--ro route-index uint32
      |           +--ro error-code? uint32
      +---x route-delete
      |  +---w input
      |  |  +---w return-failure-detail?   boolean
      |  |  +---w rib-name                 string
      |  |  +---w routes
      |  |     +---w route-list* [route-index]
      |  |        ...
      |  +--ro output
      |     +--ro success-count     uint32
      |     +--ro failed-count      uint32
      |     +--ro failure-detail
      |        +--ro failed-routes* [route-index]
      |           +--ro route-index uint32
      |           +--ro error-code? uint32
      +---x route-update
      |  +---w input
      |  |  +---w return-failure-detail?           boolean
      |  |  +---w rib-name                         string




Wang, et al.                 Standards Track                    [Page 5]
^L
RFC 8431                     RIB Data Model               September 2018


      |  |  +---w (match-options)?
      |  |     +--:(match-route-prefix)
      |  |     |  ...
      |  |     +--:(match-route-attributes)
      |  |     |  ...
      |  |     +--:(match-route-vendor-attributes) {...}?
      |  |     |  ...
      |  |     +--:(match-nexthop)
      |  |        ...
      |  +--ro output
      |     +--ro success-count uint32
      |     +--ro failed-count uint32
      |     +--ro failure-detail
      |        +--ro failed-routes* [route-index]
      |           +--ro route-index uint32
      |           +--ro error-code? uint32
      +---x nh-add
      |  +---w input
      |  |  +---w rib-name              string
      |  |  +---w nexthop-id?           uint32
      |  |  +---w sharing-flag?         boolean
      |  |  +---w (nexthop-type)?
      |  |     +--:(nexthop-base)
      |  |     |  ...
      |  |     +--:(nexthop-chain) {nexthop-chain}?
      |  |     |  ...
      |  |     +--:(nexthop-replicate) {nexthop-replicate}?
      |  |     |  ...
      |  |     +--:(nexthop-protection) {nexthop-protection}?
      |  |     |  ...
      |  |     +--:(nexthop-load-balance) {nexthop-load-balance}?
      |  |        ...
      |  +--ro output
      |     +--ro result        boolean
      |     +--ro reason?       string
      |     +--ro nexthop-id?   uint32
      +---x nh-delete
         +---w input
         |  +---w rib-name              string
         |  +---w nexthop-id?           uint32
         |  +---w sharing-flag?         boolean
         |  +---w (nexthop-type)?
         |     +--:(nexthop-base)
         |     |  ...
         |     +--:(nexthop-chain) {nexthop-chain}?
         |     |  ...
         |     +--:(nexthop-replicate) {nexthop-replicate}?
         |     |  ...



Wang, et al.                 Standards Track                    [Page 6]
^L
RFC 8431                     RIB Data Model               September 2018


         |     +--:(nexthop-protection) {nexthop-protection}?
         |     |  ...
         |     +--:(nexthop-load-balance) {nexthop-load-balance}?
         |        ...
         +--ro output
            +--ro result boolean
            +--ro reason? string
   notifications:
      +---n nexthop-resolution-status-change
      |  +--ro nexthop
      |  |  +--ro nexthop-id?           uint32
      |  |  +--ro sharing-flag?         boolean
      |  |  +--ro (nexthop-type)?
      |  |     +--:(nexthop-base)
      |  |     |  ...
      |  |     +--:(nexthop-chain) {nexthop-chain}?
      |  |     |  ...
      |  |     +--:(nexthop-replicate) {nexthop-replicate}?
      |  |     |  ...
      |  |     +--:(nexthop-protection) {nexthop-protection}?
      |  |     |  ...
      |  |     +--:(nexthop-load-balance) {nexthop-load-balance}?
      |  |        ...
      |  +--ro nexthop-state nexthop-state-definition
      +---n route-change
         +--ro rib-name                 string
         +--ro address-family               address-family-definition
         +--ro route-index              uint64
         +--ro match
         |  +--ro (route-type)?
         |     +--:(ipv4)
         |     |  ...
         |     +--:(ipv6)
         |     |  ...
         |     +--:(mpls-route)
         |     |  ...
         |     +--:(mac-route)
         |     |  ...
         |     +--:(interface-route)
         |        ...
         +--ro route-installed-state route-installed-state-definition
         +--ro route-state         route-state-definition
         +--ro route-change-reasons* [route-change-reason]
            +--ro route-change-reason    route-change-reason-definition

              Figure 1: Overview of I2RS RIB Module Structure





Wang, et al.                 Standards Track                    [Page 7]
^L
RFC 8431                     RIB Data Model               September 2018


2.1.  RIB Capability

   RIB capability negotiation is very important because not all of the
   hardware will be able to support all kinds of nexthops, and there
   might be a limitation on how many levels of lookup can be practically
   performed.  Therefore, a RIB data model needs to specify a way for an
   external entity to learn about the functional capabilities of a
   network device.

   At the same time, nexthop chains can be used to specify multiple
   headers over a packet before that particular packet is forwarded.
   Not every network device will be able to support all kinds of nexthop
   chains along with the arbitrary number of headers that are chained
   together.  The RIB data model needs a way to expose the nexthop
   chaining capability supported by a given network device.

   This module uses the feature and if-feature statements to achieve
   above capability advertisement.

2.2.  Routing Instance and RIB

   A routing instance, in the context of the RIB information model, is a
   collection of RIBs, interfaces, and routing protocol parameters.  A
   routing instance creates a logical slice of the router and can allow
   multiple different logical slices, across a set of routers, to
   communicate with each other.  The routing protocol parameters control
   the information available in the RIBs.  More details about a routing
   instance can be found in Section 2.2 of [RFC8430].

   For a routing instance, there can be multiple RIBs.  Therefore, this
   model uses "list" to express the RIBs.  The structure tree is shown
   below:

   +--rw routing-instance
      +--rw name              string
      +--rw interface-list* [name]
      |  +--rw name if:interface-ref
      +--rw router-id?        yang:dotted-quad
      +--rw lookup-limit?     uint8
      +--rw rib-list* [name]
         +--rw name            string
         +--rw address-family      address-family-definition
         +--rw ip-rpf-check?   boolean
         +--rw route-list* [route-index]
            ... // refer to Section 2.3

                   Figure 2: Routing Instance Structure




Wang, et al.                 Standards Track                    [Page 8]
^L
RFC 8431                     RIB Data Model               September 2018


2.3.  Route

   A route is essentially a match condition and an action following that
   match.  The match condition specifies the kind of route (e.g., IPv4,
   MPLS, Media Access Control (MAC), Interface, etc.) and the set of
   fields to match on.

   A route MUST contain the ROUTE_PREFERENCE attribute (see Section 2.3
   of [RFC8430]).

   In addition, a route MUST associate with the following status
   attributes in responses to a RIB writing/reading operation:

   o  Active: Indicates whether a route has at least one fully resolved
      nexthop and is therefore eligible for installation in the FIB.

   o  Installed: Indicates whether the route got installed in the FIB.

   o  Reason: Indicates the specific reason that caused the failure,
      e.g., "Not authorized".

   In addition, a route can be associated with one or more optional
   route-attributes (e.g., route-vendor-attributes).

   A RIB will have a number of routes, so the routes are expressed as a
   list under a specific RIB.  Each RIB has its own route list.

























Wang, et al.                 Standards Track                    [Page 9]
^L
RFC 8431                     RIB Data Model               September 2018


   +--rw route-list* [route-index]
      +--rw route-index                uint64
      +--rw match
      |  +--rw (route-type)?
      |     +--:(ipv4)
      |     |  +--rw ipv4
      |     |     +--rw (ip-route-match-type)?
      |     |        +--:(dest-ipv4-address)
      |     |        |  ...
      |     |        +--:(src-ipv4-address)
      |     |        |  ...
      |     |        +--:(dest-src-ipv4-address)
      |     |           ...
      |     +--:(ipv6)
      |     |  +--rw ipv6
      |     |     +--rw (ip-route-match-type)?
      |     |        +--:(dest-ipv6-address)
      |     |        |  ...
      |     |        +--:(src-ipv6-address)
      |     |        |  ...
      |     |        +--:(dest-src-ipv6-address)
      |     |           ...
      |     +--:(mpls-route)
      |     |  +--rw mpls-label              uint32
      |     +--:(mac-route)
      |     |  +--rw mac-address             uint32
      |     +--:(interface-route)
      |        +--rw interface-identifier if:interface-ref
      +--rw nexthop
      |  ...(refer to Section 2.4)

                        Figure 3: Routes Structure



















Wang, et al.                 Standards Track                   [Page 10]
^L
RFC 8431                     RIB Data Model               September 2018


2.4.  Nexthop

   A nexthop represents an object resulting from a route lookup.  As
   illustrated in Figure 4 of [RFC8430], to support various use cases
   (e.g., load-balancing, protection, multicast, or a combination of
   them), the nexthop is modeled as a multilevel structure and supports
   recursion.  The first level of the nexthop includes the following
   four types:

   o  Base: The "base" nexthop is the foundation of all other nexthop
      types.  It includes the following basic nexthops:

      *  nexthop-id

      *  IPv4 address

      *  IPv6 address

      *  egress-interface

      *  egress-interface with IPv4 address

      *  egress-interface with IPv6 address

      *  egress-interface with MAC address

      *  logical-tunnel

      *  tunnel-encapsulation

      *  tunnel-decapsulation

      *  rib-name

   o  Chain: The "chain" nexthop provides a way to perform multiple
      operations on a packet by logically combining them.

   o  Load-Balance: The "load-balance" nexthop is designed for a load-
      balance case where it normally will have multiple weighted
      nexthops.

   o  Protection: The "protection" nexthop is designed for a protection
      scenario where it normally will have primary and standby nexthop.

   o  Replicate: The "replicate" nexthop is designed for multiple
      destinations forwarding.





Wang, et al.                 Standards Track                   [Page 11]
^L
RFC 8431                     RIB Data Model               September 2018


   The structure tree of nexthop is shown in the following figures.

   +--rw nexthop
   |  +--rw nexthop-id?           uint32
   |  +--rw sharing-flag?         boolean
   |  +--rw (nexthop-type)?
   |     +--:(nexthop-base)
   |     |  ...(refer to Figure 5)
   |     +--:(nexthop-chain) {nexthop-chain}?
   |     |  +--rw nexthop-chain
   |     |     +--rw nexthop-list* [nexthop-member-id]
   |     |        +--rw nexthop-member-id uint32
   |     +--:(nexthop-replicate) {nexthop-replicate}?
   |     |  +--rw nexthop-replicate
   |     |     +--rw nexthop-list* [nexthop-member-id]
   |     |        +--rw nexthop-member-id uint32
   |     +--:(nexthop-protection) {nexthop-protection}?
   |     |  +--rw nexthop-protection
   |     |     +--rw nexthop-list* [nexthop-member-id]
   |     |        +--rw nexthop-member-id uint32
   |     |        +--rw nexthop-preference nexthop-preference-definition
   |     +--:(nexthop-load-balance) {nexthop-load-balance}?
   |        +--rw nexthop-lb
   |           +--rw nexthop-list* [nexthop-member-id]
   |              +--rw nexthop-member-id uint32
   |              +--rw nexthop-lb-weight nexthop-lb-weight-definition

                        Figure 4: Nexthop Structure

   Figure 5 (as shown below) is a subtree of nexthop.  It's under the
   nexthop base node and shows the structure of the "base" nexthop.

+--:(nexthop-base)
|  +--rw nexthop-base
|     +--rw (nexthop-base-type)?
|        +--:(special-nexthop)
|        |  +--rw special? special-nexthop-definition
|        +--:(egress-interface-nexthop)
|        |  +--rw outgoing-interface if:interface-ref
|        +--:(ipv4-address-nexthop)
|        |  +--rw ipv4-address inet:ipv4-address
|        +--:(ipv6-address-nexthop)
|        |  +--rw ipv6-address inet:ipv6-address
|        +--:(egress-interface-ipv4-nexthop)
|        |  +--rw egress-interface-ipv4-address
|        |     +--rw outgoing-interface if:interface-ref
|        |     +--rw ipv4-address       inet:ipv4-address




Wang, et al.                 Standards Track                   [Page 12]
^L
RFC 8431                     RIB Data Model               September 2018


|        +--:(egress-interface-ipv6-nexthop)
|        |  +--rw egress-interface-ipv6-address
|        |     +--rw outgoing-interface if:interface-ref
|        |     +--rw ipv6-address       inet:ipv6-address
|        +--:(egress-interface-mac-nexthop)
|        |  +--rw egress-interface-mac-address
|        |     +--rw outgoing-interface if:interface-ref
|        |     +--rw ieee-mac-address yang:mac-address
|        +--:(tunnel-encapsulation-nexthop) {nexthop-tunnel}?
|        |  +--rw tunnel-encapsulation
|        |     +--rw (tunnel-type)?
|        |        +--:(ipv4) {ipv4-tunnel}?
|        |        |  +--rw ipv4-header
|        |        |     +--rw src-ipv4-address inet:ipv4-address
|        |        |     +--rw dest-ipv4-address inet:ipv4-address
|        |        |     +--rw protocol          uint8
|        |        |     +--rw ttl?              uint8
|        |        |     +--rw dscp?             uint8
|        |        +--:(ipv6) {ipv6-tunnel}?
|        |        |  +--rw ipv6-header
|        |        |     +--rw src-ipv6-address inet:ipv6-address
|        |        |     +--rw dest-ipv6-address inet:ipv6-address
|        |        |     +--rw next-header       uint8
|        |        |     +--rw traffic-class? uint8
|        |        |     +--rw flow-label?
|        |        |             inet:ipv6-flow-label
|        |        |     +--rw hop-limit?        uint8
|        |        +--:(mpls) {mpls-tunnel}?
|        |        |  +--rw mpls-header
|        |        |     +--rw label-operations* [label-oper-id]
|        |        |        +--rw label-oper-id uint32
|        |        |        +--rw (label-actions)?
|        |        |           +--:(label-push)
|        |        |           |  +--rw label-push
|        |        |           |     +--rw label        uint32
|        |        |           |     +--rw s-bit?       boolean
|        |        |           |     +--rw tc-value? uint8
|        |        |           |     +--rw ttl-value? uint8
|        |        |           +--:(label-swap)
|        |        |              +--rw label-swap
|        |        |                 +--rw out-label     uint32
|        |        |                 +--rw ttl-action?
|        |        |                         ttl-action-definition
|        |        +--:(gre) {gre-tunnel}?
|        |        |  +--rw gre-header
|        |        |     +--rw (dest-address-type)?





Wang, et al.                 Standards Track                   [Page 13]
^L
RFC 8431                     RIB Data Model               September 2018


|        |        |     |  +--:(ipv4)
|        |        |     |  |  +--rw ipv4-dest inet:ipv4-address
|        |        |     |  +--:(ipv6)
|        |        |     |     +--rw ipv6-dest inet:ipv6-address
|        |        |     +--rw protocol-type uint16
|        |        |     +--rw key?          uint64
|        |        +--:(nvgre) {nvgre-tunnel}?
|        |        |  +--rw nvgre-header
|        |        |     +--rw (nvgre-type)?
|        |        |     |  +--:(ipv4)
|        |        |     |  |  +--rw src-ipv4-address inet:ipv4-address
|        |        |     |  |  +--rw dest-ipv4-address inet:ipv4-address
|        |        |     |  |  +--rw protocol          uint8
|        |        |     |  |  +--rw ttl?              uint8
|        |        |     |  |  +--rw dscp?             uint8
|        |        |     |  +--:(ipv6)
|        |        |     |     +--rw src-ipv6-address inet:ipv6-address
|        |        |     |     +--rw dest-ipv6-address inet:ipv6-address
|        |        |     |     +--rw next-header       uint8
|        |        |     |     +--rw traffic-class?    uint8
|        |        |     |     +--rw flow-label?
|        |        |     |             inet:ipv6-flow-label
|        |        |     |     +--rw hop-limit?        uint8
|        |        |     +--rw virtual-subnet-id uint32
|        |        |     +--rw flow-id?          uint8
|        |        +--:(vxlan) {vxlan-tunnel}?
|        |           +--rw vxlan-header
|        |              +--rw (vxlan-type)?
|        |              |  +--:(ipv4)
|        |              |  |  +--rw src-ipv4-address inet:ipv4-address
|        |              |  |  +--rw dest-ipv4-address inet:ipv4-address
|        |              |  |  +--rw protocol             uint8
|        |              |  |  +--rw ttl?                 uint8
|        |              |  |  +--rw dscp?                uint8
|        |              |  +--:(ipv6)
|        |              |     +--rw src-ipv6-address inet:ipv6-address
|        |              |     +--rw dest-ipv6-address inet:ipv6-address
|        |              |     +--rw next-header          uint8
|        |              |     +--rw traffic-class?       uint8
|        |              |     +--rw flow-label? inet:ipv6-flow-label
|        |              |     +--rw hop-limit?           uint8
|        |              +--rw vxlan-identifier     uint32
|        +--:(tunnel-decapsulation-nexthop) {nexthop-tunnel}?
|        |  +--rw tunnel-decapsulation
|        |     +--rw (tunnel-type)?






Wang, et al.                 Standards Track                   [Page 14]
^L
RFC 8431                     RIB Data Model               September 2018


|        |        +--:(ipv4) {ipv4-tunnel}?
|        |        |  +--rw ipv4-decapsulation
|        |        |     +--rw ipv4-decapsulation
|        |        |             tunnel-decapsulation-action-definition
|        |        |     +--rw ttl-action?   ttl-action-definition
|        |        +--:(ipv6) {ipv6-tunnel}?
|        |        |  +--rw ipv6-decapsulation
|        |        |     +--rw ipv6-decapsulation
|        |        |             tunnel-decapsulation-action-definition
|        |        |     +--rw hop-limit-action?
|        |        |             hop-limit-action-definition
|        |        +--:(mpls) {mpls-tunnel}?
|        |           +--rw label-pop
|        |              +--rw label-pop     mpls-label-action-definition
|        |              +--rw ttl-action?   ttl-action-definition
|        +--:(logical-tunnel-nexthop) {nexthop-tunnel}?
|        |  +--rw logical-tunnel
|        |     +--rw tunnel-type tunnel-type-definition
|        |     +--rw tunnel-name string
|        +--:(rib-name-nexthop)
|        |  +--rw rib-name?                        string
|        +--:(nexthop-identifier)
|           +--rw nexthop-ref                      nexthop-ref

                     Figure 5: Nexthop Base Structure

2.5.  RPC Operations

   This module defines the following RPC operations:

   o  rib-add: Add a RIB to a routing instance.  The following are
      passed as the input parameters: the name of the RIB, the address
      family of the RIB, and (optionally) whether the RPF check is
      enabled.  The output is the result of the add operation:

      *  true - success

      *  false - failed (when failed, the I2RS agent may return the
         specific reason that caused the failure)












Wang, et al.                 Standards Track                   [Page 15]
^L
RFC 8431                     RIB Data Model               September 2018


   o  rib-delete: Delete a RIB from a routing instance.  When a RIB is
      deleted, all routes installed in the RIB will be deleted.  A rib-
      name is passed as the input parameter.  The output is the result
      of the delete operation:

      *  true - success

      *  false - failed (when failed, the I2RS agent may return the
         specific reason that caused the failure)

   o  route-add: Add a route or a set of routes to a RIB.  The following
      are passed as the input parameters: the name of the RIB, the route
      prefix(es), the route-attributes, the route-vendor-attributes, the
      nexthop, and the "whether to return failure details" indication.
      Before calling the route-add rpc, it is required to call the nh-
      add rpc to create and/or return the nexthop identifier.  However,
      in situations when the nexthop already exists and the nexthop-id
      is known, this action is not expected.  The output is a
      combination of the route operation states while querying the
      appropriate node in the data tree, which includes:

      *  success-count: the number of routes that were successfully
         added;

      *  failed-count: the number of the routes that failed to be added;
         and,

      *  failure-detail: this shows the specific routes that failed to
         be added.

   o  route-delete: Delete a route or a set of routes from a RIB.  The
      following are passed as the input parameters: the name of the RIB,
      the route prefix(es), and the "whether to return failure details"
      indication.  The output is a combination of route operation
      states, which includes:

      *  success-count: the number of routes that were successfully
         deleted;

      *  failed-count: the number of the routes that failed to be
         deleted; and,

      *  failure-detail: this shows the specific routes that failed to
         be deleted.







Wang, et al.                 Standards Track                   [Page 16]
^L
RFC 8431                     RIB Data Model               September 2018


   o  route-update: Update a route or a set of routes.  The following
      are passed as the input parameters: the name of the RIB, the route
      prefix(es), the route-attributes, the route-vendor-attributes, or
      the nexthop.  The match conditions can be either route prefix(es),
      route-attributes, route-vendor-attributes, or nexthops.  The
      update actions include the following: update the nexthops, update
      the route-attributes, and update the route-vendor-attributes.  The
      output is a combination of the route operation states, which
      includes:

      *  success-count: the number of routes that were successfully
         updated;

      *  failed-count: the number of the routes that failed to be
         updated; and,

      *  failure-detail: this shows the specific routes that failed to
         be updated.

   o  nh-add: Add a nexthop to a RIB.  The following are passed as the
      input parameters: the name of the RIB and the nexthop.  The
      network node is required to allocate a nexthop identifier to the
      nexthop.  The outputs include the result of the nexthop add
      operation.

      *  true - success (when success, a nexthop identifier will be
         returned to the I2RS client)

      *  false - failed (when failed, the I2RS agent may return the
         specific reason that caused the failure)

   o  nh-delete: Delete a nexthop from a RIB.  The following are passed
      as the input parameters: the name of the RIB and a nexthop or
      nexthop identifier.  The output is the result of the delete
      operation:

      *  true - success

      *  false - failed (when failed, the I2RS agent may return the
         specific reason that caused the failure)











Wang, et al.                 Standards Track                   [Page 17]
^L
RFC 8431                     RIB Data Model               September 2018


   The structure tree of rpcs is shown in following figure.

   rpcs:
      +---x rib-add
      |  +---w input
      |  |  +---w rib-name        string
      |  |  +---w address-family      address-family-definition
      |  |  +---w ip-rpf-check?   boolean
      |  +--ro output
      |     +--ro result uint32
      |     +--ro reason? string
      +---x rib-delete
      |  +---w input
      |  |  +---w rib-name string
      |  +--ro output
      |     +--ro result uint32
      |     +--ro reason? string
      +---x route-add
      |  +---w input
      |  |  +---w return-failure-detail?   boolean
      |  |  +---w rib-name                 string
      |  |  +---w routes
      |  |     +---w route-list* [route-index]
      |  |        ...
      |  +--ro output
      |     +--ro success-count     uint32
      |     +--ro failed-count      uint32
      |     +--ro failure-detail
      |        +--ro failed-routes* [route-index]
      |           +--ro route-index uint32
      |           +--ro error-code? uint32
      +---x route-delete
      |  +---w input
      |  |  +---w return-failure-detail?   boolean
      |  |  +---w rib-name                 string
      |  |  +---w routes
      |  |     +---w route-list* [route-index]
      |  |        ...
      |  +--ro output
      |     +--ro success-count     uint32
      |     +--ro failed-count      uint32
      |     +--ro failure-detail
      |        +--ro failed-routes* [route-index]
      |           +--ro route-index uint32
      |           +--ro error-code? uint32






Wang, et al.                 Standards Track                   [Page 18]
^L
RFC 8431                     RIB Data Model               September 2018


      +---x route-update
      |  +---w input
      |  |  +---w return-failure-detail?           boolean
      |  |  +---w rib-name                         string
      |  |  +---w (match-options)?
      |  |     +--:(match-route-prefix)
      |  |     |  ...
      |  |     +--:(match-route-attributes)
      |  |     |  ...
      |  |     +--:(match-route-vendor-attributes) {...}?
      |  |     |  ...
      |  |     +--:(match-nexthop)
      |  |        ...
      |  +--ro output
      |     +--ro success-count uint32
      |     +--ro failed-count uint32
      |     +--ro failure-detail
      |        +--ro failed-routes* [route-index]
      |           +--ro route-index uint32
      |           +--ro error-code? uint32
      +---x nh-add
      |  +---w input
      |  |  +---w rib-name              string
      |  |  +---w nexthop-id?           uint32
      |  |  +---w sharing-flag?         boolean
      |  |  +---w (nexthop-type)?
      |  |     ...
      |  +--ro output
      |     +--ro result        uint32
      |     +--ro reason?       string
      |     +--ro nexthop-id?   uint32
      +---x nh-delete
         +---w input
         |  +---w rib-name              string
         |  +---w nexthop-id?           uint32
         |  +---w sharing-flag?         boolean
         |  +---w (nexthop-type)?
         |     ...
         +--ro output
            +--ro result uint32
            +--ro reason? string

                         Figure 6: RPCs Structure








Wang, et al.                 Standards Track                   [Page 19]
^L
RFC 8431                     RIB Data Model               September 2018


2.6.  Notifications

   Asynchronous notifications are sent by the RIB manager of a network
   device to an external entity when some event triggers on the network
   device.  An implementation of this RIB data model MUST support
   sending two kinds of asynchronous notifications.

   1.  Route change notification:

   o Installed (indicates whether the route got installed in the FIB)

   o Active (indicates whether a route has at least one fully resolved
   nexthop and is therefore eligible for installation in the FIB)

   o Reason (e.g., "Not authorized")

   2.  Nexthop resolution status notification

   Nexthops can be fully resolved or unresolved.

   A resolved nexthop has an adequate level of information to send the
   outgoing packet towards the destination by forwarding it on an
   interface to a directly connected neighbor.

   An unresolved nexthop is something that requires the RIB manager to
   determine the final resolved nexthop.  In one example, a nexthop
   could be an IP address.  The RIB manager would resolve how to reach
   that IP address, e.g., by checking if that particular IP address is
   reachable by regular IP forwarding, by an MPLS tunnel, or by both.
   If the RIB manager cannot resolve the nexthop, then the nexthop
   remains in an unresolved state and is NOT a suitable candidate for
   installation in the FIB.

   An implementation of this RIB data model MUST support sending route-
   change notifications whenever a route transitions between the
   following states:

   o  from the active state to the inactive state

   o  from the inactive state to the active state

   o  from the installed state to the uninstalled state

   o  from the uninstalled state to the installed state

   A single notification MAY be used when a route transitions from
   inactive/uninstalled to active/installed or in the other direction.




Wang, et al.                 Standards Track                   [Page 20]
^L
RFC 8431                     RIB Data Model               September 2018


   The structure tree of notifications is shown in the following figure.

   notifications:
        +---n nexthop-resolution-status-change
        |  +--ro nexthop
        |  |  +--ro nexthop-id            uint32
        |  |  +--ro sharing-flag          boolean
        |  |  +--ro (nexthop-type)?
        |  |     +--:(nexthop-base)
        |  |     |  ...
        |  |     +--:(nexthop-chain) {nexthop-chain}?
        |  |     |  ...
        |  |     +--:(nexthop-replicate) {nexthop-replicate}?
        |  |     |  ...
        |  |     +--:(nexthop-protection) {nexthop-protection}?
        |  |     |  ...
        |  |     +--:(nexthop-load-balance) {nexthop-load-balance}?
        |  |        ...
        |  +--ro nexthop-state nexthop-state-definition
        +---n route-change
           +--ro rib-name                 string
           +--ro address-family           address-family-definition
           +--ro route-index              uint64
           +--ro match
           |  +--ro (route-type)?
           |     +--:(ipv4)
           |     |  ...
           |     +--:(ipv6)
           |     |  ...
           |     +--:(mpls-route)
           |     |  ...
           |     +--:(mac-route)
           |     |  ...
           |     +--:(interface-route)
           |        ...
           +--ro route-installed-state route-installed-state-definition
           +--ro route-state              route-state-definition
           +--ro route-change-reason      route-change-reason-definition

                     Figure 7: Notifications Structure











Wang, et al.                 Standards Track                   [Page 21]
^L
RFC 8431                     RIB Data Model               September 2018


3.  YANG Module

   This YANG module references [RFC2784], [RFC7348], [RFC7637], and
   [RFC8344].

   <CODE BEGINS> file "ietf-i2rs-rib@2018-09-13.yang"

   module ietf-i2rs-rib {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-i2rs-rib";
     prefix iir;

     import ietf-inet-types {
       prefix inet;
       reference "RFC 6991";
     }
     import ietf-interfaces {
       prefix if;
       reference "RFC 8344";
     }
     import ietf-yang-types {
       prefix yang;
       reference "RFC 6991";
     }

     organization
       "IETF I2RS (Interface to Routing System) Working Group";
     contact
       "WG Web:   <https://datatracker.ietf.org/wg/i2rs/>
        WG List:  <mailto:i2rs@ietf.org>

        Editor:   Lixing Wang
                  <mailto:wang_little_star@sina.com>

        Editor:   Mach(Guoyi) Chen
                  <mailto:mach.chen@huawei.com>

        Editor:   Amit Dass
                  <mailto:dass.amit@gmail.com>

        Editor:   Hariharan Ananthakrishnan
                  <mailto:hari@netflix.com>

        Editor:   Sriganesh Kini
                  <mailto:sriganeshkini@gmail.com>

        Editor:   Nitin Bahadur
                  <mailto:nitin_bahadur@yahoo.com>";



Wang, et al.                 Standards Track                   [Page 22]
^L
RFC 8431                     RIB Data Model               September 2018


     description
       "This module defines a YANG data model for
        Routing Information Base (RIB) that aligns
        with the I2RS RIB information model.

        Copyright (c) 2018 IETF Trust and the persons
        identified as authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC 8341; see
        the RFC itself for full legal notices.";

     revision 2018-09-13 {
       description
         "initial revision";
       reference "RFC 8431";
     }

     //Features

     feature nexthop-tunnel {
       description
         "This feature means that a node supports
          tunnel nexthop capability.";
     }

     feature nexthop-chain {
       description
         "This feature means that a node supports
          chain nexthop capability.";
     }

     feature nexthop-protection {
       description
         "This feature means that a node supports
          protection nexthop capability.";
     }

     feature nexthop-replicate {
       description
         "This feature means that a node supports
          replicate nexthop capability.";



Wang, et al.                 Standards Track                   [Page 23]
^L
RFC 8431                     RIB Data Model               September 2018


     }

     feature nexthop-load-balance {
       description
         "This feature means that a node supports
          load-balance nexthop capability.";
     }

     feature ipv4-tunnel {
       description
         "This feature means that a node supports
          IPv4 tunnel encapsulation capability.";
     }

     feature ipv6-tunnel {
       description
         "This feature means that a node supports
          IPv6 tunnel encapsulation capability.";
     }

     feature mpls-tunnel {
       description
         "This feature means that a node supports
          MPLS tunnel encapsulation capability.";
     }

     feature vxlan-tunnel {
       description
         "This feature means that a node supports
          Virtual eXtensible Local Area Network
          (VXLAN) tunnel encapsulation capability.";
       reference "RFC 7348";
     }

     feature gre-tunnel {
       description
         "This feature means that a node supports
          GRE tunnel encapsulation capability.";
       reference "RFC 2784";
     }

     feature nvgre-tunnel {
       description
         "This feature means that a node supports
          Network Virtualization Using GRE (NVGRE)
          tunnel encapsulation capability.";
       reference "RFC 7637";
     }



Wang, et al.                 Standards Track                   [Page 24]
^L
RFC 8431                     RIB Data Model               September 2018


     feature route-vendor-attributes {
       description
         "This feature means that a node supports
          route vendor attributes.";
     }

     //Identities and Type Definitions

     identity mpls-label-action {
       description
         "Base identity from which all MPLS label
          operations are derived.

          The MPLS label stack operations include:
          push - to add a new label to a label stack
          pop -  to pop the top label from a label stack
          swap - to exchange the top label of a label
                 stack with a new label";
     }

     identity label-push {
       base mpls-label-action;
       description
         "MPLS label stack operation: push.";
     }

     identity label-pop {
       base mpls-label-action;
       description
         "MPLS label stack operation: pop.";
     }

     identity label-swap {
       base mpls-label-action;
       description
         "MPLS label stack operation: swap.";
     }

     typedef mpls-label-action-definition {
       type identityref {
         base mpls-label-action;
       }
       description
         "MPLS label action definition.";
     }

     identity tunnel-decapsulation-action {
       description



Wang, et al.                 Standards Track                   [Page 25]
^L
RFC 8431                     RIB Data Model               September 2018


         "Base identity from which all tunnel decapsulation
          actions are derived.
          Tunnel decapsulation actions include
          ipv4-decapsulation (to decapsulate an IPv4 tunnel)
          ipv6-decapsulation (to decapsulate an IPv6 tunnel)";
     }

     identity ipv4-decapsulation {
       base tunnel-decapsulation-action;
       description
         "IPv4 tunnel decapsulation.";
     }

     identity ipv6-decapsulation {
       base tunnel-decapsulation-action;
       description
         "IPv6 tunnel decapsulation.";
     }

     typedef tunnel-decapsulation-action-definition {
       type identityref {
         base tunnel-decapsulation-action;
       }
       description
         "Tunnel decapsulation definition.";
     }

     identity ttl-action {
       description
         "Base identity from which all TTL
          actions are derived.";
     }

     identity no-action {
       base ttl-action;
       description
         "Do nothing regarding the TTL.";
     }

     identity copy-to-inner {
       base ttl-action;
       description
         "Copy the TTL of the outer header
          to the inner header.";
     }

     identity decrease-and-copy-to-inner {
       base ttl-action;



Wang, et al.                 Standards Track                   [Page 26]
^L
RFC 8431                     RIB Data Model               September 2018


       description
         "Decrease TTL by one and copy the TTL
          to the inner header.";
     }

     identity decrease-and-copy-to-next {
       base ttl-action;
       description
         "Decrease TTL by one and copy the TTL
          to the next header; for example, when
          MPLS label swapping, decrease the TTL
          of the in_label and copy it to the
          out_label.";
     }

     typedef ttl-action-definition {
       type identityref {
         base ttl-action;
       }
       description
         "TTL action definition.";
     }

     identity hop-limit-action {
       description
         "Base identity from which all hop limit
          actions are derived.";
     }

     identity hop-limit-no-action {
       base hop-limit-action;
       description
         "Do nothing regarding the hop limit.";
     }

     identity hop-limit-copy-to-inner {
       base hop-limit-action;
       description
         "Copy the hop limit of the outer header
          to the inner header.";
     }

     typedef hop-limit-action-definition {
       type identityref {
         base hop-limit-action;
       }
       description
         "IPv6 hop limit action definition.";



Wang, et al.                 Standards Track                   [Page 27]
^L
RFC 8431                     RIB Data Model               September 2018


     }

     identity special-nexthop {
       description
         "Base identity from which all special
          nexthops are derived.";
     }

     identity discard {
       base special-nexthop;
       description
         "This indicates that the network
          device should drop the packet and
          increment a drop counter.";
     }

     identity discard-with-error {
       base special-nexthop;
       description
         "This indicates that the network
          device should drop the packet,
          increment a drop counter, and send
          back an appropriate error message
          (like ICMP error).";
     }

     identity receive {
       base special-nexthop;
       description
         "This indicates that the traffic is
          destined for the network device, e.g.,
          protocol packets or Operations,
          Administration, and Maintenance (OAM) packets.
          All locally destined traffic SHOULD be
          throttled to avoid a denial-of-service
          attack on the router's control plane.  An
          optional rate-limiter can be specified
          to indicate how to throttle traffic
          destined for the control plane.";
     }

     identity cos-value {
       base special-nexthop;
       description
         "Cos-value special nexthop.";
     }

     typedef special-nexthop-definition {



Wang, et al.                 Standards Track                   [Page 28]
^L
RFC 8431                     RIB Data Model               September 2018


       type identityref {
         base special-nexthop;
       }
       description
         "Special nexthop definition.";
     }

     identity ip-route-match-type {
       description
         "Base identity from which all route
          match types are derived.
          The route match type could be:
          match source, or
          match destination, or
          match source and destination.";
     }

     identity match-ip-src {
       base ip-route-match-type;
       description
         "Source route match type.";
     }

     identity match-ip-dest {
       base ip-route-match-type;
       description
         "Destination route match type";
     }

     identity match-ip-src-dest {
       base ip-route-match-type;
       description
         "Source and Destination route match type";
     }

     typedef ip-route-match-type-definition {
       type identityref {
         base ip-route-match-type;
       }
       description
         "IP route match type definition.";
     }

     identity address-family {
       description
         "Base identity from which all RIB
          address families are derived.";
     }



Wang, et al.                 Standards Track                   [Page 29]
^L
RFC 8431                     RIB Data Model               September 2018


     identity ipv4-address-family {
       base address-family;
       description
         "IPv4 RIB address family.";
     }

     identity ipv6-address-family {
       base address-family;
       description
         "IPv6 RIB address family.";
     }

     identity mpls-address-family {
       base address-family;
       description
         "MPLS RIB address family.";
     }

     identity ieee-mac-address-family {
       base address-family;
       description
         "MAC RIB address family.";
     }

     typedef address-family-definition {
       type identityref {
         base address-family;
       }
       description
         "RIB address family definition.";
     }

     identity route-type {
       description
         "Base identity from which all route types
          are derived.";
     }

     identity ipv4-route {
       base route-type;
       description
         "IPv4 route type.";
     }

     identity ipv6-route {
       base route-type;
       description
         "IPv6 route type.";



Wang, et al.                 Standards Track                   [Page 30]
^L
RFC 8431                     RIB Data Model               September 2018


     }

     identity mpls-route {
       base route-type;
       description
         "MPLS route type.";
     }

     identity ieee-mac {
       base route-type;
       description
         "MAC route type.";
     }

     identity interface {
       base route-type;
       description
         "Interface route type.";
     }

     typedef route-type-definition {
       type identityref {
         base route-type;
       }
       description
         "Route type definition.";
     }

     identity tunnel-type {
       description
         "Base identity from which all tunnel
          types are derived.";
     }

     identity ipv4-tunnel {
       base tunnel-type;
       description
         "IPv4 tunnel type";
     }

     identity ipv6-tunnel {
       base tunnel-type;
       description
         "IPv6 tunnel type";
     }

     identity mpls-tunnel {
       base tunnel-type;



Wang, et al.                 Standards Track                   [Page 31]
^L
RFC 8431                     RIB Data Model               September 2018


       description
         "MPLS tunnel type";
     }

     identity gre-tunnel {
       base tunnel-type;
       description
         "GRE tunnel type";
     }

     identity vxlan-tunnel {
       base tunnel-type;
       description
         "VXLAN tunnel type";
     }

     identity nvgre-tunnel {
       base tunnel-type;
       description
         "NVGRE tunnel type";
     }

     typedef tunnel-type-definition {
       type identityref {
         base tunnel-type;
       }
       description
         "Tunnel type definition.";
     }

     identity route-state {
       description
         "Base identity from which all route
          states are derived.";
     }

     identity active {
       base route-state;
       description
         "Active state.";
     }

     identity inactive {
       base route-state;
       description
         "Inactive state.";
     }




Wang, et al.                 Standards Track                   [Page 32]
^L
RFC 8431                     RIB Data Model               September 2018


     typedef route-state-definition {
       type identityref {
         base route-state;
       }
       description
         "Route state definition.";
     }

     identity nexthop-state {
       description
         "Base identity from which all nexthop
          states are derived.";
     }

     identity resolved {
       base nexthop-state;
       description
         "Resolved nexthop state.";
     }

     identity unresolved {
       base nexthop-state;
       description
         "Unresolved nexthop state.";
     }

     typedef nexthop-state-definition {
       type identityref {
         base nexthop-state;
       }
       description
         "Nexthop state definition.";
     }

     identity route-installed-state {
       description
         "Base identity from which all route
          installed states are derived.";
     }

     identity uninstalled {
       base route-installed-state;
       description
         "Uninstalled state.";
     }

     identity installed {
       base route-installed-state;



Wang, et al.                 Standards Track                   [Page 33]
^L
RFC 8431                     RIB Data Model               September 2018


       description
         "Installed state.";
     }

     typedef route-installed-state-definition {
       type identityref {
         base route-installed-state;
       }
       description
         "Route installed state definition.";
     }

     //Route Change Reason Identities

     identity route-change-reason {
       description
         "Base identity from which all route change
          reasons are derived.";
     }

     identity lower-route-preference {
       base route-change-reason;
       description
         "This route was installed in the FIB because it had
          a lower route preference value (and thus was more
          preferred) than the route it replaced.";
     }

     identity higher-route-preference {
       base route-change-reason;
       description
         "This route was uninstalled from the FIB because it had
          a higher route preference value (and thus was less
          preferred) than the route that replaced it.";
     }

     identity resolved-nexthop {
       base route-change-reason;
       description
         "This route was made active because at least
          one of its nexthops was resolved.";
     }

     identity unresolved-nexthop {
       base route-change-reason;
       description
         "This route was made inactive because all of
          its nexthops are unresolved.";



Wang, et al.                 Standards Track                   [Page 34]
^L
RFC 8431                     RIB Data Model               September 2018


     }

     typedef route-change-reason-definition {
       type identityref {
         base route-change-reason;
       }
       description
         "Route change reason definition.";
     }

     typedef nexthop-preference-definition {
       type uint8 {
         range "1..99";
       }
       description
         "Nexthop-preference is used for protection schemes.
          It is an integer value between 1 and 99.  Lower
          values are preferred.  To download N
          nexthops to the FIB, the N nexthops with the lowest
          value are selected.  If there are more than N
          nexthops that have the same preference, an
          implementation of the I2RS client should select N
          nexthops and download them.  As for how to select
          the nexthops, this is left to the implementations.";
     }

     typedef nexthop-lb-weight-definition {
       type uint8 {
         range "1..99";
       }
       description
         "Nexthop-lb-weight is used for load-balancing.
          Each list member SHOULD be assigned a weight
          between 1 and 99.  The weight determines the
          proportion of traffic to be sent over a nexthop
          used for forwarding as a ratio of the weight of
          this nexthop divided by the sum of the weights
          of all the nexthops of this route that are used
          for forwarding.  To perform equal load-balancing,
          one MAY specify a weight of 0 for all the member
          nexthops.  The value 0 is reserved for equal
          load-balancing and, if applied, MUST be applied
          to all member nexthops.
          Note that the weight of 0 is special because of
          historical reasons.  It's typically used in
          hardware devices to signify ECMP.";
     }




Wang, et al.                 Standards Track                   [Page 35]
^L
RFC 8431                     RIB Data Model               September 2018


     typedef nexthop-ref {
       type leafref {
         path  "/iir:routing-instance" +
               "/iir:rib-list" +
               "/iir:route-list" +
               "/iir:nexthop" +
               "/iir:nexthop-id";
       }
       description
         "A nexthop reference that provides
          an indirection reference to a nexthop.";
     }

     //Groupings

     grouping route-prefix {
       description
         "The common attributes used for all types of route prefixes.";
       leaf route-index {
         type uint64;
         mandatory true;
         description
           "Route index.";
       }
       container match {
         description
           "The match condition specifies the
            kind of route (IPv4, MPLS, etc.)
            and the set of fields to match on.";
         choice route-type {
           description
             "Route types: IPv4, IPv6, MPLS, MAC, etc.";
           case ipv4 {
             description
               "IPv4 route case.";
             container ipv4 {
               description
                 "IPv4 route match.";
               choice ip-route-match-type {
                 description
                   "IP route match type options:
                    match source, or
                    match destination, or
                    match source and destination.";
                 case dest-ipv4-address {
                   leaf dest-ipv4-prefix {
                     type inet:ipv4-prefix;
                     mandatory true;



Wang, et al.                 Standards Track                   [Page 36]
^L
RFC 8431                     RIB Data Model               September 2018


                     description
                       "An IPv4 destination address as the match.";
                   }
                 }
                 case src-ipv4-address {
                   leaf src-ipv4-prefix {
                     type inet:ipv4-prefix;
                     mandatory true;
                     description
                       "An IPv4 source address as the match.";
                   }
                 }
                 case dest-src-ipv4-address {
                   container dest-src-ipv4-address {
                     description
                       "A combination of an IPv4 source and
                        an IPv4 destination address as the match.";
                     leaf dest-ipv4-prefix {
                       type inet:ipv4-prefix;
                       mandatory true;
                       description
                         "The IPv4 destination address of the match.";
                     }
                     leaf src-ipv4-prefix {
                       type inet:ipv4-prefix;
                       mandatory true;
                       description
                         "The IPv4 source address of the match.";
                     }
                   }
                 }
               }
             }
           }
           case ipv6 {
             description
               "IPv6 route case.";
             container ipv6 {
               description
                 "IPv6 route match.";
               choice ip-route-match-type {
                 description
                   "IP route match type options:
                    match source,
                    match destination, or
                    match source and destination.";
                 case dest-ipv6-address {
                   leaf dest-ipv6-prefix {



Wang, et al.                 Standards Track                   [Page 37]
^L
RFC 8431                     RIB Data Model               September 2018


                     type inet:ipv6-prefix;
                     mandatory true;
                     description
                       "An IPv6 destination address as the match.";
                   }
                 }
                 case src-ipv6-address {
                   leaf src-ipv6-prefix {
                     type inet:ipv6-prefix;
                     mandatory true;
                     description
                       "An IPv6 source address as the match.";
                   }
                 }
                 case dest-src-ipv6-address {
                   container dest-src-ipv6-address {
                     description
                       "A combination of an IPv6 source and
                        an IPv6 destination address as the match.";
                     leaf dest-ipv6-prefix {
                       type inet:ipv6-prefix;
                       mandatory true;
                       description
                         "The IPv6 destination address of the match.";
                     }
                     leaf src-ipv6-prefix {
                       type inet:ipv6-prefix;
                       mandatory true;
                       description
                         "The IPv6 source address of the match.";
                     }
                   }
                 }
               }
             }
           }
           case mpls-route {
             description
               "MPLS route case.";
             leaf mpls-label {
               type uint32;
               mandatory true;
               description
                 "The label used for matching.";
             }
           }
           case mac-route {
             description



Wang, et al.                 Standards Track                   [Page 38]
^L
RFC 8431                     RIB Data Model               September 2018


               "MAC route case.";
             leaf mac-address {
               type yang:mac-address;
               mandatory true;
               description
                 "The MAC address used for matching.";
             }
           }
           case interface-route {
             description
               "Interface route case.";
             leaf interface-identifier {
               type if:interface-ref;
               mandatory true;
               description
                 "The interface used for matching.";
             }
           }
         }
       }
     }

     grouping route {
       description
         "The common attributes used for all types of routes.";
       uses route-prefix;
       container nexthop {
         description
           "The nexthop of the route.";
         uses nexthop;
       }
       //In the information model, it is called route-statistic
       container route-status {
         description
           "The status information of the route.";
         leaf route-state {
           type route-state-definition;
           config false;
           description
             "Indicate a route's state: active or inactive.";
         }
         leaf route-installed-state {
           type route-installed-state-definition;
           config false;
           description
             "Indicate that a route's installed states:
              installed or uninstalled.";
         }



Wang, et al.                 Standards Track                   [Page 39]
^L
RFC 8431                     RIB Data Model               September 2018


         leaf route-reason {
           type route-change-reason-definition;
           config false;
           description
             "Indicate the reason that caused the route change.";
         }
       }
       container route-attributes {
         description
           "Route attributes.";
         uses route-attributes;
       }
       container route-vendor-attributes {
         description
           "Route vendor attributes.";
         uses route-vendor-attributes;
       }
     }

     grouping nexthop-list {
       description
         "A generic nexthop list.";
       list nexthop-list {
         key "nexthop-member-id";
         description
           "A list of nexthops.";
         leaf nexthop-member-id {
           type uint32;
           mandatory true;
           description
             "A nexthop identifier that points
              to a nexthop list member.
              A nexthop list member is a nexthop.";
         }
       }
     }

     grouping nexthop-list-p {
       description
         "A nexthop list with preference parameter.";
       list nexthop-list {
         key "nexthop-member-id";
         description
           "A list of nexthop.";
         leaf nexthop-member-id {
           type uint32;
           mandatory true;
           description



Wang, et al.                 Standards Track                   [Page 40]
^L
RFC 8431                     RIB Data Model               September 2018


             "A nexthop identifier that points
              to a nexthop list member.
              A nexthop list member is a nexthop.";
         }
         leaf nexthop-preference {
           type nexthop-preference-definition;
           mandatory true;
           description
             "Nexthop-preference is used for protection schemes.
              It is an integer value between 1 and 99.  Lower
              values are more preferred.  To download a
              primary/standby/tertiary group to the FIB, the
              nexthops that are resolved and are most preferred
              are selected.";
         }
       }
     }

     grouping nexthop-list-w {
       description
         "A nexthop list with a weight parameter.";
       list nexthop-list {
         key "nexthop-member-id";
         description
           "A list of nexthop.";
         leaf nexthop-member-id {
           type uint32;
           mandatory true;
           description
             "A nexthop identifier that points
              to a nexthop list member.
              A nexthop list member is a nexthop.";
         }
         leaf nexthop-lb-weight {
           type nexthop-lb-weight-definition;
           mandatory true;
           description
             "The weight of a nexthop of
              the load-balance nexthops.";
         }
       }
     }

     grouping nexthop {
       description
         "The nexthop structure.";
       leaf nexthop-id {
         type uint32;



Wang, et al.                 Standards Track                   [Page 41]
^L
RFC 8431                     RIB Data Model               September 2018


         description
           "An identifier that refers to a nexthop.";
       }
       leaf sharing-flag {
         type boolean;
         description
           "To indicate whether a nexthop is sharable
            or non-sharable:
            true  - sharable (which means the nexthop can be
                    shared with other routes)
            false - non-sharable (which means the nexthop can
                    not be shared with other routes)";
       }
       choice nexthop-type {
         description
           "Nexthop type options.";
         case nexthop-base {
           container nexthop-base {
             description
               "The base nexthop.";
             uses nexthop-base;
           }
         }
         case nexthop-chain {
           if-feature "nexthop-chain";
           container nexthop-chain {
             description
               "A chain nexthop.";
             uses nexthop-list;
           }
         }
         case nexthop-replicate {
           if-feature "nexthop-replicate";
           container nexthop-replicate {
             description
               "A replicate nexthop.";
             uses nexthop-list;
           }
         }
         case nexthop-protection {
           if-feature "nexthop-protection";
           container nexthop-protection {
             description
               "A protection nexthop.";
             uses nexthop-list-p;
           }
         }
         case nexthop-load-balance {



Wang, et al.                 Standards Track                   [Page 42]
^L
RFC 8431                     RIB Data Model               September 2018


           if-feature "nexthop-load-balance";
           container nexthop-lb {
             description
               "A load-balance nexthop.";
             uses nexthop-list-w;
           }
         }
       }
     }

     grouping nexthop-base {
       description
         "The base nexthop.";
       choice nexthop-base-type {
         description
           "Nexthop base type options.";
         case special-nexthop {
           leaf special {
             type special-nexthop-definition;
             description
               "A special nexthop.";
           }
         }
         case egress-interface-nexthop {
           leaf outgoing-interface {
             type if:interface-ref;
             mandatory true;
             description
               "The nexthop is an outgoing interface.";
           }
         }
         case ipv4-address-nexthop {
           leaf ipv4-address {
             type inet:ipv4-address;
             mandatory true;
             description
               "The nexthop is an IPv4 address.";
           }
         }
         case ipv6-address-nexthop {
           leaf ipv6-address {
             type inet:ipv6-address;
             mandatory true;
             description
               "The nexthop is an IPv6 address.";
           }
         }
         case egress-interface-ipv4-nexthop {



Wang, et al.                 Standards Track                   [Page 43]
^L
RFC 8431                     RIB Data Model               September 2018


           container egress-interface-ipv4-address {
             leaf outgoing-interface {
               type if:interface-ref;
               mandatory true;
               description
                 "Name of the outgoing interface.";
             }
             leaf ipv4-address {
               type inet:ipv4-address;
               mandatory true;
               description
                 "The nexthop points to an interface with
                  an IPv4 address.";
             }
             description
               "The nexthop is an egress-interface and an IP
                address.  This can be used in cases where, e.g.,
                the IP address is a link-local address.";
           }
         }
         case egress-interface-ipv6-nexthop {
           container egress-interface-ipv6-address {
             leaf outgoing-interface {
               type if:interface-ref;
               mandatory true;
               description
                 "Name of the outgoing interface.";
             }
             leaf ipv6-address {
               type inet:ipv6-address;
               mandatory true;
               description
                 "The nexthop points to an interface with
                  an IPv6 address.";
             }
             description
               "The nexthop is an egress-interface and an IP
                address.  This can be used in cases where, e.g.,
                the IP address is a link-local address.";
           }
         }
         case egress-interface-mac-nexthop {
           container egress-interface-mac-address {
             leaf outgoing-interface {
               type if:interface-ref;
               mandatory true;
               description
                 "Name of the outgoing interface.";



Wang, et al.                 Standards Track                   [Page 44]
^L
RFC 8431                     RIB Data Model               September 2018


             }
             leaf ieee-mac-address {
               type yang:mac-address;
               mandatory true;
               description
                 "The nexthop points to an interface with
                  a specific MAC address.";
             }
             description
               "The egress-interface must be an Ethernet
                interface.  Address resolution is not required
                for this nexthop.";
           }
         }
         case tunnel-encapsulation-nexthop {
           if-feature "nexthop-tunnel";
           container tunnel-encapsulation {
             uses tunnel-encapsulation;
             description
               "This can be an encapsulation representing an IP
                tunnel, MPLS tunnel, or others as defined in the info
                model.  An optional egress-interface can be chained
                to the tunnel encapsulation to indicate which
                interface to send the packet out on.  The
                egress-interface is useful when the network device
                contains Ethernet interfaces and one needs to
                perform address resolution for the IP packet.";
           }
         }
         case tunnel-decapsulation-nexthop {
           if-feature "nexthop-tunnel";
           container tunnel-decapsulation {
             uses tunnel-decapsulation;
             description
               "This is to specify the decapsulation of a tunnel
                header.";
           }
         }
         case logical-tunnel-nexthop {
           if-feature "nexthop-tunnel";
           container logical-tunnel {
             uses logical-tunnel;
             description
               "This can be an MPLS Label Switched Path (LSP)
                or a GRE tunnel (or others as defined in this
                document) that is represented by a unique
                identifier (e.g., name).";
           }



Wang, et al.                 Standards Track                   [Page 45]
^L
RFC 8431                     RIB Data Model               September 2018


         }
         case rib-name-nexthop {
           leaf rib-name {
             type string;
             description
               "A nexthop pointing to a RIB indicates that the
                route lookup needs to continue in the specified
                RIB.  This is a way to perform chained lookups.";
           }
         }
         case nexthop-identifier {
           leaf nexthop-ref {
             type nexthop-ref;
             mandatory true;
             description
               "A nexthop reference that points to a nexthop.";
           }
         }
       }
     }

     grouping route-vendor-attributes {
       description
         "Route vendor attributes.";
     }

     grouping logical-tunnel {
       description
         "A logical tunnel that is identified
          by a type and a tunnel name.";
       leaf tunnel-type {
         type tunnel-type-definition;
         mandatory true;
         description
           "A tunnel type.";
       }
       leaf tunnel-name {
         type string;
         mandatory true;
         description
           "A tunnel name that points to a logical tunnel.";
       }
     }

     grouping ipv4-header {
       description
         "The IPv4 header encapsulation information.";
       leaf src-ipv4-address {



Wang, et al.                 Standards Track                   [Page 46]
^L
RFC 8431                     RIB Data Model               September 2018


         type inet:ipv4-address;
         mandatory true;
         description
           "The source IP address of the header.";
       }
       leaf dest-ipv4-address {
         type inet:ipv4-address;
         mandatory true;
         description
           "The destination IP address of the header.";
       }
       leaf protocol {
         type uint8;
         mandatory true;
         description
           "The protocol id of the header.";
       }
       leaf ttl {
         type uint8;
         description
           "The TTL of the header.";
       }
       leaf dscp {
         type uint8;
         description
           "The Differentiated Services Code Point
            (DSCP) field of the header.";
       }
     }

     grouping ipv6-header {
       description
         "The IPv6 header encapsulation information.";
       leaf src-ipv6-address {
         type inet:ipv6-address;
         mandatory true;
         description
           "The source IP address of the header.";
       }
       leaf dest-ipv6-address {
         type inet:ipv6-address;
         mandatory true;
         description
           "The destination IP address of the header.";
       }
       leaf next-header {
         type uint8;
         mandatory true;



Wang, et al.                 Standards Track                   [Page 47]
^L
RFC 8431                     RIB Data Model               September 2018


         description
           "The next header of the IPv6 header.";
       }
       leaf traffic-class {
         type uint8;
         description
           "The traffic class value of the header.";
       }
       leaf flow-label {
         type inet:ipv6-flow-label;
         description
           "The flow label of the header.";
       }
       leaf hop-limit {
         type uint8 {
           range "1..255";
         }
         description
           "The hop limit of the header.";
       }
     }

     grouping nvgre-header {
       description
         "The NVGRE header encapsulation information.";
       choice nvgre-type {
         description
           "NVGRE can use either an IPv4
            or an IPv6 header for encapsulation.";
         case ipv4 {
           uses ipv4-header;
         }
         case ipv6 {
           uses ipv6-header;
         }
       }
       leaf virtual-subnet-id {
         type uint32;
         mandatory true;
         description
           "The subnet identifier of the NVGRE header.";
       }
       leaf flow-id {
         type uint8;
         description
           "The flow identifier of the NVGRE header.";
       }
     }



Wang, et al.                 Standards Track                   [Page 48]
^L
RFC 8431                     RIB Data Model               September 2018


     grouping vxlan-header {
       description
         "The VXLAN encapsulation header information.";
       choice vxlan-type {
         description
           "NVGRE can use either an IPv4
            or an IPv6 header for encapsulation.";
         case ipv4 {
           uses ipv4-header;
         }
         case ipv6 {
           uses ipv6-header;
         }
       }
       leaf vxlan-identifier {
         type uint32;
         mandatory true;
         description
           "The VXLAN identifier of the VXLAN header.";
       }
     }

     grouping gre-header {
       description
         "The GRE encapsulation header information.";
       choice dest-address-type {
         description
           "GRE options: IPv4 and IPv6";
         case ipv4 {
           leaf ipv4-dest {
             type inet:ipv4-address;
             mandatory true;
             description
               "The destination IP address of the GRE header.";
           }
         }
         case ipv6 {
           leaf ipv6-dest {
             type inet:ipv6-address;
             mandatory true;
             description
               "The destination IP address of the GRE header.";
           }
         }
       }
       leaf protocol-type {
         type uint16;
         mandatory true;



Wang, et al.                 Standards Track                   [Page 49]
^L
RFC 8431                     RIB Data Model               September 2018


         description
           "The protocol type of the GRE header.";
       }
       leaf key {
         type uint64;
         description
           "The GRE key of the GRE header.";
       }
     }

     grouping mpls-header {
       description
         "The MPLS encapsulation header information.";
       list label-operations {
         key "label-oper-id";
         description
           "Label operations.";
         leaf label-oper-id {
           type uint32;
           description
             "An optional identifier that points
              to a label operation.";
         }
         choice label-actions {
           description
             "Label action options.";
           case label-push {
             container label-push {
               description
                 "Label push operation.";
               leaf label {
                 type uint32;
                 mandatory true;
                 description
                   "The label to be pushed.";
               }
               leaf s-bit {
                 type boolean;
                 description
                   "The s-bit ('Bottom of Stack' bit) of the label to be
                    pushed.";
               }
               leaf tc-value {
                 type uint8;
                 description
                   "The traffic class value of the label to be pushed.";
               }
               leaf ttl-value {



Wang, et al.                 Standards Track                   [Page 50]
^L
RFC 8431                     RIB Data Model               September 2018


                 type uint8;
                 description
                   "The TTL value of the label to be pushed.";
               }
             }
           }
           case label-swap {
             container label-swap {
               description
                 "Label swap operation.";
               leaf in-label {
                 type uint32;
                 mandatory true;
                 description
                   "The label to be swapped.";
               }
               leaf out-label {
                 type uint32;
                 mandatory true;
                 description
                   "The out MPLS label.";
               }
               leaf ttl-action {
                 type ttl-action-definition;
                 description
                   "The label TTL actions:
                    - No-action
                    - Copy to inner label
                    - Decrease (the in-label)
                      by 1 and copy to the out-label";
               }
             }
           }
         }
       }
     }

     grouping tunnel-encapsulation {
       description
         "Tunnel encapsulation information.";
       choice tunnel-type {
         description
           "Tunnel options for nexthops.";
         case ipv4 {
           if-feature "ipv4-tunnel";
           container ipv4-header {
             uses ipv4-header;
             description



Wang, et al.                 Standards Track                   [Page 51]
^L
RFC 8431                     RIB Data Model               September 2018


               "IPv4 header.";
           }
         }
         case ipv6 {
           if-feature "ipv6-tunnel";
           container ipv6-header {
             uses ipv6-header;
             description
               "IPv6 header.";
           }
         }
         case mpls {
           if-feature "mpls-tunnel";
           container mpls-header {
             uses mpls-header;
             description
               "MPLS header.";
           }
         }
         case gre {
           if-feature "gre-tunnel";
           container gre-header {
             uses gre-header;
             description
               "GRE header.";
           }
         }
         case nvgre {
           if-feature "nvgre-tunnel";
           container nvgre-header {
             uses nvgre-header;
             description
               "NVGRE header.";
           }
         }
         case vxlan {
           if-feature "vxlan-tunnel";
           container vxlan-header {
             uses vxlan-header;
             description
               "VXLAN header.";
           }
         }
       }
     }

     grouping tunnel-decapsulation {
       description



Wang, et al.                 Standards Track                   [Page 52]
^L
RFC 8431                     RIB Data Model               September 2018


         "Tunnel decapsulation information.";
       choice tunnel-type {
         description
           "Nexthop tunnel type options.";
         case ipv4 {
           if-feature "ipv4-tunnel";
           container ipv4-decapsulation {
             description
               "IPv4 decapsulation.";
             leaf ipv4-decapsulation {
               type tunnel-decapsulation-action-definition;
               mandatory true;
               description
                 "IPv4 decapsulation operations.";
             }
             leaf ttl-action {
               type ttl-action-definition;
               description
                 "The TTL actions:
                  no-action or copy to inner header.";
             }
           }
         }
         case ipv6 {
           if-feature "ipv6-tunnel";
           container ipv6-decapsulation {
             description
               "IPv6 decapsulation.";
             leaf ipv6-decapsulation {
               type tunnel-decapsulation-action-definition;
               mandatory true;
               description
                 "IPv6 decapsulation operations.";
             }
             leaf hop-limit-action {
               type hop-limit-action-definition;
               description
                 "The hop limit actions:
                  no-action or copy to inner header.";
             }
           }
         }
         case mpls {
           if-feature "mpls-tunnel";
           container label-pop {
             description
               "MPLS decapsulation.";
             leaf label-pop {



Wang, et al.                 Standards Track                   [Page 53]
^L
RFC 8431                     RIB Data Model               September 2018


               type mpls-label-action-definition;
               mandatory true;
               description
                 "Pop a label from the label stack.";
             }
             leaf ttl-action {
               type ttl-action-definition;
               description
                 "The label TTL action.";
             }
           }
         }
       }
     }

     grouping route-attributes {
       description
         "Route attributes.";
       leaf route-preference {
         type uint32;
         mandatory true;
         description
           "ROUTE_PREFERENCE: This is a numerical value that
            allows for comparing routes from different
            protocols.  Static configuration is also
            considered a protocol for the purpose of this
            field.  It is also known as administrative-distance.
            The lower the value, the higher the preference.";
       }
       leaf local-only {
         type boolean;
         mandatory true;
         description
           "Indicate whether the attribute is local only.";
       }
       container address-family-route-attributes {
         description
           "Address-family-related route attributes.";
         choice route-type {
           description
             "Address-family-related route attributes. Future
              documents should specify these attributes by augmenting
              the cases in this choice.";
           case ip-route-attributes {
           }
           case mpls-route-attributes {
           }
           case ethernet-route-attributes {



Wang, et al.                 Standards Track                   [Page 54]
^L
RFC 8431                     RIB Data Model               September 2018


           }
         }
       }
     }

     container routing-instance {
       description
         "A routing instance, in the context of
          the RIB information model, is a collection
          of RIBs, interfaces, and routing parameters.";
       leaf name {
         type string;
         description
           "The name of the routing instance.  This MUST
            be unique across all routing instances in
            a given network device.";
       }
       list interface-list {
         key "name";
         description
           "This represents the list of interfaces associated
            with this routing instance.  The interface list helps
            constrain the boundaries of packet forwarding.
            Packets coming on these interfaces are directly
            associated with the given routing instance.  The
            interface list contains a list of identifiers with
            each identifier uniquely identifying an interface.";
         leaf name {
           type if:interface-ref;
           description
             "A reference to the name of a network-layer interface.";
         }
       }
       leaf router-id {
         type yang:dotted-quad;
         description
           "Router ID: The 32-bit number in the form of a dotted quad.";
       }
       leaf lookup-limit {
         type uint8;
         description
           "A limit on how many levels of a lookup can be performed.";
       }
       list rib-list {
         key "name";
         description
           "A list of RIBs that are associated with the routing
            instance.";



Wang, et al.                 Standards Track                   [Page 55]
^L
RFC 8431                     RIB Data Model               September 2018


         leaf name {
           type string;
           mandatory true;
           description
             "A reference to the name of each RIB.";
         }
         leaf address-family {
           type address-family-definition;
           mandatory true;
           description
             "The address family of a RIB.";
         }
         leaf ip-rpf-check {
           type boolean;
           description
             "Each RIB can be optionally associated with a
              ENABLE_IP_RPF_CHECK attribute that enables Reverse
              Path Forwarding (RPF) checks on all IP routes in that
              RIB.   An RPF check is used to
              prevent spoofing and limit malicious traffic.";
         }
         list route-list {
           key "route-index";
           description
             "A list of routes of a RIB.";
           uses route;
         }
         // This is a list that maintains the nexthops added to the RIB.
         uses nexthop-list;
       }
     }

     //RPC Operations

     rpc rib-add {
       description
         "To add a RIB to an instance";
       input {
         leaf name {
           type string;
           mandatory true;
           description
             "A reference to the name of the RIB
              that is to be added.";
         }
         leaf address-family {
           type address-family-definition;
           mandatory true;



Wang, et al.                 Standards Track                   [Page 56]
^L
RFC 8431                     RIB Data Model               September 2018


           description
             "The address family of the RIB.";
         }
         leaf ip-rpf-check {
           type boolean;
           description
             "Each RIB can be optionally associated with an
              ENABLE_IP_RPF_CHECK attribute that enables
              RPF checks on all IP routes in that
              RIB.   An RPF check is used to
              prevent spoofing and limit malicious traffic.";
         }
       }
       output {
         leaf result {
           type boolean;
           mandatory true;
           description
             "Return the result of the rib-add operation.
              true  - success;
              false - failed";
         }
         leaf reason {
           type string;
           description
             "The specific reason that caused the failure.";
         }
       }
     }

     rpc rib-delete {
       description
         "To delete a RIB from a routing instance.
          After deleting the RIB, all routes installed
          in the RIB will be deleted as well.";
       input {
         leaf name {
           type string;
           mandatory true;
           description
             "A reference to the name of the RIB
              that is to be deleted.";
         }
       }
       output {
         leaf result {
           type boolean;
           mandatory true;



Wang, et al.                 Standards Track                   [Page 57]
^L
RFC 8431                     RIB Data Model               September 2018


           description
             "Return the result of the rib-delete operation.
              true  - success;
              false - failed";
         }
         leaf reason {
           type string;
           description
             "The specific reason that caused failure.";
         }
       }
     }

     grouping route-operation-state {
       description
         "Route operation state.";
       leaf success-count {
         type uint32;
         mandatory true;
         description
           "The numbers of routes that are successfully
            added/deleted/updated.";
       }
       leaf failed-count {
         type uint32;
         mandatory true;
         description
           "The numbers of the routes that fail
            to be added/deleted/updated.";
       }
       container failure-detail {
         description
           "The failure detail reflects the reason why a route
            operation fails.  It is an array that includes the route
            index and error code of the failed route.";
         list failed-routes {
           key "route-index";
           description
             "The list of failed routes.";
           leaf route-index {
             type uint32;
             description
               "The route index of the failed route.";
           }
           leaf error-code {
             type uint32;
             description
               "The error code that reflects the failure reason.



Wang, et al.                 Standards Track                   [Page 58]
^L
RFC 8431                     RIB Data Model               September 2018


                0 - Reserved
                1 - Trying to add a repeat route
                2 - Trying to delete or update a route that does not
                  exist
                3 - Malformed route attributes";
           }
         }
       }
     }

     rpc route-add {
       description
         "To add a route or a list of routes to a RIB";
       input {
         leaf return-failure-detail {
           type boolean;
           default "false";
           description
             "Whether to return the failure detail.
              true  - return the failure detail
              false - do not return the failure detail
              The default is false.";
         }
         leaf rib-name {
           type string;
           mandatory true;
           description
             "A reference to the name of a RIB.";
         }
         container routes {
           description
             "The routes to be added to the RIB.";
           list route-list {
             key "route-index";
             description
               "The list of routes to be added.";
             uses route-prefix;
             container route-attributes {
               uses route-attributes;
               description
                 "The route attributes.";
             }
             container route-vendor-attributes {
               if-feature "route-vendor-attributes";
               uses route-vendor-attributes;
               description
                 "The route vendor attributes.";
             }



Wang, et al.                 Standards Track                   [Page 59]
^L
RFC 8431                     RIB Data Model               September 2018


             container nexthop {
               uses nexthop;
               description
                 "The nexthop of the added route.";
             }
           }
         }
       }
       output {
         uses route-operation-state;
       }
     }

     rpc route-delete {
       description
         "To delete a route or a list of routes from a RIB";
       input {
         leaf return-failure-detail {
           type boolean;
           default "false";
           description
             "Whether to return the failure detail.
              true  - return the failure detail
              false - do not return the failure detail
              The default is false.";
         }
         leaf rib-name {
           type string;
           mandatory true;
           description
             "A reference to the name of a RIB.";
         }
         container routes {
           description
             "The routes to be added to the RIB.";
           list route-list {
             key "route-index";
             description
               "The list of routes to be deleted.";
             uses route-prefix;
           }
         }
       }
       output {
         uses route-operation-state;
       }
     }




Wang, et al.                 Standards Track                   [Page 60]
^L
RFC 8431                     RIB Data Model               September 2018


     grouping route-update-options {
       description
         "Update options:
          1. update the nexthop
          2. update the route attributes
          3. update the route-vendor-attributes";
       choice update-options {
         description
           "Update options:
            1. update the nexthop
            2. update the route attributes
            3. update the route-vendor-attributes";
         case update-nexthop {
           container updated-nexthop {
             uses nexthop;
             description
               "The nexthop used for updating.";
           }
         }
         case update-route-attributes {
           container updated-route-attr {
             uses route-attributes;
             description
               "The route attributes used for updating.";
           }
         }
         case update-route-vendor-attributes {
           container updated-route-vendor-attr {
             uses route-vendor-attributes;
             description
               "The vendor route attributes used for updating.";
           }
         }
       }
     }

     rpc route-update {
       description
         "To update a route or a list of routes of a RIB.
          The inputs:
            1. The match conditions, which could be:
              a. route prefix,
              b. route attributes, or
              c. nexthop.
            2. The update parameters to be used:
              a. new nexthop,
              b. new route attributes, or
              c. nexthop.



Wang, et al.                 Standards Track                   [Page 61]
^L
RFC 8431                     RIB Data Model               September 2018


          Actions:
            1. update the nexthop
            2. update the route attributes
          The outputs:
            success-count - the number of routes updated
            failed-count - the number of routes fail to update
            failure-detail - the detail failure info
         ";
       input {
         leaf return-failure-detail {
           type boolean;
           default "false";
           description
             "Whether to return the failure detail.
              true  - return the failure detail
              false - do not return the failure detail
              The default is false.";
         }
         leaf rib-name {
           type string;
           mandatory true;
           description
             "A reference to the name of a RIB.";
         }
         choice match-options {
           description
             "Match options.";
           case match-route-prefix {
             description
               "Update the routes that match the route
                prefix(es) condition.";
             container input-routes {
               description
                 "The matched routes to be updated.";
               list route-list {
                 key "route-index";
                 description
                   "The list of routes to be updated.";
                 uses route-prefix;
                 uses route-update-options;
               }
             }
           }
           case match-route-attributes {
             description
               "Update the routes that match the
                route attributes condition.";
             container input-route-attributes {



Wang, et al.                 Standards Track                   [Page 62]
^L
RFC 8431                     RIB Data Model               September 2018


               description
                 "The route attributes are used for matching.";
               uses route-attributes;
             }
             container update-parameters {
               description
                 "Update options:
                  1. update the nexthop
                  2. update the route attributes
                  3. update the route-vendor-attributes";
               uses route-update-options;
             }
           }
           case match-route-vendor-attributes {
             if-feature "route-vendor-attributes";
             description
               "Update the routes that match the
                vendor attributes condition";
             container input-route-vendor-attributes {
               description
                 "The vendor route attributes are used for matching.";
               uses route-vendor-attributes;
             }
             container update-parameters-vendor {
               description
                 "Update options:
                  1. update the nexthop
                  2. update the route attributes
                  3. update the route-vendor-attributes";
               uses route-update-options;
             }
           }
           case match-nexthop {
             description
               "Update the routes that match the nexthop.";
             container input-nexthop {
               description
                 "The nexthop used for matching.";
               uses nexthop;
             }
             container update-parameters-nexthop {
               description
                 "Update options:
                  1. update the nexthop
                  2. update the route attributes
                  3. update the route-vendor-attributes";
               uses route-update-options;
             }



Wang, et al.                 Standards Track                   [Page 63]
^L
RFC 8431                     RIB Data Model               September 2018


           }
         }
       }
       output {
         uses route-operation-state;
       }
     }
     rpc nh-add {
       description
         "To add a nexthop to a RIB.
          Inputs parameters:
            1. rib-name
            2. nexthop
          Actions:
            Add the nexthop to the RIB
          Outputs:
            1. Operation result:
               true  - success
               false - failed
            2. nexthop identifier";
       input {
         leaf rib-name {
           type string;
           mandatory true;
           description
             "A reference to the name of a RIB.";
         }
         uses nexthop;
       }
       output {
         leaf result {
           type boolean;
           mandatory true;
           description
             "Return the result of the rib-add operation:
              true  - success
              false - failed";
         }
         leaf reason {
           type string;
           description
             "The specific reason that caused the failure.";
         }
         leaf nexthop-id {
           type uint32;
           description
             "A nexthop identifier that is allocated to the nexthop.";
         }



Wang, et al.                 Standards Track                   [Page 64]
^L
RFC 8431                     RIB Data Model               September 2018


       }
     }

     rpc nh-delete {
       description
         "To delete a nexthop from a RIB";
       input {
         leaf rib-name {
           type string;
           mandatory true;
           description
             "A reference to the name of a RIB.";
         }
         uses nexthop;
       }
       output {
         leaf result {
           type boolean;
           mandatory true;
           description
             "Return the result of the rib-add operation:
              true  - success;
              false - failed";
         }
         leaf reason {
           type string;
           description
             "The specific reason that caused the failure.";
         }
       }
     }

     //Notifications

     notification nexthop-resolution-status-change {
       description
         "Nexthop resolution status (resolved/unresolved)
          notification.";
       container nexthop {
         description
           "The nexthop.";
         uses nexthop;
       }
       leaf nexthop-state {
         type nexthop-state-definition;
         mandatory true;
         description
           "Nexthop resolution status (resolved/unresolved)



Wang, et al.                 Standards Track                   [Page 65]
^L
RFC 8431                     RIB Data Model               September 2018


            notification.";
       }
     }

     notification route-change {
       description
         "Route change notification.";
       leaf rib-name {
         type string;
         mandatory true;
         description
           "A reference to the name of a RIB.";
       }
       leaf address-family {
         type address-family-definition;
         mandatory true;
         description
           "The address family of a RIB.";
       }
       uses route-prefix;
       leaf route-installed-state {
         type route-installed-state-definition;
         mandatory true;
         description
           "Indicates whether the route got installed in the FIB.";
       }
       leaf route-state {
         type route-state-definition;
         mandatory true;
         description
           "Indicates whether a route is active or inactive.";
       }
       list route-change-reasons {
         key "route-change-reason";
         description
           "The reasons that cause the route change.  A route
            change may result from several reasons; for
            example, a nexthop becoming resolved will make a
            route A active, which is of better preference than
            a currently active route B, which results in the
            route A being installed";
         leaf route-change-reason {
           type route-change-reason-definition;
           mandatory true;
           description
             "The reason that caused the route change.";
         }
       }



Wang, et al.                 Standards Track                   [Page 66]
^L
RFC 8431                     RIB Data Model               September 2018


     }
   }

   <CODE ENDS>

4.  IANA Considerations

   This document registers a URI in the "ns" registry within the "IETF
   XML Registry" [RFC3688]:

    -------------------------------------------------------------------
    URI: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib
    Registrant Contact: The IESG.
    XML: N/A, the requested URI is an XML namespace.
    -------------------------------------------------------------------

   This document registers a YANG module in the "YANG Module Names"
   registry [RFC7950]:

    -------------------------------------------------------------------
    name:         ietf-i2rs-rib
    namespace:    urn:ietf:params:xml:ns:yang:ietf-i2rs-rib
    prefix:       iir
    reference:    RFC 8431
    -------------------------------------------------------------------

5.  Security Considerations

   The YANG module specified in this document defines a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF [RFC6241] or RESTCONF [RFC8040].  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) [RFC6242].  The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   [RFC8446].

   The NETCONF access control model [RFC8341] provides the means to
   restrict access for particular NETCONF or RESTCONF users to a
   preconfigured subset of all available NETCONF or RESTCONF protocol
   operations and content.

   The YANG module defines information that can be configurable in
   certain instances, for example, a RIB, a route, a nexthop can be
   created or deleted by client applications; the YANG module also
   defines RPCs that can be used by client applications to add/delete
   RIBs, routes, and nexthops.  In such cases, a malicious client could
   attempt to remove, add, or update a RIB, a route, or a nexthop by
   creating or deleting corresponding elements in the RIB, route, and



Wang, et al.                 Standards Track                   [Page 67]
^L
RFC 8431                     RIB Data Model               September 2018


   nexthop lists, respectively.  Removing a RIB or a route could lead to
   disruption or impact in performance of a service; updating a route
   may lead to suboptimal path and degradation of service levels as well
   as possibly disruption of service.  For those reasons, it is
   important that the NETCONF access control model is vigorously applied
   to prevent misconfiguration by unauthorized clients.

   There are a number of data nodes defined in this YANG module that are
   writable/creatable/deletable (i.e., config true, which is the
   default).  These data nodes may be considered sensitive or vulnerable
   in some network environments.  Write operations (e.g., edit-config)
   to these data nodes without proper protection can have a negative
   effect on network operations.  These are the subtrees and data nodes
   and their sensitivity/vulnerability:

   o  RIB: A malicious client could attempt to remove a RIB from a
      routing instance, for example, in order to sabotage the services
      provided by the RIB or to add a RIB to a routing instance (hence,
      to inject unauthorized traffic into the nexthop).

   o  route: A malicious client could attempt to remove or add a route
      from/to a RIB, for example, in order to sabotage the services
      provided by the RIB.

   o  nexthop: A malicious client could attempt to remove or add a
      nexthop from/to RIB, which may lead to a suboptimal path, a
      degradation of service levels, and a possible disruption of
      service.

6.  References

6.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.





Wang, et al.                 Standards Track                   [Page 68]
^L
RFC 8431                     RIB Data Model               September 2018


   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC6991]  Schoenwaelder, J., Ed., "Common YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8344]  Bjorklund, M., "A YANG Data Model for IP Management",
              RFC 8344, DOI 10.17487/RFC8344, March 2018,
              <https://www.rfc-editor.org/info/rfc8344>.

   [RFC8430]  Bahadur, N., Ed., Kini, S., Ed., and J. Medved, "RIB
              Information Model", RFC 8430, DOI 10.17487/RFC8430,
              September 2018, <http://www.rfc-editor.org/info/rfc8430>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

6.2.  Informative References

   [I2RS-REQS]
              Hares, S. and M. Chen, "Summary of I2RS Use Case
              Requirements", Work in Progress, draft-ietf-i2rs-usecase-
              reqs-summary-03, November 2016.

   [RFC2784]  Farinacci, D., Li, T., Hanks, S., Meyer, D., and P.
              Traina, "Generic Routing Encapsulation (GRE)", RFC 2784,
              DOI 10.17487/RFC2784, March 2000,
              <https://www.rfc-editor.org/info/rfc2784>.



Wang, et al.                 Standards Track                   [Page 69]
^L
RFC 8431                     RIB Data Model               September 2018


   [RFC7348]  Mahalingam, M., Dutt, D., Duda, K., Agarwal, P., Kreeger,
              L., Sridhar, T., Bursell, M., and C. Wright, "Virtual
              eXtensible Local Area Network (VXLAN): A Framework for
              Overlaying Virtualized Layer 2 Networks over Layer 3
              Networks", RFC 7348, DOI 10.17487/RFC7348, August 2014,
              <https://www.rfc-editor.org/info/rfc7348>.

   [RFC7637]  Garg, P., Ed. and Y. Wang, Ed., "NVGRE: Network
              Virtualization Using Generic Routing Encapsulation",
              RFC 7637, DOI 10.17487/RFC7637, September 2015,
              <https://www.rfc-editor.org/info/rfc7637>.

   [RFC7921]  Atlas, A., Halpern, J., Hares, S., Ward, D., and T.
              Nadeau, "An Architecture for the Interface to the Routing
              System", RFC 7921, DOI 10.17487/RFC7921, June 2016,
              <https://www.rfc-editor.org/info/rfc7921>.

   [RFC8340]  Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
              BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
              <https://www.rfc-editor.org/info/rfc8340>.

Acknowledgements

   The authors would like to thank Chris Bowers, John Scudder, Tom
   Petch, Mike McBride, and Ebben Aries for their review, suggestions,
   and comments to this document.

Contributors

   The following individuals also contributed to this document.

   o  Zekun He, Tencent Holdings Ltd.

   o  Sujian Lu, Tencent Holdings Ltd.

   o  Jeffery Zhang, Juniper Networks















Wang, et al.                 Standards Track                   [Page 70]
^L
RFC 8431                     RIB Data Model               September 2018


Authors' Addresses

   Lixing Wang
   Individual

   Email: wang_little_star@sina.com


   Mach(Guoyi) Chen
   Huawei

   Email: mach.chen@huawei.com


   Amit Dass
   Ericsson

   Email: dass.amit@gmail.com


   Hariharan Ananthakrishnan
   Netflix

   Email: hari@netflix.com


   Sriganesh Kini
   Individual

   Email: sriganeshkini@gmail.com


   Nitin Bahadur
   Uber

   Email: nitin_bahadur@yahoo.com















Wang, et al.                 Standards Track                   [Page 71]
^L