summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc8519.txt
blob: 6b1cb6aab168ae9d9dee28cca0b9ce743c73908e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
Internet Engineering Task Force (IETF)                   M. Jethanandani
Request for Comments: 8519                                        VMware
Category: Standards Track                                     S. Agarwal
ISSN: 2070-1721                                      Cisco Systems, Inc.
                                                                L. Huang
                                                                D. Blair
                                                              March 2019


        YANG Data Model for Network Access Control Lists (ACLs)

Abstract

   This document defines a data model for Access Control Lists (ACLs).
   An ACL is a user-ordered set of rules used to configure the
   forwarding behavior in a device.  Each rule is used to find a match
   on a packet and define actions that will be performed on the packet.

Status of This Memo

   This is an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in Section 2 of RFC 7841.

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

Copyright Notice

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

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.





Jethanandani, et al.         Standards Track                    [Page 1]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Definitions and Acronyms  . . . . . . . . . . . . . . . .   3
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   4
     1.3.  Tree Diagram  . . . . . . . . . . . . . . . . . . . . . .   4
   2.  Problem Statement . . . . . . . . . . . . . . . . . . . . . .   4
   3.  Understanding ACL's Filters and Actions . . . . . . . . . . .   4
     3.1.  ACL Modules . . . . . . . . . . . . . . . . . . . . . . .   5
   4.  ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . .   9
     4.1.  IETF Access Control List Module . . . . . . . . . . . . .   9
     4.2.  IETF Packet Fields Module . . . . . . . . . . . . . . . .  24
     4.3.  ACL Examples  . . . . . . . . . . . . . . . . . . . . . .  37
     4.4.  Port Range Usage and Other Examples . . . . . . . . . . .  39
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  42
   6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  43
     6.1.  URI Registration  . . . . . . . . . . . . . . . . . . . .  43
     6.2.  YANG Module Name Registration . . . . . . . . . . . . . .  44
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  44
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .  44
     7.2.  Informative References  . . . . . . . . . . . . . . . . .  46
   Appendix A.  Extending ACL Model Examples . . . . . . . . . . . .  47
     A.1.  Example of a Company's Proprietary Module . . . . . . . .  47
     A.2.  Linux nftables  . . . . . . . . . . . . . . . . . . . . .  50
     A.3.  Ethertypes  . . . . . . . . . . . . . . . . . . . . . . .  51
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  60
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  60

1.  Introduction

   An Access Control List (ACL) is one of the basic elements used to
   configure device-forwarding behavior.  It is used in many networking
   technologies such as Policy-Based Routing (PBR), firewalls, etc.

   An ACL is a user-ordered set of rules that is used to filter traffic
   on a networking device.  Each rule is represented by an Access
   Control Entry (ACE).

   Each ACE has a group of match criteria and a group of actions.

   The match criteria allow for the definition of packet headers and
   metadata, the contents of which must match the definitions.

   o  Packet header matches apply to fields visible in the packet such
      as address, Class of Service (CoS), or port number.






Jethanandani, et al.         Standards Track                    [Page 2]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   o  In case a vendor supports it, metadata matches apply to fields
      associated with the packet, that are not in the packet header,
      such as the input interface or length of the packet as received
      over the wire.

   The actions specify what to do with the packet when the matching
   criteria are met.  These actions are any operations that would apply
   to the packet, such as counting, policing, or simply forwarding.  The
   list of potential actions is unbounded depending on the capabilities
   of the networking devices.

   Access Control List is also widely known as ACL (pronounced as
   [ak-uh l]) or Access List.  In this document, Access Control List,
   ACL, and Access List are used interchangeably.

   The matching of filters and actions in an ACE/ACL is triggered only
   after the application/attachment of the ACL to an interface, a
   Virtual Routing and Forwarding (VRF) interface, a vty/tty session, a
   QoS policy, or routing protocols, amongst various other configuration
   attachment points.  Once attached, it is used for filtering traffic
   using the match criteria in the ACEs and taking appropriate action(s)
   that has been configured against that ACE.  In order to apply an ACL
   to any attachment point other than an interface, vendors would have
   to augment the ACL YANG model.

1.1.  Definitions and Acronyms

   ACE: Access Control Entry

   ACL: Access Control List

   CoS: Class of Service

   DSCP: Differentiated Services Code Point

   ICMP: Internet Control Message Protocol

   IP: Internet Protocol

   IPv4: Internet Protocol version 4

   IPv6: Internet Protocol version 6

   MAC: Media Access Control

   PBR: Policy-Based Routing





Jethanandani, et al.         Standards Track                    [Page 3]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   TCP: Transmission Control Protocol

   UDP: User Datagram Protocol

1.2.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

1.3.  Tree Diagram

   For a reference to the annotations used in the tree diagrams included
   in this document, please see "YANG Tree Diagrams" [RFC8340].

2.  Problem Statement

   This document defines a YANG 1.1 data model [RFC7950] for the
   configuration of ACLs.  The model defines matching rules for commonly
   used protocols such as Ethernet, IPv4, IPv6, TCP, UDP, and ICMP.  If
   more protocols need to be supported in the future, this base model
   can be augmented.  An example of such an augmentation can be seen in
   Appendix A.

   ACL implementations in every device may vary greatly in terms of the
   filter constructs and actions that they support.  Therefore, this
   document proposes a model that can be augmented by standard
   extensions and vendor proprietary models.

3.  Understanding ACL's Filters and Actions

   Although different vendors have different ACL data models, there is a
   common understanding of what an ACL is.  A network system usually has
   a list of ACLs, and each ACL contains an ordered list of rules, also
   known as ACEs.  Each ACE has a group of match criteria and a group of
   actions.  The match criteria allows for definition of the contents of
   the packet headers or metadata, if supported by the vendor.  Packet
   header matching applies to fields visible in the packet such as
   address, CoS, or port number.  Metadata matching applies to fields
   associated with the packet, that are not in the packet header, such
   as the input interface, packet length, or source or destination
   prefix length.  The actions can be any sort of operation from logging
   to rate-limiting or dropping to simply forwarding.  Actions on the
   first matching ACE are applied with no processing of subsequent ACEs.





Jethanandani, et al.         Standards Track                    [Page 4]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The model also includes a container to hold overall operational state
   for each ACL and for each ACE.  One ACL can be applied to multiple
   targets within the device, such as the interface of a networking
   device, applications or features running in the device, etc.  When
   applied to interfaces of a networked device, distinct ACLs are
   defined for the ingress (input) or egress (output) interface.

   This document tries to address the commonalities between all vendors
   and creates a common model, which can be augmented with proprietary
   models.  The base model is simple in design, and we hope to achieve
   enough flexibility for each vendor to extend the base model.

   The use of feature statements in the model allows vendors to
   advertise match rules they are capable and willing to support.  There
   are two sets of feature statements a device needs to advertise.  The
   first set of feature statements specifies the capability of the
   device.  These include features such as "Device can support matching
   on Ethernet headers" or "Device can support matching on IPv4
   headers".  The second set of feature statements specifies the
   combinations of headers the device is willing to support.  These
   include features such as "Plain IPv6 ACL supported" or "Ethernet,
   IPv4 and IPv6 ACL combinations supported".

3.1.  ACL Modules

   There are two YANG modules in the model.  The first module, "ietf-
   access-control-list", defines generic ACL aspects that are common to
   all ACLs regardless of their type or vendor.  In effect, the module
   can be viewed as providing a generic ACL "superclass".  It imports
   the second module, "ietf-packet-fields".  The match container in
   "ietf-access-control-list" uses groupings in "ietf-packet-fields" to
   specify match fields such as port numbers or protocols.  The
   combination of 'if-feature' checks and 'must' statements allows for
   the selection of relevant match fields that a user can define rules
   for.

   If there is a need to define a new "matches" choice, such as IP Flow
   Information Export (IPFIX) [RFC7011], the container "matches" can be
   augmented.












Jethanandani, et al.         Standards Track                    [Page 5]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   module: ietf-access-control-list
     +--rw acls
        +--rw acl* [name]
        |  +--rw name    string
        |  +--rw type?   acl-type
        |  +--rw aces
        |     +--rw ace* [name]
        |        +--rw name          string
        |        +--rw matches
        |        |  +--rw (l2)?
        |        |  |  +--:(eth)
        |        |  |     +--rw eth {match-on-eth}?
        |        |  |        +--rw destination-mac-address?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw destination-mac-address-mask?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw source-mac-address?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw source-mac-address-mask?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw ethertype?
        |        |  |                eth:ethertype
        |        |  +--rw (l3)?
        |        |  |  +--:(ipv4)
        |        |  |  |  +--rw ipv4 {match-on-ipv4}?
        |        |  |  |     +--rw dscp?
        |        |  |  |     |       inet:dscp
        |        |  |  |     +--rw ecn?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw length?
        |        |  |  |     |       uint16
        |        |  |  |     +--rw ttl?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw protocol?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw ihl?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw flags?
        |        |  |  |     |       bits
        |        |  |  |     +--rw offset?
        |        |  |  |     |       uint16
        |        |  |  |     +--rw identification?
        |        |  |  |     |       uint16
        |        |  |  |     +--rw (destination-network)?
        |        |  |  |     |  +--:(destination-ipv4-network)
        |        |  |  |     |     +--rw destination-ipv4-network?
        |        |  |  |     |             inet:ipv4-prefix




Jethanandani, et al.         Standards Track                    [Page 6]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


        |        |  |  |     +--rw (source-network)?
        |        |  |  |        +--:(source-ipv4-network)
        |        |  |  |           +--rw source-ipv4-network?
        |        |  |  |                   inet:ipv4-prefix
        |        |  |  +--:(ipv6)
        |        |  |     +--rw ipv6 {match-on-ipv6}?
        |        |  |        +--rw dscp?
        |        |  |        |       inet:dscp
        |        |  |        +--rw ecn?
        |        |  |        |       uint8
        |        |  |        +--rw length?
        |        |  |        |       uint16
        |        |  |        +--rw ttl?
        |        |  |        |       uint8
        |        |  |        +--rw protocol?
        |        |  |        |       uint8
        |        |  |        +--rw (destination-network)?
        |        |  |        |  +--:(destination-ipv6-network)
        |        |  |        |     +--rw destination-ipv6-network?
        |        |  |        |             inet:ipv6-prefix
        |        |  |        +--rw (source-network)?
        |        |  |        |  +--:(source-ipv6-network)
        |        |  |        |     +--rw source-ipv6-network?
        |        |  |        |             inet:ipv6-prefix
        |        |  |        +--rw flow-label?
        |        |  |                inet:ipv6-flow-label
        |        |  +--rw (l4)?
        |        |  |  +--:(tcp)
        |        |  |  |  +--rw tcp {match-on-tcp}?
        |        |  |  |     +--rw sequence-number?          uint32
        |        |  |  |     +--rw acknowledgement-number?   uint32
        |        |  |  |     +--rw data-offset?              uint8
        |        |  |  |     +--rw reserved?                 uint8
        |        |  |  |     +--rw flags?                    bits
        |        |  |  |     +--rw window-size?              uint16
        |        |  |  |     +--rw urgent-pointer?           uint16
        |        |  |  |     +--rw options?                  binary
        |        |  |  |     +--rw source-port
        |        |  |  |     |  +--rw (source-port)?
        |        |  |  |     |     +--:(range-or-operator)
        |        |  |  |     |        +--rw (port-range-or-operator)?
        |        |  |  |     |           +--:(range)
        |        |  |  |     |           |  +--rw lower-port
        |        |  |  |     |           |  |       inet:port-number
        |        |  |  |     |           |  +--rw upper-port
        |        |  |  |     |           |          inet:port-number
        |        |  |  |     |           +--:(operator)




Jethanandani, et al.         Standards Track                    [Page 7]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


        |        |  |  |     |              +--rw operator?     operator
        |        |  |  |     |              +--rw port
        |        |  |  |     |                      inet:port-number
        |        |  |  |     +--rw destination-port
        |        |  |  |        +--rw (destination-port)?
        |        |  |  |           +--:(range-or-operator)
        |        |  |  |              +--rw (port-range-or-operator)?
        |        |  |  |                 +--:(range)
        |        |  |  |                 |  +--rw lower-port
        |        |  |  |                 |  |       inet:port-number
        |        |  |  |                 |  +--rw upper-port
        |        |  |  |                 |          inet:port-number
        |        |  |  |                 +--:(operator)
        |        |  |  |                    +--rw operator?     operator
        |        |  |  |                    +--rw port
        |        |  |  |                            inet:port-number
        |        |  |  +--:(udp)
        |        |  |  |  +--rw udp {match-on-udp}?
        |        |  |  |     +--rw length?             uint16
        |        |  |  |     +--rw source-port
        |        |  |  |     |  +--rw (source-port)?
        |        |  |  |     |     +--:(range-or-operator)
        |        |  |  |     |        +--rw (port-range-or-operator)?
        |        |  |  |     |           +--:(range)
        |        |  |  |     |           |  +--rw lower-port
        |        |  |  |     |           |  |       inet:port-number
        |        |  |  |     |           |  +--rw upper-port
        |        |  |  |     |           |          inet:port-number
        |        |  |  |     |           +--:(operator)
        |        |  |  |     |              +--rw operator?     operator
        |        |  |  |     |              +--rw port
        |        |  |  |     |                      inet:port-number
        |        |  |  |     +--rw destination-port
        |        |  |  |        +--rw (destination-port)?
        |        |  |  |           +--:(range-or-operator)
        |        |  |  |              +--rw (port-range-or-operator)?
        |        |  |  |                 +--:(range)
        |        |  |  |                 |  +--rw lower-port
        |        |  |  |                 |  |       inet:port-number
        |        |  |  |                 |  +--rw upper-port
        |        |  |  |                 |          inet:port-number
        |        |  |  |                 +--:(operator)
        |        |  |  |                    +--rw operator?     operator
        |        |  |  |                    +--rw port
        |        |  |  |                            inet:port-number
        |        |  |  +--:(icmp)





Jethanandani, et al.         Standards Track                    [Page 8]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


        |        |  |     +--rw icmp {match-on-icmp}?
        |        |  |        +--rw type?             uint8
        |        |  |        +--rw code?             uint8
        |        |  |        +--rw rest-of-header?   binary
        |        |  +--rw egress-interface?    if:interface-ref
        |        |  +--rw ingress-interface?   if:interface-ref
        |        +--rw actions
        |        |  +--rw forwarding    identityref
        |        |  +--rw logging?      identityref
        |        +--ro statistics {acl-aggregate-stats}?
        |           +--ro matched-packets?   yang:counter64
        |           +--ro matched-octets?    yang:counter64
        +--rw attachment-points
           +--rw interface* [interface-id] {interface-attachment}?
              +--rw interface-id    if:interface-ref
              +--rw ingress
              |  +--rw acl-sets
              |     +--rw acl-set* [name]
              |        +--rw name              -> /acls/acl/name
              |        +--ro ace-statistics* [name] {interface-stats}?
              |           +--ro name
              |           |       -> /acls/acl/aces/ace/name
              |           +--ro matched-packets?   yang:counter64
              |           +--ro matched-octets?    yang:counter64
              +--rw egress
                 +--rw acl-sets
                    +--rw acl-set* [name]
                       +--rw name              -> /acls/acl/name
                       +--ro ace-statistics* [name] {interface-stats}?
                          +--ro name
                          |       -> /acls/acl/aces/ace/name
                          +--ro matched-packets?   yang:counter64
                          +--ro matched-octets?    yang:counter64

4.  ACL YANG Models

4.1.  IETF Access Control List Module

   The "ietf-access-control-list" module defines the "acls" container
   that has a list of each "acl".  Each "acl" has information
   identifying the access list by a name ("name") and a list ("aces") of
   rules associated with the "name".  Each of the entries in the list
   ("aces"), indexed by the string "name", has containers defining
   "matches" and "actions".







Jethanandani, et al.         Standards Track                    [Page 9]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The model defines several ACL types and actions in the form of
   identities and features.  Features are used by implementors to select
   the ACL types the system can support, and identities are used to
   validate the types that have been selected.  These types are
   implicitly inherited by the "ace", thus safeguarding against
   misconfiguration of "ace" types in an "acl".

   The "matches" define criteria used to identify patterns in "ietf-
   packet-fields".  The choice statements within the match container
   allow for the selection of one header within each of "l2", "l3", or
   "l4" headers.  The "actions" define the behavior to undertake once a
   "match" has been identified.  In addition to permit and deny actions,
   a logging option allows for a match to be logged that can later be
   used to determine which rule was matched upon.  The model also
   defines the ability for ACLs to be attached to a particular
   interface.

   Statistics in the ACL can be collected for an "ace" or for an
   "interface".  The feature statements defined for statistics can be
   used to determine whether statistics are being collected per "ace" or
   per "interface".

   This module imports definitions from "Common YANG Data Types"
   [RFC6991] and "A YANG Data Model for Interface Management" [RFC8343].

<CODE BEGINS> file "ietf-access-control-list@2019-03-04.yang"

module ietf-access-control-list {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list";
  prefix acl;

  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991 - Common YANG Data Types.";
  }

  import ietf-packet-fields {
    prefix pf;
    reference
      "RFC 8519 - YANG Data Model for Network Access Control
                  Lists (ACLs).";
  }

  import ietf-interfaces {
    prefix if;
    reference



Jethanandani, et al.         Standards Track                   [Page 10]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


      "RFC 8343 - A YANG Data Model for Interface Management.";
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group.";

  contact
    "WG Web:  <https://datatracker.ietf.org/wg/netmod/>
     WG List: netmod@ietf.org

     Editor: Mahesh Jethanandani
             mjethanandani@gmail.com
     Editor: Lisa Huang
             huangyi_99@yahoo.com
     Editor: Sonal Agarwal
             sagarwal12@gmail.com
     Editor: Dana Blair
             dana@blairhome.com";

  description
    "This YANG module defines a component that describes the
     configuration and monitoring of Access Control Lists (ACLs).

     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 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.

     Copyright (c) 2019 IETF Trust and the persons identified as
     the document authors.  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 8519; see
     the RFC itself for full legal notices.";

  revision 2019-03-04 {
    description
      "Initial version.";
    reference
      "RFC 8519: YANG Data Model for Network Access Control



Jethanandani, et al.         Standards Track                   [Page 11]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


                 Lists (ACLs).";
  }

  /*
   * Identities
   */
  /*
   * Forwarding actions for a packet
   */

  identity forwarding-action {
    description
      "Base identity for actions in the forwarding category.";
  }

  identity accept {
    base forwarding-action;
    description
      "Accept the packet.";
  }

  identity drop {
    base forwarding-action;
    description
      "Drop packet without sending any ICMP error message.";
  }

  identity reject {
    base forwarding-action;
    description
      "Drop the packet and send an ICMP error message to the source.";
  }

  /*
   * Logging actions for a packet
   */

  identity log-action {
    description
      "Base identity for defining the destination for logging
       actions.";
  }

  identity log-syslog {
    base log-action;
    description
      "System log (syslog) the information for the packet.";
  }



Jethanandani, et al.         Standards Track                   [Page 12]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


  identity log-none {
    base log-action;
    description
      "No logging for the packet.";
  }

  /*
   * ACL type identities
   */

  identity acl-base {
    description
      "Base Access Control List type for all Access Control List type
       identifiers.";
  }

  identity ipv4-acl-type {
    base acl:acl-base;
    if-feature "ipv4";
    description
      "An ACL that matches on fields from the IPv4 header
       (e.g., IPv4 destination address) and Layer 4 headers (e.g., TCP
       destination port).  An ACL of type ipv4 does not contain
       matches on fields in the Ethernet header or the IPv6 header.";
  }

  identity ipv6-acl-type {
    base acl:acl-base;
    if-feature "ipv6";
    description
      "An ACL that matches on fields from the IPv6 header
       (e.g., IPv6 destination address) and Layer 4 headers (e.g., TCP
       destination port).  An ACL of type ipv6 does not contain
       matches on fields in the Ethernet header or the IPv4 header.";
  }

  identity eth-acl-type {
    base acl:acl-base;
    if-feature "eth";
    description
      "An ACL that matches on fields in the Ethernet header,
       like 10/100/1000baseT or a Wi-Fi Access Control List.  An ACL
       of type ethernet does not contain matches on fields in the
       IPv4 header, the IPv6 header, or Layer 4 headers.";
  }

  identity mixed-eth-ipv4-acl-type {
    base acl:eth-acl-type;



Jethanandani, et al.         Standards Track                   [Page 13]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


    base acl:ipv4-acl-type;
    if-feature "mixed-eth-ipv4";
    description
      "An ACL that contains a mix of entries that match
       on fields in Ethernet headers and in IPv4 headers.
       Matching on Layer 4 header fields may also exist in the
       list.";
  }

  identity mixed-eth-ipv6-acl-type {
    base acl:eth-acl-type;
    base acl:ipv6-acl-type;
    if-feature "mixed-eth-ipv6";
    description
      "An ACL that contains a mix of entries that match on fields
       in Ethernet headers and in IPv6 headers.  Matching
       on Layer 4 header fields may also exist in the list.";
  }

  identity mixed-eth-ipv4-ipv6-acl-type {
    base acl:eth-acl-type;
    base acl:ipv4-acl-type;
    base acl:ipv6-acl-type;
    if-feature "mixed-eth-ipv4-ipv6";
    description
      "An ACL that contains a mix of entries that
       match on fields in Ethernet headers, IPv4 headers, and IPv6
       headers.  Matching on Layer 4 header fields may also exist
       in the list.";
  }

  /*
   * Features
   */

  /*
   * Features supported by device
   */
  feature match-on-eth {
    description
      "The device can support matching on Ethernet headers.";
  }

  feature match-on-ipv4 {
    description
      "The device can support matching on IPv4 headers.";
  }




Jethanandani, et al.         Standards Track                   [Page 14]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


  feature match-on-ipv6 {
    description
      "The device can support matching on IPv6 headers.";
  }

  feature match-on-tcp {
    description
      "The device can support matching on TCP headers.";
  }

  feature match-on-udp {
    description
      "The device can support matching on UDP headers.";
  }

  feature match-on-icmp {
    description
      "The device can support matching on ICMP (v4 and v6) headers.";
  }

  /*
   * Header classifications combinations supported by
   * device
   */

  feature eth {
    if-feature "match-on-eth";
    description
      "Plain Ethernet ACL supported.";
  }

  feature ipv4 {
    if-feature "match-on-ipv4";
    description
      "Plain IPv4 ACL supported.";
  }

  feature ipv6 {
    if-feature "match-on-ipv6";
    description
      "Plain IPv6 ACL supported.";
  }

  feature mixed-eth-ipv4 {
    if-feature "match-on-eth and match-on-ipv4";
    description
      "Ethernet and IPv4 ACL combinations supported.";
  }



Jethanandani, et al.         Standards Track                   [Page 15]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


  feature mixed-eth-ipv6 {
    if-feature "match-on-eth and match-on-ipv6";
    description
      "Ethernet and IPv6 ACL combinations supported.";
  }

  feature mixed-eth-ipv4-ipv6 {
    if-feature
      "match-on-eth and match-on-ipv4
       and match-on-ipv6";
    description
      "Ethernet, IPv4, and IPv6 ACL combinations supported.";
  }

  /*
   * Stats Features
   */
  feature interface-stats {
    description
      "ACL counters are available and reported only per interface.";
  }

  feature acl-aggregate-stats {
    description
      "ACL counters are aggregated over all interfaces and reported
       only per ACL entry.";
  }

  /*
   * Attachment point features
   */
  feature interface-attachment {
    description
      "ACLs are set on interfaces.";
  }

  /*
   * Typedefs
   */
  typedef acl-type {
    type identityref {
      base acl-base;
    }
    description
      "This type is used to refer to an ACL type.";
  }

  /*



Jethanandani, et al.         Standards Track                   [Page 16]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   * Groupings
   */
  grouping acl-counters {
    description
      "Common grouping for ACL counters.";
    leaf matched-packets {
      type yang:counter64;
      config false;
      description
        "Count of the number of packets matching the current ACL
         entry.

         An implementation should provide this counter on a
         per-interface, per-ACL-entry basis if possible.

         If an implementation only supports ACL counters on a per-
         entry basis (i.e., not broken out per interface), then the
         value should be equal to the aggregate count across all
         interfaces.

         An implementation that provides counters on a per-entry, per-
         interface basis is not required to also provide an aggregate
         count, e.g., per entry -- the user is expected to be able to
         implement the required aggregation if such a count is
         needed.";
    }

    leaf matched-octets {
      type yang:counter64;
      config false;
      description
        "Count of the number of octets (bytes) matching the current
         ACL entry.

         An implementation should provide this counter on a
         per-interface, per-ACL-entry basis if possible.

         If an implementation only supports ACL counters per entry
         (i.e., not broken out per interface), then the value
         should be equal to the aggregate count across all interfaces.

         An implementation that provides counters per entry per
         interface is not required to also provide an aggregate count,
         e.g., per entry -- the user is expected to be able to
         implement the required aggregation if such a count is needed.";
    }
  }




Jethanandani, et al.         Standards Track                   [Page 17]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


  /*
   * Configuration and monitoring data nodes
   */

  container acls {
    description
      "This is a top-level container for Access Control Lists.
       It can have one or more acl nodes.";
    list acl {
      key "name";
      description
        "An ACL is an ordered list of ACEs.  Each ACE has a
         list of match criteria and a list of actions.
         Since there are several kinds of ACLs implemented
         with different attributes for different vendors,
         this model accommodates customizing ACLs for
         each kind and for each vendor.";
      leaf name {
        type string {
          length "1..64";
        }
        description
          "The name of the access list.  A device MAY further
           restrict the length of this name; space and special
           characters are not allowed.";
      }
      leaf type {
        type acl-type;
        description
          "Type of ACL.  Indicates the primary intended
           type of match criteria (e.g., Ethernet, IPv4, IPv6, mixed,
           etc.) used in the list instance.";
      }
      container aces {
        description
          "The aces container contains one or more ACE nodes.";
        list ace {
          key "name";
          ordered-by user;
          description
            "List of ACEs.";
          leaf name {
            type string {
              length "1..64";
            }
            description
              "A unique name identifying this ACE.";
          }



Jethanandani, et al.         Standards Track                   [Page 18]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


          container matches {
            description
              "The rules in this set determine what fields will be
               matched upon before any action is taken on them.
               The rules are selected based on the feature set
               defined by the server and the acl-type defined.
               If no matches are defined in a particular container,
               then any packet will match that container.  If no
               matches are specified at all in an ACE, then any
               packet will match the ACE.";

            choice l2 {
              container eth {
                when "derived-from-or-self(/acls/acl/type, "
                   + "'acl:eth-acl-type')";
                if-feature "match-on-eth";
                uses pf:acl-eth-header-fields;
                description
                  "Rule set that matches Ethernet headers.";
              }
              description
                "Match Layer 2 headers, for example, Ethernet
                 header fields.";
            }

            choice l3 {
              container ipv4 {
                when "derived-from-or-self(/acls/acl/type, "
                   + "'acl:ipv4-acl-type')";
                if-feature "match-on-ipv4";
                uses pf:acl-ip-header-fields;
                uses pf:acl-ipv4-header-fields;
                description
                  "Rule set that matches IPv4 headers.";
              }

              container ipv6 {
                when "derived-from-or-self(/acls/acl/type, "
                   + "'acl:ipv6-acl-type')";
                if-feature "match-on-ipv6";
                uses pf:acl-ip-header-fields;
                uses pf:acl-ipv6-header-fields;
                description
                  "Rule set that matches IPv6 headers.";
              }
              description
                "Choice of either IPv4 or IPv6 headers";
            }



Jethanandani, et al.         Standards Track                   [Page 19]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


            choice l4 {
              container tcp {
                if-feature "match-on-tcp";
                uses pf:acl-tcp-header-fields;
                container source-port {
                  choice source-port {
                    case range-or-operator {
                      uses pf:port-range-or-operator;
                      description
                        "Source port definition from range or
                         operator.";
                    }
                    description
                      "Choice of source port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of source ports to be referenced.";
                  }
                  description
                    "Source port definition.";
                }
                container destination-port {
                  choice destination-port {
                    case range-or-operator {
                      uses pf:port-range-or-operator;
                      description
                        "Destination port definition from range or
                         operator.";
                    }
                    description
                      "Choice of destination port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of destination ports to be referenced.";
                  }
                  description
                    "Destination port definition.";
                }
                description
                  "Rule set that matches TCP headers.";
              }

              container udp {
                if-feature "match-on-udp";
                uses pf:acl-udp-header-fields;
                container source-port {
                  choice source-port {
                    case range-or-operator {



Jethanandani, et al.         Standards Track                   [Page 20]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


                      uses pf:port-range-or-operator;
                      description
                        "Source port definition from range or
                         operator.";
                    }
                    description
                      "Choice of source port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of source ports to be referenced.";
                  }
                  description
                    "Source port definition.";
                }
                container destination-port {
                  choice destination-port {
                    case range-or-operator {
                      uses pf:port-range-or-operator;
                      description
                        "Destination port definition from range or
                         operator.";
                    }
                    description
                      "Choice of destination port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of destination ports to be referenced.";
                  }
                  description
                    "Destination port definition.";
                }
                description
                  "Rule set that matches UDP headers.";
              }

              container icmp {
                if-feature "match-on-icmp";
                uses pf:acl-icmp-header-fields;
                description
                  "Rule set that matches ICMP headers.";
              }
              description
                "Choice of TCP, UDP, or ICMP headers.";
            }

            leaf egress-interface {
              type if:interface-ref;
              description



Jethanandani, et al.         Standards Track                   [Page 21]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


                "Egress interface.  This should not be used if this ACL
                 is attached as an egress ACL (or the value should
                 equal the interface to which the ACL is attached).";
            }

            leaf ingress-interface {
              type if:interface-ref;
              description
                "Ingress interface.  This should not be used if this ACL
                 is attached as an ingress ACL (or the value should
                 equal the interface to which the ACL is attached).";
            }
          }

          container actions {
            description
              "Definition of actions for this ace entry.";
            leaf forwarding {
              type identityref {
                base forwarding-action;
              }
              mandatory true;
              description
                "Specifies the forwarding action per ace entry.";
            }

            leaf logging {
              type identityref {
                base log-action;
              }
              default "log-none";
              description
                "Specifies the log action and destination for
                 matched packets.  Default value is not to log the
                 packet.";
            }
          }
          container statistics {
            if-feature "acl-aggregate-stats";
            config false;
            description
              "Statistics gathered across all attachment points for the
               given ACL.";
            uses acl-counters;
          }
        }
      }
    }



Jethanandani, et al.         Standards Track                   [Page 22]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


    container attachment-points {
      description
        "Enclosing container for the list of
         attachment points on which ACLs are set.";
      /*
       * Groupings
       */
      grouping interface-acl {
        description
          "Grouping for per-interface ingress ACL data.";
        container acl-sets {
          description
            "Enclosing container for the list of ingress ACLs on the
             interface.";
          list acl-set {
            key "name";
            ordered-by user;
            description
              "List of ingress ACLs on the interface.";
            leaf name {
              type leafref {
                path "/acls/acl/name";
              }
              description
                "Reference to the ACL name applied on the ingress.";
            }
            list ace-statistics {
              if-feature "interface-stats";
              key "name";
              config false;
              description
                "List of ACEs.";
              leaf name {
                type leafref {
                  path "/acls/acl/aces/ace/name";
                }
                description
                  "Name of the ace entry.";
              }
              uses acl-counters;
            }
          }
        }
      }

      list interface {
        if-feature "interface-attachment";
        key "interface-id";



Jethanandani, et al.         Standards Track                   [Page 23]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


        description
          "List of interfaces on which ACLs are set.";

        leaf interface-id {
          type if:interface-ref;
          description
            "Reference to the interface id list key.";
        }

        container ingress {
          uses interface-acl;
          description
            "The ACLs applied to the ingress interface.";
        }
        container egress {
          uses interface-acl;
          description
            "The ACLs applied to the egress interface.";
        }
      }
    }
  }
}

<CODE ENDS>

4.2.  IETF Packet Fields Module

   The packet fields module defines the necessary groups for matching on
   fields in the packet including Ethernet, IPv4, IPv6, and transport-
   layer fields.  The "type" node determines which of these fields get
   included for any given ACL with the exception of TCP, UDP, and ICMP
   header fields.  Those fields can be used in conjunction with any of
   the above Layer 2 or Layer 3 fields.

   Since the number of match criteria are very large, the base
   specification does not include these directly but references them by
   the 'uses' statement to keep the base module simple.  In case more
   match conditions are needed, those can be added by augmenting choices
   within container "matches" in the ietf-access-control-list.yang data
   model.

   This module imports definitions from "Common YANG Data Types"
   [RFC6991] and references "Internet Protocol" [RFC791], "Internet
   Control Message Protocol" [RFC792], "Transmission Control Protocol"
   [RFC793], "Definition of the Differentiated Services Field (DS Field)
   in the IPv4 and IPv6 Headers" [RFC2474], "The Addition of Explicit
   Congestion Notification (ECN) to IP" [RFC3168], "IPv6 Scoped Address



Jethanandani, et al.         Standards Track                   [Page 24]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   Architecture" [RFC4007], "IP Version 6 Addressing Architecture"
   [RFC4291], "A Recommendation for IPv6 Address Text Representation"
   [RFC5952], and "Internet Protocol, Version 6 (IPv6) Specification"
   [RFC8200].

<CODE BEGINS> file "ietf-packet-fields@2019-03-04.yang"

module ietf-packet-fields {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields";
  prefix packet-fields;

  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991 - Common YANG Data Types.";
  }

  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991 - Common YANG Data Types.";
  }

  import ietf-ethertypes {
    prefix eth;
    reference
      "RFC 8519 - YANG Data Model for Network Access Control
                  Lists (ACLs).";
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group.";

  contact
    "WG Web:  <https://datatracker.ietf.org/wg/netmod/>
     WG List: netmod@ietf.org

     Editor: Mahesh Jethanandani
             mjethanandani@gmail.com
     Editor: Lisa Huang
             huangyi_99@yahoo.com
     Editor: Sonal Agarwal
             sagarwal12@gmail.com
     Editor: Dana Blair
             dana@blairhome.com";





Jethanandani, et al.         Standards Track                   [Page 25]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


  description
    "This YANG module defines groupings that are used by
     the ietf-access-control-list YANG module.  Their usage
     is not limited to ietf-access-control-list and can be
     used anywhere as applicable.

     Copyright (c) 2019 IETF Trust and the persons identified as
     the document authors.  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 8519; see
     the RFC itself for full legal notices.";

  revision 2019-03-04 {
    description
      "Initial version.";
    reference
      "RFC 8519: YANG Data Model for Network Access Control
                 Lists (ACLs).";
  }

  /*
   * Typedefs
   */
  typedef operator {
    type enumeration {
      enum lte {
        description
          "Less than or equal to.";
      }
      enum gte {
        description
          "Greater than or equal to.";
      }
      enum eq {
        description
          "Equal to.";
      }
      enum neq {
        description
          "Not equal to.";
      }



Jethanandani, et al.         Standards Track                   [Page 26]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


    }
    description
      "The source and destination port range definitions
       can be further qualified using an operator.  An
       operator is needed only if the lower-port is specified
       and the upper-port is not specified.  The operator
       therefore further qualifies the lower-port only.";
  }

  /*
   * Groupings
   */
  grouping port-range-or-operator {
    choice port-range-or-operator {
      case range {
        leaf lower-port {
          type inet:port-number;
          must '. <= ../upper-port' {
            error-message
              "The lower-port must be less than or equal to
               the upper-port.";
          }
          mandatory true;
          description
            "Lower boundary for a port.";
        }
        leaf upper-port {
          type inet:port-number;
          mandatory true;
          description
            "Upper boundary for a port.";
        }
      }
      case operator {
        leaf operator {
          type operator;
          default "eq";
          description
            "Operator to be applied on the port below.";
        }
        leaf port {
          type inet:port-number;
          mandatory true;
          description
            "Port number along with the operator on which to
             match.";
        }
      }



Jethanandani, et al.         Standards Track                   [Page 27]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


      description
        "Choice of specifying a port range or a single
         port along with an operator.";
    }
    description
      "Grouping for port definitions in the form of a
       choice statement.";
  }

  grouping acl-ip-header-fields {
    description
      "IP header fields common to IPv4 and IPv6";
    reference
      "RFC 791: Internet Protocol.";

    leaf dscp {
      type inet:dscp;
      description
        "Differentiated Services Code Point.";
      reference
        "RFC 2474: Definition of the Differentiated Services
                   Field (DS Field) in the IPv4 and IPv6
                   Headers.";
    }

    leaf ecn {
      type uint8 {
        range "0..3";
      }
      description
        "Explicit Congestion Notification.";
      reference
        "RFC 3168: The Addition of Explicit Congestion
                   Notification (ECN) to IP.";
    }

    leaf length {
      type uint16;
      description
        "In the IPv4 header field, this field is known as the Total
         Length.  Total Length is the length of the datagram, measured
         in octets, including internet header and data.

         In the IPv6 header field, this field is known as the Payload
         Length, which is the length of the IPv6 payload, i.e., the rest
         of the packet following the IPv6 header, in octets.";
      reference
        "RFC 791: Internet Protocol



Jethanandani, et al.         Standards Track                   [Page 28]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


         RFC 8200: Internet Protocol, Version 6 (IPv6) Specification.";
    }
    leaf ttl {
      type uint8;
      description
        "This field indicates the maximum time the datagram is allowed
         to remain in the internet system.  If this field contains the
         value zero, then the datagram must be dropped.

         In IPv6, this field is known as the Hop Limit.";
      reference
        "RFC 791: Internet Protocol
         RFC 8200: Internet Protocol, Version 6 (IPv6) Specification.";
    }
    leaf protocol {
      type uint8;
      description
        "Internet Protocol number.  Refers to the protocol of the
         payload.  In IPv6, this field is known as 'next-header',
         and if extension headers are present, the protocol is
         present in the 'upper-layer' header.";
      reference
        "RFC 791: Internet Protocol
         RFC 8200: Internet Protocol, Version 6 (IPv6) Specification.";
    }
  }

  grouping acl-ipv4-header-fields {
    description
      "Fields in the IPv4 header.";
    leaf ihl {
      type uint8 {
        range "5..60";
      }
      description
        "In an IPv4 header field, the Internet Header Length (IHL) is
         the length of the internet header in 32-bit words and
         thus points to the beginning of the data.  Note that the
         minimum value for a correct header is 5.";
    }
    leaf flags {
      type bits {
        bit reserved {
          position 0;
          description
            "Reserved.  Must be zero.";
        }
        bit fragment {



Jethanandani, et al.         Standards Track                   [Page 29]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


          position 1;
          description
            "Setting the value to 0 indicates may fragment, while
             setting the value to 1 indicates do not fragment.";
        }
        bit more {
          position 2;
          description
            "Setting the value to 0 indicates this is the last fragment,
             and setting the value to 1 indicates more fragments are
             coming.";
        }
      }
      description
        "Bit definitions for the Flags field in the IPv4 header.";
    }
    leaf offset {
      type uint16 {
        range "20..65535";
      }
      description
        "The fragment offset is measured in units of 8 octets (64 bits).
         The first fragment has offset zero.  The length is 13 bits";
    }
    leaf identification {
      type uint16;
      description
        "An identifying value assigned by the sender to aid in
         assembling the fragments of a datagram.";
    }

    choice destination-network {
      case destination-ipv4-network {
        leaf destination-ipv4-network {
          type inet:ipv4-prefix;
          description
            "Destination IPv4 address prefix.";
        }
      }
      description
        "Choice of specifying a destination IPv4 address or
         referring to a group of IPv4 destination addresses.";
    }

    choice source-network {
      case source-ipv4-network {
        leaf source-ipv4-network {
          type inet:ipv4-prefix;



Jethanandani, et al.         Standards Track                   [Page 30]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


          description
            "Source IPv4 address prefix.";
        }
      }
      description
        "Choice of specifying a source IPv4 address or
         referring to a group of IPv4 source addresses.";
    }
  }

  grouping acl-ipv6-header-fields {
    description
      "Fields in the IPv6 header.";

    choice destination-network {
      case destination-ipv6-network {
        leaf destination-ipv6-network {
          type inet:ipv6-prefix;
          description
            "Destination IPv6 address prefix.";
        }
      }
      description
        "Choice of specifying a destination IPv6 address
         or referring to a group of IPv6 destination
         addresses.";
    }

    choice source-network {
      case source-ipv6-network {
        leaf source-ipv6-network {
          type inet:ipv6-prefix;
          description
            "Source IPv6 address prefix.";
        }
      }
      description
        "Choice of specifying a source IPv6 address or
         referring to a group of IPv6 source addresses.";
    }

    leaf flow-label {
      type inet:ipv6-flow-label;
      description
        "IPv6 Flow label.";
    }
    reference
      "RFC 4291: IP Version 6 Addressing Architecture



Jethanandani, et al.         Standards Track                   [Page 31]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


       RFC 4007: IPv6 Scoped Address Architecture
       RFC 5952: A Recommendation for IPv6 Address Text
                 Representation.";
  }

  grouping acl-eth-header-fields {
    description
      "Fields in the Ethernet header.";
    leaf destination-mac-address {
      type yang:mac-address;
      description
        "Destination IEEE 802 Media Access Control (MAC)
         address.";
    }
    leaf destination-mac-address-mask {
      type yang:mac-address;
      description
        "Destination IEEE 802 MAC address mask.";
    }
    leaf source-mac-address {
      type yang:mac-address;
      description
        "Source IEEE 802 MAC address.";
    }
    leaf source-mac-address-mask {
      type yang:mac-address;
      description
        "Source IEEE 802 MAC address mask.";
    }
    leaf ethertype {
      type eth:ethertype;
      description
        "The Ethernet Type (or Length) value represented
         in the canonical order defined by IEEE 802.
         The canonical representation uses lowercase
         characters.";
      reference
        "IEEE 802-2014, Clause 9.2.";
    }
    reference
      "IEEE 802: IEEE Standard for Local and Metropolitan
       Area Networks: Overview and Architecture.";
  }

  grouping acl-tcp-header-fields {
    description
      "Collection of TCP header fields that can be used to
       set up a match filter.";



Jethanandani, et al.         Standards Track                   [Page 32]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


    leaf sequence-number {
      type uint32;
      description
        "Sequence number that appears in the packet.";
    }
    leaf acknowledgement-number {
      type uint32;
      description
        "The acknowledgement number that appears in the
         packet.";
    }
    leaf data-offset {
      type uint8 {
        range "5..15";
      }
      description
        "Specifies the size of the TCP header in 32-bit
         words.  The minimum size header is 5 words and
         the maximum is 15 words; thus, this gives a
         minimum size of 20 bytes and a maximum of 60
         bytes, allowing for up to 40 bytes of options
         in the header.";
    }
    leaf reserved {
      type uint8;
      description
        "Reserved for future use.";
    }
    leaf flags {
      type bits {
        bit cwr {
          position 1;
          description
            "The Congestion Window Reduced (CWR) flag is set
             by the sending host to indicate that it received
             a TCP segment with the ECN-Echo (ECE) flag set
             and had responded in the congestion control
             mechanism.";
          reference
            "RFC 3168: The Addition of Explicit Congestion
                       Notification (ECN) to IP.";
        }
        bit ece {
          position 2;
          description
            "ECN-Echo has a dual role, depending on the value
             of the SYN flag.  It indicates the following: if
             the SYN flag is set (1), the TCP peer is ECN



Jethanandani, et al.         Standards Track                   [Page 33]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


             capable, and if the SYN flag is clear (0), a packet
             with the Congestion Experienced flag set (ECN=11)
             in the IP header was received during normal
             transmission (added to the header by RFC 3168).
             This serves as an indication of network congestion
             (or impending congestion) to the TCP sender.";
          reference
            "RFC 3168: The Addition of Explicit Congestion
                       Notification (ECN) to IP.";
        }
        bit urg {
          position 3;
          description
            "Indicates that the Urgent Pointer field is significant.";
        }
        bit ack {
          position 4;
          description
            "Indicates that the Acknowledgement field is significant.
             All packets after the initial SYN packet sent by the
             client should have this flag set.";
        }
        bit psh {
          position 5;
          description
            "Push function.  Asks to push the buffered data to the
             receiving application.";
        }
        bit rst {
          position 6;
          description
            "Reset the connection.";
        }
        bit syn {
          position 7;
          description
            "Synchronize sequence numbers.  Only the first packet
             sent from each end should have this flag set.  Some
             other flags and fields change meaning based on this
             flag, and some are only valid for when it is set,
             and others when it is clear.";
        }
        bit fin {
          position 8;
          description
            "Last package from the sender.";
        }
      }



Jethanandani, et al.         Standards Track                   [Page 34]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


      description
        "Also known as Control Bits.  Contains nine 1-bit flags.";
      reference
        "RFC 793: Transmission Control Protocol.";
    }
    leaf window-size {
      type uint16;
      units "bytes";
      description
        "The size of the receive window, which specifies
         the number of window size units beyond the segment
         identified by the sequence number in the Acknowledgement
         field that the sender of this segment is currently
         willing to receive.";
    }
    leaf urgent-pointer {
      type uint16;
      description
        "This field is an offset from the sequence number
         indicating the last urgent data byte.";
    }
    leaf options {
      type binary {
        length "1..40";
      }
      description
        "The length of this field is determined by the
         Data Offset field.  Options have up to three
         fields: Option-Kind (1 byte), Option-Length
         (1 byte), and Option-Data (variable).  The Option-Kind
         field indicates the type of option and is the
         only field that is not optional.  Depending on
         what kind of option we are dealing with,
         the next two fields may be set: the Option-Length
         field indicates the total length of the option,
         and the Option-Data field contains the value of
         the option, if applicable.";
    }
  }

  grouping acl-udp-header-fields {
    description
      "Collection of UDP header fields that can be used
       to set up a match filter.";
    leaf length {
      type uint16;
      description
        "A field that specifies the length in bytes of



Jethanandani, et al.         Standards Track                   [Page 35]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


         the UDP header and UDP data.  The minimum
         length is 8 bytes because that is the length of
         the header.  The field size sets a theoretical
         limit of 65,535 bytes (8-byte header plus 65,527
         bytes of data) for a UDP datagram.  However, the
         actual limit for the data length, which is
         imposed by the underlying IPv4 protocol, is
         65,507 bytes (65,535 minus 8-byte UDP header
         minus 20-byte IP header).

         In IPv6 jumbograms, it is possible to have
         UDP packets of a size greater than 65,535 bytes.
         RFC 2675 specifies that the Length field is set
         to zero if the length of the UDP header plus
         UDP data is greater than 65,535.";
    }
  }

  grouping acl-icmp-header-fields {
    description
      "Collection of ICMP header fields that can be
       used to set up a match filter.";
    leaf type {
      type uint8;
      description
        "Also known as control messages.";
      reference
        "RFC 792: Internet Control Message Protocol
         RFC 4443: Internet Control Message Protocol (ICMPv6)
                   for Internet Protocol Version 6 (IPv6)
                   Specification.";
    }
    leaf code {
      type uint8;
      description
        "ICMP subtype.  Also known as control messages.";
      reference
        "RFC 792: Internet Control Message Protocol
         RFC 4443: Internet Control Message Protocol (ICMPv6)
                   for Internet Protocol Version 6 (IPv6)
                   Specification.";
    }
    leaf rest-of-header {
      type binary;
      description
        "Unbounded in length, the contents vary based on the
         ICMP type and code.  Also referred to as 'Message Body'
         in ICMPv6.";



Jethanandani, et al.         Standards Track                   [Page 36]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


      reference
        "RFC 792: Internet Control Message Protocol
         RFC 4443: Internet Control Message Protocol (ICMPv6)
                   for Internet Protocol Version 6 (IPv6)
                   Specification.";
    }
  }
}

<CODE ENDS>

4.3.  ACL Examples

   Requirement: Deny tcp traffic from 192.0.2.0/24, destined to
   198.51.100.0/24.

   Here is the ACL configuration xml for this Access Control List:

   [note: '\' line wrapping for formatting only]

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <acls
       xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
       <acl>
         <name>sample-ipv4-acl</name>
         <type>ipv4-acl-type</type>
         <aces>
           <ace>
             <name>rule1</name>
             <matches>
               <ipv4>
                 <protocol>6</protocol>
                 <destination-ipv4-network>198.51.100.0/24</destination\
   -ipv4-network>
                 <source-ipv4-network>192.0.2.0/24</source-ipv4-network>
               </ipv4>
             </matches>
             <actions>
               <forwarding>drop</forwarding>
             </actions>
           </ace>
         </aces>
       </acl>
     </acls>
   </config>





Jethanandani, et al.         Standards Track                   [Page 37]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The ACL and ACEs can be described in the command-line interface (CLI)
   as the following:

         acl ipv4 sample-ipv4-acl
         deny tcp 192.0.2.0/24 198.51.100.0/24

   Requirement: Accept all DNS traffic destined for 2001:db8::/32 on
   port 53.

   [note: '\' line wrapping for formatting only]

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <acls
       xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
       <acl>
         <name>allow-dns-packets</name>
         <type>ipv6-acl-type</type>
         <aces>
           <ace>
             <name>rule1</name>
             <matches>
               <ipv6>
                 <destination-ipv6-network>2001:db8::/32</destination-i\
   pv6-network>
               </ipv6>
               <udp>
                 <destination-port>
                   <operator>eq</operator>
                   <port>53</port>
                 </destination-port>
               </udp>
             </matches>
             <actions>
               <forwarding>accept</forwarding>
             </actions>
           </ace>
         </aces>
       </acl>
     </acls>
   </config>










Jethanandani, et al.         Standards Track                   [Page 38]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


4.4.  Port Range Usage and Other Examples

   When a lower-port and an upper-port are both present, it represents a
   range between the lower-port and upper-port with both the lower-port
   and upper-port included.  When only a port is present, it represents
   a port, with the operator specifying the range.

   The following XML example represents a configuration where TCP
   traffic from source ports 16384, 16385, 16386, and 16387 is dropped.

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <acls
       xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
       <acl>
         <name>sample-port-acl</name>
         <type>ipv4-acl-type</type>
         <aces>
           <ace>
             <name>rule1</name>
             <matches>
               <tcp>
                 <source-port>
                   <lower-port>16384</lower-port>
                   <upper-port>16387</upper-port>
                 </source-port>
               </tcp>
             </matches>
             <actions>
               <forwarding>drop</forwarding>
             </actions>
           </ace>
         </aces>
       </acl>
     </acls>
   </config>















Jethanandani, et al.         Standards Track                   [Page 39]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The following XML example represents a configuration where all IPv4
   ICMP echo requests are dropped.

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <acls
       xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
       <acl>
         <name>sample-icmp-acl</name>
         <aces>
           <ace>
             <name>rule1</name>
             <matches>
               <ipv4>
                 <protocol>1</protocol>
               </ipv4>
               <icmp>
                 <type>8</type>
                 <code>0</code>
               </icmp>
             </matches>
             <actions>
               <forwarding>drop</forwarding>
             </actions>
           </ace>
         </aces>
       </acl>
     </acls>
   </config>






















Jethanandani, et al.         Standards Track                   [Page 40]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The following XML example represents a configuration of a single
   port, port 21, that accepts TCP traffic.

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <acls
       xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
       <acl>
         <name>sample-ipv4-acl</name>
         <type>ipv4-acl-type</type>
         <aces>
           <ace>
             <name>rule1</name>
             <matches>
               <tcp>
                 <destination-port>
                   <operator>eq</operator>
                   <port>21</port>
                 </destination-port>
               </tcp>
             </matches>
             <actions>
               <forwarding>accept</forwarding>
             </actions>
           </ace>
         </aces>
       </acl>
     </acls>
   </config>






















Jethanandani, et al.         Standards Track                   [Page 41]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The following XML example represents a configuration specifying all
   ports that are not equal to 21 that will drop TCP packets destined
   for those ports.

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <acls
       xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
       <acl>
         <name>sample-ipv4-acl</name>
         <type>ipv4-acl-type</type>
         <aces>
           <ace>
             <name>rule1</name>
             <matches>
               <tcp>
                 <destination-port>
                   <operator>neq</operator>
                   <port>21</port>
                 </destination-port>
               </tcp>
             </matches>
             <actions>
               <forwarding>drop</forwarding>
             </actions>
           </ace>
         </aces>
       </acl>
     </acls>
   </config>

5.  Security Considerations

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

   The NETCONF Access Control Model (NACM) [RFC8341] provides the means
   to restrict access for particular NETCONF or RESTCONF users to a
   preconfigured subset of all available NETCONF or RESTCONF protocol
   operations and content.






Jethanandani, et al.         Standards Track                   [Page 42]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


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

      /acls/acl/aces: This list specifies all the configured access
      control entries on the device.  Unauthorized write access to this
      list can allow intruders to modify the entries so as to permit
      traffic that should not be permitted, or deny traffic that should
      be permitted.  The former may result in a DoS attack, or
      compromise the device.  The latter may result in a DoS attack.
      The impact of an unauthorized read access of the list will allow
      the attacker to determine which rules are in effect, to better
      craft an attack.

      /acls/acl/aces/ace/actions/logging: This node specifies ability to
      log packets that match this ace entry.  Unauthorized write access
      to this node can allow intruders to enable logging on one or many
      ace entries, overwhelming the server in the process.  Unauthorized
      read access of this node can allow intruders to access logging
      information, which could be used to craft an attack the server.

6.  IANA Considerations

   This document registers three URIs and three YANG modules.

6.1.  URI Registration

   This document registers three URIs in the "IETF XML Registry"
   [RFC3688] as follows:

   URI: urn:ietf:params:xml:ns:yang:ietf-access-control-list
   URI: urn:ietf:params:xml:ns:yang:ietf-packet-fields
   URI: urn:ietf:params:xml:ns:yang:ietf-ethertypes

   Registrant Contact: The IESG.

   XML: N/A; the requested URI is an XML namespace.










Jethanandani, et al.         Standards Track                   [Page 43]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


6.2.  YANG Module Name Registration

   This document registers three YANG modules in the "YANG Module Names"
   registry [RFC6020].

   Name: ietf-access-control-list
   Namespace: urn:ietf:params:xml:ns:yang:ietf-access-control-list
   Prefix: acl
   Reference: RFC 8519

   Name: ietf-packet-fields
   Namespace: urn:ietf:params:xml:ns:yang:ietf-packet-fields
   Prefix: packet-fields
   Reference: RFC 8519

   Name: ietf-ethertypes
   Namespace: urn:ietf:params:xml:ns:yang:ietf-ethertypes
   Prefix: ethertypes
   Reference: RFC 8519

7.  References

7.1.  Normative References

   [RFC791]   Postel, J., "Internet Protocol", STD 5, RFC 791,
              DOI 10.17487/RFC0791, September 1981,
              <https://www.rfc-editor.org/info/rfc791>.

   [RFC792]   Postel, J., "Internet Control Message Protocol", STD 5,
              RFC 792, DOI 10.17487/RFC0792, September 1981,
              <https://www.rfc-editor.org/info/rfc792>.

   [RFC793]   Postel, J., "Transmission Control Protocol", STD 7,
              RFC 793, DOI 10.17487/RFC0793, September 1981,
              <https://www.rfc-editor.org/info/rfc793>.

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

   [RFC2474]  Nichols, K., Blake, S., Baker, F., and D. Black,
              "Definition of the Differentiated Services Field (DS
              Field) in the IPv4 and IPv6 Headers", RFC 2474,
              DOI 10.17487/RFC2474, December 1998,
              <https://www.rfc-editor.org/info/rfc2474>.





Jethanandani, et al.         Standards Track                   [Page 44]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   [RFC3168]  Ramakrishnan, K., Floyd, S., and D. Black, "The Addition
              of Explicit Congestion Notification (ECN) to IP",
              RFC 3168, DOI 10.17487/RFC3168, September 2001,
              <https://www.rfc-editor.org/info/rfc3168>.

   [RFC4007]  Deering, S., Haberman, B., Jinmei, T., Nordmark, E., and
              B. Zill, "IPv6 Scoped Address Architecture", RFC 4007,
              DOI 10.17487/RFC4007, March 2005,
              <https://www.rfc-editor.org/info/rfc4007>.

   [RFC4291]  Hinden, R. and S. Deering, "IP Version 6 Addressing
              Architecture", RFC 4291, DOI 10.17487/RFC4291, February
              2006, <https://www.rfc-editor.org/info/rfc4291>.

   [RFC5952]  Kawamura, S. and M. Kawashima, "A Recommendation for IPv6
              Address Text Representation", RFC 5952,
              DOI 10.17487/RFC5952, August 2010,
              <https://www.rfc-editor.org/info/rfc5952>.

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

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

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

   [RFC8200]  Deering, S. and R. Hinden, "Internet Protocol, Version 6
              (IPv6) Specification", STD 86, RFC 8200,
              DOI 10.17487/RFC8200, July 2017,
              <https://www.rfc-editor.org/info/rfc8200>.

   [RFC8343]  Bjorklund, M., "A YANG Data Model for Interface
              Management", RFC 8343, DOI 10.17487/RFC8343, March 2018,
              <https://www.rfc-editor.org/info/rfc8343>.












Jethanandani, et al.         Standards Track                   [Page 45]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


7.2.  Informative References

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

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

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

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

   [RFC7011]  Claise, B., Ed., Trammell, B., Ed., and P. Aitken,
              "Specification of the IP Flow Information Export (IPFIX)
              Protocol for the Exchange of Flow Information", STD 77,
              RFC 7011, DOI 10.17487/RFC7011, September 2013,
              <https://www.rfc-editor.org/info/rfc7011>.

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

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

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

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









Jethanandani, et al.         Standards Track                   [Page 46]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


Appendix A.  Extending ACL Model Examples

A.1.  Example of a Company's Proprietary Module

   The "example-newco-acl" module is an example of a company's
   proprietary model that augments the "ietf-acl" module.  It shows how
   to use 'augment' with an XML Path Language (XPath) expression to add
   additional match criteria, actions, and default actions for when no
   ACE matches are found.  All these are company proprietary extensions
   or system feature extensions.  "example-newco-acl" is just an
   example, and it is expected that vendors will create their own
   proprietary models.

   module example-newco-acl {

     yang-version 1.1;

     namespace "http://example.com/ns/example-newco-acl";

     prefix example-newco-acl;

     import ietf-access-control-list {
       prefix acl;
     }

     organization
       "Newco model group.";

     contact
       "abc@newco.com";
     description
       "This YANG module augments the IETF ACL YANG module.";

     revision 2019-03-04 {
       description
         "Creating NewCo proprietary extensions to the ietf-acl
          model.";

       reference
         "RFC 8519: YANG Data Model for Network Access Control
                    Lists (ACLs).";
     }

     augment "/acl:acls/acl:acl/"
           + "acl:aces/acl:ace/"
           + "acl:matches" {
       description
         "Newco proprietary simple filter matches.";



Jethanandani, et al.         Standards Track                   [Page 47]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


       choice protocol-payload-choice {
         description
           "Newco proprietary payload match condition.";
         list protocol-payload {
           key "value-keyword";
           ordered-by user;
           description
             "Match protocol payload.";
           uses match-simple-payload-protocol-value;
         }
       }

       choice metadata {
         description
           "Newco proprietary interface match condition.";
         leaf packet-length {
           type uint16;
           description
             "Match on packet length.";
         }
       }
     }

     augment "/acl:acls/acl:acl/"
           + "acl:aces/acl:ace/"
           + "acl:actions" {
       description
         "Newco proprietary simple filter actions.";
       choice action {
         description
           "Newco proprietary action choices.";
         case count {
           description
             "Count the packet in the named counter.";
           leaf count {
             type uint32;
             description
               "Count.";
           }
         }
         case policer {
           description
             "Name of policer used to rate-limit traffic.";
           leaf policer {
             type string;
             description
               "Name of the policer.";
           }



Jethanandani, et al.         Standards Track                   [Page 48]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


         }
         case hierarchical-policer {
           leaf hierarchical-policer {
             type string;
             description
               "Name of the hierarchical policer.";
           }
           description
             "Name of the hierarchical policer used to
              rate-limit traffic.";
         }
       }
     }

     augment "/acl:acls/acl:acl"
           + "/acl:aces/acl:ace/"
           + "acl:actions" {
       leaf default-action {
         type identityref {
           base acl:forwarding-action;
         }
         default "acl:drop";
         description
           "Actions that occur if no ACE is matched.";
       }
       description
         "Newco proprietary default action.";
     }

     grouping match-simple-payload-protocol-value {
       description
         "Newco proprietary payload";
       leaf value-keyword {
         type enumeration {
           enum icmp {
             description
               "Internet Control Message Protocol.";
           }
           enum icmp6 {
             description
               "Internet Control Message Protocol
                Version 6.";
           }
           enum range {
             description
               "Range of values.";
           }
         }



Jethanandani, et al.         Standards Track                   [Page 49]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


         description
           "(null).";
       }
     }
   }

   The following figure is the tree diagram of example-newco-acl.  In
   this example, /ietf-acl:acls/ietf-acl:acl/ietf-acl:aces/ietf-acl:ace/
   ietf-acl:matches are augmented with two new choices: protocol-
   payload-choice and metadata.  The protocol-payload-choice uses a
   grouping with an enumeration of all supported protocol values.
   Metadata matches apply to fields associated with the packet, that are
   not in the packet header, such as overall packet length.  In another
   example, /ietf-acl:acls/ietf-acl:acl/ietf-acl:aces/ietf-acl:ace/
   ietf-acl:actions are augmented with a new choice of actions.

   module: example-newco-acl
     augment /acl:acls/acl:acl/acl:aces/acl:ace/acl:matches:
       +--rw (protocol-payload-choice)?
       |  +--:(protocol-payload)
       |     +--rw protocol-payload* [value-keyword]
       |        +--rw value-keyword    enumeration
       +--rw (metadata)?
          +--:(packet-length)
             +--rw packet-length?      uint16
     augment /acl:acls/acl:acl/acl:aces/acl:ace/acl:actions:
       +--rw (action)?
          +--:(count)
          |  +--rw count?                   uint32
          +--:(policer)
          |  +--rw policer?                 string
          +--:(hierarchical-policer)
             +--rw hierarchical-policer?   string
     augment /acl:acls/acl:acl/acl:aces/acl:ace/acl:actions:
       +--rw default-action?   identityref

A.2.  Linux nftables

   As the Linux platform is becoming more popular than the networking
   platform, the Linux data model is changing.  Previously, ACLs in
   Linux were highly protocol specific, and different utilities were
   used (iptables, ip6tables, arptables, and ebtables), so each one had
   a separate data model.  Recently, this has changed, and a single
   utility, nftables, has been developed.  With a single application, it
   has a single data model for firewall filters, and it follows very
   similarly the ietf-access-control list module proposed in this
   document.  The nftables support input and output ACEs, and each ACE
   can be defined with match and action.



Jethanandani, et al.         Standards Track                   [Page 50]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


   The example in Section 4.3 can be configured using nftable tool as
   below.

         nft add table ip filter
         nft add chain filter input
         nft add rule ip filter input ip protocol tcp ip saddr \
             192.0.2.1/24 drop

   The configuration entries added in nftable would be:

         table ip filter {
           chain input {
             ip protocol tcp ip saddr 192.0.2.1/24 drop
           }
         }


   We can see that there are many similarities between Linux nftables
   and IETF ACL YANG data models and their extension models.  It should
   be fairly easy to do translation between the ACL YANG model described
   in this document and Linux nftables.

A.3.  Ethertypes

   The ACL module is dependent on the definition of Ethertypes.  IEEE
   owns the allocation of those Ethertypes.  This model is being
   included here to enable the definition of those types till such time
   that IEEE takes up the task of publication of the model that defines
   those Ethertypes.  At that time, this model can be deprecated.

   <CODE BEGINS> file "ietf-ethertypes@2019-03-04.yang"

   module ietf-ethertypes {
     namespace "urn:ietf:params:xml:ns:yang:ietf-ethertypes";
     prefix ethertypes;

     organization
       "IETF NETMOD (Network Modeling) Working Group.";

     contact
       "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
        WG List:  <mailto:netmod@ietf.org>

        Editor:   Mahesh Jethanandani
                  <mjethanandani@gmail.com>";

     description
       "This module contains common definitions for the



Jethanandani, et al.         Standards Track                   [Page 51]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


        Ethertype used by different modules.  It is a
        placeholder module, till such time that IEEE
        starts a project to define these Ethertypes
        and publishes a standard.

        At that time, this module can be deprecated.

        Copyright (c) 2019 IETF Trust and the persons identified as
        the document authors.  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 8519; see
        the RFC itself for full legal notices.";

     revision 2019-03-04 {
       description
         "Initial revision.";
       reference
         "RFC 8519: YANG Data Model for Network Access Control
                    Lists (ACLs).";
     }

     typedef ethertype {
       type union {
         type uint16;
         type enumeration {
           enum ipv4 {
             value 2048;
             description
               "Internet Protocol version 4 (IPv4) with a
                hex value of 0x0800.";
             reference
               "RFC 791: Internet Protocol.";
           }
           enum arp {
             value 2054;
             description
               "Address Resolution Protocol (ARP) with a
                hex value of 0x0806.";
             reference
               "RFC 826: An Ethernet Address Resolution Protocol: Or
                         Converting Network Protocol Addresses to 48.bit



Jethanandani, et al.         Standards Track                   [Page 52]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


                         Ethernet Address for Transmission on Ethernet
                         Hardware.";
           }
           enum wlan {
             value 2114;
             description
               "Wake-on-LAN.  Hex value of 0x0842.";
           }
           enum trill {
             value 8947;
             description
               "Transparent Interconnection of Lots of Links.
                Hex value of 0x22F3.";
             reference
               "RFC 6325: Routing Bridges (RBridges): Base Protocol
                          Specification.";
           }
           enum srp {
             value 8938;
             description
               "Stream Reservation Protocol.  Hex value of
                0x22EA.";
             reference
               "IEEE 801.1Q-2011.";
           }
           enum decnet {
             value 24579;
             description
               "DECnet Phase IV.  Hex value of 0x6003.";
           }
           enum rarp {
             value 32821;
             description
               "Reverse Address Resolution Protocol.
                Hex value 0x8035.";
             reference
               "RFC 903: A Reverse Address Resolution Protocol.";
           }
           enum appletalk {
             value 32923;
             description
               "Appletalk (Ethertalk).  Hex value of 0x809B.";
           }
           enum aarp {
             value 33011;
             description
               "Appletalk Address Resolution Protocol.  Hex value
                of 0x80F3.";



Jethanandani, et al.         Standards Track                   [Page 53]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


           }
           enum vlan {
             value 33024;
             description
               "VLAN-tagged frame (IEEE 802.1Q) and Shortest Path
                Bridging IEEE 802.1aq with Network-Network
                Interface (NNI) compatibility.  Hex value of
                0x8100.";
             reference
               "IEEE 802.1Q.";
           }
           enum ipx {
             value 33079;
             description
               "Internetwork Packet Exchange (IPX).  Hex value
                of 0x8137.";
           }
           enum qnx {
             value 33284;
             description
               "QNX Qnet.  Hex value of 0x8204.";
           }
           enum ipv6 {
             value 34525;
             description
               "Internet Protocol Version 6 (IPv6).  Hex value
                of 0x86DD.";
             reference
               "RFC 8200: Internet Protocol, Version 6 (IPv6)
                          Specification
                RFC 8201: Path MTU Discovery for IP version 6.";
           }
           enum efc {
             value 34824;
             description
               "Ethernet flow control using pause frames.
                Hex value of 0x8808.";
             reference
               "IEEE 802.1Qbb.";
           }
           enum esp {
             value 34825;
             description
               "Ethernet Slow Protocol.  Hex value of 0x8809.";
             reference
               "IEEE 802.3-2015.";
           }
           enum cobranet {



Jethanandani, et al.         Standards Track                   [Page 54]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


             value 34841;
             description
               "CobraNet.  Hex value of 0x8819.";
           }
           enum mpls-unicast {
             value 34887;
             description
               "Multiprotocol Label Switching (MPLS) unicast traffic.
                Hex value of 0x8847.";
             reference
               "RFC 3031: Multiprotocol Label Switching Architecture.";
           }
           enum mpls-multicast {
             value 34888;
             description
               "MPLS multicast traffic.  Hex value of 0x8848.";
             reference
               "RFC 3031: Multiprotocol Label Switching Architecture.";
           }
           enum pppoe-discovery {
             value 34915;
             description
               "Point-to-Point Protocol over Ethernet.  Used during
                the discovery process.  Hex value of 0x8863.";
             reference
               "RFC 2516: A Method for Transmitting PPP Over Ethernet
                          (PPPoE).";
           }
           enum pppoe-session {
             value 34916;
             description
               "Point-to-Point Protocol over Ethernet.  Used during
                session stage.  Hex value of 0x8864.";
             reference
               "RFC 2516: A Method for Transmitting PPP Over Ethernet
                          (PPPoE).";
           }
           enum intel-ans {
             value 34925;
             description
               "Intel Advanced Networking Services.  Hex value of
                0x886D.";
           }
           enum jumbo-frames {
             value 34928;
             description
               "Jumbo frames or Ethernet frames with more than
                1500 bytes of payload, up to 9000 bytes.";



Jethanandani, et al.         Standards Track                   [Page 55]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


           }
           enum homeplug {
             value 34939;
             description
               "Family name for the various power line
                communications.  Hex value of 0x887B.";
           }
           enum eap {
             value 34958;
             description
               "Ethernet Access Protocol (EAP) over LAN.  Hex value
                of 0x888E.";
             reference
               "IEEE 802.1X.";
           }
           enum profinet {
             value 34962;
             description
               "PROcess FIeld Net (PROFINET).  Hex value of 0x8892.";
           }
           enum hyperscsi {
             value 34970;
             description
               "Small Computer System Interface (SCSI) over Ethernet.
                Hex value of 0x889A.";
           }
           enum aoe {
             value 34978;
             description
               "Advanced Technology Advancement (ATA) over Ethernet.
                Hex value of 0x88A2.";
           }
           enum ethercat {
             value 34980;
             description
               "Ethernet for Control Automation Technology (EtherCAT).
                Hex value of 0x88A4.";
           }
           enum provider-bridging {
             value 34984;
             description
               "Provider Bridging (802.1ad) and Shortest Path Bridging
                (801.1aq).  Hex value of 0x88A8.";
             reference
               "IEEE 802.1ad and IEEE 802.1aq).";
           }
           enum ethernet-powerlink {
             value 34987;



Jethanandani, et al.         Standards Track                   [Page 56]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


             description
               "Ethernet Powerlink.  Hex value of 0x88AB.";
           }
           enum goose {
             value 35000;
             description
               "Generic Object Oriented Substation Event (GOOSE).
                Hex value of 0x88B8.";
             reference
               "IEC/ISO 8802-2 and 8802-3.";
           }
           enum gse {
             value 35001;
             description
               "Generic Substation Events.  Hex value of 88B9.";
             reference
               "IEC 61850.";
           }
           enum sv {
             value 35002;
             description
               "Sampled Value Transmission.  Hex value of 0x88BA.";
             reference
               "IEC 61850.";
           }
           enum lldp {
             value 35020;
             description
               "Link Layer Discovery Protocol (LLDP).  Hex value of
                0x88CC.";
             reference
               "IEEE 802.1AB.";
           }
           enum sercos {
             value 35021;
             description
               "Sercos Interface.  Hex value of 0x88CD.";
           }
           enum wsmp {
             value 35036;
             description
               "WAVE Short Message Protocol (WSMP).  Hex value of
                0x88DC.";
           }
           enum homeplug-av-mme {
             value 35041;
             description
               "HomePlug AV Mobile Management Entity (MME).  Hex value



Jethanandani, et al.         Standards Track                   [Page 57]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


                of 88E1.";
           }
           enum mrp {
             value 35043;
             description
               "Media Redundancy Protocol (MRP).  Hex value of
                0x88E3.";
             reference
               "IEC 62439-2.";
           }
           enum macsec {
             value 35045;
             description
               "MAC Security.  Hex value of 0x88E5.";
             reference
               "IEEE 802.1AE.";
           }
           enum pbb {
             value 35047;
             description
               "Provider Backbone Bridges (PBB).  Hex value of
                0x88E7.";
             reference
               "IEEE 802.1ah.";
           }
           enum cfm {
             value 35074;
             description
               "Connectivity Fault Management (CFM).  Hex value of
                0x8902.";
             reference
               "IEEE 802.1ag.";
           }
           enum fcoe {
             value 35078;
             description
               "Fiber Channel over Ethernet (FCoE).  Hex value of
                0x8906.";
             reference
               "T11 FC-BB-5.";
           }
           enum fcoe-ip {
             value 35092;
             description
               "FCoE Initialization Protocol.  Hex value of 0x8914.";
           }
           enum roce {
             value 35093;



Jethanandani, et al.         Standards Track                   [Page 58]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


             description
               "RDMA over Converged Ethernet (RoCE).  Hex value of
                0x8915.";
           }
           enum tte {
             value 35101;
             description
               "TTEthernet Protocol Control Frame (TTE).  Hex value
                of 0x891D.";
             reference
               "SAE AS6802.";
           }
           enum hsr {
             value 35119;
             description
               "High-availability Seamless Redundancy (HSR).  Hex
                value of 0x892F.";
             reference
               "IEC 62439-3:2016.";
           }
         }
       }
       description
         "The uint16 type placeholder is defined to enable
          users to manage their own ethertypes not
          covered by the module.  Otherwise, the module contains
          enum definitions for the more commonly used ethertypes.";
     }
   }

   <CODE ENDS>




















Jethanandani, et al.         Standards Track                   [Page 59]
^L
RFC 8519                YANG Data Model for ACLs              March 2019


Acknowledgements

   Alex Clemm, Andy Bierman, and Lisa Huang started by sketching an
   initial draft version in several past IETF meetings.  That document
   included an ACL YANG model structure and a rich set of match filters,
   and it acknowledged contributions by Louis Fourie, Dana Blair, Tula
   Kraiser, Patrick Gili, George Serpa, Martin Bjorklund, Kent Watsen,
   and Phil Shafer.  Many people have reviewed the various earlier draft
   versions that made the document that went into IETF charter.

   Dean Bogdanovic, Kiran Agrahara Sreenivasa, Lisa Huang, and Dana
   Blair each evaluated the YANG model in earlier draft versions
   separately, and then they worked together to create an ACL draft
   version that was supported by different vendors.  That document
   removed vendor-specific features and gave examples that allowed
   vendors to extend their own proprietary ACLs.  That earlier draft
   version was superseded with this document and received participation
   from many vendors.

   The authors would like to thank Jason Sterne, Lada Lhotka, Juergen
   Schoenwalder, David Bannister, Jeff Haas, Kristian Larsson, and Einar
   Nilsen-Nygaard for their reviews of and suggestions for the document.

Authors' Addresses

   Mahesh Jethanandani
   VMware

   Email: mjethanandani@gmail.com


   Sonal Agarwal
   Cisco Systems, Inc.

   Email: sagarwal12@gmail.com


   Lisa Huang

   Email: huangyi_99@yahoo.com


   Dana Blair

   Email: dana@blairhome.com






Jethanandani, et al.         Standards Track                   [Page 60]
^L