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
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
|
Internet Engineering Task Force (IETF) B. Linowski
Request for Comments: 6095 TCS/Nokia Siemens Networks
Category: Experimental M. Ersue
ISSN: 2070-1721 Nokia Siemens Networks
S. Kuryla
360 Treasury Systems
March 2011
Extending YANG with Language Abstractions
Abstract
YANG -- the Network Configuration Protocol (NETCONF) Data Modeling
Language -- supports modeling of a tree of data elements that
represent the configuration and runtime status of a particular
network element managed via NETCONF. This memo suggests enhancing
YANG with supplementary modeling features and language abstractions
with the aim to improve the model extensibility and reuse.
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for examination, experimental implementation, and
evaluation.
This document defines an Experimental Protocol for the Internet
community. 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). Not
all documents approved by the IESG are a candidate for any level of
Internet Standard; see Section 2 of RFC 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc6095.
Linowski, et al. Experimental [Page 1]
^L
RFC 6095 YANG Language Abstractions March 2011
Copyright Notice
Copyright (c) 2011 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
(http://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. Key Words . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Motivation . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Modeling Improvements with Language Abstractions . . . . . 5
1.4. Design Approach . . . . . . . . . . . . . . . . . . . . . 6
1.5. Modeling Resource Models with YANG . . . . . . . . . . . . 6
1.5.1. Example of a Physical Network Resource Model . . . . . 6
1.5.2. Modeling Entity MIB Entries as Physical Resources . . 12
2. Complex Types . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1. Definition . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2. complex-type Extension Statement . . . . . . . . . . . . . 15
2.3. instance Extension Statement . . . . . . . . . . . . . . . 17
2.4. instance-list Extension Statement . . . . . . . . . . . . 18
2.5. extends Extension Statement . . . . . . . . . . . . . . . 19
2.6. abstract Extension Statement . . . . . . . . . . . . . . . 19
2.7. XML Encoding Rules . . . . . . . . . . . . . . . . . . . . 20
2.8. Type Encoding Rules . . . . . . . . . . . . . . . . . . . 20
2.9. Extension and Feature Definition Module . . . . . . . . . 21
2.10. Example Model for Complex Types . . . . . . . . . . . . . 24
2.11. NETCONF Payload Example . . . . . . . . . . . . . . . . . 25
2.12. Update Rules for Modules Using Complex Types . . . . . . . 26
2.13. Using Complex Types . . . . . . . . . . . . . . . . . . . 26
2.13.1. Overriding Complex Type Data Nodes . . . . . . . . . . 26
2.13.2. Augmenting Complex Types . . . . . . . . . . . . . . . 27
2.13.3. Controlling the Use of Complex Types . . . . . . . . . 28
3. Typed Instance Identifier . . . . . . . . . . . . . . . . . . 29
3.1. Definition . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2. instance-type Extension Statement . . . . . . . . . . . . 29
3.3. Typed Instance Identifier Example . . . . . . . . . . . . 30
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31
5. Security Considerations . . . . . . . . . . . . . . . . . . . 31
Linowski, et al. Experimental [Page 2]
^L
RFC 6095 YANG Language Abstractions March 2011
6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 32
7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.1. Normative References . . . . . . . . . . . . . . . . . . . 32
7.2. Informative References . . . . . . . . . . . . . . . . . . 32
Appendix A. YANG Modules for Physical Network Resource Model
and Hardware Entities Model . . . . . . . . . . . . . 34
Appendix B. Example YANG Module for the IPFIX/PSAMP Model . . . . 40
B.1. Modeling Improvements for the IPFIX/PSAMP Model with
Complex Types and Typed Instance Identifiers . . . . . . . 40
B.2. IPFIX/PSAMP Model with Complex Types and Typed
Instance Identifiers . . . . . . . . . . . . . . . . . . . 41
1. Introduction
YANG -- the NETCONF Data Modeling Language [RFC6020] -- supports
modeling of a tree of data elements that represent the configuration
and runtime status of a particular network element managed via
NETCONF. This document defines extensions for the modeling language
YANG as new language statements, which introduce language
abstractions to improve the model extensibility and reuse. The
document reports from modeling experience in the telecommunication
industry and gives model examples from an actual network management
system to highlight the value of proposed language extensions,
especially class inheritance and recursiveness. The language
extensions defined in this document have been implemented with two
open source tools. These tools have been used to validate the model
examples through the document. If this experimental specification
results in successful usage, it is possible that the language
extensions defined herein could be updated to incorporate
implementation and deployment experience, then pursued on the
Standards Track, possibly as part of a future version of YANG.
1.1. Key Words
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].
1.2. Motivation
Following are non-exhaustive motivation examples highlighting usage
scenarios for language abstractions.
o Many systems today have a Management Information Base (MIB) that
in effect is organized as a tree build of recursively nested
container nodes. For example, the physical resources in the
ENTITY-MIB conceptually form a containment tree. The index
Linowski, et al. Experimental [Page 3]
^L
RFC 6095 YANG Language Abstractions March 2011
entPhysicalContainedIn points to the containing entity in a flat
list. The ability to represent nested, recursive data structures
of arbitrary depth would enable the representation of the primary
containment hierarchy of physical entities as a node tree in the
server MIB and in the NETCONF payload.
o A manager scanning the network in order to update the state of an
inventory management system might be only interested in data
structures that represent a specific type of hardware. Such a
manager would then look for entities that are of this specific
type, including those that are an extension or specialization of
this type. To support this use case, it is helpful to bear the
corresponding type information within the data structures, which
describe the network element hardware.
o A system that is managing network elements is concerned, e.g.,
with managed objects of type "plug-in modules" that have a name, a
version, and an activation state. In this context, it is useful
to define the "plug-in module" as a concept that is supposed to be
further detailed and extended by additional concrete model
elements. In order to realize such a system, it is worthwhile to
model abstract entities, which enable reuse and ease concrete
refinements of that abstract entity in a second step.
o As particular network elements have specific types of components
that need to be managed (OS images, plug-in modules, equipment,
etc.), it should be possible to define concrete types, which
describe the managed object precisely. By using type-safe
extensions of basic concepts, a system in the manager role can
safely and explicitly determine that e.g., the "equipment" is
actually of type "network card".
o Currently, different SDOs are working on the harmonization of
their management information models. Often, a model mapping or
transformation between systems becomes necessary. The
harmonization of the models is done e.g., by mapping of the two
models on the object level or integrating an object hierarchy into
an existing information model. On the one hand, extending YANG
with language abstractions can simplify the adoption of IETF
resource models by other SDOs and facilitate the alignment with
other SDOs' resource models (e.g., TM Forum SID [SID_V8]). On the
other hand, the proposed YANG extensions can enable the
utilization of the YANG modeling language in other SDOs, which
usually model complex management systems in a top-down manner and
use high-level language features frequently.
Linowski, et al. Experimental [Page 4]
^L
RFC 6095 YANG Language Abstractions March 2011
This memo specifies additional modeling features for the YANG
language in the area of structured model abstractions, typed
references, as well as recursive data structures, and it discusses
how these new features can improve the modeling capabilities of YANG.
Section 1.5.1 contains a physical resource model that deals with some
of the modeling challenges illustrated above. Section 1.5.2 gives an
example that uses the base classes defined in the physical resource
model and derives a model for physical entities defined in the Entity
MIB.
1.3. Modeling Improvements with Language Abstractions
As an enhancement to YANG 1.0, complex types and typed instance
identifiers provide different technical improvements on the modeling
level:
o In case the model of a system that should be managed with NETCONF
makes use of inheritance, complex types enable an almost one-to-
one mapping between the classes in the original model and the YANG
module.
o Typed instance identifiers allow representing associations between
the concepts in a type-safe way to prevent type errors caused by
referring to data nodes of incompatible types. This avoids
referring to a particular location in the MIB. Referring to a
particular location in the MIB is not mandated by the domain
model.
o Complex types allow defining complete, self-contained type
definitions. It is not necessary to explicitly add a key
statement to lists, which use a grouping that defines the data
nodes.
o Complex types simplify concept refinement by extending a base
complex type and make it superfluous to represent concept
refinements with workarounds such as huge choice-statements with
complex branches.
o Abstract complex types ensure correct usage of abstract concepts
by enforcing the refinement of a common set of properties before
instantiation.
o Complex types allow defining recursive structures. This enables
representing complex structures of arbitrary depth by nesting
instances of basic complex types that may contain themselves.
Linowski, et al. Experimental [Page 5]
^L
RFC 6095 YANG Language Abstractions March 2011
o Complex types avoid introducing metadata types (e.g., type code
enumerations) and metadata leafs (e.g., leafs containing a type
code) to indicate which concrete type of object is actually
represented by a generic container in the MIB. This also avoids
explicitly ruling out illegal use of subtype-specific properties
in generic containers.
o Complex type instances include the type information in the NETCONF
payload. This allows determining the actual type of an instance
during the NETCONF payload parsing and avoids the use in the model
of additional leafs, which provide the type information as
content.
o Complex types may be declared explicitly as optional features,
which is not possible when the actual type of an entity
represented by a generic container is indicated with a type code
enumeration.
Appendix B, "Example YANG Module for the IPFIX/PSAMP Model", lists
technical improvements for modeling with complex types and typed
instance identifiers and exemplifies the usage of the proposed YANG
extensions based on the IP Flow Information Export (IPFIX) / Packet
Sampling (PSAMP) configuration model in [IPFIXCONF].
1.4. Design Approach
The proposed additional features for YANG in this memo are designed
to reuse existing YANG statements whenever possible. Additional
semantics is expressed by an extension that is supposed to be used as
a substatement of an existing statement.
The proposed features don't change the semantics of models that is
valid with respect to the YANG specification [RFC6020].
1.5. Modeling Resource Models with YANG
1.5.1. Example of a Physical Network Resource Model
The diagram below depicts a portion of an information model for
manageable network resources used in an actual network management
system.
Note: The referenced model (UDM, Unified Data Model) is based on key
resource modeling concepts from [SID_V8] and is compliant with
selected parts of SID Resource Abstract Business Entities domain
[UDM].
Linowski, et al. Experimental [Page 6]
^L
RFC 6095 YANG Language Abstractions March 2011
The class diagram in Figure 1 and the corresponding YANG module
excerpt focus on basic resource ("Resource" and the distinction
between logical and physical resources) and hardware abstractions
("Hardware", "Equipment", and "EquipmentHolder"). Class attributes
were omitted to achieve decent readability.
Linowski, et al. Experimental [Page 7]
^L
RFC 6095 YANG Language Abstractions March 2011
+--------+
|Resource|
+--------+
/\ /\
-- --
| |
| +---------------+
| |LogicalResource|
| +---------------+
|
| +--------+
| |Physical| +-----------+
'-|Resource|<|-+-|PhysicalLink|
+---- ---+ | +------------+
| |0..* physicalLink
| | equipment
| | Holder
| | 0..*
| | +-------+
| |0..* hardware | |
| +--------+ +---------------+ +---------+ |
'-|Hardware|<|-+-|ManagedHardware|<|-+-|Equipment|<>--+
+--------+ | +---------------+ | | Holder |0..1
<> | | +---------+
0..1| | | <>
| | | |0..* equipment
| | | | Holder
| | | |
| | | |0..* equipment
| | | |
| | | | equipment
| | | | 0..*
| | | | +-------+
| | | | | |
| | | +---------+ |
| | '-|Equipment|<>--+
| | +---------+0..1
| | compositeEquipment
| |
| | +-----------------+
| '-|PhysicalConnector|----+0..* source
'----------+-----------------+ | Physical
physicalConnector 0..* | | Connector
| |
+-----------+
0..* targetPhysicalConnector
Figure 1: Physical Network Resource Model
Linowski, et al. Experimental [Page 8]
^L
RFC 6095 YANG Language Abstractions March 2011
Since this model is an abstraction of network-element-specific MIB
topologies, modeling it with YANG creates some challenges. Some of
these challenges and how they can be addressed with complex types are
explained below:
o Modeling of abstract concepts: Classes like "Resource" represent
concepts that primarily serve as a base class for derived classes.
With complex types, such an abstract concept could be represented
by an abstract complex type (see "complex-type extension
statement" and "abstract extension statement").
o Class Inheritance: Information models for complex management
domains often use class inheritance to create specialized classes
like "PhysicalConnector" from a more generic base class (here,
"Hardware"), which itself might inherit from another base class
("PhysicalResource"), etc. Complex types allow creating enhanced
versions of an existing (abstract or concrete) base type via an
extension (see "extends extension statement").
o Recursive containment: In order to specify containment
hierarchies, models frequently contain different aggregation
associations, in which the target (contained element) is either
the containing class itself or a base class of the containing
class. In the model above, the recursive containment of
"EquipmentHolder" is an example of such a relationship (see the
description for the "complex-type EquipmentHolder" in the example
model "udmcore" below).
o Complex types support such a containment by using a complex type
(or one of its ancestor types) as the type of an instance or
instance list that is part of its definition (see "instance(-list)
extension statement").
o Reference relationships: A key requirement on large models for
network domains with many related managed objects is the ability
to define inter-class associations that represent essential
relationships between instances of such a class. For example, the
relationship between "PhysicalLink" and "Hardware" tells which
physical link is connecting which hardware resources. It is
important to notice that this kind of relationship does not
mandate any particular location of the two connected hardware
instances in any MIB module. Such containment-agnostic
relationships can be represented by a typed instance identifier
that embodies one direction of such an association (see Section 3,
"Typed Instance Identifier").
Linowski, et al. Experimental [Page 9]
^L
RFC 6095 YANG Language Abstractions March 2011
The YANG module excerpt below shows how the challenges listed above
can be addressed by the Complex Types extension (module import prefix
"ct:"). The complete YANG module for the physical resource model in
Figure 1 can be found in Appendix A, "YANG Modules for Physical
Network Resource Model and Hardware Entities Model".
Note: The YANG extensions proposed in this document have been
implemented as the open source tools "Pyang Extension for Complex
Types" [Pyang-ct], [Pyang], and "Libsmi Extension for Complex Types"
[Libsmi]. All model examples in the document have been validated
with the tools Pyang-ct and Libsmi.
<CODE BEGINS>
module udmcore {
namespace "http://example.com/udmcore";
prefix "udm";
import ietf-complex-types {prefix "ct"; }
// Basic complex types...
ct:complex-type PhysicalResource {
ct:extends Resource;
ct:abstract true;
// ...
leaf serialNumber {
type string;
description "'Manufacturer-allocated part number' as
defined in SID, e.g., the part number of a fiber link
cable.";
}
}
ct:complex-type Hardware {
ct:extends PhysicalResource;
ct:abstract true;
// ...
leaf-list physicalLink {
type instance-identifier {ct:instance-type PhysicalLink;}
}
ct:instance-list containedHardware {
ct:instance-type Hardware;
}
ct:instance-list physicalConnector {
ct:instance-type PhysicalConnector;
Linowski, et al. Experimental [Page 10]
^L
RFC 6095 YANG Language Abstractions March 2011
}
}
ct:complex-type PhysicalLink {
ct:extends PhysicalResource;
// ...
leaf-list hardware {
type instance-identifier {ct:instance-type Hardware;}
}
}
ct:complex-type ManagedHardware {
ct:extends Hardware;
ct:abstract true;
// ...
}
ct:complex-type PhysicalConnector {
ct:extends Hardware;
leaf location {type string;}
// ...
leaf-list sourcePhysicalConnector {
type instance-identifier {ct:instance-type PhysicalConnector;}
}
leaf-list targetPhysicalConnector {
type instance-identifier {ct:instance-type PhysicalConnector;}
}
}
ct:complex-type Equipment {
ct:extends ManagedHardware;
// ...
ct:instance-list equipment {
ct:instance-type Equipment;
}
}
ct:complex-type EquipmentHolder {
ct:extends ManagedHardware;
description "In the SID V8 definition, this is a class based on
the M.3100 specification. A base class that represents physical
objects that are both manageable as well as able to host,
hold, or contain other physical objects. Examples of physical
Linowski, et al. Experimental [Page 11]
^L
RFC 6095 YANG Language Abstractions March 2011
objects that can be represented by instances of this object
class are Racks, Chassis, Cards, and Slots.
A piece of equipment with the primary purpose of containing
other equipment.";
leaf vendorName {type string;}
// ...
ct:instance-list equipment {
ct:instance-type Equipment;
}
ct:instance-list equipmentHolder {
ct:instance-type EquipmentHolder;
}
}
// ...
}
<CODE ENDS>
1.5.2. Modeling Entity MIB Entries as Physical Resources
The physical resource module described above can now be used to model
physical entities as defined in the Entity MIB [RFC4133]. For each
physical entity class listed in the "PhysicalClass" enumeration, a
complex type is defined. Each of these complex types extends the
most specific complex type already available in the physical resource
module. For example, the type "HWModule" extends the complex type
"Equipment" as a hardware module. Physical entity properties that
should be included in a physical entity complex type are combined in
a grouping, which is then used in each complex type definition of an
entity.
This approach has following benefits:
o The definition of the complex types for hardware entities becomes
compact as many of the features can be reused from the basic
complex type definition.
o Physical entities are modeled in a consistent manner as predefined
concepts are extended.
o Entity-MIB-specific attributes as well as vendor-specific
attributes can be added without having to define separate
extension data nodes.
Linowski, et al. Experimental [Page 12]
^L
RFC 6095 YANG Language Abstractions March 2011
Module udmcore : Module hardware-entities
:
equipment :
Holder :
0..* :
+-------+ :
| | :
+---------------+ +---------+ | :
|ManagedHardware|<|-+-|Equipment|<>--+ :
+---------------+ | | Holder |0..1 : +-------+
| | |<|---------+--|Chassis|
| +---------+ : | +-------+
| <> : |
| |0..* equipment : | +---------+
| | Holder : '--|Container|
| | : +---------+
| |0..* equipment :
| | :
| | equipment :
| | 0..* :
| | +-------+ :
| | | | :
| +---------+ | :
'-|Equipment|<>--+ : +--------+
| |<|---------+--|HWModule|
+---------+ : | +--------+
compositeEquipment : |
: | +---------+
: |--|Backplane|
: +---------+
Figure 2: Hardware Entities Model
Below is an excerpt of the corresponding YANG module using complex
types to model hardware entities. The complete YANG module for the
Hardware Entities model in Figure 2 can be found in Appendix A, "YANG
Modules for Physical Network Resource Model and Hardware Entities
Model".
Linowski, et al. Experimental [Page 13]
^L
RFC 6095 YANG Language Abstractions March 2011
<CODE BEGINS>
module hardware-entities {
namespace "http://example.com/hardware-entities";
prefix "hwe";
import ietf-yang-types {prefix "yt";}
import ietf-complex-types {prefix "ct";}
import udmcore {prefix "uc";}
grouping PhysicalEntityProperties {
// ...
leaf mfgDate {type yang:date-and-time; }
leaf-list uris {type string; }
}
// Physical entities representing equipment
ct:complex-type HWModule {
ct:extends uc:Equipment;
description "Complex type representing module entries
(entPhysicalClass = module(9)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
// ...
// Physical entities representing equipment holders
ct:complex-type Chassis {
ct:extends uc:EquipmentHolder;
description "Complex type representing chassis entries
(entPhysicalClass = chassis(3)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
// ...
}
<CODE ENDS>
Linowski, et al. Experimental [Page 14]
^L
RFC 6095 YANG Language Abstractions March 2011
2. Complex Types
2.1. Definition
YANG type concept is currently restricted to simple types, e.g.,
restrictions of primitive types, enumerations, or union of simple
types.
Complex types are types with a rich internal structure, which may be
composed of substatements defined in Table 1 (e.g., lists, leafs,
containers, choices). A new complex type may extend an existing
complex type. This allows providing type-safe extensions to existing
YANG models as instances of the new type.
Complex types have the following characteristics:
o Introduction of new types, as a named, formal description of a
concrete manageable resource as well as abstract concepts.
o Types can be extended, i.e., new types can be defined by
specializing existing types and adding new features. Instances of
such an extended type can be used wherever instances of the base
type may appear.
o The type information is made part of the NETCONF payload in case a
derived type substitutes a base type. This enables easy and
efficient consumption of payload elements representing complex
type instances.
2.2. complex-type Extension Statement
The extension statement "complex-type" is introduced; it accepts an
arbitrary number of statements that define node trees, among other
common YANG statements ("YANG Statements", Section 7 of [RFC6020]).
Linowski, et al. Experimental [Page 15]
^L
RFC 6095 YANG Language Abstractions March 2011
+------------------+-------------+
| substatement | cardinality |
+------------------+-------------+
| abstract | 0..1 |
| anyxml | 0..n |
| choice | 0..n |
| container | 0..n |
| description | 0..1 |
| ct:instance | 0..n |
| ct:instance-list | 0..n |
| ct:extends | 0..1 |
| grouping | 0..n |
| if-feature | 0..n |
| key | 0..1 |
| leaf | 0..n |
| leaf-list | 0..n |
| list | 0..n |
| must | 0..n |
| ordered-by | 0..n |
| reference | 0..1 |
| refine | 0..n |
| status | 0..1 |
| typedef | 0..n |
| uses | 0..n |
+------------------+-------------+
Table 1: complex-type's Substatements
Complex type definitions may appear at every place where a grouping
may be defined. That includes the module, submodule, rpc, input,
output, notification, container, and list statements.
Complex type names populate a distinct namespace. As with YANG
groupings, it is possible to define a complex type and a data node
(e.g., leaf, list, instance statements) with the same name in the
same scope. All complex type names defined within a parent node or
at the top level of the module or its submodules share the same type
identifier namespace. This namespace is scoped to the parent node or
module.
A complex type MAY have an instance key. An instance key is either
defined with the "key" statement as part of the complex type or is
inherited from the base complex type. It is not allowed to define an
additional key if the base complex type or one of its ancestors
already defines a key.
Complex type definitions do not create nodes in the schema tree.
Linowski, et al. Experimental [Page 16]
^L
RFC 6095 YANG Language Abstractions March 2011
2.3. instance Extension Statement
The "instance" extension statement is used to instantiate a complex
type by creating a subtree in the management information node tree.
The instance statement takes one argument that is the identifier of
the complex type instance. It is followed by a block of
substatements.
The type of the instance is specified with the mandatory "ct:
instance-type" substatement. The type of an instance MUST be a
complex type. Common YANG statements may be used as substatements of
the "instance" statement. An instance is optional by default. To
make an instance mandatory, "mandatory true" has to be applied as a
substatement.
+------------------+-------------+
| substatement | cardinality |
+------------------+-------------+
| description | 0..1 |
| config | 0..1 |
| ct:instance-type | 1 |
| if-feature | 0..n |
| mandatory | 0..1 |
| must | 0..n |
| reference | 0..1 |
| status | 0..1 |
| when | 0..1 |
| anyxml | 0..n |
| choice | 0..n |
| container | 0..n |
| ct:instance | 0..n |
| ct:instance-list | 0..n |
| leaf | 0..n |
| leaf-list | 0..n |
| list | 0..n |
+------------------+-------------+
Table 2: instance's Substatements
The "instance" and "instance-list" extension statements (see
Section 2.4, "instance-list Extension Statement") are similar to the
existing "leaf" and "leaf-list" statements, with the exception that
the content is composed of subordinate elements according to the
instantiated complex type.
It is also possible to add additional data nodes by using the
corresponding leaf, leaf-list, list, and choice-statements, etc., as
substatements of the instance declaration. This is an in-place
Linowski, et al. Experimental [Page 17]
^L
RFC 6095 YANG Language Abstractions March 2011
augmentation of the used complex type confined to a complex type
instantiation (see also Section 2.13, "Using Complex Types", for
details on augmenting complex types).
2.4. instance-list Extension Statement
The "instance-list" extension statement is used to instantiate a
complex type by defining a sequence of subtrees in the management
information node tree. In addition, the "instance-list" statement
takes one argument that is the identifier of the complex type
instances. It is followed by a block of substatements.
The type of the instance is specified with the mandatory "ct:
instance-type" substatement. In addition, it can be defined how
often an instance may appear in the schema tree by using the "min-
elements" and "max-elements" substatements. Common YANG statements
may be used as substatements of the "instance-list" statement.
In analogy to the "instance" statement, YANG substatements like
"list", "choice", "leaf", etc., MAY be used to augment the "instance-
list" elements at the root level with additional data nodes.
+------------------+-------------+
| substatementc | cardinality |
+------------------+-------------+
| description | 0..1 |
| config | 0..1 |
| ct:instance-type | 1 |
| if-feature | 0..n |
| max-elements | 0..1 |
| min-elements | 0..1 |
| must | 0..n |
| ordered-by | 0..1 |
| reference | 0..1 |
| status | 0..1 |
| when | 0..1 |
| anyxml | 0..n |
| choice | 0..n |
| container | 0..n |
| ct:instance | 0..n |
| ct:instance-list | 0..n |
| leaf | 0..n |
| leaf-list | 0..n |
| list | 0..n |
+------------------+-------------+
Table 3: instance-list's Substatements
Linowski, et al. Experimental [Page 18]
^L
RFC 6095 YANG Language Abstractions March 2011
In case the instance list represents configuration data, the used
complex type of an instance MUST have an instance key.
Instances as well as instance lists may appear as arguments of the
"deviate" statement.
2.5. extends Extension Statement
A complex type MAY extend exactly one existing base complex type by
using the "extends" extension statement. The keyword "extends" MAY
occur as a substatement of the "complex-type" extension statement.
The argument of the "complex-type" extension statement refers to the
base complex type via its name. In case a complex type represents
configuration data (the default), it MUST have a key; otherwise, it
MAY have a key. A key is either defined with the "key" statement as
part of the complex type or is inherited from the base complex type.
+--------------+-------------+
| substatement | cardinality |
+--------------+-------------+
| description | 0..1 |
| reference | 0..1 |
| status | 0..1 |
+--------------+-------------+
Table 4: extends' Substatements
2.6. abstract Extension Statement
Complex types may be declared to be abstract by using the "abstract"
extension statement. An abstract complex type cannot be
instantiated, meaning it cannot appear as the most specific type of
an instance in the NETCONF payload. In case an abstract type extends
a base type, the base complex type MUST be also abstract. By
default, complex types are not abstract.
The abstract complex type serves only as a base type for derived
concrete complex types and cannot be used as a type for an instance
in the NETCONF payload.
The "abstract" extension statement takes a single string argument,
which is either "true" or "false". In case a "complex-type"
statement does not contain an "abstract" statement as a substatement,
the default is "false". The "abstract" statement does not support
any substatements.
Linowski, et al. Experimental [Page 19]
^L
RFC 6095 YANG Language Abstractions March 2011
2.7. XML Encoding Rules
An "instance" node is encoded as an XML element, where an "instance-
list" node is encoded as a series of XML elements. The corresponding
XML element names are the "instance" and "instance-list" identifiers,
respectively, and they use the same XML namespace as the module.
Instance child nodes are encoded as subelements of the instance XML
element. Subelements representing child nodes defined in the same
complex type may appear in any order. However, child nodes of an
extending complex type follow the child nodes of the extended complex
type. As such, the XML encoding of lists is similar to the encoding
of containers and lists in YANG.
Instance key nodes are encoded as subelements of the instance XML
element. Instance key nodes must appear in the same order as they
are defined within the "key" statement of the corresponding complex
type definition and precede all other nodes defined in the same
complex type. That is, if key nodes are defined in an extending
complex type, XML elements representing key data precede all other
XML elements representing child nodes. On the other hand, XML
elements representing key data follow the XML elements representing
data nodes of the base type.
The type of the actual complex type instance is encoded in a type
element, which is put in front of all instance child elements,
including key nodes, as described in Section 2.8 ("Type Encoding
Rules").
The proposed XML encoding rules conform to the YANG XML encoding
rules in [RFC6020]. Compared to YANG, enabling key definitions in
derived hierarchies is a new feature introduced with the complex
types extension. As a new language feature, complex types also
introduce a new payload entry for the instance type identifier.
Based on our implementation experience, the proposed XML encoding
rules support consistent mapping of YANG models with complex types to
an XML schema using XML complex types.
2.8. Type Encoding Rules
In order to encode the type of an instance in the NETCONF payload,
XML elements named "type" belonging to the XML namespace
"urn:ietf:params:xml:ns:yang:ietf-complex-type-instance" are added to
the serialized form of instance and instance-list nodes in the
payload. The suggested namespace prefix is "cti". The "cti:type"
XML elements are inserted before the serialized form of all members
that have been declared in the corresponding complex type definition.
Linowski, et al. Experimental [Page 20]
^L
RFC 6095 YANG Language Abstractions March 2011
The "cti:type" element is inserted for each type in the extension
chain to the actual type of the instance (most specific last). Each
type name includes its corresponding namespace.
The type of a complex type instance MUST be encoded in the reply to
NETCONF <get> and <get-config> operations, and in the payload of a
NETCONF <edit-config> operation if the operation is "create" or
"replace". The type of the instance MUST also be specified in case
<copy-config> is used to export a configuration to a resource
addressed with an URI. The type of the instance has to be specified
in user-defined remote procedure calls (RPCs).
The type of the instance MAY be specified in case the operation is
"merge" (either because this is explicitly specified or no operation
attribute is provided).
In case the node already exists in the target configuration and the
type attribute (type of a complex type instance) is specified but
differs from the data in the target, an <rpc-error> element is
returned with an <error-app-tag> value of "wrong-complex-type". In
case no such element is present in the target configuration but the
type attribute is missing in the configuration data, an <rpc-error>
element is returned with an <error-tag> value of "missing-attribute".
The type MUST NOT be specified in case the operation is "delete".
2.9. Extension and Feature Definition Module
The module below contains all YANG extension definitions for complex
types and typed instance identifiers. In addition, a "complex-type"
feature is defined, which may be used to provide conditional or
alternative modeling, depending on the support status of complex
types in a NETCONF server. A NETCONF server that supports the
modeling features for complex types and the XML encoding for complex
types as defined in this document MUST advertise this as a feature.
This is done by including the feature name "complex-types" in the
feature parameter list as part of the NETCONF <hello> message as
described in Section 5.6.4 in [RFC6020].
<CODE BEGINS> file "ietf-complex-types@2011-03-15.yang"
module ietf-complex-types {
namespace "urn:ietf:params:xml:ns:yang:ietf-complex-types";
prefix "ct";
organization
Linowski, et al. Experimental [Page 21]
^L
RFC 6095 YANG Language Abstractions March 2011
"NETMOD WG";
contact
"Editor: Bernd Linowski
<bernd.linowski.ext@nsn.com>
Editor: Mehmet Ersue
<mehmet.ersue@nsn.com>
Editor: Siarhei Kuryla
<s.kuryla@gmail.com>";
description
"YANG extensions for complex types and typed instance
identifiers.
Copyright (c) 2011 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 6095; see
the RFC itself for full legal notices.";
revision 2011-03-15 {
description "Initial revision.";
}
extension complex-type {
description "Defines a complex-type.";
reference "Section 2.2, complex-type Extension Statement";
argument type-identifier {
yin-element true;
}
}
extension extends {
description "Defines the base type of a complex-type.";
reference "Section 2.5, extends Extension Statement";
argument base-type-identifier {
yin-element true;
}
}
Linowski, et al. Experimental [Page 22]
^L
RFC 6095 YANG Language Abstractions March 2011
extension abstract {
description "Makes the complex-type abstract.";
reference "Section 2.6, abstract Extension Statement";
argument status;
}
extension instance {
description "Declares an instance of the given
complex type.";
reference "Section 2.3, instance Extension Statement";
argument ct-instance-identifier {
yin-element true;
}
}
extension instance-list {
description "Declares a list of instances of the given
complex type";
reference "Section 2.4, instance-list Extension Statement";
argument ct-instance-identifier {
yin-element true;
}
}
extension instance-type {
description "Tells to which type instance the instance
identifier refers.";
reference "Section 3.2, instance-type Extension Statement";
argument target-type-identifier {
yin-element true;
}
}
feature complex-types {
description "Indicates that the server supports
complex types and instance identifiers.";
}
}
<CODE ENDS>
Linowski, et al. Experimental [Page 23]
^L
RFC 6095 YANG Language Abstractions March 2011
2.10. Example Model for Complex Types
The example model below shows how complex types can be used to
represent physical equipment in a vendor-independent, abstract way.
It reuses the complex types defined in the physical resource model in
Section 1.5.1.
<CODE BEGINS>
module hw {
namespace "http://example.com/hw";
prefix "hw";
import ietf-complex-types {prefix "ct"; }
import udmcore {prefix "uc"; }
// Holder types
ct:complex-type Slot {
ct:extends uc:EquipmentHolder;
leaf slotNumber { type uint16; config false; }
// ...
}
ct:complex-type Chassis {
ct:extends uc:EquipmentHolder;
leaf numberOfChassisSlots { type uint32; config false; }
// ..
}
// Equipment types
ct:complex-type Card {
ct:extends uc:Equipment;
leaf position { type uint32; mandatory true; }
leaf slotsRequired {type unit32; }
}
// Root Element
ct:instance hardware { type uc:ManagedHardware; }
} // hw module
<CODE ENDS>
Linowski, et al. Experimental [Page 24]
^L
RFC 6095 YANG Language Abstractions March 2011
2.11. NETCONF Payload Example
Following example shows the payload of a reply to a NETCONF <get>
command. The actual type of managed hardware instances is indicated
with the "cti:type" elements as required by the type encoding rules.
The containment hierarchy in the NETCONF XML payload reflects the
containment hierarchy of hardware instances. This makes filtering
based on the containment hierarchy possible without having to deal
with values of leafs of type leafref that represent the tree
structure in a flattened hierarchy.
<hardware>
<cti:type>uc:BasicObject</cti:type>
<distinguishedName>/R-T31/CH-2</distinguishedName>
<globalId>6278279001</globalId>
<cti:type>uc:Resource</cti:type>
<cti:type>uc:PhysicalResource</cti:type>
<otherIdentifier>Rack R322-1</otherIdentifier>
<serialNumber>R-US-3276279a</serialNumber>
<cti:type>uc:Hardware</cti:type>
<cti:type>uc:ManagedHardware</cti:type>
<cti:type>hw:EquipmentHolder</cti:type>
<equipmentHolder>
<cti:type>uc:BasicObject</cti:type>
<distinguishedName>/R-T31/CH-2/SL-1</distinguishedName>
<globalId>548872003</globalId>
<cti:type>uc:Resource</cti:type>
<cti:type>uc:PhysicalResource</cti:type>
<otherIdentifier>CU-Slot</otherIdentifier>
<serialNumber>T-K4733890x45</serialNumber>
<cti:type>uc:Hardware</cti:type>
<cti:type>uc:ManagedHardware</cti:type>
<cti:type>uc:EquipmentHolder</cti:type>
<equipment>
<cti:type>uc:BasicObject</cti:type>
<distinguishedName>/R-T31/CH-2/SL-1/C-3</distinguishedName>
<globalId>89772001</globalId>
<cti:type>uc:Resource</cti:type>
<cti:type>uc:PhysicalResource</cti:type>
<otherIdentifier>ATM-45252</otherIdentifier>
<serialNumber>A-778911-b</serialNumber>
<cti:type>uc:Hardware</cti:type>
<cti:type>uc:ManagedHardware</cti:type>
<cti:type>uc:Equipment</cti:type>
<installed>true</installed>
<version>A2</version>
<redundancy>1</redundancy>
<cti:type>hw:Card</cti:type>
Linowski, et al. Experimental [Page 25]
^L
RFC 6095 YANG Language Abstractions March 2011
<usedSlots>1</usedSlots>
</equipment>
<cti:type>hw:Slot</cti:type>
<slotNumber>1</slotNumber>
</equipmentHolder>
<cti:type>hw:Chassis</cti:type>
<numberOfChassisSlots>6</numberOfChassisSlots>
// ...
</hardware>
2.12. Update Rules for Modules Using Complex Types
In addition to the module update rules specified in Section 10 in
[RFC6020], modules that define complex types, instances of complex
types, and typed instance identifiers must obey following rules:
o New complex types MAY be added.
o A new complex type MAY extend an existing complex type.
o New data definition statements MAY be added to a complex type only
if:
* they are not mandatory or
* they are not conditionally dependent on a new feature (i.e.,
they do not have an "if-feature" statement that refers to a new
feature).
o The type referred to by the instance-type statement may be changed
to a type that derives from the original type only if the original
type does not represent configuration data.
2.13. Using Complex Types
All data nodes defined inside a complex type reside in the complex
type namespace, which is their parent node namespace.
2.13.1. Overriding Complex Type Data Nodes
It is not allowed to override a data node inherited from a base type.
That is, it is an error if a type "base" with a leaf named "foo" is
extended by another complex type ("derived") with a leaf named "foo"
in the same module. In case they are derived in different modules,
there are two distinct "foo" nodes that are mapped to the XML
namespaces of the module, where the complex types are specified.
Linowski, et al. Experimental [Page 26]
^L
RFC 6095 YANG Language Abstractions March 2011
A complex type that extends a basic complex type may use the "refine"
statement in order to improve an inherited data node. The target
node identifier must be qualified by the module prefix to indicate
clearly which inherited node is refined.
The following refinements can be done:
o A leaf or choice node may have a default value, or a new default
value if it already had one.
o Any node may have a different "description" or "reference" string.
o A leaf, anyxml, or choice node may have a "mandatory true"
statement. However, it is not allowed to change from "mandatory
true" to "mandatory false".
o A leaf, leaf-list, list, container, or anyxml node may have
additional "must" expressions.
o A list, leaf-list, instance, or instance-list node may have a
"min-elements" statement, if the base type does not have one or
does not have one with a value that is greater than the minimum
value of the base type.
o A list, leaf-list, instance, or instance-list node may have a
"max-elements" statement, if the base type does not have one or
does not have one with a value that is smaller than the maximum
value of the base type.
It is not allowed to refine complex-type nodes inside "instance" or
"instance-list" statements.
2.13.2. Augmenting Complex Types
Augmenting complex types is only allowed if a complex type is
instantiated in an "instance" or "instance-list" statement. This
confines the effect of the augmentation to the location in the schema
tree where the augmentation is done. The argument of the "augment"
statement MUST be in the descendant form (as defined by the rule
"descendant-schema-nodeid" in Section 12 in [RFC6020]).
Linowski, et al. Experimental [Page 27]
^L
RFC 6095 YANG Language Abstractions March 2011
ct:complex-type Chassis {
ct:extends EquipmentHolder;
container chassisInfo {
config false;
leaf numberOfSlots { type uint16; }
leaf occupiedSlots { type uint16; }
leaf height {type unit16;}
leaf width {type unit16;}
}
}
ct:instance-list chassis {
type Chassis;
augment "chassisInfo" {
leaf modelId { type string; }
}
}
When augmenting a complex type, only the "container", "leaf", "list",
"leaf-list", "choice", "instance", "instance-list", and "if-feature"
statements may be used within the "augment" statement. The nodes
added by the augmentation MUST NOT be mandatory nodes. One or many
"augment" statements may not cause the creation of multiple nodes
with the same name from the same namespace in the target node.
To achieve less-complex modeling, this document proposes the
augmentation of complex type instances without recursion.
2.13.3. Controlling the Use of Complex Types
A server might not want to support all complex types defined in a
supported module. This issue can be addressed with YANG features as
follows:
o Features are defined that are used inside complex type definitions
(by using "if-feature" as a substatement) to make them optional.
In this case, such complex types may only be instantiated if the
feature is supported (advertised as a capability in the NETCONF
<hello> message).
o The "deviation" statement may be applied to node trees, which are
created by "instance" and "instance-list" statements. In this
case, only the substatement "deviate not-supported" is allowed.
Linowski, et al. Experimental [Page 28]
^L
RFC 6095 YANG Language Abstractions March 2011
o It is not allowed to apply the "deviation" statement to node tree
elements that may occur because of the recursive use of a complex
type. Other forms of deviations ("deviate add", "deviate
replace", "deviate delete") are NOT supported inside node trees
spanned by "instance" or "instance-list".
As complex type definitions do not contribute by themselves to the
data node tree, data node declarations inside complex types cannot be
the target of deviations.
In the example below, client applications are informed that the leaf
"occupiedSlots" is not supported in the top-level chassis. However,
if a chassis contains another chassis, the contained chassis may
support the leaf that reports the number of occupied slots.
deviation "/chassis/chassisSpec/occupiedSlots" {
deviate not-supported;
}
3. Typed Instance Identifier
3.1. Definition
Typed instance identifier relationships are an addition to the
relationship types already defined in YANG, where the leafref
relationship is location dependent, and the instance-identifier does
not specify to which type of instances the identifier points.
A typed instance identifier represents a reference to an instance of
a complex type without being restricted to a particular location in
the containment tree. This is done by using the extension statement
"instance-type" as a substatement of the existing "type instance
identifier" statement.
Typed instance identifiers allow referring to instances of complex
types that may be located anywhere in the schema tree. The "type"
statement plays the role of a restriction that must be fulfilled by
the target node, which is referred to with the instance identifier.
The target node MUST be of a particular complex type, either the type
itself or any type that extends this complex type.
3.2. instance-type Extension Statement
The "instance-type" extension statement specifies the complex type of
the instance to which the instance-identifier refers. The referred
instance may also instantiate any complex type that extends the
specified complex type.
Linowski, et al. Experimental [Page 29]
^L
RFC 6095 YANG Language Abstractions March 2011
The instance complex type is identified by the single name argument.
The referred complex type MUST have a key. This extension statement
MUST be used as a substatement of the "type instance-identifier"
statement. The "instance-type" extension statement does not support
any substatements.
3.3. Typed Instance Identifier Example
In the example below, a physical link connects an arbitrary number of
physical ports. Here, typed instance identifiers are used to denote
which "PhysicalPort" instances (anywhere in the data tree) are
connected by a "PhysicalLink".
// Extended version of type Card
ct:complex-type Card {
ct:extends Equipment;
leaf usedSlot { type uint16; mandatory true; }
ct:instance-list port {
type PhysicalPort;
}
}
ct:complex-type PhysicalPort {
ct:extends ManagedHardware;
leaf portNumber { type int32; mandatory true; }
}
ct:complex-type PhysicalLink {
ct:extends ManagedHardware;
leaf media { type string; }
leaf-list connectedPort {
type instance-identifier {
ct:instance-type PhysicalPort;
}
min-elements 2;
}
}
Below is the XML encoding of an element named "link" of type
"PhysicalLink":
Linowski, et al. Experimental [Page 30]
^L
RFC 6095 YANG Language Abstractions March 2011
<link>
<objectId>FTCL-771</objectId>
<media>Fiber</media>
<connectedPort>/hw:hardware[objectId='R-11']
/hw:equipment[objectId='AT22']/hw:port[objectId='P12']
</connectedPort>
<connectedPort>/hw:hardware[objectId='R-42]
/hw:equipment[objectId='AT30']/hw:port[objectId='P3']
</connectedPort>
<serialNumber>F-7786828</serialNumber>
<commonName>FibCon 7</commonName>
</link>
4. IANA Considerations
This document registers two URIs in the IETF XML registry. IANA
registered the following URIs, according to [RFC3688]:
URI: urn:ietf:params:xml:ns:yang:ietf-complex-types
URI: urn:ietf:params:xml:ns:yang:ietf-complex-type-instance
Registrant Contact:
Bernd Linowski (bernd.linowski.ext@nsn.com)
Mehmet Ersue (mehmet.ersue@nsn.com)
Siarhei Kuryla (s.kuryla@gmail.com)
XML: N/A, the requested URIs are XML namespaces.
This document registers one module name in the "YANG Module Names"
registry, defined in [RFC6020].
name: ietf-complex-types
namespace: urn:ietf:params:xml:ns:yang:ietf-complex-types
prefix: ct
RFC: 6095
5. Security Considerations
The YANG module "complex-types" in this memo defines YANG extensions
for complex types and typed instance identifiers as new language
statements.
Complex types and typed instance identifiers themselves do not have
any security impact on the Internet.
Linowski, et al. Experimental [Page 31]
^L
RFC 6095 YANG Language Abstractions March 2011
The security considerations described throughout [RFC6020] apply here
as well.
6. Acknowledgements
The authors would like to thank to Martin Bjorklund, Balazs Lengyel,
Gerhard Muenz, Dan Romascanu, Juergen Schoenwaelder, and Martin
Storch for their valuable review and comments on different versions
of the document.
7. References
7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
January 2004.
[RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the
Network Configuration Protocol (NETCONF)", RFC 6020,
October 2010.
7.2. Informative References
[IPFIXCONF]
Muenz, G., Claise, B., and P. Aitken, "Configuration Data
Model for IPFIX and PSAMP", Work in Progress, March 2011.
[Libsmi] Kuryla, S., "Libsmi Extension for Complex Types",
April 2010, <http://www.ibr.cs.tu-bs.de/svn/libsmi>.
[Pyang] Bjorklund, M., "An extensible YANG validator and converter
in python", October 2010,
<http://code.google.com/p/pyang/>.
[Pyang-ct]
Kuryla, S., "Complex type extension for an extensible YANG
validator and converter in python", April 2010,
<http://code.google.com/p/pyang-ct/>.
[RFC4133] Bierman, A. and K. McCloghrie, "Entity MIB (Version 3)",
RFC 4133, August 2005.
Linowski, et al. Experimental [Page 32]
^L
RFC 6095 YANG Language Abstractions March 2011
[SID_V8] TeleManagement Forum, "GB922, Information Framework (SID)
Solution Suite, Release 8.0", July 2008, <http://
www.tmforum.org/DocumentsInformation/
GB922InformationFramework/35499/article.html>.
[UDM] NSN, "Unified Data Model SID Compliance Statement",
May 2010, <http://www.tmforum.org/InformationFramework/
NokiaSiemensNetworks/8815/home.html>.
Linowski, et al. Experimental [Page 33]
^L
RFC 6095 YANG Language Abstractions March 2011
Appendix A. YANG Modules for Physical Network Resource Model and
Hardware Entities Model
YANG module for the 'Physical Network Resource Model':
<CODE BEGINS>
module udmcore {
namespace "http://example.com/udmcore";
prefix "udm";
import ietf-yang-types {prefix "yang";}
import ietf-complex-types {prefix "ct";}
ct:complex-type BasicObject {
ct:abstract true;
key "distinguishedName";
leaf globalId {type int64;}
leaf distinguishedName {type string; mandatory true;}
}
ct:complex-type ManagedObject {
ct:extends BasicObject;
ct:abstract true;
leaf instance {type string;}
leaf objectState {type int32;}
leaf release {type string;}
}
ct:complex-type Resource {
ct:extends ManagedObject;
ct:abstract true;
leaf usageState {type int16;}
leaf managementMethodSupported {type string;}
leaf managementMethodCurrent {type string;}
leaf managementInfo {type string;}
leaf managementDomain {type string;}
leaf version {type string;}
leaf entityIdentification {type string;}
leaf description {type string;}
leaf rootEntityType {type string;}
}
Linowski, et al. Experimental [Page 34]
^L
RFC 6095 YANG Language Abstractions March 2011
ct:complex-type LogicalResource {
ct:extends Resource;
ct:abstract true;
leaf lrStatus {type int32;}
leaf serviceState {type int32;}
leaf isOperational {type boolean;}
}
ct:complex-type PhysicalResource {
ct:extends Resource;
ct:abstract true;
leaf manufactureDate {type string;}
leaf otherIdentifier {type string;}
leaf powerState {type int32;}
leaf serialNumber {type string;}
leaf versionNumber {type string;}
}
ct:complex-type Hardware {
ct:extends PhysicalResource;
ct:abstract true;
leaf width {type string;}
leaf height {type string;}
leaf depth {type string;}
leaf measurementUnits {type int32;}
leaf weight {type string;}
leaf weightUnits {type int32;}
leaf-list physicalLink {
type instance-identifier {
ct:instance-type PhysicalLink;
}
}
ct:instance-list containedHardware {
ct:instance-type Hardware;
}
ct:instance-list physicalConnector {
ct:instance-type PhysicalConnector;
}
}
ct:complex-type PhysicalLink {
ct:extends PhysicalResource;
leaf isWireless {type boolean;}
leaf currentLength {type string;}
leaf maximumLength {type string;}
Linowski, et al. Experimental [Page 35]
^L
RFC 6095 YANG Language Abstractions March 2011
leaf mediaType {type int32;}
leaf-list hardware {
type instance-identifier {
ct:instance-type Hardware;
}
}
}
ct:complex-type ManagedHardware {
ct:extends Hardware;
leaf additionalinfo {type string;}
leaf physicalAlarmReportingEnabled {type boolean;}
leaf pyhsicalAlarmStatus {type int32;}
leaf coolingRequirements {type string;}
leaf hardwarePurpose {type string;}
leaf isPhysicalContainer {type boolean;}
}
ct:complex-type AuxiliaryComponent {
ct:extends ManagedHardware;
ct:abstract true;
}
ct:complex-type PhysicalPort {
ct:extends ManagedHardware;
leaf portNumber {type int32;}
leaf duplexMode {type int32;}
leaf ifType {type int32;}
leaf vendorPortName {type string;}
}
ct:complex-type PhysicalConnector {
ct:extends Hardware;
leaf location {type string;}
leaf cableType {type int32;}
leaf gender {type int32;}
leaf inUse {type boolean;}
leaf pinDescription {type string;}
leaf typeOfConnector {type int32;}
leaf-list sourcePhysicalConnector {
type instance-identifier {
ct:instance-type PhysicalConnector;
}
}
Linowski, et al. Experimental [Page 36]
^L
RFC 6095 YANG Language Abstractions March 2011
leaf-list targetPhysicalConnector {
type instance-identifier {
ct:instance-type PhysicalConnector;
}
}
}
ct:complex-type Equipment {
ct:extends ManagedHardware;
leaf installStatus {type int32;}
leaf expectedEquipmentType {type string;}
leaf installedEquipmentType {type string;}
leaf installedVersion {type string;}
leaf redundancy {type int32;}
leaf vendorName {type string;}
leaf dateOfLastService {type yang:date-and-time;}
leaf interchangeability {type string;}
leaf identificationCode {type string;}
ct:instance-list equipment {
ct:instance-type Equipment;
}
}
ct:complex-type EquipmentHolder {
ct:extends ManagedHardware;
leaf vendorName {type string;}
leaf locationName {type string;}
leaf dateOfLastService {type yang:date-and-time;}
leaf partNumber {type string;}
leaf availabilityStatus {type int16;}
leaf nameFromPlanningSystem {type string;}
leaf modelNumber {type string;}
leaf acceptableEquipmentList {type string;}
leaf isSolitaryHolder {type boolean;}
leaf holderStatus {type int16;}
leaf interchangeability {type string;}
leaf equipmentHolderSpecificType {type string; }
leaf position {type string;}
leaf atomicCompositeType {type int16;}
leaf uniquePhysical {type boolean;}
leaf physicalDescription {type string;}
leaf serviceApproach {type string;}
leaf mountingOptions {type int32;}
leaf cableManagementStrategy {type string;}
leaf isSecureHolder {type boolean;}
ct:instance-list equipment {
Linowski, et al. Experimental [Page 37]
^L
RFC 6095 YANG Language Abstractions March 2011
ct:instance-type Equipment;
}
ct:instance-list equipmentHolder {
ct:instance-type EquipmentHolder;
}
}
// ... other resource complex types ...
}
<CODE ENDS>
YANG module for the 'Hardware Entities Model':
<CODE BEGINS>
module hardware-entities {
namespace "http://example.com/:hardware-entities";
prefix "hwe";
import ietf-yang-types {prefix "yang";}
import ietf-complex-types {prefix "ct";}
import udmcore {prefix "uc";}
grouping PhysicalEntityProperties {
leaf hardwareRev {type string; }
leaf firmwareRev {type string; }
leaf softwareRev {type string; }
leaf serialNum {type string; }
leaf mfgName {type string; }
leaf modelName {type string; }
leaf alias {type string; }
leaf ssetID{type string; }
leaf isFRU {type boolean; }
leaf mfgDate {type yang:date-and-time; }
leaf-list uris {type string; }
}
// Physical entities representing equipment
ct:complex-type Module {
ct:extends uc:Equipment;
description "Complex type representing module entries
Linowski, et al. Experimental [Page 38]
^L
RFC 6095 YANG Language Abstractions March 2011
(entPhysicalClass = module(9)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
ct:complex-type Backplane {
ct:extends uc:Equipment;
description "Complex type representing backplane entries
(entPhysicalClass = backplane(4)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
// Physical entities representing auxiliary hardware components
ct:complex-type PowerSupply {
ct:extends uc:AuxiliaryComponent;
description "Complex type representing power supply entries
(entPhysicalClass = powerSupply(6)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
ct:complex-type Fan {
ct:extends uc:AuxiliaryComponent;
description "Complex type representing fan entries
(entPhysicalClass = fan(7)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
ct:complex-type Sensor {
ct:extends uc:AuxiliaryComponent;
description "Complex type representing sensor entries
(entPhysicalClass = sensor(8)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
// Physical entities representing equipment holders
ct:complex-type Chassis {
ct:extends uc:EquipmentHolder;
description "Complex type representing chassis entries
(entPhysicalClass = chassis(3)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
ct:complex-type Container {
ct:extends uc:EquipmentHolder;
description "Complex type representing container entries
Linowski, et al. Experimental [Page 39]
^L
RFC 6095 YANG Language Abstractions March 2011
(entPhysicalClass = container(5)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
ct:complex-type Stack {
ct:extends uc:EquipmentHolder;
description "Complex type representing stack entries
(entPhysicalClass = stack(11)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
// Other kinds of physical entities
ct:complex-type Port {
ct:extends uc:PhysicalPort;
description "Complex type representing port entries
(entPhysicalClass = port(10)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
ct:complex-type CPU {
ct:extends uc:Hardware;
description "Complex type representing cpu entries
(entPhysicalClass = cpu(12)) in entPhysicalTable";
uses PhysicalEntityProperties;
}
}
<CODE ENDS>
Appendix B. Example YANG Module for the IPFIX/PSAMP Model
B.1. Modeling Improvements for the IPFIX/PSAMP Model with Complex Types
and Typed Instance Identifiers
The module below is a variation of the IPFIX/PSAMP configuration
model, which uses complex types and typed instance identifiers to
model the concept outlined in [IPFIXCONF].
When looking at the YANG module with complex types and typed instance
identifiers, various technical improvements on the modeling level
become apparent.
o There is almost a one-to-one mapping between the domain concepts
introduced in IPFIX and the complex types in the YANG module.
Linowski, et al. Experimental [Page 40]
^L
RFC 6095 YANG Language Abstractions March 2011
o All associations between the concepts (besides containment) are
represented with typed identifiers. That avoids having to refer
to a particular location in the tree. Referring to a particular
in the tree is not mandated by the original model.
o It is superfluous to represent concept refinement (class
inheritance in the original model) with containment in the form of
quite big choice-statements with complex branches. Instead,
concept refinement is realized by complex types extending a base
complex type.
o It is unnecessary to introduce metadata identities and leafs
(e.g., "identity cacheMode" and "leaf cacheMode" in "grouping
cacheParameters") that just serve the purpose of indicating which
concrete subtype of a generic type (modeled as grouping, which
contains the union of all features of all subtypes) is actually
represented in the MIB.
o Ruling out illegal use of subtype-specific properties (e.g., "leaf
maxFlows") by using "when" statements that refer to a subtype
discriminator is not necessary (e.g., when "../cacheMode !=
'immediate'").
o Defining properties like the configuration status wherever a so
called "parameter grouping" is used is not necessary. Instead,
those definitions can be put inside the complex type definition
itself.
o Separating the declaration of the key from the related data nodes
definitions in a grouping (see use of "grouping
selectorParameters") can be avoided.
o Complex types may be declared as optional features. If the type
is indicated with an identity (e.g., "identity immediate"), this
is not possible, since "if-feature" is not allowed as a
substatement of "identity".
B.2. IPFIX/PSAMP Model with Complex Types and Typed Instance
Identifiers
<CODE BEGINS>
module ct-ipfix-psamp-example {
namespace "http://example.com/ns/ct-ipfix-psamp-example";
prefix ipfix;
import ietf-yang-types { prefix yang; }
import ietf-inet-types { prefix inet; }
import ietf-complex-types {prefix "ct"; }
Linowski, et al. Experimental [Page 41]
^L
RFC 6095 YANG Language Abstractions March 2011
description "Example IPFIX/PSAMP Configuration Data Model
with complex types and typed instance identifiers";
revision 2011-03-15 {
description "The YANG Module ('YANG Module of the IPFIX/PSAMP
Configuration Data Model') in [IPFIXCONF] modeled with
complex types and typed instance identifiers.
Disclaimer: This example model illustrates the use of the
language extensions defined in this document and does not
claim to be an exact reproduction of the original YANG
model referred above. The original description texts have
been shortened to increase the readability of the model
example.";
}
/*****************************************************************
* Features
*****************************************************************/
feature exporter {
description "If supported, the Monitoring Device can be used as
an Exporter. Exporting Processes can be configured.";
}
feature collector {
description "If supported, the Monitoring Device can be used as
a Collector. Collecting Processes can be configured.";
}
feature meter {
description "If supported, Observation Points, Selection
Processes, and Caches can be configured.";
}
feature psampSampCountBased {
description "If supported, the Monitoring Device supports
count-based Sampling...";
}
feature psampSampTimeBased {
description "If supported, the Monitoring Device supports
time-based Sampling...";
}
feature psampSampRandOutOfN {
description "If supported, the Monitoring Device supports
random n-out-of-N Sampling...";
}
Linowski, et al. Experimental [Page 42]
^L
RFC 6095 YANG Language Abstractions March 2011
feature psampSampUniProb {
description "If supported, the Monitoring Device supports
uniform probabilistic Sampling...";
}
feature psampFilterMatch {
description "If supported, the Monitoring Device supports
property match Filtering...";
}
feature psampFilterHash {
description "If supported, the Monitoring Device supports
hash-based Filtering...";
}
feature cacheModeImmediate {
description "If supported, the Monitoring Device supports
Cache Mode 'immediate'.";
}
feature cacheModeTimeout {
description "If supported, the Monitoring Device supports
Cache Mode 'timeout'.";
}
feature cacheModeNatural {
description "If supported, the Monitoring Device supports
Cache Mode 'natural'.";
}
feature cacheModePermanent {
description "If supported, the Monitoring Device supports
Cache Mode 'permanent'.";
}
feature udpTransport {
description "If supported, the Monitoring Device supports UDP
as transport protocol.";
}
feature tcpTransport {
description "If supported, the Monitoring Device supports TCP
as transport protocol.";
}
feature fileReader {
description "If supported, the Monitoring Device supports the
configuration of Collecting Processes as File Readers.";
Linowski, et al. Experimental [Page 43]
^L
RFC 6095 YANG Language Abstractions March 2011
}
feature fileWriter {
description "If supported, the Monitoring Device supports the
configuration of Exporting Processes as File Writers.";
}
/*****************************************************************
* Identities
*****************************************************************/
/*** Hash function identities ***/
identity hashFunction {
description "Base identity for all hash functions...";
}
identity BOB {
base "hashFunction";
description "BOB hash function";
reference "RFC 5475, Section 6.2.4.1.";
}
identity IPSX {
base "hashFunction";
description "IPSX hash function";
reference "RFC 5475, Section 6.2.4.1.";
}
identity CRC {
base "hashFunction";
description "CRC hash function";
reference "RFC 5475, Section 6.2.4.1.";
}
/*** Export mode identities ***/
identity exportMode {
description "Base identity for different usages of export
destinations configured for an Exporting Process...";
}
identity parallel {
base "exportMode";
description "Parallel export of Data Records to all
destinations configured for the Exporting Process.";
}
identity loadBalancing {
base "exportMode";
description "Load-balancing between the different
destinations...";
}
identity fallback {
base "exportMode";
Linowski, et al. Experimental [Page 44]
^L
RFC 6095 YANG Language Abstractions March 2011
description "Export to the primary destination...";
}
/*** Options type identities ***/
identity optionsType {
description "Base identity for report types exported
with options...";
}
identity meteringStatistics {
base "optionsType";
description "Metering Process Statistics.";
reference "RFC 5101, Section 4.1.";
}
identity meteringReliability {
base "optionsType";
description "Metering Process Reliability Statistics.";
reference "RFC 5101, Section 4.2.";
}
identity exportingReliability {
base "optionsType";
description "Exporting Process Reliability
Statistics.";
reference "RFC 5101, Section 4.3.";
}
identity flowKeys {
base "optionsType";
description "Flow Keys.";
reference "RFC 5101, Section 4.4.";
}
identity selectionSequence {
base "optionsType";
description "Selection Sequence and Selector Reports.";
reference "RFC 5476, Sections 6.5.1 and 6.5.2.";
}
identity selectionStatistics {
base "optionsType";
description "Selection Sequence Statistics Report.";
reference "RFC 5476, Sections 6.5.3.";
}
identity accuracy {
base "optionsType";
description "Accuracy Report.";
reference "RFC 5476, Section 6.5.4.";
}
identity reducingRedundancy {
base "optionsType";
description "Enables the utilization of Options Templates to
reduce redundancy in the exported Data Records.";
Linowski, et al. Experimental [Page 45]
^L
RFC 6095 YANG Language Abstractions March 2011
reference "RFC 5473.";
}
identity extendedTypeInformation {
base "optionsType";
description "Export of extended type information for
enterprise-specific Information Elements used in the
exported Templates.";
reference "RFC 5610.";
}
/*****************************************************************
* Type definitions
*****************************************************************/
typedef nameType {
type string {
length "1..max";
pattern "\S(.*\S)?";
}
description "Type for 'name' leafs...";
}
typedef direction {
type enumeration {
enum ingress {
description "This value is used for monitoring incoming
packets.";
}
enum egress {
description "This value is used for monitoring outgoing
packets.";
}
enum both {
description "This value is used for monitoring incoming and
outgoing packets.";
}
}
description "Direction of packets going through an interface or
linecard.";
}
typedef transportSessionStatus {
type enumeration {
enum inactive {
description "This value MUST be used for...";
}
enum active {
description "This value MUST be used for...";
Linowski, et al. Experimental [Page 46]
^L
RFC 6095 YANG Language Abstractions March 2011
}
enum unknown {
description "This value MUST be used if the status...";
}
}
description "Status of a Transport Session.";
reference "RFC 5815, Section 8 (ipfixTransportSessionStatus).";
}
/*****************************************************************
* Complex types
*****************************************************************/
ct:complex-type ObservationPoint {
description "Observation Point";
key name;
leaf name {
type nameType;
description "Key of an observation point.";
}
leaf observationPointId {
type uint32;
config false;
description "Observation Point ID...";
reference "RFC 5102, Section 5.1.10.";
}
leaf observationDomainId {
type uint32;
mandatory true;
description "The Observation Domain ID associates...";
reference "RFC 5101.";
}
choice OPLocation {
mandatory true;
description "Location of the Observation Point.";
leaf ifIndex {
type uint32;
description "Index of an interface...";
reference "RFC 2863.";
}
leaf ifName {
type string;
description "Name of an interface...";
reference "RFC 2863.";
}
leaf entPhysicalIndex {
type uint32;
description "Index of a linecard...";
Linowski, et al. Experimental [Page 47]
^L
RFC 6095 YANG Language Abstractions March 2011
reference "RFC 4133.";
}
leaf entPhysicalName {
type string;
description "Name of a linecard...";
reference "RFC 4133.";
}
}
leaf direction {
type direction;
default both;
description "Direction of packets....";
}
leaf-list selectionProcess {
type instance-identifier { ct:instance-type SelectionProcess; }
description "Selection Processes in this list process packets
in parallel.";
}
}
ct:complex-type Selector {
ct:abstract true;
description "Abstract selector";
key name;
leaf name {
type nameType;
description "Key of a selector";
}
leaf packetsObserved {
type yang:counter64;
config false;
description "The number of packets observed ...";
reference "RFC 5815, Section 8
(ipfixSelectionProcessStatsPacketsObserved).";
}
leaf packetsDropped {
type yang:counter64;
config false;
description "The total number of packets discarded ...";
reference "RFC 5815, Section 8
(ipfixSelectionProcessStatsPacketsDropped).";
}
leaf selectorDiscontinuityTime {
type yang:date-and-time;
config false;
description "Timestamp of the most recent occasion at which
one or more of the Selector counters suffered a
discontinuity...";
Linowski, et al. Experimental [Page 48]
^L
RFC 6095 YANG Language Abstractions March 2011
reference "RFC 5815, Section 8
(ipfixSelectionProcessStatsDiscontinuityTime).";
}
}
ct:complex-type SelectAllSelector {
ct:extends Selector;
description "Method that selects all packets.";
}
ct:complex-type SampCountBasedSelector {
if-feature psampSampCountBased;
ct:extends Selector;
description "Selector applying systematic count-based
packet sampling to the packet stream.";
reference "RFC 5475, Section 5.1;
RFC 5476, Section 6.5.2.1.";
leaf packetInterval {
type uint32;
units packets;
mandatory true;
description "The number of packets that are consecutively
sampled between gaps of length packetSpace.
This parameter corresponds to the Information Element
samplingPacketInterval.";
reference "RFC 5477, Section 8.2.2.";
}
leaf packetSpace {
type uint32;
units packets;
mandatory true;
description "The number of unsampled packets between two
sampling intervals.
This parameter corresponds to the Information Element
samplingPacketSpace.";
reference "RFC 5477, Section 8.2.3.";
}
}
ct:complex-type SampTimeBasedSelector {
if-feature psampSampTimeBased;
ct:extends Selector;
description "Selector applying systematic time-based
packet sampling to the packet stream.";
reference "RFC 5475, Section 5.1;
RFC 5476, Section 6.5.2.2.";
leaf timeInterval {
type uint32;
Linowski, et al. Experimental [Page 49]
^L
RFC 6095 YANG Language Abstractions March 2011
units microseconds;
mandatory true;
description "The time interval in microseconds during
which all arriving packets are sampled between gaps
of length timeSpace.
This parameter corresponds to the Information Element
samplingTimeInterval.";
reference "RFC 5477, Section 8.2.4.";
}
leaf timeSpace {
type uint32;
units microseconds;
mandatory true;
description "The time interval in microseconds during
which no packets are sampled between two sampling
intervals specified by timeInterval.
This parameter corresponds to the Information Element
samplingTimeInterval.";
reference "RFC 5477, Section 8.2.5.";
}
}
ct:complex-type SampRandOutOfNSelector {
if-feature psampSampRandOutOfN;
ct:extends Selector;
description "This container contains the configuration
parameters of a Selector applying n-out-of-N packet
sampling to the packet stream.";
reference "RFC 5475, Section 5.2.1;
RFC 5476, Section 6.5.2.3.";
leaf size {
type uint32;
units packets;
mandatory true;
description "The number of elements taken from the parent
population.
This parameter corresponds to the Information Element
samplingSize.";
reference "RFC 5477, Section 8.2.6.";
}
leaf population {
type uint32;
units packets;
mandatory true;
description "The number of elements in the parent
population.
This parameter corresponds to the Information Element
samplingPopulation.";
Linowski, et al. Experimental [Page 50]
^L
RFC 6095 YANG Language Abstractions March 2011
reference "RFC 5477, Section 8.2.7.";
}
}
ct:complex-type SampUniProbSelector {
if-feature psampSampUniProb;
ct:extends Selector;
description "Selector applying uniform probabilistic
packet sampling (with equal probability per packet) to the
packet stream.";
reference "RFC 5475, Section 5.2.2.1;
RFC 5476, Section 6.5.2.4.";
leaf probability {
type decimal64 {
fraction-digits 18;
range "0..1";
}
mandatory true;
description "Probability that a packet is sampled,
expressed as a value between 0 and 1. The probability
is equal for every packet.
This parameter corresponds to the Information Element
samplingProbability.";
reference "RFC 5477, Section 8.2.8.";
}
}
ct:complex-type FilterMatchSelector {
if-feature psampFilterMatch;
ct:extends Selector;
description "This container contains the configuration
parameters of a Selector applying property match filtering
to the packet stream.";
reference "RFC 5475, Section 6.1;
RFC 5476, Section 6.5.2.5.";
choice nameOrId {
mandatory true;
description "The field to be matched is specified by
either the name or the ID of the Information
Element.";
leaf ieName {
type string;
description "Name of the Information Element.";
}
leaf ieId {
type uint16 {
range "1..32767" {
description "Valid range of Information Element
Linowski, et al. Experimental [Page 51]
^L
RFC 6095 YANG Language Abstractions March 2011
identifiers.";
reference "RFC 5102, Section 4.";
}
}
description "ID of the Information Element.";
}
}
leaf ieEnterpriseNumber {
type uint32;
description "If present, ... ";
}
leaf value {
type string;
mandatory true;
description "Matching value of the Information Element.";
}
}
ct:complex-type FilterHashSelector {
if-feature psampFilterHash;
ct:extends Selector;
description "This container contains the configuration
parameters of a Selector applying hash-based filtering
to the packet stream.";
reference "RFC 5475, Section 6.2;
RFC 5476, Section 6.5.2.6.";
leaf hashFunction {
type identityref {
base "hashFunction";
}
default BOB;
description "Hash function to be applied. According to
RFC 5475, Section 6.2.4.1, BOB hash function must be
used in order to be compliant with PSAMP.";
}
leaf ipPayloadOffset {
type uint64;
units octets;
default 0;
description "IP payload offset ... ";
reference "RFC 5477, Section 8.3.2.";
}
leaf ipPayloadSize {
type uint64;
units octets;
default 8;
description "Number of IP payload bytes ... ";
reference "RFC 5477, Section 8.3.3.";
Linowski, et al. Experimental [Page 52]
^L
RFC 6095 YANG Language Abstractions March 2011
}
leaf digestOutput {
type boolean;
default false;
description "If true, the output ... ";
reference "RFC 5477, Section 8.3.8.";
}
leaf initializerValue {
type uint64;
description "Initializer value to the hash function.
If not configured by the user, the Monitoring Device
arbitrarily chooses an initializer value.";
reference "RFC 5477, Section 8.3.9.";
}
list selectedRange {
key name;
min-elements 1;
description "List of hash function return ranges for
which packets are selected.";
leaf name {
type nameType;
description "Key of this list.";
}
leaf min {
type uint64;
description "Beginning of the hash function's selected
range.
This parameter corresponds to the Information Element
hashSelectedRangeMin.";
reference "RFC 5477, Section 8.3.6.";
}
leaf max {
type uint64;
description "End of the hash function's selected range.
This parameter corresponds to the Information Element
hashSelectedRangeMax.";
reference "RFC 5477, Section 8.3.7.";
}
}
}
ct:complex-type Cache {
ct:abstract true;
description "Cache of a Monitoring Device.";
key name;
leaf name {
type nameType;
description "Key of a cache";
Linowski, et al. Experimental [Page 53]
^L
RFC 6095 YANG Language Abstractions March 2011
}
leaf-list exportingProcess {
type leafref { path "/ipfix/exportingProcess/name"; }
description "Records are exported by all Exporting Processes
in the list.";
}
description "Configuration and state parameters of a Cache.";
container cacheLayout {
description "Cache Layout.";
list cacheField {
key name;
min-elements 1;
description "List of fields in the Cache Layout.";
leaf name {
type nameType;
description "Key of this list.";
}
choice nameOrId {
mandatory true;
description "Name or ID of the Information Element.";
reference "RFC 5102.";
leaf ieName {
type string;
description "Name of the Information Element.";
}
leaf ieId {
type uint16 {
range "1..32767" {
description "Valid range of Information Element
identifiers.";
reference "RFC 5102, Section 4.";
}
}
description "ID of the Information Element.";
}
}
leaf ieLength {
type uint16;
units octets;
description "Length of the field ... ";
reference "RFC 5101, Section 6.2; RFC 5102.";
}
leaf ieEnterpriseNumber {
type uint32;
description "If present, the Information Element is
enterprise-specific. ... ";
reference "RFC 5101; RFC 5102.";
}
Linowski, et al. Experimental [Page 54]
^L
RFC 6095 YANG Language Abstractions March 2011
leaf isFlowKey {
when "(../../../cacheMode != 'immediate')
and
((count(../ieEnterpriseNumber) = 0)
or
(../ieEnterpriseNumber != 29305))" {
description "This parameter is not available
for Reverse Information Elements (which have
enterprise number 29305) or if the Cache Mode
is 'immediate'.";
}
type empty;
description "If present, this is a flow key.";
}
}
}
leaf dataRecords {
type yang:counter64;
units "Data Records";
config false;
description "The number of Data Records generated ... ";
reference "RFC 5815, Section 8
(ipfixMeteringProcessCacheDataRecords).";
}
leaf cacheDiscontinuityTime {
type yang:date-and-time;
config false;
description "Timestamp of the ... ";
reference "RFC 5815, Section 8
(ipfixMeteringProcessCacheDiscontinuityTime).";
}
}
ct:complex-type ImmediateCache {
if-feature cacheModeImmediate;
ct:extends Cache;
}
ct:complex-type NonImmediateCache {
ct:abstract true;
ct:extends Cache;
leaf maxFlows {
type uint32;
units flows;
description "This parameter configures the maximum number of
Flows in the Cache ... ";
}
Linowski, et al. Experimental [Page 55]
^L
RFC 6095 YANG Language Abstractions March 2011
leaf activeFlows {
type yang:gauge32;
units flows;
config false;
description "The number of Flows currently active in this
Cache.";
reference "RFC 5815, Section 8
(ipfixMeteringProcessCacheActiveFlows).";
}
leaf unusedCacheEntries {
type yang:gauge32;
units flows;
config false;
description "The number of unused Cache entries in this
Cache.";
reference "RFC 5815, Section 8
(ipfixMeteringProcessCacheUnusedCacheEntries).";
}
}
ct:complex-type NonPermanentCache {
ct:abstract true;
ct:extends NonImmediateCache;
leaf activeTimeout {
type uint32;
units milliseconds;
description "This parameter configures the time in
milliseconds after which ... ";
}
leaf inactiveTimeout {
type uint32;
units milliseconds;
description "This parameter configures the time in
milliseconds after which ... ";
}
}
ct:complex-type NaturalCache {
if-feature cacheModeNatural;
ct:extends NonPermanentCache;
}
ct:complex-type TimeoutCache {
if-feature cacheModeTimeout;
ct:extends NonPermanentCache;
}
ct:complex-type PermanentCache {
Linowski, et al. Experimental [Page 56]
^L
RFC 6095 YANG Language Abstractions March 2011
if-feature cacheModePermanent;
ct:extends NonImmediateCache;
leaf exportInterval {
type uint32;
units milliseconds;
description "This parameter configures the interval for
periodical export of Flow Records in milliseconds.
If not configured by the user, the Monitoring Device sets
this parameter.";
}
}
ct:complex-type ExportDestination {
ct:abstract true;
description "Abstract export destination.";
key name;
leaf name {
type nameType;
description "Key of an export destination.";
}
}
ct:complex-type IpDestination {
ct:abstract true;
ct:extends ExportDestination;
description "IP export destination.";
leaf ipfixVersion {
type uint16;
default 10;
description "IPFIX version number.";
}
leaf destinationPort {
type inet:port-number;
description "If not configured by the user, the Monitoring
Device uses the default port number for IPFIX, which is
4739 without Transport Layer Security, and 4740 if Transport
Layer Security is activated.";
}
choice indexOrName {
description "Index or name of the interface ... ";
reference "RFC 2863.";
leaf ifIndex {
type uint32;
description "Index of an interface as stored in the ifTable
of IF-MIB.";
reference "RFC 2863.";
}
leaf ifName {
Linowski, et al. Experimental [Page 57]
^L
RFC 6095 YANG Language Abstractions March 2011
type string;
description "Name of an interface as stored in the ifTable
of IF-MIB.";
reference "RFC 2863.";
}
}
leaf sendBufferSize {
type uint32;
units bytes;
description "Size of the socket send buffer.
If not configured by the user, this parameter is set by
the Monitoring Device.";
}
leaf rateLimit {
type uint32;
units "bytes per second";
description "Maximum number of bytes per second ... ";
reference "RFC 5476, Section 6.3";
}
container transportLayerSecurity {
presence "If transportLayerSecurity is present, DTLS is
enabled if the transport protocol is SCTP or UDP, and TLS
is enabled if the transport protocol is TCP.";
description "Transport Layer Security configuration.";
uses transportLayerSecurityParameters;
}
container transportSession {
config false;
description "State parameters of the Transport Session
directed to the given destination.";
uses transportSessionParameters;
}
}
ct:complex-type SctpExporter {
ct:extends IpDestination;
description "SCTP exporter.";
leaf-list sourceIPAddress {
type inet:ip-address;
description "List of source IP addresses used ... ";
reference "RFC 4960, Section 6.4
(Multi-Homed SCTP Endpoints).";
}
leaf-list destinationIPAddress {
type inet:ip-address;
min-elements 1;
description "One or multiple IP addresses ... ";
reference "RFC 4960, Section 6.4
Linowski, et al. Experimental [Page 58]
^L
RFC 6095 YANG Language Abstractions March 2011
(Multi-Homed SCTP Endpoints).";
}
leaf timedReliability {
type uint32;
units milliseconds;
default 0;
description "Lifetime in milliseconds ... ";
reference "RFC 3758; RFC 4960.";
}
}
ct:complex-type UdpExporter {
ct:extends IpDestination;
if-feature udpTransport;
description "UDP parameters.";
leaf sourceIPAddress {
type inet:ip-address;
description "Source IP address used by the Exporting
Process ...";
}
leaf destinationIPAddress {
type inet:ip-address;
mandatory true;
description "IP address of the Collection Process to which
IPFIX Messages are sent.";
}
leaf maxPacketSize {
type uint16;
units octets;
description "This parameter specifies the maximum size of
IP packets ... ";
}
leaf templateRefreshTimeout {
type uint32;
units seconds;
default 600;
description "Sets time after which Templates are resent in the
UDP Transport Session. ... ";
reference "RFC 5101, Section 10.3.6; RFC 5815, Section 8
(ipfixTransportSessionTemplateRefreshTimeout).";
}
leaf optionsTemplateRefreshTimeout {
type uint32;
units seconds;
default 600;
description "Sets time after which Options Templates are
resent in the UDP Transport Session. ... ";
reference "RFC 5101, Section 10.3.6; RFC 5815, Section 8
Linowski, et al. Experimental [Page 59]
^L
RFC 6095 YANG Language Abstractions March 2011
(ipfixTransportSessionOptionsTemplateRefreshTimeout).";
}
leaf templateRefreshPacket {
type uint32;
units "IPFIX Messages";
description "Sets number of IPFIX Messages after which
Templates are resent in the UDP Transport Session. ... ";
reference "RFC 5101, Section 10.3.6; RFC 5815, Section 8
(ipfixTransportSessionTemplateRefreshPacket).";
}
leaf optionsTemplateRefreshPacket {
type uint32;
units "IPFIX Messages";
description "Sets number of IPFIX Messages after which
Options Templates are resent in the UDP Transport Session
protocol. ... ";
reference "RFC 5101, Section 10.3.6; RFC 5815, Section 8
(ipfixTransportSessionOptionsTemplateRefreshPacket).";
}
}
ct:complex-type TcpExporter {
ct:extends IpDestination;
if-feature tcpTransport;
description "TCP exporter";
leaf sourceIPAddress {
type inet:ip-address;
description "Source IP address used by the Exporting
Process...";
}
leaf destinationIPAddress {
type inet:ip-address;
mandatory true;
description "IP address of the Collection Process to which
IPFIX Messages are sent.";
}
}
ct:complex-type FileWriter {
ct:extends ExportDestination;
if-feature fileWriter;
description "File Writer.";
leaf ipfixVersion {
type uint16;
default 10;
description "IPFIX version number.";
}
leaf file {
Linowski, et al. Experimental [Page 60]
^L
RFC 6095 YANG Language Abstractions March 2011
type inet:uri;
mandatory true;
description "URI specifying the location of the file.";
}
leaf bytes {
type yang:counter64;
units octets;
config false;
description "The number of bytes written by the File
Writer...";
}
leaf messages {
type yang:counter64;
units "IPFIX Messages";
config false;
description "The number of IPFIX Messages written by the File
Writer. ... ";
}
leaf discardedMessages {
type yang:counter64;
units "IPFIX Messages";
config false;
description "The number of IPFIX Messages that could not be
written by the File Writer ... ";
}
leaf records {
type yang:counter64;
units "Data Records";
config false;
description "The number of Data Records written by the File
Writer. ... ";
}
leaf templates {
type yang:counter32;
units "Templates";
config false;
description "The number of Template Records (excluding
Options Template Records) written by the File Writer.
... ";
}
leaf optionsTemplates {
type yang:counter32;
units "Options Templates";
config false;
description "The number of Options Template Records written
by the File Writer. ... ";
}
leaf fileWriterDiscontinuityTime {
Linowski, et al. Experimental [Page 61]
^L
RFC 6095 YANG Language Abstractions March 2011
type yang:date-and-time;
config false;
description "Timestamp of the most recent occasion at which
one or more File Writer counters suffered a discontinuity.
... ";
}
list template {
config false;
description "This list contains the Templates and Options
Templates that have been written by the File Reader. ... ";
uses templateParameters;
}
}
ct:complex-type ExportingProcess {
if-feature exporter;
description "Exporting Process of the Monitoring Device.";
key name;
leaf name {
type nameType;
description "Key of this list.";
}
leaf exportMode {
type identityref {
base "exportMode";
}
default parallel;
description "This parameter determines to which configured
destination(s) the incoming Data Records are exported.";
}
ct:instance-list destination {
ct:instance-type ExportDestination;
min-elements 1;
description "Export destinations.";
}
list options {
key name;
description "List of options reported by the Exporting
Process.";
leaf name {
type nameType;
description "Key of this list.";
}
leaf optionsType {
type identityref {
base "optionsType";
}
mandatory true;
Linowski, et al. Experimental [Page 62]
^L
RFC 6095 YANG Language Abstractions March 2011
description "Type of the exported options data.";
}
leaf optionsTimeout {
type uint32;
units milliseconds;
description "Time interval for periodic export of the options
data. ... ";
}
}
}
ct:complex-type CollectingProcess {
description "A Collecting Process.";
key name;
leaf name {
type nameType;
description "Key of a collecing process.";
}
ct:instance-list sctpCollector {
ct:instance-type SctpCollector;
description "List of SCTP receivers (sockets) on which the
Collecting Process receives IPFIX Messages.";
}
ct:instance-list udpCollector {
if-feature udpTransport;
ct:instance-type UdpCollector;
description "List of UDP receivers (sockets) on which the
Collecting Process receives IPFIX Messages.";
}
ct:instance-list tcpCollector {
if-feature tcpTransport;
ct:instance-type TcpCollector;
description "List of TCP receivers (sockets) on which the
Collecting Process receives IPFIX Messages.";
}
ct:instance-list fileReader {
if-feature fileReader;
ct:instance-type FileReader;
description "List of File Readers from which the Collecting
Process reads IPFIX Messages.";
}
leaf-list exportingProcess {
type instance-identifier { ct:instance-type ExportingProcess; }
description "Export of received records without any
modifications. Records are processed by all Exporting
Processes in the list.";
}
}
Linowski, et al. Experimental [Page 63]
^L
RFC 6095 YANG Language Abstractions March 2011
ct:complex-type Collector {
ct:abstract true;
description "Abstract collector.";
key name;
leaf name {
type nameType;
description "Key of collectors";
}
}
ct:complex-type IpCollector {
ct:abstract true;
ct:extends Collector;
description "Collector for IP transport protocols.";
leaf localPort {
type inet:port-number;
description "If not configured, the Monitoring Device uses the
default port number for IPFIX, which is 4739 without
Transport Layer Security, and 4740 if Transport Layer
Security is activated.";
}
container transportLayerSecurity {
presence "If transportLayerSecurity is present, DTLS is enabled
if the transport protocol is SCTP or UDP, and TLS is enabled
if the transport protocol is TCP.";
description "Transport Layer Security configuration.";
uses transportLayerSecurityParameters;
}
list transportSession {
config false;
description "This list contains the currently established
Transport Sessions terminating at the given socket.";
uses transportSessionParameters;
}
}
ct:complex-type SctpCollector {
ct:extends IpCollector;
description "Collector listening on an SCTP socket";
leaf-list localIPAddress {
type inet:ip-address;
description "List of local IP addresses ... ";
reference "RFC 4960, Section 6.4
(Multi-Homed SCTP Endpoints).";
}
}
ct:complex-type UdpCollector {
Linowski, et al. Experimental [Page 64]
^L
RFC 6095 YANG Language Abstractions March 2011
ct:extends IpCollector;
description "Parameters of a listening UDP socket at a
Collecting Process.";
leaf-list localIPAddress {
type inet:ip-address;
description "List of local IP addresses on which the Collecting
Process listens for IPFIX Messages.";
}
leaf templateLifeTime {
type uint32;
units seconds;
default 1800;
description "Sets the lifetime of Templates for all UDP
Transport Sessions ... ";
reference "RFC 5101, Section 10.3.7; RFC 5815, Section 8
(ipfixTransportSessionTemplateRefreshTimeout).";
}
leaf optionsTemplateLifeTime {
type uint32;
units seconds;
default 1800;
description "Sets the lifetime of Options Templates for all
UDP Transport Sessions terminating at this UDP socket.
... ";
reference "RFC 5101, Section 10.3.7; RFC 5815, Section 8
(ipfixTransportSessionOptionsTemplateRefreshTimeout).";
}
leaf templateLifePacket {
type uint32;
units "IPFIX Messages";
description "If this parameter is configured, Templates
defined in a UDP Transport Session become invalid if ...";
reference "RFC 5101, Section 10.3.7; RFC 5815, Section 8
(ipfixTransportSessionTemplateRefreshPacket).";
}
leaf optionsTemplateLifePacket {
type uint32;
units "IPFIX Messages";
description "If this parameter is configured, Options
Templates defined in a UDP Transport Session become
invalid if ...";
reference "RFC 5101, Section 10.3.7; RFC 5815, Section 8
(ipfixTransportSessionOptionsTemplateRefreshPacket).";
}
}
ct:complex-type TcpCollector {
ct:extends IpCollector;
Linowski, et al. Experimental [Page 65]
^L
RFC 6095 YANG Language Abstractions March 2011
description "Collector listening on a TCP socket.";
leaf-list localIPAddress {
type inet:ip-address;
description "List of local IP addresses on which the Collecting
Process listens for IPFIX Messages.";
}
}
ct:complex-type FileReader {
ct:extends Collector;
description "File Reading collector.";
leaf file {
type inet:uri;
mandatory true;
description "URI specifying the location of the file.";
}
leaf bytes {
type yang:counter64;
units octets;
config false;
description "The number of bytes read by the File Reader.
... ";
}
leaf messages {
type yang:counter64;
units "IPFIX Messages";
config false;
description "The number of IPFIX Messages read by the File
Reader. ... ";
}
leaf records {
type yang:counter64;
units "Data Records";
config false;
description "The number of Data Records read by the File
Reader. ... ";
}
leaf templates {
type yang:counter32;
units "Templates";
config false;
description "The number of Template Records (excluding
Options Template Records) read by the File Reader. ...";
}
leaf optionsTemplates {
type yang:counter32;
units "Options Templates";
config false;
Linowski, et al. Experimental [Page 66]
^L
RFC 6095 YANG Language Abstractions March 2011
description "The number of Options Template Records read by
the File Reader. ... ";
}
leaf fileReaderDiscontinuityTime {
type yang:date-and-time;
config false;
description "Timestamp of the most recent occasion ... ";
}
list template {
config false;
description "This list contains the Templates and Options
Templates that have been read by the File Reader.
Withdrawn or invalidated (Options) Templates MUST be removed
from this list.";
uses templateParameters;
}
}
ct:complex-type SelectionProcess {
description "Selection Process";
key name;
leaf name {
type nameType;
description "Key of a selection process.";
}
ct:instance-list selector {
ct:instance-type Selector;
min-elements 1;
ordered-by user;
description "List of Selectors that define the action of the
Selection Process on a single packet. The Selectors are
serially invoked in the same order as they appear in this
list.";
}
list selectionSequence {
config false;
description "This list contains the Selection Sequence IDs
which are assigned by the Monitoring Device ... ";
reference "RFC 5476.";
leaf observationDomainId {
type uint32;
description "Observation Domain ID for which the
Selection Sequence ID is assigned.";
}
leaf selectionSequenceId {
type uint64;
description "Selection Sequence ID used in the Selection
Sequence (Statistics) Report Interpretation.";
Linowski, et al. Experimental [Page 67]
^L
RFC 6095 YANG Language Abstractions March 2011
}
}
leaf cache {
type instance-identifier { ct:instance-type Cache; }
description "Cache which receives the output of the
Selection Process.";
}
}
/*****************************************************************
* Groupings
*****************************************************************/
grouping transportLayerSecurityParameters {
description "Transport layer security parameters.";
leaf-list localCertificationAuthorityDN {
type string;
description "Distinguished names of certification authorities
whose certificates may be used to identify the local
endpoint.";
}
leaf-list localSubjectDN {
type string;
description "Distinguished names that may be used in the
certificates to identify the local endpoint.";
}
leaf-list localSubjectFQDN {
type inet:domain-name;
description "Fully qualified domain names that may be used to
in the certificates to identify the local endpoint.";
}
leaf-list remoteCertificationAuthorityDN {
type string;
description "Distinguished names of certification authorities
whose certificates are accepted to authorize remote
endpoints.";
}
leaf-list remoteSubjectDN {
type string;
description "Distinguished names that are accepted in
certificates to authorize remote endpoints.";
}
leaf-list remoteSubjectFQDN {
type inet:domain-name;
description "Fully qualified domain names that are accepted in
certificates to authorize remote endpoints.";
}
}
Linowski, et al. Experimental [Page 68]
^L
RFC 6095 YANG Language Abstractions March 2011
grouping templateParameters {
description "State parameters of a Template used by an Exporting
Process or received by a Collecting Process ... ";
reference "RFC 5101; RFC 5815, Section 8 (ipfixTemplateEntry,
ipfixTemplateDefinitionEntry, ipfixTemplateStatsEntry)";
leaf observationDomainId {
type uint32;
description "The ID of the Observation Domain for which this
Template is defined.";
reference "RFC 5815, Section 8
(ipfixTemplateObservationDomainId).";
}
leaf templateId {
type uint16 {
range "256..65535" {
description "Valid range of Template Ids.";
reference "RFC 5101";
}
}
description "This number indicates the Template Id in the IPFIX
message.";
reference "RFC 5815, Section 8 (ipfixTemplateId).";
}
leaf setId {
type uint16;
description "This number indicates the Set Id of the Template.
... ";
reference "RFC 5815, Section 8 (ipfixTemplateSetId).";
}
leaf accessTime {
type yang:date-and-time;
description "Used for Exporting Processes, ... ";
reference "RFC 5815, Section 8 (ipfixTemplateAccessTime).";
}
leaf templateDataRecords {
type yang:counter64;
description "The number of transmitted or received Data
Records ... ";
reference "RFC 5815, Section 8 (ipfixTemplateDataRecords).";
}
leaf templateDiscontinuityTime {
type yang:date-and-time;
description "Timestamp of the most recent occasion at which
the counter templateDataRecords suffered a discontinuity.
... ";
reference "RFC 5815, Section 8
(ipfixTemplateDiscontinuityTime).";
}
Linowski, et al. Experimental [Page 69]
^L
RFC 6095 YANG Language Abstractions March 2011
list field {
description "This list contains the (Options) Template
fields of which the (Options) Template is defined.
... ";
leaf ieId {
type uint16 {
range "1..32767" {
description "Valid range of Information Element
identifiers.";
reference "RFC 5102, Section 4.";
}
}
description "This parameter indicates the Information
Element Id of the field.";
reference "RFC 5815, Section 8 (ipfixTemplateDefinitionIeId);
RFC 5102.";
}
leaf ieLength {
type uint16;
units octets;
description "This parameter indicates the length of the
Information Element of the field.";
reference "RFC 5815, Section 8
(ipfixTemplateDefinitionIeLength); RFC 5102.";
}
leaf ieEnterpriseNumber {
type uint32;
description "This parameter indicates the IANA enterprise
number of the authority ... ";
reference "RFC 5815, Section 8
(ipfixTemplateDefinitionEnterpriseNumber).";
}
leaf isFlowKey {
when "../../setId = 2" {
description "This parameter is available for non-Options
Templates (Set Id is 2).";
}
type empty;
description "If present, this is a Flow Key field.";
reference "RFC 5815, Section 8
(ipfixTemplateDefinitionFlags).";
}
leaf isScope {
when "../../setId = 3" {
description "This parameter is available for Options
Templates (Set Id is 3).";
}
type empty;
Linowski, et al. Experimental [Page 70]
^L
RFC 6095 YANG Language Abstractions March 2011
description "If present, this is a scope field.";
reference "RFC 5815, Section 8
(ipfixTemplateDefinitionFlags).";
}
}
}
grouping transportSessionParameters {
description "State parameters of a Transport Session ... ";
reference "RFC 5101; RFC 5815, Section 8
(ipfixTransportSessionEntry,
ipfixTransportSessionStatsEntry)";
leaf ipfixVersion {
type uint16;
description "Used for Exporting Processes, this parameter
contains the version number of the IPFIX protocol ... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionIpfixVersion).";
}
leaf sourceAddress {
type inet:ip-address;
description "The source address of the Exporter of the
IPFIX Transport Session... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionSourceAddressType,
ipfixTransportSessionSourceAddress).";
}
leaf destinationAddress {
type inet:ip-address;
description "The destination address of the Collector of
the IPFIX Transport Session... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionDestinationAddressType,
ipfixTransportSessionDestinationAddress).";
}
leaf sourcePort {
type inet:port-number;
description "The transport protocol port number of the
Exporter of the IPFIX Transport Session.";
reference "RFC 5815, Section 8
(ipfixTransportSessionSourcePort).";
}
leaf destinationPort {
type inet:port-number;
description "The transport protocol port number of the
Collector of the IPFIX Transport Session... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionDestinationPort).";
Linowski, et al. Experimental [Page 71]
^L
RFC 6095 YANG Language Abstractions March 2011
}
leaf sctpAssocId {
type uint32;
description "The association id used for the SCTP session
between the Exporter and the Collector ... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionSctpAssocId),
RFC 3871";
}
leaf status {
type transportSessionStatus;
description "Status of the Transport Session.";
reference "RFC 5815, Section 8 (ipfixTransportSessionStatus).";
}
leaf rate {
type yang:gauge32;
units "bytes per second";
description "The number of bytes per second transmitted by the
Exporting Process or received by the Collecting Process.
This parameter is updated every second.";
reference "RFC 5815, Section 8 (ipfixTransportSessionRate).";
}
leaf bytes {
type yang:counter64;
units bytes;
description "The number of bytes transmitted by the
Exporting Process or received by the Collecting
Process ... ";
reference "RFC 5815, Section 8 (ipfixTransportSessionBytes).";
}
leaf messages {
type yang:counter64;
units "IPFIX Messages";
description "The number of messages transmitted by the
Exporting Process or received by the Collecting Process... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionMessages).";
}
leaf discardedMessages {
type yang:counter64;
units "IPFIX Messages";
description "Used for Exporting Processes, this parameter
indicates the number of messages that could not be
sent ...";
reference "RFC 5815, Section 8
(ipfixTransportSessionDiscardedMessages).";
}
leaf records {
Linowski, et al. Experimental [Page 72]
^L
RFC 6095 YANG Language Abstractions March 2011
type yang:counter64;
units "Data Records";
description "The number of Data Records transmitted ... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionRecords).";
}
leaf templates {
type yang:counter32;
units "Templates";
description "The number of Templates transmitted by the
Exporting Process or received by the Collecting Process.
... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionTemplates).";
}
leaf optionsTemplates {
type yang:counter32;
units "Options Templates";
description "The number of Option Templates transmitted by the
Exporting Process or received by the Collecting Process...";
reference "RFC 5815, Section 8
(ipfixTransportSessionOptionsTemplates).";
}
leaf transportSessionStartTime {
type yang:date-and-time;
description "Timestamp of the start of the given Transport
Session... ";
}
leaf transportSessionDiscontinuityTime {
type yang:date-and-time;
description "Timestamp of the most recent occasion at which
one or more of the Transport Session counters suffered a
discontinuity... ";
reference "RFC 5815, Section 8
(ipfixTransportSessionDiscontinuityTime).";
}
list template {
description "This list contains the Templates and Options
Templates that are transmitted by the Exporting Process
or received by the Collecting Process.
Withdrawn or invalidated (Options) Templates MUST be removed
from this list.";
uses templateParameters;
}
}
/*****************************************************************
* Main container
Linowski, et al. Experimental [Page 73]
^L
RFC 6095 YANG Language Abstractions March 2011
*****************************************************************/
container ipfix {
description "Top-level node of the IPFIX/PSAMP configuration
data model.";
ct:instance-list collectingProcess {
if-feature collector;
ct:instance-type CollectingProcess;
}
ct:instance-list observationPoint {
if-feature meter;
ct:instance-type ObservationPoint;
}
ct:instance-list selectionProcess {
if-feature meter;
ct:instance-type SelectionProcess;
}
ct:instance-list cache {
if-feature meter;
description "Cache of the Monitoring Device.";
ct:instance-type Cache;
}
ct:instance-list exportingProcess {
if-feature exporter;
description "Exporting Process of the Monitoring Device.";
ct:instance-type ExportingProcess;
}
}
}
<CODE ENDS>
Linowski, et al. Experimental [Page 74]
^L
RFC 6095 YANG Language Abstractions March 2011
Authors' Addresses
Bernd Linowski
TCS/Nokia Siemens Networks
Heltorfer Strasse 1
Duesseldorf 40472
Germany
EMail: bernd.linowski.ext@nsn.com
Mehmet Ersue
Nokia Siemens Networks
St.-Martin-Strasse 76
Munich 81541
Germany
EMail: mehmet.ersue@nsn.com
Siarhei Kuryla
360 Treasury Systems
Grueneburgweg 16-18
Frankfurt am Main 60322
Germany
EMail: s.kuryla@gmail.com
Linowski, et al. Experimental [Page 75]
^L
|