summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc8913.txt
blob: 8c96e52af9886fbc7a23d19c2b0f7edf311896cb (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
Internet Engineering Task Force (IETF)                          R. Civil
Request for Comments: 8913                             Ciena Corporation
Category: Standards Track                                      A. Morton
ISSN: 2070-1721                                                AT&T Labs
                                                               R. Rahman
                                                                        
                                                         M. Jethanandani
                                                     Xoriant Corporation
                                                     K. Pentikousis, Ed.
                                                                 Detecon
                                                           November 2021


      Two-Way Active Measurement Protocol (TWAMP) YANG Data Model

Abstract

   This document specifies a data model for client and server
   implementations of the Two-Way Active Measurement Protocol (TWAMP).
   This document defines the TWAMP data model through Unified Modeling
   Language (UML) class diagrams and formally specifies it using the
   YANG data modeling language (RFC 7950).  The data model is compliant
   with the Network Management Datastore Architecture (NMDA).

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/rfc8913.

Copyright Notice

   Copyright (c) 2021 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 Revised BSD License text as described in Section 4.e of the
   Trust Legal Provisions and are provided without warranty as described
   in the Revised BSD License.

Table of Contents

   1.  Introduction
     1.1.  Motivation
     1.2.  Terminology
     1.3.  Document Organization
   2.  Scope, Model, and Applicability
   3.  Data Model Overview
     3.1.  Control-Client
     3.2.  Server
     3.3.  Session-Sender
     3.4.  Session-Reflector
   4.  Data Model Parameters
     4.1.  Control-Client
     4.2.  Server
     4.3.  Session-Sender
     4.4.  Session-Reflector
   5.  Data Model
     5.1.  YANG Tree Diagram
     5.2.  YANG Module
   6.  Data Model Examples
     6.1.  Control-Client
     6.2.  Server
     6.3.  Session-Sender
     6.4.  Session-Reflector
   7.  Security Considerations
   8.  IANA Considerations
   9.  References
     9.1.  Normative References
     9.2.  Informative References
   Appendix A.  Detailed Data Model Examples
     A.1.  Control-Client
     A.2.  Server
     A.3.  Session-Sender
     A.4.  Session-Reflector
   Appendix B.  TWAMP Operational Commands
   Acknowledgments
   Contributors
   Authors' Addresses

1.  Introduction

   The Two-Way Active Measurement Protocol (TWAMP) [RFC5357] is used to
   measure network performance parameters such as latency, bandwidth,
   and packet loss by sending probe packets and measuring their
   experience in the network.  To date, TWAMP implementations do not
   come with a standard management framework, and, as such, implementers
   have no choice except to provide a proprietary mechanism.  This
   document addresses this gap by defining the model using Unified
   Modeling Language (UML) class diagrams [UML] and formally specifying
   a TWAMP data model that is compliant with the Network Management
   Datastore Architecture (NMDA) [RFC8342], using YANG 1.1 [RFC7950].

1.1.  Motivation

   In current TWAMP deployments, the lack of a standardized data model
   limits the flexibility to dynamically instantiate TWAMP-based
   measurements across equipment from different vendors.  In large,
   virtualized, and dynamically instantiated infrastructures where
   network functions are placed according to orchestration algorithms,
   proprietary mechanisms for managing TWAMP measurements pose severe
   limitations with respect to programmability.

   Two major trends call for standardizing TWAMP management aspects.
   First, it is expected that in the coming years large-scale and multi-
   vendor TWAMP deployments will become the norm.  From an operations
   perspective, using several vendor-specific TWAMP configuration
   mechanisms when one standard mechanism could provide an alternative
   is expensive and inefficient.  Second, the increasingly software-
   defined and virtualized nature of network infrastructures, based on
   dynamic service chains [NSC] and programmable control and management
   planes [RFC7426], requires a well-defined data model for TWAMP
   implementations.  This document defines such a TWAMP data model and
   specifies it formally using the YANG 1.1 data modeling language
   [RFC7950].

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.  Document Organization

   The rest of this document is organized as follows.  Section 2
   presents the scope and applicability of this document.  Section 3
   provides a high-level overview of the TWAMP data model.  Section 4
   details the configuration parameters of the data model, and Section 5
   specifies in YANG the TWAMP data model.  Section 6 lists illustrative
   examples that conform to the YANG data model specified in this
   document.  Appendix A elaborates these examples further.

2.  Scope, Model, and Applicability

   The purpose of this document is the specification of a vendor-
   independent data model for TWAMP implementations.

   Figure 1 illustrates a redrawn version of the TWAMP logical model
   found in Section 1.2 of TWAMP [RFC5357].  The figure is annotated
   with pointers to the UML diagrams [UML] provided in this document and
   associated with the data model of the four logical entities in a
   TWAMP deployment, namely the TWAMP Control-Client, Server, Session-
   Sender, and Session-Reflector.  A UML Notation Guide is available in
   Section 5 of UML [UML].

   As per TWAMP [RFC5357], unlabeled links in Figure 1 are left
   unspecified and may be proprietary protocols.

            (Figure 3)                              (Figure 4)
        +----------------+                          +--------+
        | Control-Client |  <-- TWAMP-Control -->   | Server |
        +----------------+                          +--------+
                ^                                        ^
                |                                        |
                V                                        V
        +----------------+                     +-------------------+
        | Session-Sender |  <-- TWAMP-Test --> | Session-Reflector |
        +----------------+                     +-------------------+
            (Figure 5)                               (Figure 6)

                  Figure 1: Annotated TWAMP Logical Model

   As per TWAMP [RFC5357], a TWAMP implementation may follow a
   simplified logical model, in which the same node acts as both
   Control-Client and Session-Sender, while another node acts at the
   same time as both TWAMP Server and Session-Reflector.  Figure 2
   illustrates this simplified logical model and indicates the
   interaction between the TWAMP configuration client and server using,
   for instance, NETCONF [RFC6241] or RESTCONF [RFC8040].

     o-------------------o                       o-------------------o
     |   Config client   |                       |   Config client   |
     o-------------------o                       o-------------------o
              ||                                          ||
      NETCONF || RESTCONF                         NETCONF || RESTCONF
              ||                                          ||
     o-------------------o                       o-------------------o
     |   Config server   |                       |   Config server   |
     | (Figures 3 and 5) |                       | (Figures 4 and 6) |
     +-------------------+                       +-------------------+
     |   Control-Client  | <-- TWAMP-Control --> |      Server       |
     |                   |                       |                   |
     |   Session-Sender  |  <-- TWAMP-Test -->   | Session-Reflector |
     +-------------------+                       +-------------------+

               Figure 2: Simplified TWAMP Model and Protocols

   The data model defined in this document is orthogonal to the specific
   protocol used between the Config client and Config server to
   communicate the TWAMP configuration parameters.

   Operational actions such as how TWAMP-Test sessions are started and
   stopped, how performance measurement results are retrieved, or how
   stored results are cleared, and so on, are not addressed by the
   configuration model defined in this document.  As noted above, such
   operational actions are not part of the TWAMP specification [RFC5357]
   and hence are out of scope for this document.  See also Appendix B.
   In addition, for operational state, the information provided in the
   Performance Metrics Registry [RFC8911] and [PERF-METRICS] can be used
   to develop an independent model for the Performance Metrics that need
   to be captured and retrieved.

3.  Data Model Overview

   The TWAMP data model includes four categories of configuration items.

   First, global configuration items relate to parameters that are set
   on a per-device level.  For example, the administrative status of the
   device with respect to whether it allows TWAMP sessions and, if so,
   in what capacity (e.g., Control-Client, Server, or both) is a typical
   instance of a global configuration item.

   A second category includes attributes that can be configured on a
   per-TWAMP-Control-connection basis, such as the Server IP address.

   A third category includes attributes related to per-TWAMP-Test-
   session attributes -- for instance, setting different values in the
   Differentiated Services Code Point (DSCP) field.

   Finally, the data model includes attributes that relate to the
   operational state of the TWAMP implementation.

   As the TWAMP data model is described in the remaining sections of
   this document, readers should keep in mind the functional entity
   grouping illustrated in Figure 1.

3.1.  Control-Client

   A TWAMP Control-Client has an administrative status field set at the
   device level that indicates whether the node is enabled to function
   as such.

   Each TWAMP Control-Client is associated with zero or more
   TWAMP-Control connections.  The main configuration parameters of each
   control connection are:

   *  A name that can be used to uniquely identify at the Control-Client
      a particular control connection.  This name is necessary for
      programmability reasons because at the time of creation of a
      TWAMP-Control connection not all IP and TCP port number
      information needed to uniquely identify the connection is
      available.

   *  The IP address of the interface the Control-Client will use for
      connections.

   *  The IP address of the remote TWAMP Server.

   *  Authentication and encryption attributes such as KeyID, Token, and
      the Control-Client Initialization Vector (Client-IV); see also
      Section 3.1 of "A One-way Active Measurement Protocol (OWAMP)"
      [RFC4656] and "Randomness Requirements for Security" [RFC4086].

   Each TWAMP-Control connection, in turn, is associated with zero or
   more TWAMP-Test sessions.  For each test session, the following
   configuration items should be noted:

   *  The test session name, which uniquely identifies a particular test
      session at the Control-Client and Session-Sender.  Similar to the
      control connections mentioned above, this unique test session name
      is needed because at the time of creation of a TWAMP-Test session,
      for example, the source UDP port number is not known to uniquely
      identify the test session.

   *  The IP address and UDP port number of the Session-Sender on the
      path under test by TWAMP.

   *  The IP address and UDP port number of the Session-Reflector on
      said path.

   *  Information pertaining to the test packet stream, such as the test
      starting time; which Performance Metric is to be used, as defined
      in "Registry for Performance Metrics" [RFC8911]; or whether the
      test should be repeated.

3.2.  Server

   Each TWAMP Server has an administrative status field set at the
   device level to indicate whether the node is enabled to function as a
   TWAMP Server.

   Each Server is associated with zero or more TWAMP-Control
   connections.  Each control connection is uniquely identified by the
   4-tuple {Control-Client IP address, Control-Client TCP port number,
   Server IP address, Server TCP port}.  Control connection
   configuration items on a TWAMP Server are read-only.

3.3.  Session-Sender

   A TWAMP Session-Sender has an administrative status field set at the
   device level that indicates whether the node is enabled to function
   as such.

   There is one Session-Sender instance for each TWAMP-Test session that
   is initiated from the sending device.  Primary configuration fields
   include:

   *  The test session name, which MUST be identical to the
      corresponding test session name on the TWAMP Control-Client
      (Section 3.1).

   *  The control connection name, which, along with the test session
      name, uniquely identifies the TWAMP Session-Sender instance.

   *  Information pertaining to the test packet stream, such as the
      number of test packets and the packet distribution to be employed;
      see also "Network performance measurement with periodic streams"
      [RFC3432].

3.4.  Session-Reflector

   Each TWAMP Session-Reflector has an administrative status field set
   at the device level to indicate whether the node is enabled to
   function as such.

   Each Session-Reflector is associated with zero or more TWAMP-Test
   sessions.  For each test session, the REFWAIT timeout parameter,
   which determines whether to discontinue the session if no packets
   have been received (TWAMP [RFC5357], Section 4.2), can be configured.

   Read-only access to other data model parameters, such as the Sender
   IP address, is foreseen.  Each test session can be uniquely
   identified by the 4-tuple mentioned in Section 3.2.

4.  Data Model Parameters

   This section defines the TWAMP data model using UML [UML] and
   introduces selected parameters associated with the four TWAMP logical
   entities.  The complete TWAMP data model specification is provided in
   the YANG module presented in Section 5.2.

4.1.  Control-Client

   The client container (see Figure 3) holds items that are related to
   the configuration of the TWAMP Control-Client logical entity (recall
   Figure 1).

   The client container includes an administrative configuration
   parameter (client/admin-state) that indicates whether the device is
   allowed to initiate TWAMP-Control connections.

     +-------------+
     | client      |
     +-------------+                   1..* +-----------------------+
     | admin-state |<>----------------------| mode-preference-chain |
     |             |                        +-----------------------+
     |             |  1..* +------------+   | priority              |
     |             |<>-----| key-chain  |   | mode                  |
     +-------------+       +------------+   +-----------------------+
            ^              | key-id     |
            V              | secret-key |
            |              +------------+
            | 0..*
     +------------------------+
     | ctrl-connection        |
     +------------------------+
     | name                   |
     | client-ip              |
     | server-ip              |
     | server-tcp-port        |    0..* +----------------------+
     | control-packet-dscp    |<>-------| test-session-request |
     | key-id                 |         +----------------------+
     | max-count              |         | name                 |
     | client-tcp-port   {ro} |         | sender-ip            |
     | server-start-time {ro} |         | sender-udp-port      |
     | state             {ro} |         | reflector-ip         |
     | selected-mode     {ro} |         | reflector-udp-port   |
     | token             {ro} |         | timeout              |
     | client-iv         {ro} |         | padding-length       |
     +------------------------+         | test-packet-dscp     |
                                        | start-time           |
                 +-------------+ 1      | repeat               |
                 | pm-reg-list |------<>| repeat-interval      |
                 +-------------+        | state           {ro} |
                 | pm-index    |        | sid             {ro} |
                 +-------------+        +----------------------+

              Figure 3: TWAMP Control-Client UML Class Diagram

   The client container holds a list (mode-preference-chain) that
   specifies the mode values according to their preferred order of use
   by the operator of this Control-Client, including the authentication
   and encryption modes.  Specifically, mode-preference-chain lists the
   mode and its corresponding priority, expressed as a 16-bit unsigned
   integer.  Values for the priority start with zero, the highest
   priority, and decreasing priority value is indicated by every
   increase in value by one.

   Depending on the modes available in the Server Greeting, the Control-
   Client MUST choose the highest-priority mode from the configured
   mode-preference-chain list.

   Note that the list of preferred modes may set multiple bit positions
   independently, such as when referring to the extended TWAMP features
   in "Mixed Security Mode for the Two-Way Active Measurement Protocol
   (TWAMP)" [RFC5618], "Individual Session Control Feature for the
   Two-Way Active Measurement Protocol (TWAMP)" [RFC5938], "Two-Way
   Active Measurement Protocol (TWAMP) Reflect Octets and Symmetrical
   Size Features" [RFC6038], and "IKEv2-Derived Shared Secret Key for
   the One-Way Active Measurement Protocol (OWAMP) and Two-Way Active
   Measurement Protocol (TWAMP)" [RFC7717].  If the Control-Client
   cannot determine an acceptable mode, or when the bit combinations do
   not make sense, e.g., authenticated and unauthenticated bits are both
   set, it MUST respond with zero Mode bits set in the Set-Up-Response
   message, indicating that it will not continue with the control
   connection.

   In addition, the client container holds a list named "key-chain",
   which relates key-id with the respective secret-key.  Both the Server
   and the Control-Client use the same mappings from key-id to
   secret-key (in Figure 3); in order for this to work properly, key-id
   must be unique across all systems in the administrative domain.  The
   Server, being prepared to conduct sessions with more than one
   Control-Client, uses key-id to choose the appropriate secret-key; a
   Control-Client would typically have different secret keys for
   different Servers.  The secret-key is the shared secret, of type
   "binary", and the length SHOULD contain at least 128 bits of entropy.
   The key-id and secret-key encoding SHOULD follow Section 9.8 of YANG
   [RFC7950].  The derived key length (dkLen as defined in "PKCS #5:
   Password-Based Cryptography Specification Version 2.1" [RFC8018])
   MUST be 16 octets for the AES Session-key used for encryption and
   32 octets for the HMAC-SHA1 Session-key used for authentication; see
   also Section 6.10 of OWAMP [RFC4656].

   Each client container also holds a list of control connections, where
   each item in the list describes a TWAMP-Control connection initiated
   by this Control-Client.  There SHALL be one ctrl-connection per
   TWAMP-Control (TCP) connection that is to be initiated from this
   device.

   In turn, each ctrl-connection holds a test-session-request list.
   Each test-session-request holds information associated with the
   Control-Client for this test session.  This includes information
   associated with the Request-TW-Session/Accept-Session message
   exchange (see Section 3.5 of TWAMP [RFC5357]).

   There SHALL be one instance of test-session-request for each
   TWAMP-Test session that is to be negotiated by this TWAMP-Control
   connection via a Request-TW-Session/Accept-Session exchange.

   The Control-Client is also responsible for scheduling TWAMP-Test
   sessions; therefore, test-session-request holds information related
   to these actions (e.g., pm-index, repeat-interval).

4.2.  Server

   The server container (see Figure 4) holds items that are related to
   the configuration of the TWAMP Server logical entity (recall
   Figure 1).

   The server container includes an administrative configuration
   parameter (server/admin-state) that indicates whether the device is
   allowed to receive TWAMP-Control connections.

   A device operating in the Server Role cannot configure attributes on
   a per-TWAMP-Control-connection basis, as it has no foreknowledge of
   the incoming TWAMP-Control connections to be received.  Consequently,
   any parameter that the Server might want to apply to an incoming
   control connection must be configured at the overall Server level and
   applied to all incoming TWAMP-Control connections.

       +---------------------+
       | server              |
       +---------------------+
       | admin-state         |   1..* +------------+
       | server-tcp-port     |<>------| key-chain  |
       | servwait            |        +------------+
       | control-packet-dscp |        | key-id     |
       | count               |        | secret-key |
       | max-count           |        +------------+
       | modes               |
       |                     |   0..* +--------------------------+
       |                     |<>------| ctrl-connection          |
       +---------------------+        +--------------------------+
                                      | client-ip           {ro} |
                                      | client-tcp-port     {ro} |
                                      | server-ip           {ro} |
                                      | server-tcp-port     {ro} |
                                      | state               {ro} |
                                      | control-packet-dscp {ro} |
                                      | selected-mode       {ro} |
                                      | key-id              {ro} |
                                      | count               {ro} |
                                      | max-count           {ro} |
                                      | salt                {ro} |
                                      | server-iv           {ro} |
                                      | challenge           {ro} |
                                      +--------------------------+

                  Figure 4: TWAMP Server UML Class Diagram

   Each server container holds a list named "key-chain", which relates
   key-id with the respective secret-key.  As mentioned in Section 4.1,
   both the Server and the Control-Client use the same mapping from
   key-id to the shared secret-key; in order for this to work properly,
   key-id must be unique across all the systems in the administrative
   domain.  The Server, being prepared to conduct sessions with more
   than one Control-Client, uses key-id to choose the appropriate
   secret-key; a Control-Client would typically have different secret
   keys for different Servers.  key-id tells the Server which shared
   secret-key the Control-Client wishes to use for authentication or
   encryption.

   Each incoming control connection active on the Server is represented
   by a ctrl-connection.  There SHALL be one ctrl-connection per
   incoming TWAMP-Control (TCP) connection that is received and active
   on the Server.  Each ctrl-connection can be uniquely identified by
   the 4-tuple {client-ip, client-tcp-port, server-ip, server-tcp-
   port}.  All items in the ctrl-connection list are read-only.

4.3.  Session-Sender

   The session-sender container, illustrated in Figure 5, holds items
   that are related to the configuration of the TWAMP Session-Sender
   logical entity.

   The session-sender container includes an administrative parameter
   (session-sender/admin-state) that controls whether the device is
   allowed to initiate TWAMP-Test sessions.

         +----------------+
         | session-sender |
         +----------------+  0..* +---------------------------+
         | admin-state    |<>-----| test-session              |
         +----------------+       +---------------------------+
                                  | name                      |
                                  | ctrl-connection-name {ro} |
                                  | fill-mode                 |
                                  | number-of-packets         |
                                  | state                {ro} |
                                  | sent-packets         {ro} |
                                  | rcv-packets          {ro} |
                                  | last-sent-seq        {ro} |
                                  | last-rcv-seq         {ro} |
                                  +---------------------------+
                                               ^
                                               V
                                               | 1
                                   +---------------------+
                                   | packet-distribution |
                                   +---------------------+
                                   | periodic / poisson  |
                                   +---------------------+
                                       |           |
                            +-------------------+  |
                            | periodic-interval |  |
                            +-------------------+  |
                                                   |
                                           +--------------+
                                           | lambda       |
                                           | max-interval |
                                           +--------------+

              Figure 5: TWAMP Session-Sender UML Class Diagram

   Each TWAMP-Test session initiated by the Session-Sender will be
   represented by an instance of a test-session object.  There SHALL be
   one instance of test-session for each TWAMP-Test session for which
   packets are being sent.

4.4.  Session-Reflector

   The session-reflector container, illustrated in Figure 6, holds items
   that are related to the configuration of the TWAMP Session-Reflector
   logical entity.

   The session-reflector container includes an administrative parameter
   (session-reflector/admin-state) that controls whether the device is
   allowed to respond to incoming TWAMP-Test sessions.

   A device operating in the Session-Reflector Role cannot configure
   attributes on a per-session basis, as it has no foreknowledge of what
   incoming sessions it will receive.  As such, any parameter that the
   Session-Reflector might want to apply to an incoming TWAMP-Test
   session must be configured at the overall Session-Reflector level and
   applied to all incoming sessions.

                +-------------------+
                | session-reflector |
                +-------------------+
                | admin-state       |
                | refwait           |
                +-------------------+
                         ^
                         V
                         |
                         | 0..*
                +----------------------------------------+
                | test-session                           |
                +----------------------------------------+
                | sid                               {ro} |
                | sender-ip                         {ro} |
                | sender-udp-port                   {ro} |
                | reflector-ip                      {ro} |
                | reflector-udp-port                {ro} |
                | parent-connection-client-ip       {ro} |
                | parent-connection-client-tcp-port {ro} |
                | parent-connection-server-ip       {ro} |
                | parent-connection-server-tcp-port {ro} |
                | test-packet-dscp                  {ro} |
                | sent-packets                      {ro} |
                | rcv-packets                       {ro} |
                | last-sent-seq                     {ro} |
                | last-rcv-seq                      {ro} |
                +----------------------------------------+

            Figure 6: TWAMP Session-Reflector UML Class Diagram

   Each incoming TWAMP-Test session that is active on the Session-
   Reflector SHALL be represented by an instance of a test-session
   object.  All items in the test-session object are read-only.

   Instances of test-session are indexed by a Session Identifier (SID)
   (the sid parameter).  This SID value is auto-allocated by the TWAMP
   Server as test session requests are received and is communicated back
   to the Control-Client in the SID field of the Accept-Session message;
   see Section 4.3 of "Two-Way Active Measurement Protocol (TWAMP)
   Reflect Octets and Symmetrical Size Features" [RFC6038].

   When attempting to retrieve operational data for active test sessions
   from a Session-Reflector device, the user will not know what sessions
   are currently active on that device or what SIDs have been
   auto-allocated for these test sessions.  If the user has network
   access to the Control-Client device, then it is possible to read the
   data for this session under client/ctrl-connection/test-session-
   request/sid and obtain the SID (see Figure 3).  The user may then use
   this SID value as an index to retrieve an individual session-
   reflector/test-session instance on the Session-Reflector device.

   If the user has no network access to the Control-Client device, then
   the only option is to retrieve all test-session instances from the
   Session-Reflector device and then pick out specific test-session
   instances of interest to the user.  This could be problematic if a
   large number of test sessions are currently active on that device.

   Each Session-Reflector TWAMP-Test session contains the following
   4-tuple: {parent-connection-client-ip, parent-connection-client-tcp-
   port, parent-connection-server-ip, parent-connection-server-tcp-
   port}.  This 4-tuple MUST correspond to the equivalent 4-tuple
   {client-ip, client-tcp-port, server-ip, server-tcp-port} in
   server/ctrl-connection.  This 4-tuple allows the user to trace back
   from the TWAMP-Test session to the (parent) TWAMP-Control connection
   that negotiated this test session.

5.  Data Model

   This section formally specifies the TWAMP data model using YANG.

5.1.  YANG Tree Diagram

   This section presents a simplified graphical representation of the
   TWAMP data model using a YANG tree diagram.  Readers should keep in
   mind that the limit of 72 characters per line forces us to introduce
   artificial line breaks in some tree diagram nodes.  Tree diagrams
   used in this document follow the notation defined in "YANG Tree
   Diagrams" [RFC8340].

   Please note that the backslash ('\') character near the end of the
   diagram is used for formatting purposes only (i.e.,
   "reflector-udp-port]" should be treated as part of the same line as
   "[sender-ip sender-udp-port reflector-ip").

   module: ietf-twamp
     +--rw twamp
        +--rw client {control-client}?
        |  +--rw admin-state?             boolean
        |  +--rw mode-preference-chain* [priority]
        |  |  +--rw priority    uint16
        |  |  +--rw mode?       twamp-modes
        |  +--rw key-chain* [key-id]
        |  |  +--rw key-id        string
        |  |  +--rw secret-key?   binary
        |  +--rw ctrl-connection* [name]
        |     +--rw name                    string
        |     +--rw client-ip?              inet:ip-address
        |     +--rw server-ip               inet:ip-address
        |     +--rw server-tcp-port?        inet:port-number
        |     +--rw control-packet-dscp?    inet:dscp
        |     +--rw key-id?                 string
        |     +--rw max-count-exponent?     uint8
        |     +--ro client-tcp-port?        inet:port-number
        |     +--ro server-start-time?      uint64
        |     +--ro repeat-count?           uint64
        |     +--ro state?
        |     |       control-client-connection-state
        |     +--ro selected-mode?          twamp-modes
        |     +--ro token?                  binary
        |     +--ro client-iv?              binary
        |     +--rw test-session-request* [name]
        |        +--rw name                  string
        |        +--rw sender-ip?            inet:ip-address
        |        +--rw sender-udp-port?      union
        |        +--rw reflector-ip          inet:ip-address
        |        +--rw reflector-udp-port?   inet:port-number
        |        +--rw timeout?              uint64
        |        +--rw padding-length?       uint32
        |        +--rw test-packet-dscp?     inet:dscp
        |        +--rw start-time?           uint64
        |        +--rw repeat?               uint32
        |        +--rw repeat-interval?      uint32
        |        +--rw pm-reg-list* [pm-index]
        |        |  +--rw pm-index    uint16
        |        +--ro state?                test-session-state
        |        +--ro sid?                  string
        +--rw server {server}?
        |  +--rw admin-state?           boolean
        |  +--rw server-tcp-port?       inet:port-number
        |  +--rw servwait?              uint32
        |  +--rw control-packet-dscp?   inet:dscp
        |  +--rw count?                 uint8
        |  +--rw max-count-exponent?    uint8
        |  +--rw modes?                 twamp-modes
        |  +--rw key-chain* [key-id]
        |  |  +--rw key-id        string
        |  |  +--rw secret-key?   binary
        |  +--ro ctrl-connection*
        |          [client-ip client-tcp-port server-ip server-tcp-port]
        |     +--ro client-ip              inet:ip-address
        |     +--ro client-tcp-port        inet:port-number
        |     +--ro server-ip              inet:ip-address
        |     +--ro server-tcp-port        inet:port-number
        |     +--ro state?                 server-ctrl-connection-state
        |     +--ro control-packet-dscp?   inet:dscp
        |     +--ro selected-mode?         twamp-modes
        |     +--ro key-id?                string
        |     +--ro count?                 uint8
        |     +--ro max-count-exponent?    uint8
        |     +--ro salt?                  binary
        |     +--ro server-iv?             binary
        |     +--ro challenge?             binary
        +--rw session-sender {session-sender}?
        |  +--rw admin-state?    boolean
        |  +--rw test-session* [name]
        |     +--rw name                    string
        |     +--ro ctrl-connection-name?   string
        |     +--rw fill-mode?              padding-fill-mode
        |     +--rw number-of-packets       uint32
        |     +--rw (packet-distribution)?
        |     |  +--:(periodic)
        |     |  |  +--rw periodic-interval       decimal64
        |     |  +--:(poisson)
        |     |     +--rw lambda                  decimal64
        |     |     +--rw max-interval?           decimal64
        |     +--ro state?                  sender-session-state
        |     +--ro sent-packets?           uint32
        |     +--ro rcv-packets?            uint32
        |     +--ro last-sent-seq?          uint32
        |     +--ro last-rcv-seq?           uint32
        +--rw session-reflector {session-reflector}?
           +--rw admin-state?    boolean
           +--rw refwait?        uint32
           +--ro test-session*
                   [sender-ip sender-udp-port reflector-ip \
                    reflector-udp-port]
              +--ro sid?                                string
              +--ro sender-ip                           inet:ip-address
              +--ro sender-udp-port
              |       dynamic-port-number
              +--ro reflector-ip                        inet:ip-address
              +--ro reflector-udp-port                  inet:port-number
              +--ro parent-connection-client-ip?        inet:ip-address
              +--ro parent-connection-client-tcp-port?  inet:port-number
              +--ro parent-connection-server-ip?        inet:ip-address
              +--ro parent-connection-server-tcp-port?  inet:port-number
              +--ro test-packet-dscp?                   inet:dscp
              +--ro sent-packets?                       uint32
              +--ro rcv-packets?                        uint32
              +--ro last-sent-seq?                      uint32
              +--ro last-rcv-seq?                       uint32

                        Figure 7: YANG Tree Diagram

5.2.  YANG Module

   This section presents the YANG module for the TWAMP data model
   defined in this document.  The module imports definitions from
   "Common YANG Data Types" [RFC6991] and references "Framework for IP
   Performance Metrics" [RFC2330], "Network performance measurement with
   periodic streams" [RFC3432], "A One-way Active Measurement Protocol
   (OWAMP)" [RFC4656], "A Two-Way Active Measurement Protocol (TWAMP)"
   [RFC5357], "Mixed Security Mode for the Two-Way Active Measurement
   Protocol (TWAMP)" [RFC5618], "Network Time Protocol Version 4:
   Protocol and Algorithms Specification" [RFC5905], "Individual Session
   Control Feature for the Two-Way Active Measurement Protocol (TWAMP)"
   [RFC5938], "Two-Way Active Measurement Protocol (TWAMP) Reflect
   Octets and Symmetrical Size Features" [RFC6038], "Advanced Stream and
   Sampling Framework for IP Performance Metrics (IPPM)" [RFC7312],
   "IKEv2-Derived Shared Secret Key for the One-Way Active Measurement
   Protocol (OWAMP) and Two-Way Active Measurement Protocol (TWAMP)"
   [RFC7717], "Well-Known Port Assignments for the One-Way Active
   Measurement Protocol (OWAMP) and the Two-Way Active Measurement
   Protocol (TWAMP)" [RFC8545], and "Registry for Performance Metrics"
   [RFC8911].

   <CODE BEGINS> file "ietf-twamp@2021-11-17.yang"
   module ietf-twamp {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-twamp";
     prefix ietf-twamp;

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

     organization
       "IETF IPPM (IP Performance Metrics) Working Group";
     contact
       "WG Web: <https://datatracker.ietf.org/wg/ippm/documents/>
        WG List: <mailto:ippm@ietf.org>

        Editor: Ruth Civil
                <mailto:ruthcivil@gmail.com>

        Editor: Al Morton
                <mailto:acmorton@att.com>

        Editor: Reshad Rahman
                <mailto:reshad@yahoo.com>

        Editor: Mahesh Jethanandani
                <mailto:mjethanandani@gmail.com>

        Editor: Kostas Pentikousis
                <mailto:kostas.pentikousis@detecon.com>";
     description
       "This YANG module specifies a vendor-independent data
        model for the Two-Way Active Measurement Protocol (TWAMP).

        The data model defines four TWAMP logical entities, namely
        Control-Client, Server, Session-Sender, and Session-Reflector,
        as illustrated in the annotated TWAMP logical model (Figure 1
        of RFC 8913).

        This YANG module uses features to indicate which of the four
        logical entities are supported by a TWAMP implementation.

        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) 2021 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

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

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

     revision 2021-11-17 {
       description
         "Initial revision.

          References RFC 5357, RFC 5618, RFC 5938, RFC 6038, RFC 7717,
          and RFC 8911.";
       reference
         "RFC 8913: Two-Way Active Measurement Protocol (TWAMP) YANG
          Data Model";
     }

     /*
      * Typedefs
      */

     typedef twamp-modes {
       type bits {
         bit unauthenticated {
           position 0;
           description
             "Unauthenticated mode, in which no encryption or
              authentication is applied in TWAMP-Control and
              TWAMP-Test.  KeyID, Token, and Client-IV are not used in
              the Set-Up-Response message.  See Section 3.1 of
              RFC 4656.";
           reference
             "RFC 4656: A One-way Active Measurement Protocol (OWAMP),
                        Section 3.1";
         }
         bit authenticated {
           position 1;
           description
             "Authenticated mode, in which the Control-Client and
              Server possess a shared secret, thus prohibiting
              'theft of service'.  As per Section 6 of RFC 4656,
              in 'authenticated mode, the timestamp is in the clear
              and is not protected cryptographically in any way,
              while the rest of the message has the same protection
              as in encrypted mode.  This mode allows one to trade off
              cryptographic protection against accuracy of
              timestamps.'";
           reference
             "RFC 4656: A One-way Active Measurement Protocol (OWAMP),
                        Section 6";
         }
         bit encrypted {
           position 2;
           description
             "Encrypted mode 'makes it impossible to alter
              timestamps undetectably' (Section 1 of RFC 4656).
              See also Section 4 of RFC 7717.";
           reference
             "RFC 4656: A One-way Active Measurement Protocol (OWAMP),
                        Section 6
              RFC 7717: IKEv2-Derived Shared Secret Key for the One-Way
              Active Measurement Protocol (OWAMP) and Two-Way Active
              Measurement Protocol (TWAMP), Section 4";
         }
         bit unauth-test-encrypt-control {
           position 3;
           description
             "When using the mixed security mode, the TWAMP-Test
              protocol operates in unauthenticated mode and the
              TWAMP-Control protocol operates in encrypted mode.";
           reference
             "RFC 5618: Mixed Security Mode for the Two-Way Active
              Measurement Protocol (TWAMP)";
         }
         bit individual-session-control {
           position 4;
           description
             "This mode enables individual test sessions using
              Session Identifiers.";
           reference
             "RFC 5938: Individual Session Control Feature
              for the Two-Way Active Measurement Protocol (TWAMP)";
         }
         bit reflect-octets {
           position 5;
           description
             "This mode indicates the reflect octets capability.";
           reference
             "RFC 6038: Two-Way Active Measurement Protocol (TWAMP)
              Reflect Octets and Symmetrical Size Features";
         }
         bit symmetrical-size {
           position 6;
           description
             "This mode indicates support for the symmetrical size
              sender test packet format.";
           reference
             "RFC 6038: Two-Way Active Measurement Protocol (TWAMP)
              Reflect Octets and Symmetrical Size Features";
         }
         bit IKEv2Derived {
           position 7;
           description
             "In this mode, the shared key is derived
              from an Internet Key Exchange Protocol Version 2 (IKEv2)
              security association (SA).";
           reference
             "RFC 7717: IKEv2-Derived Shared Secret Key for
              the One-Way Active Measurement Protocol (OWAMP)
              and Two-Way Active Measurement Protocol (TWAMP)";
         }
       }
       description
         "Specifies the configurable TWAMP-Modes supported during a
          TWAMP-Control connection setup between a Control-Client
          and a Server.  Section 7 of RFC 7717 summarizes the
          'TWAMP-Modes' Registry and points to their
          formal specification.";
     }

     typedef control-client-connection-state {
       type enumeration {
         enum active {
           description
             "Indicates an active TWAMP-Control connection to the
              Server.";
         }
         enum idle {
           description
             "Indicates an idle TWAMP-Control connection to the
              Server.";
         }
       }
       description
         "Indicates the Control-Client TWAMP-Control connection
          state.";
     }

     typedef test-session-state {
       type enumeration {
         enum accepted {
           value 0;
           description
             "Indicates an accepted TWAMP-Test session request.";
         }
         enum failed {
           value 1;
           description
             "Indicates a TWAMP-Test session failure due to
              some unspecified reason (catch-all).";
         }
         enum internal-error {
           value 2;
           description
             "Indicates a TWAMP-Test session failure due to
              an internal error.";
         }
         enum not-supported {
           value 3;
           description
             "Indicates a TWAMP-Test session failure because
              some aspect of the TWAMP-Test session request
              is not supported.";
         }
         enum permanent-resource-limit {
           value 4;
           description
             "Indicates a TWAMP-Test session failure due to
              permanent resource limitations.";
         }
         enum temp-resource-limit {
           value 5;
           description
             "Indicates a TWAMP-Test session failure due to
              temporary resource limitations.";
         }
       }
       description
         "Indicates the Control-Client TWAMP-Test session state.";
     }

     typedef server-ctrl-connection-state {
       type enumeration {
         enum active {
           description
             "Indicates an active TWAMP-Control connection
              to the Control-Client.";
         }
         enum servwait {
           description
             "Indicates that the TWAMP-Control connection to the
              Control-Client is in SERVWAIT as per the definition in
              Section 3.1 of RFC 5357.";
           reference
             "RFC 5357: A Two-Way Active Measurement Protocol (TWAMP),
                        Section 3.1";
         }
       }
       description
         "Indicates the Server TWAMP-Control connection state.";
     }

     typedef sender-session-state {
       type enumeration {
         enum active {
           description
             "Indicates that the TWAMP-Test session is active.";
         }
         enum failure {
           description
             "Indicates that the TWAMP-Test session has failed.";
         }
       }
       description
         "Indicates the Session-Sender TWAMP-Test session state.";
     }

     typedef padding-fill-mode {
       type enumeration {
         enum zero {
           description
             "TWAMP-Test packets are padded with all zeros.";
         }
         enum random {
           description
             "TWAMP-Test packets are padded with pseudorandom
              numbers.";
         }
       }
       description
         "Indicates what type of packet padding is used in the
          TWAMP-Test packets.";
     }

     typedef dynamic-port-number {
       type inet:port-number {
         range "49152..65535";
       }
       description
         "Dynamic range for port numbers.";
     }

     /*
      * Features
      */

     feature control-client {
       description
         "Indicates that the device supports configuration of the
          TWAMP Control-Client logical entity.";
     }

     feature server {
       description
         "Indicates that the device supports configuration of the
          TWAMP Server logical entity.";
     }

     feature session-sender {
       description
         "Indicates that the device supports configuration of the
          TWAMP Session-Sender logical entity.";
     }

     feature session-reflector {
       description
         "Indicates that the device supports configuration of the
          TWAMP Session-Reflector logical entity.";
     }

     /*
      * Reusable node groups
      */

     grouping key-management {
       list key-chain {
         key "key-id";
         leaf key-id {
           type string {
             length "1..80";
           }
           description
             "KeyID used for a TWAMP-Control connection.  As per
              Section 3.1 of RFC 4656, KeyID is 'a UTF-8 string, up to
              80 octets in length' and is used to select which 'shared
              secret the client' (Control-Client) 'wishes to use to
              authenticate or encrypt'.";
         }
         leaf secret-key {
           type binary;
           description
             "The secret key corresponding to the KeyID for this
              TWAMP-Control connection.";
         }
         description
           "Relates KeyIDs with their respective secret keys
            in a TWAMP-Control connection.";
       }
       description
         "Used by the Control-Client and Server for TWAMP-Control
          key management.";
     }

     grouping maintenance-statistics {
       leaf sent-packets {
         type uint32;
         config false;
         description
           "Indicates the number of packets sent.";
       }
       leaf rcv-packets {
         type uint32;
         config false;
         description
           "Indicates the number of packets received.";
       }
       leaf last-sent-seq {
         type uint32;
         config false;
         description
           "Indicates the last sent sequence number.";
       }
       leaf last-rcv-seq {
         type uint32;
         config false;
         description
           "Indicates the last received sequence number.";
       }
       description
         "Used for TWAMP-Test maintenance statistics.";
     }

     grouping count {
       leaf count {
         type uint8 {
           range "10..31";
         }
         default "15";
         description
           "Parameter communicated to the Control-Client as part of
            the Server Greeting message and used for deriving a key
            from a shared secret as per Section 3.1 of RFC 4656:
            MUST be a power of 2 and at least 1024.  It is configured
            by providing said power.  For example, configuring 20 here
            means count 2^20 = 1048576.  The default is 15,
            meaning 2^15 = 32768.";
       }
       description
         "Reusable data structure for count, which is used in both the
          Server and the Control-Client.";
     }

     grouping max-count-exponent {
       leaf max-count-exponent {
         type uint8 {
           range "10..31";
         }
         default "20";
         description
           "This parameter limits the maximum Count value, which MUST
            be a power of 2 and at least 1024 as per RFC 5357.  It is
            configured by providing said power.  For example,
            configuring 10 here means max count 2^10 = 1024.
            The default is 20, meaning 2^20 = 1048576.

            A TWAMP Server uses this configured value in the
            Server Greeting message sent to the Control-Client.

            A TWAMP Control-Client uses this configured value to
            prevent denial-of-service (DoS) attacks by closing the
            control connection to the Server if it 'receives a
            Server-Greeting message with Count greater that [sic] its
            maximum configured value', as per Section 6 of RFC 5357.

            Further, note that according to Section 6 of RFC 5357:

            'If an attacking system set the maximum value in Count
            (2**32), then the system under attack would stall for a
            significant period of time while it attempts to generate
            keys.  Therefore, TWAMP-compliant systems SHOULD have a
            configuration control to limit the maximum Count value.
            The default maximum Count value SHOULD be 32768.'

            In the case of this document, the default max-count-exponent
            value SHOULD be 15, which corresponds to a maximum value of
            2**15 or 32768.

            RFC 5357 does not qualify 'significant period' in terms of
            time, but it is clear that this depends on the processing
            capacity available, and operators need to pay attention to
            this security consideration.";
       }
       description
         "Reusable data structure for max-count that is used in both
          the client (Control-Client) container and the server
          container.";
     }

     /*
      * Configuration data nodes
      */

     container twamp {
       description
         "TWAMP logical entity configuration grouping of four models
          that correspond to the four TWAMP logical entities
          Control-Client, Server, Session-Sender, and Session-Reflector
          as illustrated in Figure 1 of RFC 8913.";
       container client {
         if-feature "control-client";
         description
           "Configuration of the TWAMP Control-Client logical entity.";
         leaf admin-state {
           type boolean;
           default "true";
           description
             "Indicates whether the device is allowed to operate as a
              TWAMP Control-Client.";
         }
         list mode-preference-chain {
           key "priority";
           unique "mode";
           leaf priority {
             type uint16;
             description
               "Indicates the Control-Client mode preference priority,
                expressed as a 16-bit unsigned integer.  Values for the
                priority start with zero, the highest priority, and
                decreasing priority value is indicated by every increase
                in value by one.";
           }
           leaf mode {
             type twamp-modes;
             description
               "The supported TWAMP-Modes matching the corresponding
                priority.";
           }
           description
             "Indicates the Control-Client preferred order of use of
              the supported TWAMP-Modes.

              Depending on the modes available in the TWAMP Server
              Greeting message (see Figure 2 of RFC 7717), the
              Control-Client MUST choose the highest-priority
              mode from the configured mode-preference-chain list.";
         }
         uses key-management;
         list ctrl-connection {
           key "name";
           description
             "List of TWAMP Control-Client control connections.
              Each item in the list describes a control connection
              that will be initiated by this Control-Client.";
           leaf name {
             type string;
             description
               "A unique name used as a key to identify this
                individual TWAMP-Control connection on the
                Control-Client device.";
           }
           leaf client-ip {
             type inet:ip-address;
             description
               "The IP address of the local Control-Client device,
                to be placed in the source IP address field of the
                IP header in TWAMP-Control (TCP) packets belonging
                to this control connection.  If not configured, the
                device SHALL choose its own source IP address.";
           }
           leaf server-ip {
             type inet:ip-address;
             mandatory true;
             description
               "The IP address of the remote Server device to which
                the TWAMP-Control connection will be initiated.";
           }
           leaf server-tcp-port {
             type inet:port-number;
             default "862";
             description
               "This parameter defines the TCP port number that is
                to be used by this outgoing TWAMP-Control connection.
                Typically, this is the well-known TWAMP-Control
                port number (862) as per RFC 5357.  However, there are
                known realizations of TWAMP in the field that were
                implemented before this well-known port number was
                allocated.  These early implementations allowed the
                port number to be configured.  This parameter is
                therefore provided for backward-compatibility
                reasons.";
           }
           leaf control-packet-dscp {
             type inet:dscp;
             default "0";
             description
               "The Differentiated Services Code Point (DSCP) value
                to be placed in the IP header of TWAMP-Control (TCP)
                packets generated by this Control-Client.";
           }
           leaf key-id {
             type string {
               length "1..80";
             }
             description
               "Indicates the KeyID value selected for this
                TWAMP-Control connection.";
           }
           uses max-count-exponent;
           leaf client-tcp-port {
             type inet:port-number;
             config false;
             description
               "Indicates the source TCP port number used in the
                TWAMP-Control packets belonging to this control
                connection.";
           }
           leaf server-start-time {
             type uint64;
             config false;
             description
               "Indicates the Start-Time advertised by the Server in
                the Server-Start message (RFC 4656, Section 3.1),
                representing the time when the current
                instantiation of the Server started operating.
                The timestamp format follows RFC 5905, according to
                Section 4.1.2 of RFC 4656.";
             reference
               "RFC 4656: A One-way Active Measurement Protocol (OWAMP),
                Sections 3.1 and 4.1.2
                RFC 5905: Network Time Protocol Version 4: Protocol and
                Algorithms Specification";
           }
           leaf repeat-count {
             type uint64;
             config false;
             description
               "Indicates how many times the test session has been
                repeated.  When a test is running, this value will be
                greater than 0.  If the repeat parameter is non-zero,
                this value is smaller than or equal to the repeat
                parameter.";
           }
           leaf state {
             type control-client-connection-state;
             config false;
             description
               "Indicates the current TWAMP-Control connection state.";
           }
           leaf selected-mode {
             type twamp-modes;
             config false;
             description
               "The TWAMP-Modes that the Control-Client has chosen for
                this control connection as set in the Mode field of
                the Set-Up-Response message.";
             reference
               "RFC 4656: A One-way Active Measurement Protocol (OWAMP),
                          Section 3.1";
           }
           leaf token {
             type binary {
               length "64";
             }
             config false;
             description
               "This parameter holds the 64 octets containing the
                concatenation of a 16-octet Challenge, a 16-octet AES
                Session-key used for encryption, and a 32-octet
                HMAC-SHA1 Session-key used for authentication; see
                also the last paragraph of Section 6.10 of RFC 4656.

                If the mode defined in RFC 7717 is selected
                (selected-mode), Token is limited to 16 octets.";
             reference
               "RFC 4656: A One-way Active Measurement Protocol (OWAMP),
                          Section 6.10
                RFC 7717: IKEv2-Derived Shared Secret Key for the
                One-Way Active Measurement Protocol (OWAMP) and
                Two-Way Active Measurement Protocol (TWAMP)";
           }
           leaf client-iv {
             type binary {
               length "16";
             }
             config false;
             description
               "Indicates the Control-Client Initialization Vector
                (Client-IV), which is generated randomly by the
                Control-Client.  As per RFC 4656:

                'Client-IV merely needs to be unique (i.e., it MUST
                never be repeated for different sessions using the
                same secret key; a simple way to achieve that without
                the use of cumbersome state is to generate the
                Client-IV values using a cryptographically secure
                pseudo-random number source.'

                If the mode defined in RFC 7717 is selected
                (selected-mode), Client-IV is limited to 12 octets.";
             reference
               "RFC 4656: A One-way Active Measurement Protocol (OWAMP)
                RFC 7717: IKEv2-Derived Shared Secret Key for the
                One-Way Active Measurement Protocol (OWAMP) and
                Two-Way Active Measurement Protocol (TWAMP)";
           }
           list test-session-request {
             key "name";
             description
               "Information associated with the Control-Client
                for this test session.";
             leaf name {
               type string;
               description
                 "A unique name to be used for identification of
                  this TWAMP-Test session on the Control-Client.";
             }
             leaf sender-ip {
               type inet:ip-address;
               description
                 "The IP address of the Session-Sender device,
                  which is to be placed in the source IP address
                  field of the IP header in TWAMP-Test (UDP) packets
                  belonging to this test session.  This value will be
                  used to populate the Sender Address field of the
                  Request-TW-Session message.

                  If not configured, the device SHALL choose its own
                  source IP address.";
             }
             leaf sender-udp-port {
               type union {
                 type dynamic-port-number;
                 type enumeration {
                   enum autoallocate {
                     description
                       "Indicates that the Control-Client will
                        auto-allocate the TWAMP-Test (UDP) port number
                        from the dynamic port range.";
                   }
                 }
               }
               default "autoallocate";
               description
                 "The UDP port number that is to be used by
                  the Session-Sender for this TWAMP-Test session.
                  The number is restricted to the dynamic port range.

                  By default, the Control-Client SHALL auto-allocate a
                  UDP port number for this TWAMP-Test session.

                  The configured (or auto-allocated) value is
                  advertised in the Sender Port field of the
                  Request-TW-Session message (see Section 3.5 of
                  RFC 5357).  Note that in the scenario where a device
                  auto-allocates a UDP port number for a session and
                  the repeat parameter for that session indicates that
                  it should be repeated, the device is free to
                  auto-allocate a different UDP port number when it
                  negotiates the next (repeated) iteration of this
                  session.";
             }
             leaf reflector-ip {
               type inet:ip-address;
               mandatory true;
               description
                 "The IP address belonging to the remote
                  Session-Reflector device to which the TWAMP-Test
                  session will be initiated.  This value will be
                  used to populate the Receiver Address field of
                  the Request-TW-Session message.";
             }
             leaf reflector-udp-port {
               type inet:port-number {
                 range "862 | 49152..65535";
               }
               description
                 "This parameter defines the UDP port number that
                  will be used by the Session-Reflector for
                  this TWAMP-Test session.  The default number is
                  within the dynamic port range and is to be placed
                  in the Receiver Port field of the Request-TW-Session
                  message.  The well-known port (862) MAY be used.";
               reference
                 "RFC 8545: Well-Known Port Assignments for the One-Way
                  Active Measurement Protocol (OWAMP) and the Two-Way
                  Active Measurement Protocol (TWAMP)";
             }
             leaf timeout {
               type uint64;
               units "seconds";
               default "2";
               description
                 "The length of time (in seconds) that the
                  Session-Reflector should continue to respond to
                  packets belonging to this TWAMP-Test session after
                  a Stop-Sessions TWAMP-Control message has been
                  received.

                  This value will be placed in the Timeout field of
                  the Request-TW-Session message.";
               reference
                 "RFC 5357: A Two-Way Active Measurement Protocol
                  (TWAMP), Section 3.5";
             }
             leaf padding-length {
               type uint32 {
                 range "64..4096";
               }
               description
                 "The number of padding bytes to be added to the
                  TWAMP-Test (UDP) packets generated by the
                  Session-Sender.

                  This value will be placed in the Padding Length
                  field of the Request-TW-Session message.";
               reference
                 "RFC 4656: A One-way Active Measurement Protocol
                  (OWAMP), Section 3.5";
             }
             leaf test-packet-dscp {
               type inet:dscp;
               default "0";
               description
                 "The DSCP value to be placed in the IP header
                  of TWAMP-Test packets generated by the
                  Session-Sender and in the UDP header of the
                  TWAMP-Test response packets generated by the
                  Session-Reflector for this test session.

                  This value will be placed in the Type-P Descriptor
                  field of the Request-TW-Session message.";
               reference
                 "RFC 5357: A Two-Way Active Measurement Protocol
                  (TWAMP)";
             }
             leaf start-time {
               type uint64;
               default "0";
               description
                 "Time when the session is to be started
                  (but not before the TWAMP Start-Sessions command
                  is issued; see Section 3.4 of RFC 5357).

                  The start-time value is placed in the Start Time
                  field of the Request-TW-Session message.

                  The timestamp format follows RFC 5905 as per
                  Section 3.5 of RFC 4656.

                  The default value of 0 indicates that the session
                  will be started as soon as the Start-Sessions
                  message is received.";
             }
             leaf repeat {
               type uint32 {
                 range "0..4294967295";
               }
               default "0";
               description
                 "This value determines if the TWAMP-Test session must
                  be repeated.  When a test session has completed, the
                  repeat parameter is checked.

                  The default value of 0 indicates that the session
                  MUST NOT be repeated.

                  If the repeat value is 1 through 4,294,967,294,
                  then the test session SHALL be repeated using the
                  information in the repeat-interval parameter, and the
                  parent TWAMP-Control connection for this test
                  session is restarted to negotiate a new instance
                  of this TWAMP-Test session.

                  A value of 4,294,967,295 indicates that the test
                  session SHALL be repeated *forever* using the
                  information in the repeat-interval parameter and
                  SHALL NOT decrement the value.";
             }
             leaf repeat-interval {
               when "../repeat!='0'" {
                 description
                   "This parameter determines the timing of repeated
                    TWAMP-Test sessions when repeat is more than 0.

                    When the value of repeat-interval is 0, the
                    negotiation of a new test session SHALL begin
                    immediately after the previous test session
                    completes.  Otherwise, the Control-Client will
                    wait for the number of seconds specified in the
                    repeat-interval parameter before negotiating the
                    new instance of this TWAMP-Test session.";
               }
               type uint32;
               units "seconds";
               default "0";
               description
                 "Repeat interval (in seconds).";
             }
             list pm-reg-list {
               key "pm-index";
               leaf pm-index {
                 type uint16;
                 description
                   "Numerical index value of a Registered Metric in
                    the Performance Metrics Registry (see RFC 8911).
                    Output statistics are specified in the
                    corresponding Registry Entry.";
               }
               description
                 "A list of one or more Performance Metrics Registry
                  Index values, which communicate packet stream
                  characteristics along with one or more metrics
                  to be measured.

                  All members of the pm-reg-list MUST have the same
                  stream characteristics, such that they combine
                  to specify all metrics that shall be measured on
                  a single stream.";
               reference
                 "RFC 8911: Registry for Performance Metrics";
             }
             leaf state {
               type test-session-state;
               config false;
               description
                 "Indicates the TWAMP-Test session state -- an accepted
                  request or an indication of an error.";
               reference
                 "RFC 5357: A Two-Way Active Measurement Protocol
                  (TWAMP), Section 3.5";
             }
             leaf sid {
               type string;
               config false;
               description
                 "The Session Identifier (SID) allocated by the Server
                  for this TWAMP-Test session and communicated back to
                  the Control-Client in the SID field of the
                  Accept-Session message.";
               reference
                 "RFC 6038: Two-Way Active Measurement Protocol (TWAMP)
                  Reflect Octets and Symmetrical Size
                  Features, Section 4.3";
             }
           }
         }
       }
       container server {
         if-feature "server";
         description
           "Configuration of the TWAMP Server logical entity.";
         leaf admin-state {
           type boolean;
           default "true";
           description
             "Indicates whether the device is allowed to operate
              as a TWAMP Server.";
         }
         leaf server-tcp-port {
           type inet:port-number;
           default "862";
           description
             "This parameter defines the well-known TCP port number
              that is used by TWAMP-Control.  The Server will listen
              on this port number for incoming TWAMP-Control
              connections.  Although this is defined as a fixed value
              (862) in RFC 5357, there are several realizations of
              TWAMP in the field that were implemented before this
              well-known port number was allocated.  These early
              implementations allowed the port number to be
              configured.  This parameter is therefore provided for
              backward-compatibility reasons.";
         }
         leaf servwait {
           type uint32 {
             range "1..604800";
           }
           units "seconds";
           default "900";
           description
             "TWAMP-Control (TCP) session timeout, in seconds.
              According to Section 3.1 of RFC 5357:

              'The Server MAY discontinue any established control
              connection when no packet associated with that
              connection has been received within SERVWAIT seconds.'";
         }
         leaf control-packet-dscp {
           type inet:dscp;
           description
             "The DSCP value to be placed in the IP header of
              TWAMP-Control (TCP) packets generated by the Server.

              Section 3.1 of RFC 5357 specifies that the Server
              SHOULD use the DSCP value from the Control-Client's
              TCP SYN.  However, for practical purposes, TWAMP will
              typically be implemented using a general-purpose TCP
              stack provided by the underlying operating system,
              and such a stack may not provide this information to the
              user.  Consequently, it is not always possible to
              implement the behavior described in RFC 5357 in an
              OS-portable version of TWAMP.

              The default behavior if this item is not set is to use
              the DSCP value from the Control-Client's TCP SYN.";
           reference
             "RFC 5357: A Two-Way Active Measurement Protocol (TWAMP),
              Section 3.1";
         }
         uses count;
         uses max-count-exponent;
         leaf modes {
           type twamp-modes;
           description
             "The bit mask of TWAMP-Modes this Server instance is
              willing to support; see the IANA 'TWAMP-Modes' Registry.";
         }
         uses key-management;
         list ctrl-connection {
           key "client-ip client-tcp-port server-ip server-tcp-port";
           config false;
           description
             "List of all incoming TWAMP-Control (TCP) connections.";
           leaf client-ip {
             type inet:ip-address;
             description
               "The IP address on the remote Control-Client device,
                which is the source IP address used in the
                TWAMP-Control (TCP) packets belonging to this control
                connection.";
           }
           leaf client-tcp-port {
             type inet:port-number;
             description
               "The source TCP port number used in the TWAMP-Control
                (TCP) packets belonging to this control connection.";
           }
           leaf server-ip {
             type inet:ip-address;
             description
               "The IP address of the local Server device, which is
                the destination IP address used in the
                TWAMP-Control (TCP) packets belonging to this control
                connection.";
           }
           leaf server-tcp-port {
             type inet:port-number;
             description
               "The destination TCP port number used in the
                TWAMP-Control (TCP) packets belonging to this
                control connection.  This will usually be the
                same value as the server-tcp-port configured
                under twamp/server.  However, in the event that
                the user reconfigured server/server-tcp-port
                after this control connection was initiated, this
                value will indicate the server-tcp-port that is
                actually in use for this control connection.";
           }
           leaf state {
             type server-ctrl-connection-state;
             description
               "Indicates the Server TWAMP-Control connection state.";
           }
           leaf control-packet-dscp {
             type inet:dscp;
             description
               "The DSCP value used in the IP header of the
                TWAMP-Control (TCP) packets sent by the Server
                for this control connection.  This will usually
                be the same value as is configured in the
                control-packet-dscp parameter under the twamp/server
                container.  However, in the event that the user
                reconfigures server/dscp after this control
                connection is already in progress, this read-only
                value will show the actual DSCP value in use by this
                TWAMP-Control connection.";
           }
           leaf selected-mode {
             type twamp-modes;
             description
               "The mode that was chosen for this TWAMP-Control
                connection as set in the Mode field of the
                Set-Up-Response message.";
           }
           leaf key-id {
             type string {
               length "1..80";
             }
             description
               "The KeyID value that is in use by this TWAMP-Control
                connection as selected by the Control-Client.";
           }
           uses count {
             description
               "The Count value that is in use by this TWAMP-Control
                connection.  This will usually be the same value
                as is configured under twamp/server.  However, in the
                event that the user reconfigures server/count
                after this control connection is already in progress,
                this read-only value will show the actual count that
                is in use for this TWAMP-Control connection.";
           }
           uses max-count-exponent {
             description
               "This read-only value indicates the actual max-count in
                use for this control connection.  Usually, this would be
                the same value as is configured under twamp/server.";
           }
           leaf salt {
             type binary {
               length "16";
             }
             description
               "A parameter used in deriving a key from a
                shared secret, as described in Section 3.1 of RFC 4656.
                It is communicated to the Control-Client as part of
                the Server Greeting message.";
           }
           leaf server-iv {
             type binary {
               length "16";
             }
             description
               "The Server Initialization Vector (Server-IV)
                generated randomly by the Server.";
           }
           leaf challenge {
             type binary {
               length "16";
             }
             description
               "A random sequence of octets generated by the Server.
                As described in client/token, a Challenge is used
                by the Control-Client to prove possession of a
                shared secret.";
           }
         }
       }
       container session-sender {
         if-feature "session-sender";
         description
           "Configuration of the TWAMP Session-Sender logical entity.";
         leaf admin-state {
           type boolean;
           default "true";
           description
             "Indicates whether the device is allowed to operate
              as a TWAMP Session-Sender.";
         }
         list test-session {
           key "name";
           description
             "List of TWAMP Session-Sender test sessions.";
           leaf name {
             type string;
             description
               "A unique name for this TWAMP-Test session to be used
                for identifying this test session by the
                Session-Sender logical entity.";
           }
           leaf ctrl-connection-name {
             type string;
             config false;
             description
               "The name of the parent TWAMP-Control connection that
                is responsible for negotiating this TWAMP-Test
                session.";
           }
           leaf fill-mode {
             type padding-fill-mode;
             default "zero";
             description
               "Indicates whether the padding added to the
                TWAMP-Test (UDP) packets (1) will contain pseudorandom
                numbers or (2) should consist of all zeros, as per
                Section 4.2.1 of RFC 5357.";
           }
           leaf number-of-packets {
             type uint32;
             mandatory true;
             description
               "The overall number of TWAMP-Test (UDP) packets to be
                transmitted by the Session-Sender for this test
                session.";
           }
           choice packet-distribution {
             description
               "Indicates the distribution to be used for transmitting
                the TWAMP-Test (UDP) packets.";
             case periodic {
               leaf periodic-interval {
                 type decimal64 {
                   fraction-digits 5;
                 }
                 units "seconds";
                 mandatory true;
                 description
                   "Indicates the time to wait (in seconds) between
                    the first bits of TWAMP-Test (UDP) packet
                    transmissions for this test session.";
                 reference
                   "RFC 3432: Network performance measurement with
                    periodic streams";
               }
             }
             case poisson {
               leaf lambda {
                 type decimal64 {
                   fraction-digits 5;
                 }
                 units "seconds";
                 mandatory true;
                 description
                   "Indicates the average time interval (in seconds)
                    between packets in the Poisson distribution.
                    The packet is calculated using the reciprocal of
                    lambda and the TWAMP-Test packet size (which
                    depends on the selected mode and the packet
                    padding).";
                 reference
                   "RFC 2330: Framework for IP Performance Metrics";
               }
               leaf max-interval {
                 type decimal64 {
                   fraction-digits 5;
                 }
                 units "seconds";
                 description
                   "Indicates the maximum time (in seconds)
                    between packet transmissions.";
                 reference
                   "RFC 7312: Advanced Stream and Sampling Framework
                    for IP Performance Metrics (IPPM)";
               }
             }
           }
           leaf state {
             type sender-session-state;
             config false;
             description
               "Indicates the Session-Sender test session state.";
           }
           uses maintenance-statistics;
         }
       }
       container session-reflector {
         if-feature "session-reflector";
         description
           "Configuration of the TWAMP Session-Reflector logical
            entity.";
         leaf admin-state {
           type boolean;
           default "true";
           description
             "Indicates whether the device is allowed to operate
              as a TWAMP Session-Reflector.";
         }
         leaf refwait {
           type uint32 {
             range "1..604800";
           }
           units "seconds";
           default "900";
           description
             "The Session-Reflector MAY discontinue any session that
              has been started when no packet associated with that
              session has been received for REFWAIT seconds.  As per
              Section 3.1 of RFC 5357, this timeout allows a
              Session-Reflector to free up resources in case of
              failure.";
         }
         list test-session {
           key "sender-ip sender-udp-port
                reflector-ip reflector-udp-port";
           config false;
           description
             "TWAMP Session-Reflector test sessions.";
           leaf sid {
             type string;
             description
               "An auto-allocated identifier for this TWAMP-Test
                session that is unique within the context of this
                Server/Session-Reflector device only.  This value
                is communicated to the Control-Client that
                requested the test session in the SID field of the
                Accept-Session message.";
           }
           leaf sender-ip {
             type inet:ip-address;
             description
               "The IP address on the remote device, which is the
                source IP address used in the TWAMP-Test (UDP) packets
                belonging to this test session.";
           }
           leaf sender-udp-port {
             type dynamic-port-number;
             description
               "The source UDP port used in the TWAMP-Test packets
                belonging to this test session.";
           }
           leaf reflector-ip {
             type inet:ip-address;
             description
               "The IP address of the local Session-Reflector
                device, which is the destination IP address used
                in the TWAMP-Test (UDP) packets belonging to this test
                session.";
           }
           leaf reflector-udp-port {
             type inet:port-number {
               range "862 | 49152..65535";
             }
             description
               "The destination UDP port number used in the
                TWAMP-Test (UDP) test packets belonging to this
                test session.";
           }
           leaf parent-connection-client-ip {
             type inet:ip-address;
             description
               "The IP address on the Control-Client device, which
                is the source IP address used in the TWAMP-Control
                (TCP) packets belonging to the parent control
                connection that negotiated this test session.";
           }
           leaf parent-connection-client-tcp-port {
             type inet:port-number;
             description
               "The source TCP port number used in the TWAMP-Control
                (TCP) packets belonging to the parent control
                connection that negotiated this test session.";
           }
           leaf parent-connection-server-ip {
             type inet:ip-address;
             description
               "The IP address of the Server device, which is the
                destination IP address used in the TWAMP-Control
                (TCP) packets belonging to the parent control
                connection that negotiated this test session.";
           }
           leaf parent-connection-server-tcp-port {
             type inet:port-number;
             description
               "The destination TCP port number used in the
                TWAMP-Control (TCP) packets belonging to the parent
                control connection that negotiated this test
                session.";
           }
           leaf test-packet-dscp {
             type inet:dscp;
             description
               "The DSCP value present in the IP header of
                TWAMP-Test (UDP) packets belonging to this session.";
           }
           uses maintenance-statistics;
         }
       }
     }
   }
   <CODE ENDS>

6.  Data Model Examples

   This section presents simple but complete examples of configuring all
   four entities in Figure 1, based on the YANG module specified in
   Section 5.  The examples are illustrative in nature but aim to be
   self-contained, i.e., were they to be executed in a real TWAMP
   implementation, they would lead to correctly configured test
   sessions.  For completeness, examples are provided for both IPv4 and
   IPv6.  The examples are shown using XML [W3C.REC-xml-20081126].

   More elaborate examples, which also include authentication
   parameters, are provided in Appendix A.

6.1.  Control-Client

   Figure 8 shows a configuration example for a Control-Client with
   client/admin-state enabled.  In a real implementation following
   Figure 2, this would permit the initiation of TWAMP-Control
   connections and TWAMP-Test sessions.

   <?xml version="1.0" encoding="utf-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <client>
         <admin-state>true</admin-state>
       </client>
     </twamp>
   </config>

          Figure 8: XML Instance Enabling Control-Client Operation

   The following example shows a Control-Client with two instances of
   client/ctrl-connection -- one called "RouterA" and another called
   "RouterB".  Each TWAMP-Control connection is to a different Server.
   The control connection named "RouterA" has two test session requests.
   The TWAMP-Control connection named "RouterB" has no TWAMP-Test
   session requests.

   <?xml version="1.0" encoding="utf-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <client>
         <admin-state>true</admin-state>
         <ctrl-connection>
           <name>RouterA</name>
           <client-ip>203.0.113.1</client-ip>
           <server-ip>203.0.113.2</server-ip>
           <test-session-request>
             <name>Test1</name>
             <sender-ip>203.0.113.3</sender-ip>
             <sender-udp-port>54001</sender-udp-port>
             <reflector-ip>203.0.113.4</reflector-ip>
             <reflector-udp-port>50001</reflector-udp-port>
             <start-time>0</start-time>
           </test-session-request>
           <test-session-request>
             <name>Test2</name>
             <sender-ip>203.0.113.1</sender-ip>
             <sender-udp-port>54001</sender-udp-port>
             <reflector-ip>203.0.113.2</reflector-ip>
             <reflector-udp-port>50001</reflector-udp-port>
             <start-time>0</start-time>
           </test-session-request>
         </ctrl-connection>
         <ctrl-connection>
           <name>RouterB</name>
           <client-ip>203.0.113.1</client-ip>
           <server-ip>203.0.113.3</server-ip>
         </ctrl-connection>
       </client>
     </twamp>
   </config>

   <?xml version="1.0" encoding="utf-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <client>
         <admin-state>true</admin-state>
         <ctrl-connection>
           <name>RouterA</name>
           <client-ip>2001:db8:203:0:113::1</client-ip>
           <server-ip>2001:db8:203:0:113::2</server-ip>
           <test-session-request>
             <name>Test1</name>
             <sender-ip>2001:db8:203:1:113::3</sender-ip>
             <sender-udp-port>54000</sender-udp-port>
             <reflector-ip>2001:db8:203:1:113::4</reflector-ip>
             <reflector-udp-port>55000</reflector-udp-port>
             <start-time>0</start-time>
           </test-session-request>
           <test-session-request>
             <name>Test2</name>
             <sender-ip>2001:db8:203:0:113::1</sender-ip>
             <sender-udp-port>54001</sender-udp-port>
             <reflector-ip>2001:db8:203:0:113::2</reflector-ip>
             <reflector-udp-port>55001</reflector-udp-port>
             <start-time>0</start-time>
           </test-session-request>
         </ctrl-connection>
         <ctrl-connection>
           <name>RouterB</name>
           <client-ip>2001:db8:203:0:113::1</client-ip>
           <server-ip>2001:db8:203:0:113::3</server-ip>
         </ctrl-connection>
       </client>
     </twamp>
   </config>

6.2.  Server

   Figure 9 shows a configuration example for a Server with
   server/admin-state enabled, which permits a device following Figure 2
   to respond to TWAMP-Control connections and TWAMP-Test sessions.

   <?xml version="1.0" encoding="utf-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <server>
         <admin-state>true</admin-state>
       </server>
     </twamp>
   </config>

              Figure 9: XML Instance Enabling Server Operation

   The following example presents a Server with the TWAMP-Control
   connection corresponding to the control connection name
   (client/ctrl-connection/name) "RouterA" presented in Section 6.1.

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <server>
         <admin-state>true</admin-state>
         <ctrl-connection>
           <client-ip>203.0.113.1</client-ip>
           <client-tcp-port>16341</client-tcp-port>
           <server-ip>203.0.113.2</server-ip>
           <server-tcp-port>862</server-tcp-port>
           <state>active</state>
         </ctrl-connection>
       </server>
     </twamp>
   </data>

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <server>
         <admin-state>true</admin-state>
         <ctrl-connection>
           <client-ip>2001:db8:203:0:113::1</client-ip>
           <client-tcp-port>16341</client-tcp-port>
           <server-ip>2001:db8:203:0:113::2</server-ip>
           <server-tcp-port>862</server-tcp-port>
           <state>active</state>
         </ctrl-connection>
       </server>
     </twamp>
   </data>

6.3.  Session-Sender

   Figure 10 shows a configuration example for a Session-Sender with
   session-sender/admin-state enabled, which permits a device following
   Figure 2 to initiate TWAMP-Test sessions.

   <?xml version="1.0" encoding="utf-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-sender>
         <admin-state>true</admin-state>
       </session-sender>
     </twamp>
   </config>

         Figure 10: XML Instance Enabling Session-Sender Operation

   The following configuration example shows a Session-Sender with the
   two TWAMP-Test sessions presented in Section 6.1.

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-sender>
         <admin-state>true</admin-state>
         <test-session>
           <name>Test1</name>
           <ctrl-connection-name>RouterA</ctrl-connection-name>
           <number-of-packets>900</number-of-packets>
           <periodic-interval>1</periodic-interval>
         </test-session>
         <test-session>
           <name>Test2</name>
           <ctrl-connection-name>RouterA</ctrl-connection-name>
           <number-of-packets>900</number-of-packets>
           <lambda>1</lambda>
           <max-interval>2</max-interval>
         </test-session>
       </session-sender>
     </twamp>
   </data>

6.4.  Session-Reflector

   This configuration example shows a Session-Reflector with
   session-reflector/admin-state enabled, which permits a device
   following Figure 2 to respond to TWAMP-Test sessions.

   <?xml version="1.0" encoding="utf-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-reflector>
         <admin-state>true</admin-state>
       </session-reflector>
     </twamp>
   </config>

        Figure 11: XML Instance Enabling Session-Reflector Operation

   The following example shows the two Session-Reflector TWAMP-Test
   sessions corresponding to the test sessions presented in Section 6.3.

      |  Note: '\' line wrapping is for formatting only.

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-reflector>
         <admin-state>true</admin-state>
         <test-session>
           <sender-ip>203.0.113.3</sender-ip>
           <sender-udp-port>54000</sender-udp-port>
           <reflector-ip>203.0.113.4</reflector-ip>
           <reflector-udp-port>50001</reflector-udp-port>
           <sid>1232</sid>
           <parent-connection-client-ip>203.0.113.1</parent-connection-\
   client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>203.0.113.2</parent-connection-\
   server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <sent-packets>2</sent-packets>
           <rcv-packets>2</rcv-packets>
           <last-sent-seq>1</last-sent-seq>
           <last-rcv-seq>1</last-rcv-seq>
         </test-session>
         <test-session>
           <sender-ip>203.0.113.1</sender-ip>
           <sender-udp-port>54001</sender-udp-port>
           <reflector-ip>192.0.2.2</reflector-ip>
           <reflector-udp-port>50001</reflector-udp-port>
           <sid>178943</sid>
           <parent-connection-client-ip>203.0.113.1</parent-connection-\
   client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>203.0.113.2</parent-connection-\
   server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <sent-packets>21</sent-packets>
           <rcv-packets>21</rcv-packets>
           <last-sent-seq>20</last-sent-seq>
           <last-rcv-seq>20</last-rcv-seq>
         </test-session>
       </session-reflector>
     </twamp>
   </data>

      |  Note: '\' line wrapping is for formatting only.

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-reflector>
         <admin-state>true</admin-state>
         <test-session>
           <sender-ip>203.0.113.3</sender-ip>
           <sender-udp-port>54000</sender-udp-port>
           <reflector-ip>203.0.113.4</reflector-ip>
           <reflector-udp-port>54001</reflector-udp-port>
           <sid>1232</sid>
           <parent-connection-client-ip>203.0.113.1</parent-connection-\
   client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>203.0.113.2</parent-connection-\
   server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <sent-packets>2</sent-packets>
           <rcv-packets>2</rcv-packets>
           <last-sent-seq>1</last-sent-seq>
           <last-rcv-seq>1</last-rcv-seq>
         </test-session>
         <test-session>
           <sender-ip>203.0.113.1</sender-ip>
           <sender-udp-port>54001</sender-udp-port>
           <reflector-ip>192.0.2.2</reflector-ip>
           <reflector-udp-port>55001</reflector-udp-port>
           <sid>178943</sid>
           <parent-connection-client-ip>203.0.113.1</parent-connection-\
   client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>203.0.113.2</parent-connection-\
   server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <sent-packets>21</sent-packets>
           <rcv-packets>21</rcv-packets>
           <last-sent-seq>20</last-sent-seq>
           <last-rcv-seq>20</last-rcv-seq>
         </test-session>
       </session-reflector>
     </twamp>
   </data>

7.  Security Considerations

   Virtually all existing measurement systems using TWAMP [RFC5357] are
   administered by the same network operator.  For example, attacks on
   the measurement infrastructure could be launched by third parties to
   commandeer the packet generation capability, corrupt the
   measurements, or perform other nefarious acts.

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

   The Network Configuration 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.

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

   *  If written, the 'admin-state' node can cause unintended test
      sessions to be created.

   *  If the node 'number-of-packets', which dictates how many packets
      are sent in any particular test session, is written with a large
      value, it can cause a test session to run longer than expected.

   *  Nodes that are particularly vulnerable include several timeout
      values put in the protocol to protect against sessions that are
      not active but are consuming resources.  These are the REFWAIT
      timeout parameter, which determines whether to discontinue the
      session if no packets are received; and the nodes 'count' and
      'max-count-exponent', which can cause a long time to be spent on
      Password-Based Key Derivation Function 2 (PBKDF2) iterations.

   *  In addition, a 'dscp' node marked with different DSCP markings can
      cause the test traffic on the network to be skewed and the result
      manipulated.

   *  Finally, nodes within 'mode-preference-chain', which specifies the
      'mode' and 'priority' values and indicates the preferred order of
      use by an operator, can be manipulated to send unauthenticated or
      non-encrypted traffic, enabling an on-path attack.

   *  Limiting access to these nodes will limit the ability to launch an
      attack in network environments.

   Some of the readable data nodes in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control read access (e.g., via get, get-config, or
   notification) to these data nodes.  This is the subtree and data node
   and its sensitivity/vulnerability:

   *  The 'token' node defined in the model, containing a concatenation
      of a Challenge, an AES Session-key used for encryption, and an
      HMAC-SHA1 Session-key used for authentication, is sensitive from a
      privacy perspective and can be used to disrupt a test session.
      The ability to read the field should be limited to the
      administrator of the test network.

   The TWAMP YANG data model does not define RPC operations, as detailed
   in Appendix B, and defers the definition of NETCONF RPC operations to
   each implementation.  These RPC operations, when defined, may be
   considered sensitive or vulnerable in some network environments.  It
   is thus important to control access to these operations.

8.  IANA Considerations

   IANA has registered the following URI in the "IETF XML Registry"
   [RFC3688].

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

   IANA has registered the following YANG module in the "YANG Module
   Names" registry [RFC6020].

   Name:  ietf-twamp
   Namespace:  urn:ietf:params:xml:ns:yang:ietf-twamp
   Prefix:  twamp
   Reference:  RFC 8913

9.  References

9.1.  Normative References

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

   [RFC3432]  Raisanen, V., Grotefeld, G., and A. Morton, "Network
              performance measurement with periodic streams", RFC 3432,
              DOI 10.17487/RFC3432, November 2002,
              <https://www.rfc-editor.org/info/rfc3432>.

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

   [RFC4086]  Eastlake 3rd, D., Schiller, J., and S. Crocker,
              "Randomness Requirements for Security", BCP 106, RFC 4086,
              DOI 10.17487/RFC4086, June 2005,
              <https://www.rfc-editor.org/info/rfc4086>.

   [RFC4656]  Shalunov, S., Teitelbaum, B., Karp, A., Boote, J., and M.
              Zekauskas, "A One-way Active Measurement Protocol
              (OWAMP)", RFC 4656, DOI 10.17487/RFC4656, September 2006,
              <https://www.rfc-editor.org/info/rfc4656>.

   [RFC5357]  Hedayat, K., Krzanowski, R., Morton, A., Yum, K., and J.
              Babiarz, "A Two-Way Active Measurement Protocol (TWAMP)",
              RFC 5357, DOI 10.17487/RFC5357, October 2008,
              <https://www.rfc-editor.org/info/rfc5357>.

   [RFC5905]  Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch,
              "Network Time Protocol Version 4: Protocol and Algorithms
              Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010,
              <https://www.rfc-editor.org/info/rfc5905>.

   [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>.

   [RFC6038]  Morton, A. and L. Ciavattone, "Two-Way Active Measurement
              Protocol (TWAMP) Reflect Octets and Symmetrical Size
              Features", RFC 6038, DOI 10.17487/RFC6038, October 2010,
              <https://www.rfc-editor.org/info/rfc6038>.

   [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>.

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

   [RFC7717]  Pentikousis, K., Ed., Zhang, E., and Y. Cui,
              "IKEv2-Derived Shared Secret Key for the One-Way Active
              Measurement Protocol (OWAMP) and Two-Way Active
              Measurement Protocol (TWAMP)", RFC 7717,
              DOI 10.17487/RFC7717, December 2015,
              <https://www.rfc-editor.org/info/rfc7717>.

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

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

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

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

   [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>.

   [RFC8545]  Morton, A., Ed. and G. Mirsky, Ed., "Well-Known Port
              Assignments for the One-Way Active Measurement Protocol
              (OWAMP) and the Two-Way Active Measurement Protocol
              (TWAMP)", RFC 8545, DOI 10.17487/RFC8545, March 2019,
              <https://www.rfc-editor.org/info/rfc8545>.

   [RFC8911]  Bagnulo, M., Claise, B., Eardley, P., Morton, A., and A.
              Akhter, "Registry for Performance Metrics", RFC 8911,
              DOI 10.17487/RFC8911, November 2021,
              <https://www.rfc-editor.org/info/rfc8911>.

   [UML]      ISO/IEC, "Information technology - Open Distributed
              Processing - Unified Modeling Language (UML) Version
              1.4.2", ISO/IEC 19501:2005, OMG-UML VER 1.3, April 2005.

   [W3C.REC-xml-20081126]
              Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and
              F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth
              Edition)", World Wide Web Consortium Recommendation REC-
              xml-20081126, November 2008,
              <https://www.w3.org/TR/2008/REC-xml-20081126>.

9.2.  Informative References

   [NSC]      John, W., Pentikousis, K., Agapiou, G., Jacob, E., Kind,
              M., Manzalini, A., Risso, F., Staessens, D., Steinert, R.,
              and C. Meirosu, "Research directions in network service
              chaining", 2013 IEEE SDN for Future Networks and Services
              (SDN4FNS), Trento, Italy,
              DOI 10.1109/SDN4FNS.2013.6702549, November 2013,
              <https://doi.org/10.1109/SDN4FNS.2013.6702549>.

   [PERF-METRICS]
              IANA, "Performance Metrics",
              <https://www.iana.org/assignments/performance-metrics>.

   [RFC2330]  Paxson, V., Almes, G., Mahdavi, J., and M. Mathis,
              "Framework for IP Performance Metrics", RFC 2330,
              DOI 10.17487/RFC2330, May 1998,
              <https://www.rfc-editor.org/info/rfc2330>.

   [RFC5618]  Morton, A. and K. Hedayat, "Mixed Security Mode for the
              Two-Way Active Measurement Protocol (TWAMP)", RFC 5618,
              DOI 10.17487/RFC5618, August 2009,
              <https://www.rfc-editor.org/info/rfc5618>.

   [RFC5938]  Morton, A. and M. Chiba, "Individual Session Control
              Feature for the Two-Way Active Measurement Protocol
              (TWAMP)", RFC 5938, DOI 10.17487/RFC5938, August 2010,
              <https://www.rfc-editor.org/info/rfc5938>.

   [RFC7312]  Fabini, J. and A. Morton, "Advanced Stream and Sampling
              Framework for IP Performance Metrics (IPPM)", RFC 7312,
              DOI 10.17487/RFC7312, August 2014,
              <https://www.rfc-editor.org/info/rfc7312>.

   [RFC7426]  Haleplidis, E., Ed., Pentikousis, K., Ed., Denazis, S.,
              Hadi Salim, J., Meyer, D., and O. Koufopavlou, "Software-
              Defined Networking (SDN): Layers and Architecture
              Terminology", RFC 7426, DOI 10.17487/RFC7426, January
              2015, <https://www.rfc-editor.org/info/rfc7426>.

   [RFC8018]  Moriarty, K., Ed., Kaliski, B., and A. Rusch, "PKCS #5:
              Password-Based Cryptography Specification Version 2.1",
              RFC 8018, DOI 10.17487/RFC8018, January 2017,
              <https://www.rfc-editor.org/info/rfc8018>.

   [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>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

Appendix A.  Detailed Data Model Examples

   This appendix extends the examples presented in Section 6 by
   configuring more fields, such as authentication parameters, DSCP
   values, and so on.

A.1.  Control-Client

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <client>
         <admin-state>true</admin-state>
         <mode-preference-chain>
           <priority>0</priority>
           <mode>authenticated</mode>
         </mode-preference-chain>
         <mode-preference-chain>
           <priority>1</priority>
           <mode>unauthenticated</mode>
         </mode-preference-chain>
         <key-chain>
           <key-id>KeyClient1ToRouterA</key-id>
           <secret-key>c2VjcmV0MQ==</secret-key>
         </key-chain>
         <key-chain>
           <key-id>KeyForRouterB</key-id>
           <secret-key>c2VjcmV0Mg0K</secret-key>
         </key-chain>
         <ctrl-connection>
           <name>RouterA</name>
           <client-ip>203.0.113.1</client-ip>
           <server-ip>203.0.113.2</server-ip>
           <control-packet-dscp>32</control-packet-dscp>
           <key-id>KeyClient1ToRouterA</key-id>
           <test-session-request>
             <name>Test1</name>
             <sender-ip>203.0.113.3</sender-ip>
             <sender-udp-port>54000</sender-udp-port>
             <reflector-ip>203.0.113.4</reflector-ip>
             <reflector-udp-port>55000</reflector-udp-port>
             <padding-length>64</padding-length>
             <start-time>0</start-time>
           </test-session-request>
           <test-session-request>
             <name>Test2</name>
             <sender-ip>203.0.113.1</sender-ip>
             <sender-udp-port>54001</sender-udp-port>
             <reflector-ip>203.0.113.2</reflector-ip>
             <reflector-udp-port>55001</reflector-udp-port>
             <padding-length>128</padding-length>
             <start-time>0</start-time>
           </test-session-request>
         </ctrl-connection>
       </client>
     </twamp>
   </data>

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <client>
         <admin-state>true</admin-state>
         <mode-preference-chain>
           <priority>0</priority>
           <mode>authenticated</mode>
         </mode-preference-chain>
         <mode-preference-chain>
           <priority>1</priority>
           <mode>unauthenticated</mode>
         </mode-preference-chain>
         <key-chain>
           <key-id>KeyClient1ToRouterA</key-id>
           <secret-key>c2VjcmV0MQ==</secret-key>
         </key-chain>
         <key-chain>
           <key-id>KeyForRouterB</key-id>
           <secret-key>c2VjcmV0Mg0K</secret-key>
         </key-chain>
         <ctrl-connection>
           <name>RouterA</name>
           <client-ip>2001:db8:203:0:113::1</client-ip>
           <server-ip>2001:db8:203:0:113::2</server-ip>
           <control-packet-dscp>32</control-packet-dscp>
           <key-id>KeyClient1ToRouterA</key-id>
           <test-session-request>
             <name>Test1</name>
             <sender-ip>2001:db8:10:1:1::1</sender-ip>
             <sender-udp-port>54000</sender-udp-port>
             <reflector-ip>2001:db8:10:1:1::2</reflector-ip>
             <reflector-udp-port>55000</reflector-udp-port>
             <padding-length>64</padding-length>
             <start-time>0</start-time>
           </test-session-request>
           <test-session-request>
             <name>Test2</name>
             <sender-ip>2001:db8:203:0:113::1</sender-ip>
             <sender-udp-port>54001</sender-udp-port>
             <reflector-ip>2001:db8:203:0:113::2</reflector-ip>
             <reflector-udp-port>55001</reflector-udp-port>
             <padding-length>128</padding-length>
             <start-time>0</start-time>
           </test-session-request>
         </ctrl-connection>
       </client>
     </twamp>
   </data>

A.2.  Server

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <server>
         <admin-state>true</admin-state>
         <servwait>1800</servwait>
         <control-packet-dscp>32</control-packet-dscp>
         <modes>authenticated unauthenticated</modes>
         <count>15</count>
         <key-chain>
           <key-id>KeyClient1ToRouterA</key-id>
           <secret-key>c2VjcmV0MQ==</secret-key>
         </key-chain>
         <key-chain>
           <key-id>KeyClient10ToRouterA</key-id>
           <secret-key>c2VjcmV0MTANCg==</secret-key>
         </key-chain>
         <ctrl-connection>
           <client-ip>203.0.113.1</client-ip>
           <client-tcp-port>16341</client-tcp-port>
           <server-ip>203.0.113.2</server-ip>
           <server-tcp-port>862</server-tcp-port>
           <control-packet-dscp>32</control-packet-dscp>
           <selected-mode>unauthenticated</selected-mode>
           <key-id>KeyClient1ToRouterA</key-id>
           <count>15</count>
         </ctrl-connection>
       </server>
     </twamp>
   </data>

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <server>
         <admin-state>true</admin-state>
         <servwait>1800</servwait>
         <control-packet-dscp>32</control-packet-dscp>
         <modes>authenticated unauthenticated</modes>
         <count>15</count>
         <key-chain>
           <key-id>KeyClient1ToRouterA</key-id>
           <secret-key>c2VjcmV0MQ==</secret-key>
         </key-chain>
         <key-chain>
           <key-id>KeyClient10ToRouterA</key-id>
           <secret-key>c2VjcmV0MTANCg==</secret-key>
         </key-chain>
         <ctrl-connection>
           <client-ip>2001:db8:203:0:113::1</client-ip>
           <client-tcp-port>16341</client-tcp-port>
           <server-ip>2001:db8:203:0:113::2</server-ip>
           <server-tcp-port>862</server-tcp-port>
           <control-packet-dscp>32</control-packet-dscp>
           <selected-mode>unauthenticated</selected-mode>
           <key-id>KeyClient1ToRouterA</key-id>
           <count>15</count>
         </ctrl-connection>
       </server>
     </twamp>
   </data>

A.3.  Session-Sender

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-sender>
         <admin-state>true</admin-state>
         <test-session>
           <name>Test1</name>
           <ctrl-connection-name>RouterA</ctrl-connection-name>
           <fill-mode>zero</fill-mode>
           <number-of-packets>900</number-of-packets>
           <periodic-interval>1</periodic-interval>
           <sent-packets>2</sent-packets>
           <rcv-packets>2</rcv-packets>
           <last-sent-seq>1</last-sent-seq>
           <last-rcv-seq>1</last-rcv-seq>
         </test-session>
         <test-session>
           <name>Test2</name>
           <ctrl-connection-name>RouterA</ctrl-connection-name>
           <fill-mode>random</fill-mode>
           <number-of-packets>900</number-of-packets>
           <lambda>1</lambda>
           <max-interval>2</max-interval>
           <sent-packets>21</sent-packets>
           <rcv-packets>21</rcv-packets>
           <last-sent-seq>20</last-sent-seq>
           <last-rcv-seq>20</last-rcv-seq>
         </test-session>
       </session-sender>
     </twamp>
   </data>

A.4.  Session-Reflector

      |  Note: '\' line wrapping is for formatting only.

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-reflector>
         <admin-state>true</admin-state>
         <test-session>
           <sender-ip>203.0.113.3</sender-ip>
           <sender-udp-port>54000</sender-udp-port>
           <reflector-ip>203.0.113.4</reflector-ip>
           <reflector-udp-port>55000</reflector-udp-port>
           <sid>1232</sid>
           <parent-connection-client-ip>203.0.113.1</parent-connection-\
   client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>203.0.113.2</parent-connection-\
   server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <test-packet-dscp>32</test-packet-dscp>
           <sent-packets>2</sent-packets>
           <rcv-packets>2</rcv-packets>
           <last-sent-seq>1</last-sent-seq>
           <last-rcv-seq>1</last-rcv-seq>
         </test-session>
         <test-session>
           <sender-ip>203.0.113.1</sender-ip>
           <sender-udp-port>54001</sender-udp-port>
           <reflector-ip>192.0.2.2</reflector-ip>
           <reflector-udp-port>55001</reflector-udp-port>
           <sid>178943</sid>
           <parent-connection-client-ip>203.0.113.1</parent-connection-\
   client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>203.0.113.2</parent-connection-\
   server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <test-packet-dscp>32</test-packet-dscp>
           <sent-packets>21</sent-packets>
           <rcv-packets>21</rcv-packets>
           <last-sent-seq>20</last-sent-seq>
           <last-rcv-seq>20</last-rcv-seq>
         </test-session>
       </session-reflector>
     </twamp>
   </data>

      |  Note: '\' line wrapping is for formatting only.

   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <twamp xmlns="urn:ietf:params:xml:ns:yang:ietf-twamp">
       <session-reflector>
         <admin-state>true</admin-state>
         <test-session>
           <sender-ip>2001:db8:10:1:1::1</sender-ip>
           <sender-udp-port>54000</sender-udp-port>
           <reflector-ip>2001:db8:10:1:1::2</reflector-ip>
           <reflector-udp-port>55000</reflector-udp-port>
           <sid>1232</sid>
           <parent-connection-client-ip>2001:db8:203:0:113::1</parent-c\
   onnection-client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>2001:db8:203:0:113::2</parent-c\
   onnection-server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <test-packet-dscp>32</test-packet-dscp>
           <sent-packets>2</sent-packets>
           <rcv-packets>2</rcv-packets>
           <last-sent-seq>1</last-sent-seq>
           <last-rcv-seq>1</last-rcv-seq>
         </test-session>
         <test-session>
           <sender-ip>2001:db8:203:0:113::1</sender-ip>
           <sender-udp-port>54001</sender-udp-port>
           <reflector-ip>2001:db8:192:68::2</reflector-ip>
           <reflector-udp-port>55001</reflector-udp-port>
           <sid>178943</sid>
           <parent-connection-client-ip>2001:db8:203:0:113::1</parent-c\
   onnection-client-ip>
           <parent-connection-client-tcp-port>16341</parent-connection-\
   client-tcp-port>
           <parent-connection-server-ip>2001:db8:203:0:113::2</parent-c\
   onnection-server-ip>
           <parent-connection-server-tcp-port>862</parent-connection-se\
   rver-tcp-port>
           <test-packet-dscp>32</test-packet-dscp>
           <sent-packets>21</sent-packets>
           <rcv-packets>21</rcv-packets>
           <last-sent-seq>20</last-sent-seq>
           <last-rcv-seq>20</last-rcv-seq>
         </test-session>
       </session-reflector>
     </twamp>
   </data>

Appendix B.  TWAMP Operational Commands

   TWAMP operational commands could be performed programmatically or
   manually, e.g., using a command-line interface (CLI).

   With respect to programmability, YANG can be used to define NETCONF
   Remote Procedure Calls (RPCs); therefore, it would be, in principle,
   possible to define TWAMP RPC operations for actions such as starting
   or stopping control connections, test sessions, or groups of
   sessions; retrieving results; clearing stored results; and so on.

   However, TWAMP [RFC5357] does not attempt to describe such
   operational actions.  Refer also to Section 2 and the unlabeled links
   in Figure 1.  In actual deployments, different TWAMP implementations
   may support different sets of operational commands, with different
   restrictions.  Therefore, this document considers it the
   responsibility of the individual implementation to define its
   corresponding data model for TWAMP operational commands.

Acknowledgments

   We thank Fred Baker, Kevin D'Souza, Gregory Mirsky, Brian Trammell,
   Robert Sherman, and Marius Georgescu for their thorough and
   constructive reviews, comments, and text suggestions.

   Haoxing Shen contributed to the definition of the YANG module in
   Section 5.

   Jan Lindblad and Ladislav Lhotka did thorough reviews of the YANG
   module and the examples in Appendix A.

   Kostas Pentikousis was partially supported by FP7 UNIFY, a research
   project partially funded by the European Community under the Seventh
   Framework Program (grant agreement no. 619609).  The views expressed
   here are those of the authors only.  The European Commission is not
   liable for any use that may be made of the information in this
   document.

Contributors

   Lianshu Zheng

Authors' Addresses

   Ruth Civil
   Ciena Corporation
   307 Legget Drive
   Kanata ON K2K 3C8
   Canada

   Email: ruthcivil@gmail.com
   URI:   www.ciena.com


   Al Morton
   AT&T Labs
   200 Laurel Avenue South
   Middletown, NJ 07748
   United States of America

   Phone: +1 732 420 1571
   Email: acmorton@att.com


   Reshad Rahman
   Canada

   Email: reshad@yahoo.com


   Mahesh Jethanandani
   Xoriant Corporation
   1248 Reamwood Avenue
   Sunnyvale, CA 94089
   United States of America

   Email: mjethanandani@gmail.com


   Kostas Pentikousis (editor)
   Detecon
   Winterfeldtstrasse 21
   10781 Berlin
   Germany

   Email: kostas.pentikousis@detecon.com